Args: axcodes: N elements sequence for spatial ND input's orientation. e.g. axcodes='RAS' represents 3D orientation: (Left, Right), (Posterior, Anterior), (Inferior, Superior). default orientation labels options are: 'L' and 'R' fo
(
self,
keys: KeysCollection,
axcodes: str | None = None,
as_closest_canonical: bool = False,
labels: Sequence[tuple[str, str]] | None = None,
allow_missing_keys: bool = False,
lazy: bool = False,
)
| 564 | ), |
| 565 | ) |
| 566 | def __init__( |
| 567 | self, |
| 568 | keys: KeysCollection, |
| 569 | axcodes: str | None = None, |
| 570 | as_closest_canonical: bool = False, |
| 571 | labels: Sequence[tuple[str, str]] | None = None, |
| 572 | allow_missing_keys: bool = False, |
| 573 | lazy: bool = False, |
| 574 | ) -> None: |
| 575 | """ |
| 576 | Args: |
| 577 | axcodes: N elements sequence for spatial ND input's orientation. |
| 578 | e.g. axcodes='RAS' represents 3D orientation: |
| 579 | (Left, Right), (Posterior, Anterior), (Inferior, Superior). |
| 580 | default orientation labels options are: 'L' and 'R' for the first dimension, |
| 581 | 'P' and 'A' for the second, 'I' and 'S' for the third. |
| 582 | as_closest_canonical: if True, load the image as closest to canonical axis format. |
| 583 | labels: optional, None or sequence of (2,) sequences |
| 584 | (2,) sequences are labels for (beginning, end) of output axis. |
| 585 | If ``None``, an appropriate value is chosen depending on the |
| 586 | value of the ``"space"`` metadata item of a metatensor: if |
| 587 | ``"space"`` is ``"LPS"``, the value used is ``(('R', 'L'), |
| 588 | ('A', 'P'), ('I', 'S'))``, if ``"space"`` is ``"RPS"`` or the |
| 589 | input is not a meta-tensor or has no ``"space"`` item, the |
| 590 | value ``(('L', 'R'), ('P', 'A'), ('I', 'S'))`` is used. If not |
| 591 | ``None``, the provided value is always used and the ``"space"`` |
| 592 | metadata item (if any) of the input is ignored. |
| 593 | allow_missing_keys: don't raise exception if key is missing. |
| 594 | lazy: a flag to indicate whether this transform should execute lazily or not. |
| 595 | Defaults to False |
| 596 | |
| 597 | See Also: |
| 598 | `nibabel.orientations.ornt2axcodes`. |
| 599 | |
| 600 | """ |
| 601 | MapTransform.__init__(self, keys, allow_missing_keys) |
| 602 | LazyTransform.__init__(self, lazy=lazy) |
| 603 | self.ornt_transform = Orientation( |
| 604 | axcodes=axcodes, as_closest_canonical=as_closest_canonical, labels=labels, lazy=lazy |
| 605 | ) |
| 606 | |
| 607 | @LazyTransform.lazy.setter # type: ignore |
| 608 | def lazy(self, val: bool) -> None: |
nothing calls this directly
no test coverage detected