Hi,
I've been looking to store data in different DCM tags and am currently looking at using DCM_EncryptedContent to store indeed store encrypted information as a unsigned char array:
status = dataset->putAndInsertUint8Array(DCM_EncryptedContent, data, num_bytes);
I can write this data just fine (using the above), and to test I can also read it in Matlab:
info = dicominfo(dcmfile); % info.EncryptedContent then contains the data I wrote.
But, adding the following read to my DCM load routine using DCMTK (3.6.0) causes an exception in the DcmElement destructor when the DcmFileFormat goes out of scope:
if (fileformat.getDataset()->findAndGetUint8Array(DCM_EncryptedContent, data, &length).good())
The status of the read is good, and I know the file is fine (based on the Matlab read). Just commenting out the above causes the DICOM file to load fine using DCMTK, so this really isolates the issue.
When the DcmFileFormat goes out of scope is deletes all DCMElement via deleteAllElements. The exception is when it tries to delete fLoadValue (which is NULL) in: DcmElement::~DcmElement()
In looking for any known issues that could point to a 3.6.0 bug, I could not find anything. If anyone has any thoughts as to what is going on, or where I have gone wrong, I would appreciate it. I am wondering also if I should upgrade to a more recent version. Thanks,
Jonathan.
findAndGetUint8Array read of DCM_EncryptedContent
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2504
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: findAndGetUint8Array read of DCM_EncryptedContent
Deleting a NULL pointer should be OK (does nothing). Maybe, you delete the "data" pointer which refers to the internally stored element value, i.e. when you retrieved the pointer with findAndGetUint8Array()?
You should definitely upgrade since DCMTK 3.6.0 is more than 8 years old.I am wondering also if I should upgrade to a more recent version.
Re: findAndGetUint8Array read of DCM_EncryptedContent
You are right, sorry, I stepped through all deletions and see that the exception arises because I do delete the data pointer referencing the internally stored element value.
Thanks for catching that!
Yes, 3.6.0 is old, but it's really good! But I do indeed see multiple reasons to upgrade, too.
Thanks for catching that!
Yes, 3.6.0 is old, but it's really good! But I do indeed see multiple reasons to upgrade, too.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest