axes_utils
Utilities to check axes validity.
NAPARI_AXES = 'TSZYXC'
module-attribute
#
Axes used in Napari.
REF_AXES = 'STCZYX'
module-attribute
#
References axes in CAREamics.
are_axes_valid(axes)
#
Check if axes are valid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
axes | str | Axes to check. | required |
Returns:
Type | Description |
---|---|
bool | Whether the axes are valid. |
Source code in src/careamics_napari/utils/axes_utils.py
filter_dimensions(shape_length, is_3D)
#
Filter axes based on shape and dimensions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shape_length | int | Number of dimensions. | required |
is_3D | bool | Whether the dimensions include Z. | required |
Returns:
Type | Description |
---|---|
list of str | List of valid axes. |
Source code in src/careamics_napari/utils/axes_utils.py
reshape_prediction(prediction, axes, is_3d)
#
Reshape the prediction to match the input axes. The default axes of the model prediction is SC(Z)YX.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prediction | ndarray | Prediction. | required |
axes | str | Axes of the input data. | required |
is_3d | bool | Whether the data is 3D. | required |
Returns:
Type | Description |
---|---|
ndarray | Reshaped prediction. |