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 & Data">prova</element>".
What am I doing wrong?
Adding new Tags
Moderator: Moderator Team
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: Adding new Tags
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".
Re: Adding new Tags
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?
"
#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?
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Adding new Tags
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.
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.
Who is online
Users browsing this forum: Google [Bot] and 1 guest