[Insight-developers] Exception reading Analyze files

Mathieu Coursolle mcoursolle at rogue-research.com
Mon Mar 2 09:46:08 EST 2009


Hi ITK developers,

I am using the itkAnalyzeImageIO to read some Analyze files. We got  
some Analyze files
that the reader could not open properly (throws an exception) recently.

According to the Analyze file format description, the dim[] array  
contains the number of dimensions,
followed by the size of each dimension. The problematic files do have  
valid values for each dimensions,
but the number of dimension is set to 0.

Those files were created from a converter software to convert PAR/REC  
files. I agree that the file doesn't
follow the file format, but the files could be opened with success  
with other softwares such as Neurolens
and the MINC tools.

Therefore, I think it would make sense for ITK to be able to open  
those files as well. A simple solution would
be to compute the number of dimensions based on the non-zero dimension  
sizes.

For example, the problematic files have their dim array equal to: [0,  
200, 256, 256, 1, 0, 0, 0].
It is clear in this case that the first element should be 4 (dimX:  
200, dimY:256 dimZ:256 dimT:1).

I attached a patch that resolves the issue.

Is this a change you would like to see in ITK? Is it too late for the  
next release?

Thanks,

Mathieu

____________________
Mathieu Coursolle, M.Ing.		
Rogue Research Inc.
www.rogue-research.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090302/4dd7ce32/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_analyze.txt
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090302/4dd7ce32/attachment.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090302/4dd7ce32/attachment-0001.htm>


More information about the Insight-developers mailing list