[ITK] when using itkImageFileReader to read dicom image , it occurs assertion failure:pixeltype_debug==pixeltype.

Matt McCormick matt.mccormick at kitware.com
Wed Feb 25 12:40:58 EST 2015


Hi Liu,

The community will likely need a self-contained [1] example with code
and data to help with your problem.

Thanks,
Matt

[1] http://sscce.org/

On Wed, Feb 25, 2015 at 12:06 PM, 转身转瞬 <1549917255 at qq.com> wrote:
> 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
>
>
>
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>


More information about the Community mailing list