Skip to content

Add to_monai and from_monai methods - #454

Merged
CPBridge merged 21 commits into
v0.29.0devfrom
feature/monai_volume_conversion
Nov 13, 2026
Merged

CPBridge merged 21 commits into
v0.29.0devfrom
feature/monai_volume_conversion

Conversation

@mccle

@mccle mccle commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@mccle
mccle changed the base branch from master to v0.29.0dev August 6, 2026 19:08
@mccle
mccle marked this pull request as ready for review September 3, 2026 19:25
@mccle
mccle requested a review from CPBridge September 3, 2026 20:02
Comment thread src/highdicom/volume.py Resolved
Comment thread src/highdicom/volume.py Resolved
Comment thread src/highdicom/volume.py Resolved
Comment thread src/highdicom/volume.py Resolved
Comment thread src/highdicom/volume.py Resolved
Comment thread src/highdicom/volume.py Resolved
Comment thread tests/test_monai.py Resolved
Comment thread tests/test_monai.py Resolved
Comment thread docs/monai_lib.rst Resolved
Comment thread docs/monai_lib.rst Resolved
Comment thread docs/monai_lib.rst Resolved
Comment thread src/highdicom/volume.py
item in the dictionary corresponds to axis 3 of the array and so
on).
channel_dim: int
Channel dimension index of the metatensor. Defaults to 0.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Channel dimension index of the metatensor. Defaults to 0.
Channel dimension index of the metatensor. Only used if the
number of dimensions in the metatensor (after unsqueezing) is
4. Defaults to 0.

Comment thread src/highdicom/volume.py
Comment on lines +4267 to +4268
Index of a singleton dimension to squeeze (must be a spatial
dimension). Defaults to None.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Index of a singleton dimension to squeeze (must be a spatial
dimension). Defaults to None.
Index of a singleton dimension to squeeze (must be a spatial
dimension) to give a metatensor representing a 2D image. Note
that the affine matrix of the resulting metatensor will have
the correct pixel spacing, but will not represent the same
mapping into the frame-of-reference coordinate system (this
is due to limitations on the way MONAI represents affine
matrices for 2D images).

Comment thread src/highdicom/volume.py Resolved
mccle and others added 4 commits November 12, 2026 17:19
Co-authored-by: Chris Bridge <chrisbridge44@googlemail.com>
Co-authored-by: Chris Bridge <chrisbridge44@googlemail.com>
Co-authored-by: Chris Bridge <chrisbridge44@googlemail.com>
Co-authored-by: Chris Bridge <chrisbridge44@googlemail.com>
@CPBridge
CPBridge merged commit c998d5c into v0.29.0dev Nov 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants