[Insight-users] MINC2ImageIO loses scaling information

Geoff Topping g_topping at hotmail.com
Thu May 14 11:28:41 EDT 2009


Hi all,

 
 I've been trying to get the MINC2ImageIO code working, and after help from Leila Baghdadi, I've gotten a test program built and running.  However, with this program, I'm having some strange problems with output image scaling.

The program loads a MINC2 format image and outputs it back
without modification.  The input I'm using to test is a file from the
MNI:

 

http://packages.bic.mni.mcgill.ca/tgz/mni-models_icbm152-lin-1.0.tar.gz

 

This is actually a MINC1 format image, but I've converted it to MINC2
using MINC2's mincconvert with the -2 option, since the MINC2ImageIO
code only works with MINC2 format images.

 

The attached code, ImageReadWrite.cxx, is built with the attached
CMakeLists.txt, the FindMINC2.cmake that comes with ITK and having
netcdf, hdf5 and the minc2 libraries set up in cmake.

The code and input files and other relevant files are available here:

http://www.pet.ubc.ca/gtopping/ITK/

 
To run the program, one specifies the input and output file names on the command line, in that order.

 

The program runs and outputs an image.  When this output image and the
original (converted to minc2) image are examined using mincheader, the
header files have some differences.  The image-min and image-max fields
are notably significantly reduced, and many of the other fields are
smaller and changed.  When the two images are loaded in minc's register
program, which shows them side-by-side, the rewritten image has
different scaling values by default, and setting the two images to use
the same range for the display results in rather different visible
results.

Screenshots of register initially when the images are loaded and after adjusting the scales of both images to be the same, along with all the other relevant files can be seen on the webspace linked above.

In those screenshots, the scaling range is set in the
black text on white background above the pink bar near the bottom below
the two sets of images.

 

Looking at the image data directly, with mincdump, the first few image
data numbers are also different.  In the same scale case,
both the original (left) and read-written versions of the test input
are scaled 0 to 500000.  In the original / default case, they have
different scaling ranges when initially loaded into register, probably
in part due to the differences in scaling information in the headers of
the mnc files themselves.

 

Does something in particular need to be done after loading the image
using MINC2ImageIO to get the scaling in the output image to be
consistent?  Or am I missing an important step of some other kind?

 

Thanks,

Geoff Topping
_________________________________________________________________
Internet explorer 8 lets you browse the web faster.
http://go.microsoft.com/?linkid=9655582
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 152_original_and_read_written_image_data_excerpt.txt
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090514/ff172987/attachment-0005.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 152_rewritten_header.txt
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090514/ff172987/attachment-0006.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 152_original_header.txt
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090514/ff172987/attachment-0007.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090514/ff172987/attachment-0008.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ImageReadWrite.cxx
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090514/ff172987/attachment.asc>


More information about the Insight-users mailing list