Copying an attribute

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Misi
Posts: 12
Joined: Wed, 2012-11-07, 09:31

Copying an attribute

#1 Post by Misi »

Hi,

I wonder if its possible to copy an attribute from tag A to tag B - without handling the value representation of the tag. To be me more precise: I want to copy a tag, now matter if it holds a string or a sequence or a number. It seems that this is part of something I'm looking for:

Code: Select all

DcmDataSet::findAndGetElement(const DcmTagKey & tagKey, DcmElement *& element) 


But I can't see any pendent giving me the possibilty to set a DcmElement. I miss something like :

Code: Select all

DcmDataSet::putElement(const DcmTagKey & tagKey, const DcmElement & element) 


Moreover, DcmDataSet::insert(...) does not give me the possibility to set the target tag. Does anybody know a solution?

J. Riesmeier
DCMTK Developer
Posts: 2517
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Copying an attribute

#2 Post by J. Riesmeier »

Why don't you just get the element value as a string and put this string value to the destination element?

Changing the tag only is a bad idea since this could also change the VR of the data element.

Misi
Posts: 12
Joined: Wed, 2012-11-07, 09:31

Re: Copying an attribute

#3 Post by Misi »

Because you can not copy a sequence like a string. Also copying OW & OB have to be done in a different way. Usually you have to distinguish those value representations. If it would be possible to copy an attribute without taking care of the VR, you might save a lot of development time.

J. Riesmeier
DCMTK Developer
Posts: 2517
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Copying an attribute

#4 Post by J. Riesmeier »

DcmElement::copyFrom() allows for copying a data element, but this will also not solve your original problem completely ...

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests