[Insight-users] DicomImageReadChangeHeaderWrite---0002|0003
Mathieu Malaterre
mathieu.malaterre at gmail.com
Mon May 11 03:48:15 EDT 2009
On Fri, May 8, 2009 at 2:56 PM, Todd Jensen <todd.jensen at ieee.org> wrote:
>>
>> I used the example DicomImageReadChangeHeaderWrite.cxx to change the dicom
>> file,when I wrote it as followed:
>> std::string entryId( "0002|0003" );
>> std::string value( "1.2.86.755.4.2.2.24.1.3.201");
>> itk::EncapsulateMetaData<std::string>( dictionary, entryId,
>> value );
>>and the result is "(0002|0003) Media Storage SOP Instance UID =
>> 1.2.826.0.1.3680043.2.1143.68351427
>>608.2009050811121070158". Why? How can I change it ?Could anyone help me
>> ?thanks.
>
> 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():
>
> :
> std::string sop = Util::CreateUniqueUID();
> :
> CopyMandatoryEntry(0x0002,0x0003,sop);
> CheckMandatoryEntry(0x0008,0x0018,sop);
> :
>
> This overwrites your value.
>
> If it was made CheckMandatoryEntry(0x0002,0x0003,sop), that would solve your
> issue.
>
> Also, the code as is allows the two SOP Instance UIDs to be different when
> they should be the same.
Fill in a bug report, please, and assign it to me.
Thanks,
--
Mathieu
More information about the Insight-users
mailing list