<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No ITK will always apply the modality LUT for grayscale image. You<br>cannot control this option. There is IMHO no reason to disable this
<br>behavior. Please describe why you are looking for something like this<br>This is potentially dangerous, since it will affect professional<br>interpretation of the image.</blockquote><div><br>I&#39;m using itk 2.8.1 with the version of gdcm that ships with it ( i don&#39;t use an external build of gdcm lib ). I&#39;m doing testing with several test images for grayscale display consistency and I found some problems about modality lut which I don&#39;t know if they&#39;re bugs of gdcm or not.
<br><br>As you said, gdcm always applies modality lut transforms, but in my case this is not true. When there are the rescale slope/intercept values they&#39;re applied but there&#39;s no modality lut transform when there are modality lookup tables .
<br><br>For example, with test image <a href="http://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm/gdcmSampleData/imgdisplay_testcases/mlut_18.dcm">http://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm/gdcmSampleData/imgdisplay_testcases/mlut_18.dcm
</a><br>it has a pixel range of -2048-2047 and a modality lut with lut descriptor ( 4096\63488\16, that is, the lut has 4096 entries, and the first value mapped is -2048 and each value in the lut is 16-bit ). The values in the lut range from 0 to 65535 with increment +16, so the lookup table looks like 0,16,32,48,....65535, so value 0 in original image corresponds to 0, value 1 with 16, value 2 with 32, ... value 4095 with 65535.
<br>But when I read this image it still has the range -2048..2047, so it seems the modality lut is not applied, and that&#39;s why I&#39;m asking if there&#39;s some method to disable/enable the modality lut&#39;s.because
 I though maybe the modality lut application was not enabled. Is this just a bug or this kind of luts are not implemented in the version of gdcm that comes with itk 2.8.1??<br>I have the same problem with <a href="http://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm/gdcmSampleData/imgdisplay_testcases/mlut_19.dcm">
http://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm/gdcmSampleData/imgdisplay_testcases/mlut_19.dcm</a><br><br>Then, I also have a case where the rescale slope/intercept is not applied correctly<br><a href="http://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm/gdcmSampleData/imgdisplay_testcases/xlut_01.dcm">
http://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm/gdcmSampleData/imgdisplay_testcases/xlut_01.dcm</a><br>The original range is 128..255. The rescale slope is = 2 and the rescale intercept is = -128. <br>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.
<br><br>I would like you to check this and find the possible bugs and solutions to it. Thanks!<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-Mathieu<br><br>Jesús Spí­nola wrote:<br>&gt; Is this behaviour modificable? I mean, is there a method in the proper<br>&gt; gdcm class to turn on/off&nbsp;&nbsp;the modality lut transforms?<br>&gt;<br>&gt; 2007/2/8, Mathieu Malaterre &lt; 
<a href="mailto:mathieu.malaterre@kitware.com">mathieu.malaterre@kitware.com</a><br>&gt; &lt;mailto:<a href="mailto:mathieu.malaterre@kitware.com">mathieu.malaterre@kitware.com</a>&gt;&gt;:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Jesús Spí­nola wrote:
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; Hello,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; I&#39;m reading a series of DICOM images with the itk::ImageSeriesReader<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; class attaching the itk::GDCMImageIO as the ImageIO for the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; series reader.
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; When the rescale intercept and rescale slope values are present<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; in the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; dicom series, this parameters are applied to the resulting<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; itk::Image.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; Another way of define a rescale of the values of the raw pixels
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; of the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; dicom images is the modality lut. If present, does gdcm apply this<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; modality lut to the resulting image? If it does not, there&#39;s any<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; method<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; to make gdcm apply this lut?
<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Hi Jesús,<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Yes GDCM will apply any modality lut directly for you. In case of an<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; RGB image be sure to construct a RGB pixeltype for reading your image.<br>&gt;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; HTH<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Mathieu<br>&gt;<br>&gt;<br><br></blockquote></div><br>