[Insight-users] itkImageSeriesReader crashes

Bill Lorensen bill.lorensen at gmail.com
Wed Oct 7 12:41:15 EDT 2009


Thomas,

This was fixed in itk 3.16:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/IO/itkImageSeriesReader.txx?root=Insight&r1=1.31&view=log


Bill

On Wed, Oct 7, 2009 at 12:30 PM, van Bruggen Thomas
<t.vanbruggen at dkfz-heidelberg.de> wrote:
> Hello,
>
>
>
> I am experiencing a problem with the ImageSeriesReader when trying to load
> DICOM data consisting of one file only. I am suspecting that it is a bug.
> When the dataset consists of multiple files the member variable
> m_NumberOfDimensionsInImage is decreased by one (line 160 of
> itkImageSeriesReader.txx, using itk 3.12). When there is only one file the
> following code block is executed, the result of which gives
> m_NumberOfDimensionsInImage the value 3:
>
>
>
> if (m_FileNames.size() == 1)
>
>       {
>
>       // ----------------------------
>
>       // there is only one file need to copy all of it's meta data
>
>       spacing = reader->GetOutput()->GetSpacing();
>
>       origin = reader->GetOutput()->GetOrigin();
>
>       direction = reader->GetOutput()->GetDirection();
>
>       largestRegion = reader->GetOutput()->GetLargestPossibleRegion();
>
>
>
>       m_NumberOfDimensionsInImage =
> reader->GetImageIO()->GetNumberOfDimensions();
>
>       }
>
>
>
> Later in Generate data m_NumberOfDimensionsInImage is used as an index to
> access the last element of sliceStartIndex:
>
> sliceStartIndex[m_NumberOfDimensionsInImage] = i;
>
>
>
> sliceStartIndex has length 3 so it writes outside the bounds of the array,
> resulting in a crash, because the stack around the variable
>
> sliceStartIndex[] is corrupted.
>
>
>
>
>
> Is this a known bug/does anybody else ever experienced the same problem? The
> solution to this problem could be to set m_NumberOfDimensionsInImage =
> reader->GetImageIO()->GetNumberOfDimensions() – 1
>
>
>
> Kind regards,
>
>
>
> Thomas
>
>
>
>
>
>
>
> _____________________________________
> 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-users
>
>


More information about the Insight-users mailing list