cornucopia.fov
FlipTransform
Bases: FinalTransform
Flip one or more axes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axis
|
[list of] int
|
Axes to flip. By default, flip all axes. |
None
|
RandomFlipTransform
Bases: NonFinalTransform
Randomly flip one or more axes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axes
|
Sampler or [list of] int
|
Axes that can be flipped (default: all) |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
shared |
(channels, tensors, channels + tensors, '')
|
Apply the same flip to all channels and/or tensors |
PermuteAxesTransform
Bases: FinalTransform
Permute axes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
permutation
|
[list of] int
|
Axes permutation. By default, reverse axes. Only applies to spatial axes, so axes are numbered [C, 0, 1, 2] |
None
|
RandomPermuteAxesTransform
Bases: NonFinalTransform
Randomly permute axes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axes
|
[list of] int
|
Axes that can be permuted (default: all) |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
shared |
(channels, tensors, channels + tensors, '')
|
Apply the same permutation to all channels and/or tensors |
Rot90Transform
Bases: FinalTransform
Apply a 90 (or 180) rotation along one or several axes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axis
|
int or list[int]
|
Rotation axis (indexing does not account for the channel axis) |
0
|
negative
|
bool or list[bool]
|
Rotate by -90 deg instead of 90 deg |
False
|
double
|
bool or list[bool]
|
Rotate be 180 instead of 90 ( |
False
|
Rot180Transform
Bases: Rot90Transform
Apply a 180 deg rotation along one or several axes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axis
|
int or list[int]
|
Rotation axis (indexing does not account for the channel axis) |
0
|
RandomRot90Transform
Bases: NonFinalTransform
Random set of 90 transforms
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axes
|
int or list[int]
|
Axes along which rotations can happen.
If |
None
|
max_rot
|
int or Sampler
|
Maximum number of consecutive rotations. |
2
|
negative
|
bool
|
Whether to authorize negative rotations. |
True
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
shared |
(channels, tensors, channels + tensors, '')
|
Apply the same permutation to all channels and/or tensors |
CropPadTransform
Bases: FinalTransform
Crop and/or pad a tensor
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
crop
|
list[slice]
|
Slicing operator per dimension. |
required |
pad
|
list[int]
|
Left and right padding per dimensions |
required |
bound
|
[list of] str
|
Boundary condition for padding |
'zero'
|
value
|
number
|
Padding value in case |
0
|
PatchTransform
Bases: NonFinalTransform
Extract a patch from the volume
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
[list of] int
|
Patch shape |
64
|
center
|
[list of] float
|
Patch center, in relative coordinates -1..1 |
0
|
bound
|
str
|
Boundary condition in case padding is needed |
'zero'
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
shared |
(channels, tensors, channels + tensor, '')
|
|
RandomPatchTransform
Bases: NonFinalTransform
Extract a (randomly located) patch from the volume.
This transform ensures that the patch is fully contained within the original field of view (unless the patch size is larger than the input shape).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
[list of] int
|
Patch shape |
required |
bound
|
str
|
Boundary condition in case padding is needed |
'zero'
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
shared |
(channels, tensors, channels + tensors, None)
|
Extract the same patch from all channels and/or tensors |
CropTransform
Bases: NonFinalTransform
Crop a tensor by some amount
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cropping
|
[list of] int or float
|
Amount of cropping. If |
required |
unit
|
(vox, pct)
|
Padding unit |
'vox'
|
side
|
(pre, post, both, None)
|
Side to crop |
'pre'
|
PadTransform
Bases: NonFinalTransform
Pad a tensor by some amount
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
padding
|
[list of] int or float
|
Amount of padding. If |
required |
unit
|
(vox, pct)
|
Padding unit |
'vox'
|
side
|
(pre, post, both, None)
|
Side to pad |
'pre'
|
bound
|
str
|
Boundary condition |
'zero'
|
value
|
float
|
Value for case |
0
|
PowerTwoTransform
Bases: NonFinalTransform
Pad the volume such that the tensor shape can be divided by 2**x
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exponent
|
[list of] int
|
Ensure that the shape can be divided by 2 ** exponent |
1
|
bound
|
[list of] str
|
Boundary condition for padding |
'zero'
|