-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gauging interest on spatial transforms #654
Comments
Here there is an example: master...oesteban:enh/transforms. This code makes it easy to apply an affine transform on images: import nibabel as nb
ref = nb.load('image.nii.gz')
xfm = nb.transform.Affine([[1, 0, 0, 4], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]])
xfm.reference = ref # Set a reference image
moved = xfm.resample(ref) # Resample ref into reference space through xfm
moved.to_filename('moved_4mm_image.nii.gz') The purpose of the module would also include reading linear and nonlinear transforms from different formats (mainly FSL, ITK/ANTs, SPM, FreeSurfer, etc.). cc @effigies |
This looks useful. I've done some work already with FreeSurfer's LTA format in #565. So a |
#565 is definitely related to this. In principle, Transforms are Voxel-to-voxel. However, they must have an internal parameterization of the transform. That internal model should be defined to be RAS-RAS and accessible through the |
Sorry for the second post. For RAS-RAS transforms with the >>> xfm.map_point([10.0, -10.0, 20.0])
array([14.0, -10.0, 20.0]) However, the |
I'm about to start working on python (mostly numpy) based geometric transformation of 3D images. I feel nibabel could be the best host to a new module
nibabel.transforms
.I would start by implementing affine transforms (which is almost there already with
resample_from_to
) and free-deformation fields (e.g. generated by ANTs registration).Next steps would include taking in collapsed transforms (hdf5), and also parametric transforms (e.g. BSpline).
WDYT?
The text was updated successfully, but these errors were encountered: