Skip to content

Commit dd68613

Browse files
committed
fix: restore mypy gitignore entries and Transposed doc note
- .gitignore: restore .mypy_cache/ and .dmypy.json since mypy is retained - monai/transforms/utility/dictionary.py: restore Transposed doc note warning about affine not being updated Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
1 parent 769c33b commit dd68613

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ venv.bak/
109109

110110
# pyrefly cache
111111
.pyrefly_cache/
112+
113+
# mypy
114+
.mypy_cache/
115+
.dmypy.json
112116
examples/scd_lvsegs.npz
113117
temp/
114118
.idea/

monai/transforms/utility/dictionary.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,13 @@ def __call__(self, data: Mapping[Hashable, Any]) -> dict[Hashable, Any]:
636636
class Transposed(MapTransform, InvertibleTransform):
637637
"""
638638
Dictionary-based wrapper of :py:class:`monai.transforms.Transpose`.
639+
640+
.. note::
641+
This transform does not update the affine matrix in the metadata. As a result,
642+
affine-dependent transforms applied after (e.g. :py:class:`monai.transforms.Spacingd`)
643+
may produce unexpected results, because the affine no longer corresponds to the
644+
transposed data. To reorient medical images in an affine-aware way, use
645+
:py:class:`monai.transforms.Orientationd` instead.
639646
"""
640647

641648
backend = Transpose.backend

0 commit comments

Comments
 (0)