Dictionary-based wrapper of :py:class:`monai.transforms.Orientation`. This transform assumes the channel-first input format. In the case of using this transform for normalizing the orientations of images, it should be used before any anisotropic spatial transforms. This transf
| 541 | |
| 542 | |
| 543 | class Orientationd(MapTransform, InvertibleTransform, LazyTransform): |
| 544 | """ |
| 545 | Dictionary-based wrapper of :py:class:`monai.transforms.Orientation`. |
| 546 | |
| 547 | This transform assumes the channel-first input format. |
| 548 | In the case of using this transform for normalizing the orientations of images, |
| 549 | it should be used before any anisotropic spatial transforms. |
| 550 | |
| 551 | This transform is capable of lazy execution. See the :ref:`Lazy Resampling topic<lazy_resampling>` |
| 552 | for more information. |
| 553 | """ |
| 554 | |
| 555 | backend = Orientation.backend |
| 556 | |
| 557 | @deprecated_arg_default( |
| 558 | name="labels", |
| 559 | old_default=(("L", "R"), ("P", "A"), ("I", "S")), |
| 560 | new_default=None, |
| 561 | msg_suffix=( |
| 562 | "Default value changed to None meaning that the transform now uses the 'space' of a " |
| 563 | "meta-tensor, if applicable, to determine appropriate axis labels." |
| 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 | """ |
no outgoing calls
searching dependent graphs…