Resize nii image getting the modified affine information

Hello every body!

I’m trying to resize nii images but I don’t know how to modify its affine information to have the reference space information. The resize would be from (512,512,n_slices) to (256,256,n_slices)

What I want is resize the nii image and algo obtain the new affine and header information.

Could you help me, please?
Thank you very much in advance :slight_smile:

The transform stays the same. What you want to specify is larger spacing for the resampled image. Take a look at image representation, ResampleImageFilter and examples linked there.

1 Like

Hello @AmericaBG,

An additional SimpleITK specific resource, from the SimpleITK notebook repository, is the notebook on resampling.

1 Like

Thank you all!
What I needed is in the next issue:
https://github.com/nipy/nibabel/issues/998

Thank you very much for your attention one more time :smiley: