[Insight-users] 2d images defined as itk::image<type,3>

Luis Ibanez luis.ibanez at kitware.com
Thu Jul 2 19:06:17 EDT 2009


Hi Maarten,

            Yes,
            ITK doesn't consider a 3D image of 1 slice
            to be equivalent to a 2D image.


Therefore, any filter that uses Neighborhoods, will most likely crash,
or run *very* slowly when feed with a 3D image of 1 slice.

For any Neighbord-based filters (Median, Mean, Gradient, Region
Growing, LevelSet.... pretty much everything except pixel-wise filters)
you will need separate pipelines for 3D images and 2D images.


You should probably have a separate code for converting 2D images
from Amira into 2D images in ITK ( as opposed to presenting them
as 3D images of 1 slice).

or...

You could use the itkExtractImageFilter in order to extract a 2D slice
from a 3D image. In this case, the output is really an itk 2D image
that you can feed as input to a 2D pipeline.


You will find an example on the use of the ExtractImageFilter
in the file:

         Insight/Examples/IO/ImageReadExtractWrite.cxx



BTW: It will be great if you contribute these conversion classes
         to the Insight Journal.

                            http://www.insight-journal.org/

         I'm sure that many users of Amira and ITK will find useful
         to have a mechanism for exchanging images between the
         two systems.



     Regards,


             Luis



----------------------------------------------------------------------------------------
On Thu, Jul 2, 2009 at 2:33 PM, Maarten Beek <mbeek at sri.utoronto.ca> wrote:

>
> I wrote classes to convert Amira's HxUniformScalarField3 into Itk's
> itk::Image and vice versa.
> I hard-coded the dimension of the itk::Image to 3 (since Amira's class
> represents a 3d image as well).
>
> However, I have noticed that some itk filters don't work correctly after
> converting a 2d HxUniformScalarField3 (e.g. one slice) into an
> itk::Image<type,3>. I think this has to do with the iterators in Itk (these
> are templated over the dimension as well).
>
> Is this true and is there some work-around to get every
> HxUniformScalarField3 (2d and 3d) converted into a itk::Image<type,3>?
>
> Thanks - Maarten
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090702/8771591d/attachment.htm>


More information about the Insight-users mailing list