ngff_zarr.rfc4¶
RFC 4 implementation for anatomical orientation in OME-NGFF.
This module implements RFC 4 which adds anatomical orientation support to OME-NGFF axes, based on the LinkML schema.
Module Contents¶
Classes¶
Anatomical orientation refers to the specific arrangement and directional alignment of anatomical structures within an imaging dataset. It is crucial for ensuring accurate alignment and comparison of images to anatomical atlases, facilitating consistent analysis and interpretation of biological data. |
|
Anatomical orientation specification for spatial axes. |
Functions¶
Convert ITK LPS coordinate system to anatomical orientation. |
|
Check if RFC 4 is enabled in the list of enabled RFCs. |
|
Add anatomical orientation to an axis dictionary. |
|
Remove anatomical orientation from an axis dictionary. |
Data¶
API¶
- class ngff_zarr.rfc4.AnatomicalOrientationValues¶
-
Anatomical orientation refers to the specific arrangement and directional alignment of anatomical structures within an imaging dataset. It is crucial for ensuring accurate alignment and comparison of images to anatomical atlases, facilitating consistent analysis and interpretation of biological data.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- left_to_right¶
‘left-to-right’
- right_to_left¶
‘right-to-left’
- anterior_to_posterior¶
‘anterior-to-posterior’
- posterior_to_anterior¶
‘posterior-to-anterior’
- inferior_to_superior¶
‘inferior-to-superior’
- superior_to_inferior¶
‘superior-to-inferior’
- dorsal_to_ventral¶
‘dorsal-to-ventral’
- ventral_to_dorsal¶
‘ventral-to-dorsal’
- dorsal_to_palmar¶
‘dorsal-to-palmar’
- palmar_to_dorsal¶
‘palmar-to-dorsal’
- dorsal_to_plantar¶
‘dorsal-to-plantar’
- plantar_to_dorsal¶
‘plantar-to-dorsal’
- rostral_to_caudal¶
‘rostral-to-caudal’
- caudal_to_rostral¶
‘caudal-to-rostral’
- cranial_to_caudal¶
‘cranial-to-caudal’
- caudal_to_cranial¶
‘caudal-to-cranial’
- proximal_to_distal¶
‘proximal-to-distal’
- distal_to_proximal¶
‘distal-to-proximal’
- class ngff_zarr.rfc4.AnatomicalOrientation¶
Anatomical orientation specification for spatial axes.
- value: ngff_zarr.rfc4.AnatomicalOrientationValues¶
None
- ngff_zarr.rfc4.LPS: Dict[str, ngff_zarr.rfc4.AnatomicalOrientation]¶
None
LPS (Left-Posterior-Superior) coordinate system orientations. In LPS, the axes increase from:
X: right-to-left (L = Left)
Y: anterior-to-posterior (P = Posterior)
Z: inferior-to-superior (S = Superior) This is the standard coordinate system used by ITK and many medical imaging applications.
Example usage: ngff_image = NgffImage( data=data, dims=(“z”, “y”, “x”), scale={“x”: 1.0, “y”: 1.0, “z”: 1.0}, translation={“x”: 0.0, “y”: 0.0, “z”: 0.0}, axes_orientations=LPS )
- ngff_zarr.rfc4.RAS: Dict[str, ngff_zarr.rfc4.AnatomicalOrientation]¶
None
RAS (Right-Anterior-Superior) coordinate system orientations. In RAS, the axes increase from:
X: left-to-right (R = Right)
Y: posterior-to-anterior (A = Anterior)
Z: inferior-to-superior (S = Superior) This coordinate system is commonly used in neuroimaging applications like FreeSurfer and FSL.
Example usage: ngff_image = NgffImage( data=data, dims=(“z”, “y”, “x”), scale={“x”: 1.0, “y”: 1.0, “z”: 1.0}, translation={“x”: 0.0, “y”: 0.0, “z”: 0.0}, axes_orientations=RAS )
- ngff_zarr.rfc4.itk_lps_to_anatomical_orientation(
- axis_name: str,
Convert ITK LPS coordinate system to anatomical orientation.
ITK uses the LPS (Left-Posterior-Superior) coordinate system by default. In LPS, the axes increase from:
X: right-to-left (L = Left)
Y: anterior-to-posterior (P = Posterior)
Z: inferior-to-superior (S = Superior)
Parameters
axis_name : str The axis name (‘x’, ‘y’, or ‘z’)
Returns
Optional[AnatomicalOrientation] The corresponding anatomical orientation, or None for non-spatial axes
- ngff_zarr.rfc4.is_rfc4_enabled(enabled_rfcs: Optional[list[int]]) bool¶
Check if RFC 4 is enabled in the list of enabled RFCs.
- ngff_zarr.rfc4.add_anatomical_orientation_to_axis(
- axis_dict: dict,
- orientation: ngff_zarr.rfc4.AnatomicalOrientation,
Add anatomical orientation to an axis dictionary.
Parameters
axis_dict : dict The axis dictionary to modify orientation : AnatomicalOrientation The anatomical orientation to add
Returns
dict The modified axis dictionary