dasf.transforms.operations
Basic transform operations module.
Classes
Get a slice of a cube. An inline slice is a section over the x-axis. |
|
Class representing a Transform operation of the pipeline. |
|
Class representing a Transform operation of the pipeline. |
|
Class representing a Transform operation of the pipeline. |
|
Base Class for ApplyPatches Functionalities |
|
ApplyPatches with Weighted Average combination function. |
|
ApplyPatches with Voting combination function. |
Module Contents
- class dasf.transforms.operations.Reshape(shape=None)[source]
Bases:
dasf.transforms.base.Fit
Get a slice of a cube. An inline slice is a section over the x-axis.
Parameters
- iline_indexint
The index of the inline to get.
- shape
- Parameters:
shape (tuple)
- class dasf.transforms.operations.SliceArray(output_size)[source]
Bases:
dasf.transforms.base.Transform
Class representing a Transform operation of the pipeline.
- x
- class dasf.transforms.operations.SliceArrayByPercent(x=100.0, y=100.0, z=100.0)[source]
Bases:
dasf.transforms.base.Transform
Class representing a Transform operation of the pipeline.
- x
- y
- z
- class dasf.transforms.operations.SliceArrayByPercentile(percentile)[source]
Bases:
dasf.transforms.base.Transform
Class representing a Transform operation of the pipeline.
- p
- class dasf.transforms.operations.ApplyPatchesBase(function, weight_function, input_size, overlap, offsets)[source]
Bases:
dasf.transforms.base.Transform
Base Class for ApplyPatches Functionalities
function: function to be applied to each patch, can be eiter a Python Function or a ModelLoader weight_function: weight attribution function, must receive a shape and produce a NDArray with the respective weights for each array position input_size: size of input to the function to be applied, overlap: dictionary containing overlapping/padding configurations to use with np.pad or dask.overlap.overlap. Its important that for the base patch set the whole “chunk core” is covered by the patches. offsets: list of offsets for overlapping patches extraction
- _function
- _weight_function
- _input_size
- _offsets
- overlap
- _overlap_config
- _reconstruct_patches(patches, index, weights, inner_dim=None)[source]
Rearranges patches to reconstruct area of interest from patches and weights
- _adjust_patches(arrays, ref_shape, offset, pad_value=0)[source]
Pads reconstructed_patches with 0s to have same shape as the reference shape from the base patch set
- abstract _combine_patches(results, offsets, indexes)[source]
How results are combined is dependent on what is being combined. ApplyPatchesWeightedAvg uses Weighted Average ApplyPatchesVoting uses Voting (hard or soft)
- _extract_patches(data, patch_shape)[source]
Patch extraction method. It will be called once for the base patch set and also for the requested offsets (overlapping patch sets)
- class dasf.transforms.operations.ApplyPatchesWeightedAvg(function, weight_function, input_size, overlap, offsets)[source]
Bases:
ApplyPatchesBase
ApplyPatches with Weighted Average combination function.
function: function to be applied to each patch, can be eiter a Python Function or a ModelLoader weight_function: weight attribution function, must receive a shape and produce a NDArray with the respective weights for each array position input_size: size of input to the function to be applied, overlap: dictionary containing overlapping/padding configurations to use with np.pad or dask.overlap.overlap. Its important that for the base patch set the whole “chunk core” is covered by the patches. offsets: list of offsets for overlapping patches extraction
- class dasf.transforms.operations.ApplyPatchesVoting(function, weight_function, input_size, overlap, offsets, voting, num_classes)[source]
Bases:
ApplyPatchesBase
ApplyPatches with Voting combination function.
function: function to be applied to each patch, can be eiter a Python Function or a ModelLoader weight_function: weight attribution function, must receive a shape and produce a NDArray with the respective weights for each array position input_size: size of input to the function to be applied, overlap: dictionary containing overlapping/padding configurations to use with np.pad or dask.overlap.overlap. Its important that for the base patch set the whole “chunk core” is covered by the patches. offsets: list of offsets for overlapping patches extraction voting: voting method. “hard” or “soft” num_classes: number of classes possible
- _voting
- _num_classes