[Insight-developers] failing itkImageFileReaderDimensionsTest_MHD

Bradley Lowekamp blowekamp at mail.nih.gov
Mon May 18 14:38:43 EDT 2009


There are bugs in the ImageFileReader related to reading of images  
where dimensions don't match. It can be broken into the following cases:


1) IO Dimension (from file) == ImageDimension (tempted image type)

This works good, it's the normal things to do.

2) IO Dimension < ImageDimension

ImageSeriesReader makes use of this. When reading 2D slices into a 3D  
image it requests ImageFileReader regions with size [x, y, 1]. And  
ImageFileReader::GenerateOutputInformation pads the size of the output  
image's LargestPossibleRegion with 1s. This works too, I don't see any  
problems. (Excluding direction cosine issues)

3) IO Dimension > ImageDimension

3a) If the IORegion's size is padded with 1s after ImageDimension,  
then currently should work with all file types. For example if a 3D  
image file has size [x,y,1] then it can be read into a 2D image with  
size [x,y]


3b) If the IORegions's size ends in non-one values, we can have  
problems, like segfaults. This is because the size of the buffers  
don't match, and ImageIO object will over write the image buffer.
However the ImageIO classes which support streaming appear to handle  
this case correctly, by padding the region size with 1s.


My proposed solution is to modify  
ImageIOBase::GenerateStreamableReadRegionFromRequestedRegion to  
actually return the full dimensionality of the image. This reflects  
what the ImageIO can actually do. Then in  
ImageFileReader::EnlargeOutputRequestedRegion and a check to make sure  
this case is not occurring.




On May 16, 2009, at 3:39 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote:

> This is my doing, I should be checking the fix in on monday.
>
> http://www.cdash.org/CDash/testSummary.php?project=2&name=itkImageFileReaderDimensionsTest_MHD&date=2009-05-16
> _______________________________________________
> Powered by 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-developers

========================================================
Bradley Lowekamp
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090518/d7a5c44a/attachment.htm>


More information about the Insight-developers mailing list