neuralib.atlas.view.AbstractSliceView
- class neuralib.atlas.view.AbstractSliceView[source]
Bases:
objectSliceView ABC for different plane type
Dimension parameters:
AP = anterior-posterior
DV = dorsal-ventral
ML = medial-lateral
W = view width
H = view height
- __init__(view_type, plane, resolution, reference)[source]
- Parameters:
view_type (Literal['annotation', 'reference']) –
DATA_SOURCE_TYPE. {‘ccf_annotation’, ‘ccf_template’, ‘allensdk_annotation’}plane (Literal['coronal', 'sagittal', 'transverse']) – PLANE_TYPE`. {‘coronal’, ‘sagittal’, ‘transverse’}
resolution (int) – um/pixel
reference (ndarray) – Array[uint16, [AP, DV, ML]]
Methods
__init__(view_type, plane, resolution, reference)coor_on(plane, o)map slice point (x, y) at plane plane back to volume point (ap, dv, ml)
offset(h, v)plane(offset)Get image plane.
plane_at(slice_index)plot_max_projection(ax, *[, ...])Plot max projection for the given
plane_typeAttributes
reference from which axis
height (pixel) in a specific plane view
height (um) in a specific plane view
number of slices along AP axis
number of slices along DV axis
number of slices along ML axis
number of planes in a specific plane view
plane(p), x, y of index order in (AP, DV, ML)
reference point in a specific plane view.
width (pixel) in a specific plane view
width (um) in a specific plane view
VIEW_TYPE.PLANE_TYPE`.
um/pixel
Array[float, [AP, DV, ML]]
Array[int, [W, H]]
Array[int, [W, H]]
- REFERENCE_FROM: ClassVar[str] = ''
reference from which axis
- static __new__(cls, view_type, plane, resolution, reference)[source]
- Parameters:
view_type (Literal['annotation', 'reference'])
plane (Literal['coronal', 'sagittal', 'transverse'])
resolution (int)
reference (ndarray)
- __init__(view_type, plane, resolution, reference)[source]
- Parameters:
view_type (Literal['annotation', 'reference']) –
DATA_SOURCE_TYPE. {‘ccf_annotation’, ‘ccf_template’, ‘allensdk_annotation’}plane (Literal['coronal', 'sagittal', 'transverse']) – PLANE_TYPE`. {‘coronal’, ‘sagittal’, ‘transverse’}
resolution (int) – um/pixel
reference (ndarray) – Array[uint16, [AP, DV, ML]]
- view_type: Final[Literal['annotation', 'reference']]
VIEW_TYPE. {‘annotation’, ‘reference’}
- plane_type: Final[Literal['coronal', 'sagittal', 'transverse']]
PLANE_TYPE`. {‘coronal’, ‘sagittal’, ‘transverse’}
- resolution: Final[int]
um/pixel
- reference: Final[ndarray]
Array[float, [AP, DV, ML]]
- grid_y: Final[ndarray]
Array[int, [W, H]]
- grid_x: Final[ndarray]
Array[int, [W, H]]
- property bregma: ndarray
- property n_ap: int
number of slices along AP axis
- property n_dv: int
number of slices along DV axis
- property n_ml: int
number of slices along ML axis
- abstract property n_planes: int
number of planes in a specific plane view
- abstract property width: int
width (pixel) in a specific plane view
- abstract property height: int
height (pixel) in a specific plane view
- property width_mm: float
width (um) in a specific plane view
- property height_mm: float
height (um) in a specific plane view
- abstract property reference_point: int
reference point in a specific plane view. aka, bregma plane index
- abstract property project_index: tuple[int, int, int]
plane(p), x, y of index order in (AP, DV, ML)
- Returns:
(p, x, y)
- abstract property max_projection_axis: int
- plot_max_projection(ax, *, annotation_regions=None, annotation_cmap='hsv')[source]
Plot max projection for the given
plane_type- Parameters:
ax (Axes) –
Axesannotation_regions (str | list[str] | None) – annotation_regions
annotation_cmap (str) – camp for the annotation regions, defaults to ‘hsv’
- offset(h, v)[source]
- Parameters:
h (int) – horizontal plane diff to the center. right side positive.
v (int) – vertical plane diff to the center. bottom side positive.
- Returns:
(H, W) array
- Return type:
ndarray