Skip to content

Add nibabel volume conversions and tests#411

Draft
mccle wants to merge 1 commit into
v0.28.0devfrom
feature/nibabel_volume_conversion
Draft

Add nibabel volume conversions and tests#411
mccle wants to merge 1 commit into
v0.28.0devfrom
feature/nibabel_volume_conversion

Conversation

@mccle
Copy link
Copy Markdown
Collaborator

@mccle mccle commented May 19, 2026

No description provided.

Comment thread src/highdicom/volume.py
' Casting to float64 is not possible.'
)

nifti = nib.Nifti1Image(
Copy link
Copy Markdown
Collaborator Author

@mccle mccle May 19, 2026

Choose a reason for hiding this comment

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

nibabel has several other image classes that I believe could represent a volume, listed here. Not all of them are relevant, but the MINC and MGH formats seem worth consideration. I think at the very least, we should support both Nifti1Image and Nifti2Image, meaning the to_nib method should already be changed to allow the user to specify the class to which they wish to convert. Additionally, several of these classes can accept an array, affine, and dtype exactly as the Nifti1Image class or with extremely minor changes.

However, I do not think all of the formats support the same data types. Are you interested in supporting other formats @CPBridge? If so, would it be best to group different classes into separate to_* methods or have any branching logic be included in a single to_nib method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant