[Insight-users] Help: ResampleImageFilter

Dan Mueller dan.muel at gmail.com
Sat Nov 1 00:35:49 EDT 2008


Hi Kun,

It is the transform (not the output direction) that specifies how to
map between the output and input coordinate spaces. The
SetOutputDirection(.) method sets the so-called "direction cosines"
which specifies an additional orientation of the output image in
physical space.

You may be interested in the following Insight Journal submission
which provides a helper function to initialise a transform to "look
at" a point. Once you have this transform, you pass this to the
resample filter with the desired output parameters. The
itk::ObliqueSectionImageFilter, also provided in the submission, does
this for you.
    http://www.insight-journal.org/browse/publication/168

Regarding your second question about output spacing: this is simply
the spacing of the output image. For example, if your input image has
spacing [1.0, 1.0, 1.0] you could specify the output image to have
spacing [2.0, 2.0, 2.0]. These values are independent and no magic
needs to be computed by you. The resample filter takes care of the
mapping between the two coordinate spaces (via the transform).

If you haven't already done so, have a read of section 6.9.4 of the
ITK Software Guide:
    http://www.itk.org/ItkSoftwareGuide.pdf

Hope this helps.

Regards, Dan

2008/10/31 Kun <kun_ch at 163.com>:
>  Hi, all
>
>      I am using the ResampleImageFilter to get an oblique slice from the 3D
> volume data. I use the
>
>      ResampleImageFilter->SetOutputOrigin(origin);
>      ResampleImageFilter->SetOutputDirection(direction);
>
> to set the direction of the desired slice, the 3*3 direction is the unit
> vector of x,y,z direction.
>
>  Would this be right to get an accurate oblique slice?
>
> Also, I feel a litter confused about the outputspacing. Should I set the
> spacing information of the input image as the outputspacing or use the
> spacing along the desired new x,y,z direction?
> for example, the desired x direction is [0.8;0.6;0], then the spacing[0] is
> set xspacing of the input image, or sqrt((0.8* xspacing)^2 + (0.6*
> yspacing)^2) ?
>
> Looking forward to your help.
>
>
> Thanks
>
> Kun
>
>
> ________________________________
> 网易邮箱10周年,技术见证辉煌
> _______________________________________________
> 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