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

Luis Ibanez luis.ibanez at kitware.com
Thu Jul 2 19:54:01 EDT 2009


HI Maarten,


0) How does the Insight Journal works ?

    Answer:
http://www.vtk.org/Wiki/ITK_Procedure_for_Contributing_New_Classes_and_Algorithms

    In short, yes, you write an article (a technical report, of a couple of
pages)
    and add to it your source code, data and parameters.

     Any reader of the Journal should be able to get your code and
     simply do on it:

                cmake .
                make
                ctest

     and obtain the *SAME* results that you describe in your paper
     (or technical report).

     You may want to take a look at other papers to get a feeling
     for the process.

      Here is a good model:

         http://www.insight-journal.org/browse/publication/318



1) you can convert all the Amira images to 3D ITK images,
    Then you check their Z size, and if it is == 1, then you
     pass them through the itkExtractImageFilter, get a 2D
     image and pass it to a 2D pipeline.

     Yes, that means that your application should compile
      *BOTH* a 3D pipeline and a 2D pipeline.  There is no
     much mistery beyond that.



   Regards,


         Luis



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

>
>
> 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
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090702/0c375722/attachment.htm>


More information about the Insight-users mailing list