[Insight-users] itk ResampleImageFilter + OutputDirection Problem (dicom)

Luis Ibanez luis.ibanez at kitware.com
Sat Mar 6 20:31:44 EST 2010


Hi Sebastian


Thanks for your detailed description of the problem.


1) If you are using the latest release of ITK, you
    don't need to use the itk::OrientedImage anymore.
    The standard itk::Image now behaves the same
    as the itk::OrientedImage.


2)  In order to interpret the correctness of the resampling,
     we need you to tell us what parameters did you set up
     in the Affine transform.

     Please post to the mailing list the Affine transform
     parameters that you used.


3)  Before you called the method:

              SetOutputDirection(itkimage->GetDirection())

      did you make sure the the "itkimage" was read in memory ?

      For example, if "itkimage" is the output of a reader,
      please make sure that you call "Update()" in that
      reader, before you call the SetOutputDirection()
      line shown above.


4)  To help you beyond this, we will need you to tell us:

      A) Parameters of the input image:

               Origin
               Spacing
               Direction cosines

       B) Parameters that you set in the resampling filter

                OutputOrigin
                OutputSpacing

        C)  How did you initialized the AffineTransform



For a detailed description of how the ResampleImageFilter
works, you should read the ITK Software Guide:

           http://www.itk.org/ItkSoftwareGuide.pdf

In particular,

            "Section  6.9.4 Resample Image Filter"

In pdf-pages 254-252


The source code of the examples described in
this section are available in:


Insight/Examples/Filtering
        ResampleImageFilter.cxx
        ResampleImageFilter2.cxx
        ResampleImageFilter3.cxx
        ResampleImageFilter4.cxx
        ResampleImageFilter5.cxx
        ResampleImageFilter6.cxx
        ResampleImageFilter7.cxx
        ResampleImageFilter8.cxx
        ResampleImageFilter9.cxx
        ResampleOrientedImageFilter.cxx
        ResampleVolumesToBeIsotropic.cxx




      Regards,


               Luis


-----------------------------------------------------------------------------------
On Wed, Mar 3, 2010 at 8:52 AM, Aussensaiter <s.ganger at hotmail.com> wrote:
>
> Hi.
> Im using the latest Release of VTK/ITK/GDCM and currently I am working on
> viewing slices in 3 dimension from a set of dicom slices. I stumbled across
> a problem and i can't figure out how to solve it, likely because i don't
> fully understand what the transform/ResampleImageFilter does.
>
> I have  a itkOrientedImage that is created from slices, which results in a
> 3D image.
> I then pass it to an ResampleImageFilter where i use LinearInterpolation and
> AffineTransform. So far so good, _but_ if I got 1 dataset that produces
> problems:
> http://pubimage.hcuge.ch:8080/     The set(one of them, afterwards i found 2
> more) that makes problems is the "KNEE" example.
>
> I got two cases and two sets, for an example that works heres the "brain"
> set:
> http://www.mathworks.com/matlabcentral/fileexchange/2762-dicom-example-files
>
> Case 1:
> I _don't_ use the method "SetOutputDirection(itkimage->GetDirection())" and
> don't feed the filter with the direction from the image.
> The brain image is shown exactly as in Slicer3 which i use to compare my
> results, and isn't a cube with horizontal lines.
> The images are not taken horizontally, so its a little bit rotated, which
> can be seen in this image :
> http://old.nabble.com/file/p27768466/Bildschirmphoto1.png
> But, the knee image is just a monocoloured canvas with no texture at all,
> just blank and one colour, so basically useless.
>
> Case2:
> I  _use_ the method "SetOutputDirection(itkimage->GetDirection())" and feed
> the filter with the direction from the image.
> Then i get both sample sets correct, but in the brain example the little
> rotation is missing. And also in the Knee example of course, but that is the
> only way I can view it anyway.
>
> Can someone tell me how to get around this, and how to fix it ? I don't know
> if I am using the wrong transform, or how to tell the transform how to
> translate the dimensions ?
>
> Thanks, and seeing forward to your help :)
> --
> View this message in context: http://old.nabble.com/itk-ResampleImageFilter-%2B-OutputDirection-Problem-%28dicom%29-tp27768466p27768466.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list