Hi, Lius,<br><br>
<div><span class="gmail_quote">2007/5/2, Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hi Chris,<br><br>What exactly was changed in the image content (the pixel data) ?<br><br>Did the intensities of the pixels changed ?
</blockquote>
<div> </div>
<div><font color="#33ccff">---------------Yes, I changed the intensities of the pixels.</font></div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">What was the pixel type of the original data ?</blockquote>
<div> </div>
<div><font color="#00cccc"><font color="#33ccff">---------------I didn't know the exactly pixel type of the original data, From it header infomation of "(0028,0100) Bits Allocated<br> US 2 16" and " (0028,0101) Bits Stored US 2 12" , I think it may be 16-bits. Is it unsigned short??.
</font></font></div>
<div><font color="#00cccc"><font color="#33ccff"></font></font> </div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">What was the pixel type that you used for<br>instantiating the itk::Image<> in your code ?</blockquote>
<div> </div>
<div> </div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">If you instantiate the image using the correct pixel type,<br>then the values should not change.<br><br>What tool are you using for looking at the DICOM image
<br>pixel data ?</blockquote>
<div> </div>
<div>
<div><font color="#33ccff">--------------------Actualy I used the filter work-flow described in the example "CurvesLevelSet". </font></div>
<div><font color="#666600">typedef itk::Image< float, 2 > InputImageType;</font></div>
<div>
<div><font color="#666600">typedef itk::Image< unsigned char, 2 > OutputImageType;</font></div>
<div><font color="#666600"></font> </div>
<div><font color="#666600">typedef itk::BinaryThresholdImageFilter< InputImageType, OutputImageType > ThresholdingFilterType;</font></div>
<div><font color="#666600">ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New();</font></div>
<div>
<p><font color="#666600"> typedef itk::ImageFileReader< InternalImageType > ReaderType;<br> typedef itk::ImageFileWriter< OutputImageType > WriterType;</font></p>
<p><font color="#666600"> ReaderType::Pointer reader = ReaderType::New();<br> WriterType::Pointer writer = WriterType::New();</font></p>
<p><font color="#666600"> reader->SetFileName( argv[1] );<br> reader->SetImageIO( gdcmIO );<br> writer->SetFileName( argv[2] ); <br> //writer->SetImageIO( gdcmIO );</font></p>
<p><font color="#666600">............. // filter and process</font></p>
<p><font color="#666600">///--------------------I use this to make the output images'dicom image header</font></p>
<p><font color="#666600"> typedef itk::MetaDataDictionary DictionaryType;<br> DictionaryType & dictionary = gdcmIO->GetMetaDataDictionary();</font></p>
<p><br><font color="#666600"> typedef itk::MetaDataObject< std::string > MetaDataStringType;<br> DictionaryType::ConstIterator itr = dictionary.Begin();<br> DictionaryType::ConstIterator end = dictionary.End();</font>
</p>
<p><font color="#666600"> while( itr != end )<br> {<br> itk::MetaDataObjectBase::Pointer entry = itr->second;<br> MetaDataStringType::Pointer entryvalue =<br> dynamic_cast<MetaDataStringType *>( entry.GetPointer
() ) ;<br> if( entryvalue )<br> {<br> std::string tagkey = itr->first;<br> std::string labelId;<br> bool found = itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId );<br> std::string tagvalue = entryvalue->GetMetaDataObjectValue();
<br> itk::EncapsulateMetaData<std::string>( dictionary, labelId, tagvalue );</font></p>
<p><font color="#666600"> if( found )<br> {<br> std::cout << "(" << tagkey << ") " << labelId;<br> std::cout << " = " << tagvalue.c_str() << std::endl;
<br> }<br> // Software Guide : EndCodeSnippet<br> else<br> {<br> std::cout << "(" << tagkey << ") " << "Unknown";<br> std::cout << " = " <<
tagvalue.c_str() << std::endl;<br> }<br> }<br> <br> ++itr;<br> }</font></p>
<p><font color="#666600">//-------------------header infomation end</font></p>
<p><font color="#666600"> thresholder->SetInput( geodesicActiveContour->GetOutput() );<br> writer->SetInput( thresholder->GetOutput() );</font></p></div>
<div><font color="#33ccff">Is it right? The problem exist the data type change from float to unsighed char??</font></div>
<div> </div>
<div>
<div><font color="#33ccff"></font> </div></div>
<div><font color="#33ccff"></font> </div>
<div> </div></div></div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> Please let us know,<br><br><br> Thanks<br><br><br><br> Luis<br><br><br><br>------------------<br>
Chris Lee wrote:<br>> Hi, itkers,<br>><br>> I need help about the problem how to save a dicom file after processing<br>> with its orginal header infomation.<br>> In detail, I filter and segment a dicom image file, for example, CT image,
<br>> and I want the result file can be saved in the format of dicom and with<br>> the same header infomation( including image position, instance number<br>> and so on ).<br>><br>> I learned from the example "DicomImageReadChangeHeaderWrite",.
<br>> However, when I run this example, I made the paramaters Entry as "<br>> 0020|0013", Value as "7".<br>> As a result, I found the output dicom image file with the correct<br>> Instance Number as 7, and the image content (the pixel data) was changed.
<br>><br>> Did I misunderstand this example?<br>> And if I want to achive my goal as the title said, what can I do?<br>><br>> Thank you.<br>><br>> --<br>> Best wishes,<br>> Chris<br>><br>>
<br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________<br>> Insight-users mailing list<br>> <a href="mailto:Insight-users@itk.org">
Insight-users@itk.org</a><br>> <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Best wishes,<br>Chris