<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hi, i'm trying to saving a DICOM file into another DICOM file with some transformation like IntensityWindowingImageFilterT</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">ype adapted from the</span><a href="http://www.itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM" target="_blank" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">http://www.itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM</a><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> example. The only problem that occurs it the "brightness" doesn't change on the new DICOM file created during the process but the "contrast" changes is ok. This snippet of code corresponds the moment that occurs the passage of parameters to the transformation of the IntensityWindowingImageFilterT</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">ype and the moment that is written a new DICOM file.</span><br clear="all" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div>//////////////////////////////////////////////// </div><div>// "filter" is the type IntensityWindowingImageFilterType</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div><span style="white-space:pre-wrap">        </span>rescaler->SetInput(reader->GetOutput());</div>
<div><span style="white-space:pre-wrap">        </span>rescaler->SetOutputMinimum( 0 ); //rescaler default to view the original colors [0,255]</div><div><span style="white-space:pre-wrap">        </span>rescaler->SetOutputMaximum( 255 ); //</div>
<div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>filter->SetInput(rescaler->GetOutput());//</div><div><span style="white-space:pre-wrap">        </span>filter->SetWindowLevel(intMaxWindowGlobal, intMinWindowGlobal); //(window, level)</div>
<div><span style="white-space:pre-wrap">        </span>//parameters from a Dialog created by the main class</div><div> <span style="white-space:pre-wrap">        </span>filter->SetWindowMinimum(intMinWindowGlobal);//Minimum Contrast</div>
<div> <span style="white-space:pre-wrap">        </span>filter->SetWindowMaximum(intMaxWindowGlobal);//Maximum Contrast</div><div> <span style="white-space:pre-wrap">        </span>filter->SetOutputMinimum(intOutMinGlobal);//Minimum Brightness<span style="white-space:pre-wrap">        </span></div>
<div> <span style="white-space:pre-wrap">        </span>filter->SetOutputMaximum(intOutMaxGlobal);//Maximum Brightness</div><div><br></div><div><span style="white-space:pre-wrap">        </span>try</div><div><span style="white-space:pre-wrap">        </span> {</div>
<div><span style="white-space:pre-wrap">        </span> filter->Update();</div><div><span style="white-space:pre-wrap">        </span> }</div><div><span style="white-space:pre-wrap">        </span> catch( itk::ExceptionObject & err )</div>
<div><span style="white-space:pre-wrap">        </span> {</div><div><span style="white-space:pre-wrap">        </span> std::cerr << "ExceptionObject caught !" << std::endl;</div><div><span style="white-space:pre-wrap">        </span> std::cerr << err << std::endl;</div>
<div><span style="white-space:pre-wrap">        </span> }</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<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("/home/brennobr/Source/dcm-files/teste-resample/output");</div><div> seriesFormat = seriesFormat + "/" + "IM%d.dcm";</div><div> outputNames->SetSeriesFormat (seriesFormat.c_str());</div>
<div> outputNames->SetStartIndex (1);</div><div> outputNames->SetEndIndex (outputSize[2]);</div><div> </div><div> SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New();</div><div> seriesWriter->SetInput( filter->GetOutput() );</div>
<div> seriesWriter->SetImageIO( gdcmIO );</div><div> seriesWriter->SetFileNames( outputNames->GetFileNames() );</div><div> seriesWriter->SetMetaDataDictionaryArray( &outputArray );</div><div> try</div>
<div> {</div><div> seriesWriter->Update();</div><div> }</div><div> catch( itk::ExceptionObject & excp )</div><div> {</div><div> std::cerr << "Exception thrown while writing the series " << std::endl;</div>
<div> std::cerr << excp << std::endl;</div><div> }</div><div> std::cout << "The output series in directory " << "/home/brennobr/Source/dcm-files/teste-resample/output"</div>
<div> << " has " << outputSize[2] << " files with spacing "</div><div> << outputSpacing</div><div> << std::endl;</div></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>