[Insight-users] Possible bug reading DICOM MONOCHROME1 images with Pixel Padding Value != 2^bits stored-1

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Feb 17 04:47:00 EST 2009


The only reasonable option I can think of, is disconnect the
ConvertFixGreyLevels(). I would make it an option and activate it only
for ITK/GDCM (somewhere in itk::GDCMImageIO).

Comments ?

On Mon, Feb 16, 2009 at 9:28 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Mathieu,
>
> Can it be fixed in gdcm 1.x?
>
> Bill
>
> On Mon, Feb 16, 2009 at 10:48 AM, Mathieu Malaterre
> <mathieu.malaterre at gmail.com> wrote:
>> On Mon, Feb 16, 2009 at 1:03 PM, Iván Macía <imacia at vicomtech.org> wrote:
>>> Hi,
>>>
>>>
>>>
>>> I tried to load a DICOM MONOCHROME1 image (MG) and resulting output values
>>> are outside the range specified in the DICOM fields. The resulting image is
>>> shown in black with the W/L settings taken from DICOM.
>>>
>>>
>>>
>>> Debugging a bit and getting deep into ITK, it seems like the problem lies in
>>> the GDCM library in gdcm::PixelReadConvert::ConvertFixGreyLevels() and the
>>> interpretation of (0028,0120) Pixel Padding Value and (0028,0107) Largest
>>> Image Pixel Value. For this image, the Largest Image Pixel Value is 32767
>>> and the Pixel Padding Value 32767 (recommended to be 2^16-1 = 65535) but not
>>> mandatory.
>>>
>>>
>>>
>>> In gdcm::PixelReadConvert::ConvertFixGreyLevels() always pixels are
>>> converted in the form:
>>>
>>>
>>>
>>> value = 65535 - value
>>>
>>>
>>>
>>> which results in pixels above the 5571 - 32767 range for this image.
>>>
>>>
>>>
>>> In my opinion, in this case it should be
>>>
>>>
>>>
>>> value = 32767 - value
>>>
>>>
>>>
>>> which gives the correct values.
>>>
>>>
>>>
>>> I am not totally sure, but the image seems to be following the standard.
>>> Could please someone confirm this?
>>>
>>> We have several of these images and none is loading correctly
>>>
>>>
>>>
>>> I added a new bug entry in Mantis for this
>>>
>>> http://public.kitware.com/Bug/view.php?id=8538
>>
>> Agreed with diagnosis. Thanks for bug report.
>>
>> If you switch to gdcm 2.x (using ITK_USE_SYSTEM_GDCM) this bug will go away.
>>
>> Thanks,
>> --
>> Mathieu
>> _____________________________________
>> 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
>>
>



-- 
Mathieu


More information about the Insight-users mailing list