<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">> I used the example DicomImageReadChangeHeaderWrite.cxx to change the dicom file,when I wrote it as followed:<br>> std::string entryId( "0002|0003" );<br>> std::string value( "1.2.86.755.4.2.2.24.1.3.201");<br>> itk::EncapsulateMetaData<std::string>( dictionary, entryId, value );<br>>and the result is "(0002|0003) Media Storage SOP Instance UID = 1.2.826.0.1.3680043.2.1143.68351427<br>>608.2009050811121070158". Why? How can I change it ?Could anyone help me ?thanks.<br> <br>The underlying
GDCM library bundled with ITK overwrites this element with a UID it generates. You have to walk the code and you will find in Utilities/gdcm/gdcmFileHelper.cxx->CheckMandatoryElements():<br><br> :<br>std::string sop = Util::CreateUniqueUID();<br> :<br>CopyMandatoryEntry(0x0002,0x0003,sop);<br>CheckMandatoryEntry(0x0008,0x0018,sop);<br> :<br><br>This overwrites your value.<br><br> If it was made CheckMandatoryEntry(0x0002,0x0003,sop), that would solve your issue.<br><br>Also, the code as is allows the two SOP Instance UIDs to be different when they should be the same.<br><br>Todd Jensen<br></div></div></div></body></html>