Hi, i&#39;m trying to saving a DICOM file into another DICOM file with some transformation like IntensityWindowingImageFilterType adapted from the <a href="http://www.itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM">http://www.itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM</a> example. The only problem that occurs it the &quot;brightness&quot; doesn&#39;t change on the new DICOM file created during the process but the &quot;contrast&quot; changes is ok. This snippet of code corresponds the moment that occurs the passage of parameters to the transformation of the IntensityWindowingImageFilterType and the moment that is written a new DICOM file.<br clear="all">
<div><br></div><div><div>////////////////////////////////////////////////  </div><div>// &quot;filter&quot; is the type IntensityWindowingImageFilterType</div></div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>rescaler-&gt;SetInput(reader-&gt;GetOutput());</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>rescaler-&gt;SetOutputMinimum( 0 ); //rescaler default to view the original colors [0,255]</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>rescaler-&gt;SetOutputMaximum( 255 ); //</div>
<div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>filter-&gt;SetInput(rescaler-&gt;GetOutput());//</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>filter-&gt;SetWindowLevel(intMaxWindowGlobal, intMinWindowGlobal); //(window, level)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>//parameters from a Dialog created by the main class</div><div>  <span class="Apple-tab-span" style="white-space:pre">        </span>filter-&gt;SetWindowMinimum(intMinWindowGlobal);//Minimum Contrast</div>
<div>  <span class="Apple-tab-span" style="white-space:pre">        </span>filter-&gt;SetWindowMaximum(intMaxWindowGlobal);//Maximum Contrast</div><div>  <span class="Apple-tab-span" style="white-space:pre">        </span>filter-&gt;SetOutputMinimum(intOutMinGlobal);//Minimum Brightness<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div>  <span class="Apple-tab-span" style="white-space:pre">        </span>filter-&gt;SetOutputMaximum(intOutMaxGlobal);//Maximum Brightness</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>try</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>     {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>      filter-&gt;Update();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>      }</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>    catch( itk::ExceptionObject &amp; err )</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>      {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>      std::cerr &lt;&lt; &quot;ExceptionObject caught !&quot; &lt;&lt; std::endl;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>      std::cerr &lt;&lt; err &lt;&lt; std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>      }</div></div><div><br></div><div>
<br></div><div><br></div><div><div>////////////////////////////////////////////////  </div><div>// 5) Write the new DICOM series</div><div><br></div><div>  // Generate the file names</div><div>  OutputNamesGeneratorType::Pointer outputNames = OutputNamesGeneratorType::New();</div>
<div>  std::string seriesFormat(&quot;/home/brennobr/Source/dcm-files/teste-resample/output&quot;);</div><div>  seriesFormat = seriesFormat + &quot;/&quot; + &quot;IM%d.dcm&quot;;</div><div>  outputNames-&gt;SetSeriesFormat (seriesFormat.c_str());</div>
<div>  outputNames-&gt;SetStartIndex (1);</div><div>  outputNames-&gt;SetEndIndex (outputSize[2]);</div><div> </div><div>    SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New();</div><div>    seriesWriter-&gt;SetInput( filter-&gt;GetOutput() );</div>
<div>    seriesWriter-&gt;SetImageIO( gdcmIO );</div><div>    seriesWriter-&gt;SetFileNames( outputNames-&gt;GetFileNames() );</div><div>    seriesWriter-&gt;SetMetaDataDictionaryArray( &amp;outputArray );</div><div>  try</div>
<div>    {</div><div>    seriesWriter-&gt;Update();</div><div>    }</div><div>  catch( itk::ExceptionObject &amp; excp )</div><div>    {</div><div>    std::cerr &lt;&lt; &quot;Exception thrown while writing the series &quot; &lt;&lt; std::endl;</div>
<div>    std::cerr &lt;&lt; excp &lt;&lt; std::endl;</div><div>    }</div><div>  std::cout &lt;&lt; &quot;The output series in directory &quot; &lt;&lt; &quot;/home/brennobr/Source/dcm-files/teste-resample/output&quot;</div>
<div>            &lt;&lt; &quot; has &quot; &lt;&lt; outputSize[2] &lt;&lt; &quot; files with spacing &quot;</div><div>            &lt;&lt; outputSpacing</div><div>            &lt;&lt; std::endl;</div></div><div><br></div>
<div><br></div><div><br></div>-- <br><div>Brenno Bernardes Ribeiro<br><br>Engenharia da Computação</div><div>
Universidade Federal do Pará</div><div style="padding:0px;overflow:hidden;margin-left:0px;margin-top:0px;color:black;font-size:10px;text-align:left;line-height:130%"></div>