[Insight-users] Modality LUT transform with gdcmIO

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Feb 21 13:12:21 EST 2007


I'll start with the easy one.

> Then, I also have a case where the rescale slope/intercept is not 
> applied correctly
> http://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm/gdcmSampleData/imgdisplay_testcases/xlut_01.dcm
> The original range is 128..255. The rescale slope is = 2 and the rescale 
> intercept is = -128.
> The expected range after apply the rescale should be 
> 128*2-128..255*2-128 == 128..382 but surprisingly I get a range of 
> -128..126 which is obviously wrong.

Jesús,

   Nice job in tracking those down. Thanks a lot for your time.
   However I need to ask you what tool you are using to get those 
results, I have tried different ones, and I always see an original 
stored pixel data range of [0,255]. Which means the actual pixel values 
should be in the range [-128,382].

Fixing the code in itkGDCMImageIO.cxx with (*) gives the correct answer.
Could you please enter a bug report for this in the ITK bug tracker system :

   http://itk.org/Bug


Thanks,
-Mathieu

(*)
   if (m_RescaleIntercept < 0)
     {
     switch (m_ComponentType)
       {
       case ImageIOBase::UCHAR:
         //m_ComponentType = ImageIOBase::CHAR;
         m_ComponentType = ImageIOBase::SHORT;
         break;
       case ImageIOBase::UINT:
         m_ComponentType = ImageIOBase::INT;
         break;
       case ImageIOBase::USHORT:
         m_ComponentType = ImageIOBase::SHORT;
         break;
       case ImageIOBase::ULONG:
         m_ComponentType = ImageIOBase::LONG;
         break;
       default:
         break;
       }
     }


More information about the Insight-users mailing list