Re:removal of private tags

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
levomaniac
Posts: 19
Joined: Fri, 2006-12-08, 10:49
Contact:

Re:removal of private tags

#1 Post by levomaniac »

hello,

Is there any function in dcmtk by which we can remove some of the private tags from a DICOM image?? any help on this would be greatly appreciated. Thanking you.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

There's no ready-to-use function (yet).

Michael Onken
DCMTK Developer
Posts: 2052
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#3 Post by Michael Onken »

Hi,

just a note to Jörg's answer: We need that functionality for another project in the past. I added a (really short) howto (including code) to our public DCMTK wiki how you can remove all private data from a DICOM dataset.

Regards,
Michael

levomaniac
Posts: 19
Joined: Fri, 2006-12-08, 10:49
Contact:

#4 Post by levomaniac »

When i execute the below piece of code the the status in the romoveallprivatetags function returns "Tag not found" but the image contains many private tags.. Can u help me with this?? have i done any mistake whil executing the below code??


DcmFileFormat fileformat;

DcmItem dset;


//Loading DICOM Files
OFCondition status = fileformat.loadFile(DicomFilename);


if(status.good())
{
removeAllPrivateTags(dset);
}

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#5 Post by Jörg Riesmeier »

Did you simply forget to set the value of "dset"? Use fileformat.getDataset() as described in the documentation ...

levomaniac
Posts: 19
Joined: Fri, 2006-12-08, 10:49
Contact:

#6 Post by levomaniac »

Thanks i did as u said and it worked fine :D

levomaniac
Posts: 19
Joined: Fri, 2006-12-08, 10:49
Contact:

#7 Post by levomaniac »

I managed to delete the private tag and save it as fileformat.savefile() but i can only do it with naming it with a different filename. How can i copy the dataset and save it with the same file name as before?? (i.e) if the old file name is 1.dcm i need to save it as 1.dcm and not by any other file name.


Thanking you

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#8 Post by Jörg Riesmeier »

Use loadAllDataIntoMemory() in order to make sure that large data elements (e.g. pixel data) are not removed from the "new" file.

levomaniac
Posts: 19
Joined: Fri, 2006-12-08, 10:49
Contact:

#9 Post by levomaniac »

Thanks for all ur help jorg :)

Post Reply

Who is online

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