[Insight-users] WarpImageFilter and SetSize()

Karthik Krishnan Karthik.Krishnan at kitware.com
Fri Feb 24 17:36:34 EST 2006


jkao at swri.ca wrote:

>Hi Everyone,
>
>I just had a quick and easy question about using WarpImageFilter.
>
>I'm currently trying to warp a volume image using WarpImageFilter, and it
>is working fine, except that I want the extents of the warped image to
>exceed those of the original image.  Why does the SetSize function not
>exist as it does for the ResampleImageFilter, and what options do I have
>to resize the image other than putting the image through a resample filter
>beforehand to increase its size? (which is what I'm doing now)
>  
>
You need to change the method:
WarpImageFilter::GenerateOutputInformation() (lines 268-284)
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkWarpImageFilter.txx?annotate=1.25&root=Insight

The method should set the output size to the largest possible region 
that the Deformation field can produce, instead of setting the output as 
the field region itself (which is the same as the input image region.. 
See the GenerateInputRequestedRegion method ).

Its fairly easy to do.. Just iterate over the fieldPtr and compute what 
the output region is supposed to be. If you do that please submit a patch.

For now, please log this as a feature request at:
www.itk.org/Bug

Thanks
karthik

>Thanks for your help!
>
>Jeff Kao
>Imaging Research
>Sunnybrook and Women's College Health Sciences Centre
>
>
>
>
>
>
>_______________________________________________
>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