<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1462968756925_3278" abp="3005"><span abp="3006">I have tried this:</span></div><div abp="3005"><span abp="3006"><raw></span></div><span id="yui_3_16_0_ym19_1_1462968756925_3116" abp="3006"><font id="yui_3_16_0_ym19_1_1462968756925_3073" color="#808080" abp="3162"><div id="yui_3_16_0_ym19_1_1462968756925_3074" abp="3163">   // Create a greyscale lookup m_pLUTAxial</div><div id="yui_3_16_0_ym19_1_1462968756925_3075" abp="3164">
m_pLUTAxial->SetValueRange(0.0, 1.0); // from black to white</div><div id="yui_3_16_0_ym19_1_1462968756925_3077" abp="3165">
m_pLUTAxial->SetSaturationRange(0.0, 0.0); // no color saturation</div><div id="yui_3_16_0_ym19_1_1462968756925_3079" abp="3166">
double dRange[2];</div><div id="yui_3_16_0_ym19_1_1462968756925_3272" dir="ltr" abp="3166">m_pDICOMReader->Update();</div><div id="yui_3_16_0_ym19_1_1462968756925_3081" abp="3167">
m_pDICOMReader->GetOutput()->GetScalarRange(dRange);</div><div id="yui_3_16_0_ym19_1_1462968756925_3083" abp="3168">
m_pLUTAxial->SetRange(dRange); // image intensity range</div><div id="yui_3_16_0_ym19_1_1462968756925_3085" abp="3169">
m_pLUTAxial->SetRampToLinear();</div><div id="yui_3_16_0_ym19_1_1462968756925_3087" abp="3170">
m_pLUTAxial->Build();</div><div id="yui_3_16_0_ym19_1_1462968756925_3089" abp="3171">
m_pColorAxial->SetLookupTable(m_pLUTAxial);</div><div id="yui_3_16_0_ym19_1_1462968756925_3117" abp="3172"><font id="yui_3_16_0_ym19_1_1462968756925_3171" color="#000000" abp="3174"></raw></font></div><div id="yui_3_16_0_ym19_1_1462968756925_3118" dir="ltr" abp="3173"><font id="yui_3_16_0_ym19_1_1462968756925_3161" color="#000000" abp="3175">The trouble is that image m_pColorAxial which is vtkMapImageToColors, is still whiter ... I noticed that dRange is between 0 and 3913 ...</font></div><div id="yui_3_16_0_ym19_1_1462968756925_3279" dir="ltr" abp="3173"><font color="#000000"></font><br></div><div id="yui_3_16_0_ym19_1_1462968756925_3281" dir="ltr" abp="3173"><font id="yui_3_16_0_ym19_1_1462968756925_3280" color="#000000">I guess that is more than that ... I will try to dig into converting pixels to Hounsfield units ... aIs nybody done this before ?</font></div><div id="yui_3_16_0_ym19_1_1462968756925_3317" dir="ltr" abp="3173"><font color="#000000"></font><br></div><div id="yui_3_16_0_ym19_1_1462968756925_3314" dir="ltr" abp="3173"><font color="#000000">Flaviu.</font></div></font><div id="yui_3_16_0_ym19_1_1462968756925_3091" abp="3005"><br></div></span><div id="yui_3_16_0_ym19_1_1462968756925_3092" dir="ltr" abp="3005"><br></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font face="Arial" size="2"> On Tuesday, May 10, 2016 5:15 PM, David Gobbi <david.gobbi@gmail.com> wrote:<br></font></div>  <br><br> <div class="y_msg_container"><div id="yiv5428072888"><div><div dir="ltr"><div class="yiv5428072888gmail_extra"><div class="yiv5428072888gmail_quote"><div>On Tue, May 10, 2016 at 7:37 AM, Flaviu2 <<a href="mailto:flaviu2@yahoo.com" target="_blank" rel="nofollow" shape="rect" ymailto="mailto:flaviu2@yahoo.com">flaviu2@yahoo.com</a>> wrote:<br clear="none">><br clear="none">> Very useful your comments ! I have learned something here.<br clear="none">><br clear="none">> The line<br clear="none">><br clear="none">> > table->SetRange(0, 2047)<br clear="none"><br clear="none">Try something like the code below, it is simple but it often works fine.</div><div>If it doesn't work for your image, there are more sophisticated methods</div><div>that can be used, but they involve computing some statistics on the</div><div>image and using the metadata to convert pixels to Hounsfield units.</div><div><br clear="none">m_pDICOMReader->Update();<br clear="none">double range[2];<br clear="none">m_pDICOMReader->GetOutput()->GetScalarRange(range);</div><div>table->SetRange(range);</div><div class="yiv5428072888yqt4291551557" id="yiv5428072888yqtfd28283"><div><br clear="none"></div><div> - David</div></div></div></div></div></div></div><br><br></div>  </div> </div>  </div></div></body></html>