Adding new Tags

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ManfredLS
Posts: 4
Joined: Mon, 2020-12-21, 09:08

Adding new Tags

#1 Post by ManfredLS »

Hi guys, I have a problem on adding new tags.
My step are:
1) I edited private.dic with " (000b,"Manfredi_LS",f006) LO StudyGuiNumber 1 PRIVATE_2021_studyGUI "
2) Exported with " DCMDICTPATH=/usr/local/dicom/lib/dicom.dic:/usr/local/dicom/lib/private.dic:/Users/chilab/Desktop/Progetto_ManfrediLS/DCMTK/dcmtk-3.6.6-install/usr/local/share/dcmtk/private.dic "

but when I try, for example, dcm2xml, I get "<element tag="000b,f006" vr="LO" vm="1" len="36" name="Unknown Tag &amp; Data">prova</element>".

What am I doing wrong?

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1435
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

Re: Adding new Tags

#2 Post by Marco Eichelberg »

Have you created the "reservation" element (000b,00f0) (VR=LO, value="Manfredi_LS") in the dataset? This is required per DICOM rules, and this is how DCMTK would recognize the private tag as "belonging" to the creator "Manfredi_LS".

ManfredLS
Posts: 4
Joined: Mon, 2020-12-21, 09:08

Re: Adding new Tags

#3 Post by ManfredLS »

No I don't, probably is that. To create the reserved element, do you mean this?

"
#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmdata/dctk.h"

#define PRV_PrivateCreator DcmTag(0x0029, 0x0010, EVR_LO)
#define PRV_PrivateElement1 DcmTag(0x0029, 0x1000, EVR_LO)
#define PRV_PrivateElement2 DcmTag(0x0029, 0x1010, EVR_US)
#define PRV_PrivateElement3 DcmTag(0x0029, 0x1020, EVR_OB)

void addPrivateElements(DcmItem &item)
{
if (!item.tagExists(PRV_PrivateCreator))
{
item.putAndInsertString(PRV_PrivateCreator, "Your Company Name");
item.putAndInsertString(PRV_PrivateElement1, "Some Text");
item.putAndInsertUint16(PRV_PrivateElement2, 12345);
item.putAndInsertUint8Array(PRV_PrivateElement3, NULL /*data*/, 0 /*length*/);
}
}
"
If yes, I'm a little confused about how to do it. Is there a file inside dcmtk where can i edit it?

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

Re: Adding new Tags

#4 Post by J. Riesmeier »

It seems that you've already found the HOWTO on "Add private data elements to a DICOM dataset": https://support.dcmtk.org/redmine/proje ... rivateData

If you want to enable DCMTK tools like dcmdump or dcm2xml to support your private tags (i.e. by showing their associated names for example), you could e.g. create a new private data dictionary file (see "private.dic" for an example) and load it at runtime. The text file datadict.txt explains all the details on handling data dictionaries with DCMTK.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest