[Insight-users] Resampling and padding an image

Julian Tam julian.t at gmail.com
Thu Jul 21 13:38:29 EDT 2005


Hello,

I have an image that I would like to downsample, and pad with zeros to
a certain dimension such that the resampled image is centered in the
new image.

I have managed to perform this task, but wonder if my method is
unconventional.  My code isn't bloated, but doesn't seem very
intuitive.

I am using itkResampleImageFilter.h and itkIdentityTransform.h.

The filter's OutputSpacing is set as needed.  The filter's size is set
to that of the image + the padding.  Finally, I set the filter's
origin to a negative value such that the original and resized image is
centred within the larger padded image.

Is there a better way to do this?

Thanks,
Julian


More information about the Insight-users mailing list