[Insight-users] ResampleImageFIlter discards input image's spacing?

Luis Ibanez luis.ibanez at kitware.com
Tue Apr 19 20:18:54 EDT 2005


Hi Zach,

The ResampleImageFilter is intended to be used for "sampling"
the image using a new grid. It is therefore the responsibility
of the users to set the parameters of such a new grid.

Origin, spacing and number of pixels are the most important
characteristics of the new grid.

It is true that we could default these values to the ones of
the input image instead of zeros and ones... but... at the
end it is really something that the user must put explicitly.

You may want to put this in the bug tracker. It wouldn't hurt
to default the values to the input image... the drawback is that
then we need to have internal booleans that specify whether the
filter is using the default values or the ones that have been
set manually by a user.


    Regards,


       Luis



---------------------------------------------------------------
Zachary Pincus wrote:
> Hello,
> 
>  From a brief look at the code, it appears that the 
> itk::ResampleImageFilter class uses a default origin of all zeros and a 
> default spacing of all ones, if SetOutputOrigin() and SetOutputSpacing() 
> are not called.
> 
> This doesn't seem to be the most intuitive behavior -- is would seem 
> more correct for the ResampleImageFilter to use the input image's 
> origin, and *especially* its spacing than defaulting to something 
> arbitrary. That is, given the importance of the spacing values in ITK 
> and the fact that a resampler is probably more likely to be used in a 
> geometric transform than to change spacing values, it seems like 
> throwing away the input image's spacing information by default might not 
> be the right way to go. Moreover, if I recall correctly, other image 
> filter classes just pass along the origin and spacing of the input, so 
> this seems even more at variance.
> 
> Is this in fact the case, or did I overlook the part of the code where 
> the ResampleImageFilter actually does, by default, retain the input 
> image's spacing?
> 
> Zach Pincus
> Department of Biochemistry and Program in Biomedical Informatics
> Stanford University School of Medicine
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 





More information about the Insight-users mailing list