[Insight-users] Rewriting Dicom header entries
Angela Wang
Angela.Y.Wang at hsc.utah.edu
Tue Oct 16 12:26:56 EDT 2007
Hi Mathieu,
On 10/16/07 2:05 AM, "Mathieu Malaterre" <mathieu.malaterre at gmail.com>
wrote:
> Correct me if I am wrong, but doesn't DICOM actually clearly specify
> that for a derived image (*), you have to set Image Type (0008,0008)
> to DERIVED\PRIMARY.
That is good to know.
> The process is fairly simple, if you derive an image (ie. read a
> DICOM) and then writes it, ITK-gdcm will actually do the correct job
> of marking it derived and setting up the Reference SOP Instance UID
> for you. Otherwise you need to create an image from scratch, or
> somehow disconnect from the source. But I'd be interested what is your
> test case.
I am using a processing program that converts images from DICOM to ECAT 6.
Then I convert the processed images from ECAT 6 back into DICOM, using
XMedcon. During that process, all of the original header entries are pretty
much lost, so I am using ITK to rewrite information back into the DICOM
header entries. The (0008,0008) is filled in by one of those programs and
has a null character termination, which is not acceptable to the upload
site. That is the long story why I am trying to re-write that particular
entry.
Thanks for your help and comments!
Angela
>
> On 10/15/07, Angela Wang <Angela.Y.Wang at hsc.utah.edu> wrote:
>> I am trying to write two values into a DICOM header entry for my processed
>> image file. This one tag does not write my values. I am able, however, to
>> change other DICOM header entries. The tag is (0008,0008) for Image Iype
>> and takes type CS = code string.
>> The code looks like:
>>
>> ReaderType::DictionaryArrayRawPointer dictPointer =
>> reader -> GetMetaDataDictionaryArray();
>> ReaderType::DictionaryRawPointer dict = (*dictPointer)[i];
>> itk::MetaDataDictionary & dictionary= *dict;
>> std::string tagkey, value;
>> tagkey = "0008|0008"; // Image Type vr = CS
>> value = "ORIGINAL\\SECONDARY";
>> itk::EncapsulateMetaData<std::string>(dictionary, tagkey, value);
>>
>> Does anyone know how to make this work?
>> Thanks.
>> Angela
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>
More information about the Insight-users
mailing list