[Insight-developers] Question about ImageIO and re-ordering dimensions

Luis Ibanez luis.ibanez@kitware.com
Mon, 03 Feb 2003 11:49:50 -0500


Hi Kent,

 From your description, it looks like the images
stored in Analyze format are not in coronal format
and you want them to be converted to coronal on
the fly during reading. Is this right ?


A) For the technical aspect:

You could simply write the ReadInformation() method
in such a way that it permutes the image size and
spacings in the apropriate way to convert it to
coronal. Then when you get to the Read() method this
information will be already consistent with what was
computed in ReadInformation().

Note that ReadInformation() happens in a different
pass of the pipeling than the Read() method.



B) For the medical aspect:

It is a bit of a concern that you are permuting
axis on reading....

Would you do the same upon writing ?

That is, if you run a program that just read a
volume and pass it to a writer.... will the
resulting output file be exactly the same as the
input ? or will it have permuted axis ?

What is the reason for requiring the volume to
be in coronal format ?

It sound like a viewer issue rather than an IO
issue...  Selecting multiple views shouldn't be
a concern of the readers. This looks like something
that you could deal with at the GUI level...

Permuting axis in IO will cause problems if later
to try to register a volume MetaImage format against
a volume in Analize.



C) About checking in data for testing, you may
    use the directory:

       Insight/Testing/Data/Input

    CMake configures ITK in such a way that this
    directory can be found for running tests.
    This is done by defining the ITK_DATA_ROOT
    variable during CMake configuration.

    Please take a look at the CMakeLists.txt file
    in the directory:

       Insight/Testing/Code/BasicFilter

    for example, the test:  itkBilateralImageFilterTest
    uses the input image "cake_easy.png".

    It will be nice if you could put small files only
    since the sources checkout makes already 45 Mb...


---

Regards


    Luis


-----------------------------------------------
Kent Williams wrote:
> Hi!
> 
> I'm in charge of getting the Mayo-Analyze file reader/writer fully functional, 
> and I had a question about ImageIO internals. 
> 
> One of our requirements is that once loaded into ITK, the Analyze data be in
> Coronal scan order -- i.e. vertical brain slices, from back/posterior to 
> front/anterior.  This is easy enough for the case where the scan volume is a 
> cube, but the images are more likely to be rectangular prism.
> 
> The existing Analyze reader gets the dimensions from the Analyze header in the 
> ReadInformation method.  Then later, the AnalyzeIO::Read method reads in the 
> pixel data from the image file.
> 
> I guess my question is this: After the image data is read in, can I change the 
> dimensions of the image? In other words, let ImageIOBase figure out the image 
> size and strides of the old configuration, then change the dimensions, 
> re-compute the strides, and then re-order the image buffer.? Or is there some
> really elegant way to do this in ITK that I've not yet found?
> 
> Question 2 -- I'd like to check in a test for the analyze file IO, but I'll 
> need to check in a pair of Analyze-format data files.  Where in the testing 
> tree would be the logical place to park them, and when the tests are run, how 
> would my test find its data files?
> 
> thanks!
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
> 
>