<DIV>Thank you very much,Todd Jensen. I overwrite gdcmFileHelper.cxx as followed:<BR> std::string sop = "1.2.86.755.4.2.4.24.1.3.201";</DIV>
<DIV> CopyMandatoryEntry(0x0002,0x0003,sop);</DIV>
<DIV>and then rebuilt ITK(InsightToolkit-3.8.0),but the <SPAN lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: red; FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">SOP Instance UID <FONT color="#000000">become wrong:</FONT></SPAN></DIV>
<DIV> (0002|0003) Media Storage SOP Instance UID = 1.2.826.0.1.3680043.2.1125.1.78291920758156013450636231478551699</DIV>
<DIV>I don't know what's wrong with it?</DIV>
<DIV> </DIV>
<DIV>regards,</DIV>
<DIV> mexiao<BR><BR><BR></DIV>
<DIV></DIV><BR>在2009-05-08 20:56:07,"Todd Jensen" <todd.jensen@ieee.org> 写道:<BR>
<BLOCKQUOTE id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial,helvetica,sans-serif">>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial,helvetica,sans-serif">
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial,helvetica,sans-serif">> 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></BLOCKQUOTE><br><!-- footer --><br><span title="neteasefooter"/><hr/>
<a href="http://512.mail.163.com/mailstamp/stamp/dz/activity.do?from=footer">穿越地震带 纪念汶川地震一周年</a>
</span>