Hello,
it would be nice to provide a humble piece of code that remove all frames from dicom
Best Regards
George
how to remove all frames from dicom
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: how to remove all frames from dicom
Unfortunately, your question is not clear. Do you want to remove the Pixel Data element or to set its length to 0 (i.e. clear its value)? What would be the value of Rows and Columns then? What about other data elements that refer to the image frames (pixel data)?
In both cases, this would make the DICOM image invalid. If this would be ok for you, some more background information would also be helpful.
In both cases, this would make the DICOM image invalid. If this would be ok for you, some more background information would also be helpful.
Re: how to remove all frames from dicom
Hello,
I have a dicom image with size 1.2GB, I only want to use its header ( meaning to use the tags in dicom header ) so I want to narrow its size as much as possible by remove all its unwanted metadata.
meaning I wish to have only the dicom header which size is 255KB instead of the whole thing, I tried to set the number of frames to zero and pixel data to null but it did not work
What should I do?
https://forum.dcmtk.org/viewtopic.php?t=4719
Best Regards
George
I have a dicom image with size 1.2GB, I only want to use its header ( meaning to use the tags in dicom header ) so I want to narrow its size as much as possible by remove all its unwanted metadata.
meaning I wish to have only the dicom header which size is 255KB instead of the whole thing, I tried to set the number of frames to zero and pixel data to null but it did not work
What should I do?
https://forum.dcmtk.org/viewtopic.php?t=4719
Best Regards
George
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: how to remove all frames from dicom
If there is no requirement that the result would still be a valid DICOM dataset/file, you could remove the Pixel Data (7fe0,0010) element by calling something like this on the main DICOM dataset:
However, unless you access the Pixel Data element (7fe0,0010) somewhere in your code, DCMTK will not load large element values (like this) when calling DcmFileFormat::loadFle() (see parameter "maxReadLength").
Code: Select all
dataset->findAndDeleteElement(DCM_PixelData);
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest