[ITK] when using itkImageFileReader to read dicom image , it occurs assertion failure:pixeltype_debug==pixeltype.
转身转瞬
1549917255 at qq.com
Wed Feb 25 12:06:59 EST 2015
Hi,everyone
I'm just starting using itk to read dicom image.I wrote a simple program and when it runs to reader->update(),it occurs the following failure:
assertion failed:pixeltype_debug==pixeltype,file F:\I_VTK\ITK\InsightToolkit-4.7.0\Modules\IO\GDCM\src\itkGDCMImageIO.cxx,line 230
and then the program would be aborted.
I determine the place where this error occurs.It is because that the member(BitsAllocated) of pixeltype_debug is different from the member(BitsAllocated) of pixeltype.
1)gdcm::Image & image = reader.GetImage();
gdcm::PixelFormat pixeltype_debug = image.GetPixelFormat();
the BitsAllocated of pixeltype_debug is 12.
2) if ( !image.GetBuffer( (char*)pointer ) )
{
itkExceptionMacro(<< "Failed to get the buffer!");
}
const gdcm::PixelFormat & pixeltype = image.GetPixelFormat();
the BitsAllocated of pixeltype is 16.it changes in the code in red above.And I can't solve it.
Could you please help me?
thanks.
Liu Guirong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150226/fea06d99/attachment.html>
More information about the Community
mailing list