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

Maarten Beek mbeek at sri.utoronto.ca
Thu Jul 2 19:37:43 EDT 2009



Luis Ibanez wrote:
>
> Hi Maarten,
>
>             Yes,
>             ITK doesn't consider a 3D image of 1 slice
>             to be equivalent to a 2D image.
<...>
>
> 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.
>
I didn't know of the existence of this class. I'll have a look at it. 
But at the moment I don't see how it will help me, since one cannot 
determine a template variable during runtime. Amira works with modules 
(=class) and I am creating modules that internally use functionality 
found in ITK. Amira uses the same class for 2d and 3d images, 
nonetheless I would like my modules to work on all images without having 
to create a 2d and 3d version of each module...
Maybe I can check for the dimension of the Amira image before creating 
the module with ITK code and then use template specialization to create 
the correct itk::Image.... Hmmm
>
> 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.
>
How does this work?
Do I just upload the code and everyone can use it, or is there some 
review involved and do I need to write an article describing the code?
>
>
>      Regards,
>
>
>              Luis
>
>
>
> ----------------------------------------------------------------------------------------
> On Thu, Jul 2, 2009 at 2:33 PM, Maarten Beek <mbeek at sri.utoronto.ca 
> <mailto: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 <http://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
>
>


More information about the Insight-users mailing list