Repository navigation
ENH: Support writing displacement field transforms with write_transform - #930
Merged
Merged
Conversation
write_transform previously rejected displacement-field transforms at the native binding. This change supports saving them directly as .nii/.nii.gz images or as single-component composite transforms in .h5/.hdf5 files. ENH: Deprecate write_transform "ref" argument - Make transform_to_displacement_field’s ref argument optional, using the stored field’s geometry and region by default. - Deprecate explicit references while preserving their existing behavior. I don't understand the point of 'ref'. It doesn't resample the deformation field if given a ref of a different shape or orientation. It also doesn't do any bounds checking. Seems like it should just use the transform's own metadata, ref is only correct if it's the same. Other changes: - Reject NIfTI output for affine and composite transforms with a clear error. - Document supported formats and the composite representation used for displacement-field HDF5 output. Validation: passing 2D/3D tests cover affine round trips through TXT, MAT, and HDF5; displacement-field round trips through NIfTI and HDF5; and mixed affine/displacement composite HDF5 round trips. Tests check point mappings, field values and geometry, and compatibility with explicit references. Fixes #929.
Not sure why that was imported instead of just warnings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
write_transform previously rejected displacement-field transforms at the native binding. This change supports saving them directly as .nii/.nii.gz images or as single-component composite transforms in .h5/.hdf5 files.
ENH: Deprecate transform_to_displacement_field "ref" argument
I don't understand the point of 'ref'. It doesn't resample the deformation field if given a ref of a different shape or orientation. It also doesn't do any bounds checking. Seems like it should just use the transform's own metadata, ref is only correct if it's the same.
Other changes:
Fixes #929.