Partially modifying tag values

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Aleksei Terentev
Posts: 3
Joined: Fri, 2017-10-13, 08:48

Partially modifying tag values

#1 Post by Aleksei Terentev »

Hello,

I've recently switched to your library and enjoyed it so far. Howerver, I have some issues
regarding partial edit of large tags. And I didn't find the answer in the documentation, here or anywhere else.

In particular, I would like to edit several frames of uncompressed frame data,
reorder frame or even remove some frames from the dataset. And the complication heere is that
my datasets are about 1GB or so and I cannot allocate enough space to change this tag completely.

The only option I found was temporal file. Could you please tell me if there is any other way of perfroming this?

Thank you.

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

Re: Partially modifying tag values

#2 Post by J. Riesmeier »

You mean you've enough main memory to load this large element value once (i.e. the original one) but not another time in order to replace it?

Aleksei Terentev
Posts: 3
Joined: Fri, 2017-10-13, 08:48

Re: Partially modifying tag values

#3 Post by Aleksei Terentev »

To be honest, I do not use frame data so I am not completely sure that it was loaded into memory. However, I did try

Code: Select all

findAndGetUint8Array()
method and it succeed, so I guess, it was loded. And yes, when I tried to allocate space for another object of the same size, the space was not enough.
And I was wondering about the opportunity for partial tag editing or something like that.

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

Re: Partially modifying tag values

#4 Post by J. Riesmeier »

There is a DcmElement::getPartialValue() method but no ready-to-use method to modify only parts of the element value. If the length of the value does not change, I would use DcmOtherByteOtherWord::getUint8Array() which returns a non-const pointer to the element value (which, therefore, allows for modifying its content).

Aleksei Terentev
Posts: 3
Joined: Fri, 2017-10-13, 08:48

Re: Partially modifying tag values

#5 Post by Aleksei Terentev »

Hm, I noticed the "getUint8Array()" method. But is was said that:
This method does not copy, but returns a pointer to the element value,
* which remains under control of this object and is valid only until the next
* read, write or put operation.
So I thought that all modifications would be somehow wiped. Apparantly, it was a mistake.
Thank you very much for your help, I will try this approach.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest