neuralib.registration.coordinates.FieldOfView

class neuralib.registration.coordinates.FieldOfView[source]

Bases: object

Field‑Of‑View defined by its four XY corners

__init__(corners, rotation_ml=0.0, rotation_ap=0.0, unit='mm', *, perpendicular=True, region_name=None)

Method generated by attrs for class FieldOfView.

Parameters:
  • corners (ndarray)

  • rotation_ml (float)

  • rotation_ap (float)

  • unit (Literal['mm', 'um'])

  • perpendicular (bool)

  • region_name (str | None)

Return type:

None

Methods

__init__(corners[, rotation_ml, ...])

Method generated by attrs for class FieldOfView.

invert_axes([ap, ml])

Return a new FOV with specified axes inverted

to_polygon(**kwargs)

convert corners to a matplotlib Polygon patch

to_um()

Attributes

corners

corner coordinates in order [AM, PM, PL, AL].

rotation_ml

in-plane rotation (CCW) around the ML axis, in degrees

rotation_ap

tilt around the AP axis (foreshortening), in degrees

unit

unit of the corners value

perpendicular

imaging objective is perpendicular to the cranial windows.

region_name

optional identifier for this FOV region

al

anterolateral corner coordinate [x, y] in mm or µm

am

anteromedial corner coordinate [x, y] in mm or µm.

ap_distance

span along the AP axis

ml_distance

span along the ML axis

pl

posterolateral corner coordinate [x, y] in mm or µm

pm

posteromedial corner coordinate [x, y] in mm or µm

corners: ndarray

corner coordinates in order [AM, PM, PL, AL]. Array[float, [4, 2]]

rotation_ml: float

in-plane rotation (CCW) around the ML axis, in degrees

rotation_ap: float

tilt around the AP axis (foreshortening), in degrees

unit: Literal['mm', 'um']

unit of the corners value

perpendicular: bool

imaging objective is perpendicular to the cranial windows. if True, skip rotation and tilt transforms

region_name: str | None

optional identifier for this FOV region

property am: ndarray

anteromedial corner coordinate [x, y] in mm or µm.

property pm: ndarray

posteromedial corner coordinate [x, y] in mm or µm

property pl: ndarray

posterolateral corner coordinate [x, y] in mm or µm

property al: ndarray

anterolateral corner coordinate [x, y] in mm or µm

property ap_distance: float

span along the AP axis

property ml_distance: float

span along the ML axis

invert_axes(ap=True, ml=True)[source]

Return a new FOV with specified axes inverted

Parameters:
  • ap (bool) – invert anterior-posterior (Y) axis if True.

  • ml (bool) – invert medial-lateral (X) axis if True.

Return type:

Self

to_um()[source]
Return type:

Self

to_polygon(**kwargs)[source]

convert corners to a matplotlib Polygon patch

Return type:

Polygon

__init__(corners, rotation_ml=0.0, rotation_ap=0.0, unit='mm', *, perpendicular=True, region_name=None)

Method generated by attrs for class FieldOfView.

Parameters:
  • corners (ndarray)

  • rotation_ml (float)

  • rotation_ap (float)

  • unit (Literal['mm', 'um'])

  • perpendicular (bool)

  • region_name (str | None)

Return type:

None