DcItem::newDicomElement for private tags

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Shaeto
Posts: 147
Joined: Tue, 2009-01-20, 17:50
Location: CA, USA
Contact:

DcItem::newDicomElement for private tags

#1 Post by Shaeto »

is it possible to add privateCreator parameter for 2 static methods DcmItem::newDicomElement ?

for example

static DcmElement *newDicomElement(const DcmTagKey &tag, const char *privateCreator = NULL)

....

{
DcmTag temp(tag, privateCreator);

....

currently it is not possible to use this method to create private elements

thanks!


=========================================
--- a/dcmdata/include/dcmtk/dcmdata/dcitem.h
+++ b/dcmdata/include/dcmtk/dcmdata/dcitem.h
@@ -1213,20 +1213,21 @@ class DCMTK_DCMDATA_EXPORT DcmItem

/** creates new DICOM element from given attribute tag.
* @param tag attribute tag of the element to be created.
+ * @param privateCreator attribute private creator of the element
* @return pointer to newly created element returned in this parameter upon success,
* NULL pointer otherwise
*/
- static DcmElement *newDicomElement(const DcmTagKey &tag);
+ static DcmElement *newDicomElement(const DcmTagKey &tag, const char *privateCreator = NULL);

/** creates new anew DICOM element from given attribute tag.
* @param newElement Pointer to newly created element returned in this parameter upon success,
* NULL pointer otherwise
* @param tag attribute tag of the element to be created.
- * @param length attribute value length of the element to be created
+ * @param privateCreator attribute private creator of the element
* @return EC_Normal upon success, an error code otherwise
*/
static OFCondition newDicomElement(DcmElement *&newElement,
- const DcmTagKey &tag);
+ const DcmTagKey &tag, const char *privateCreator = NULL);

protected:

--- a/dcmdata/libsrc/dcitem.cc
+++ b/dcmdata/libsrc/dcitem.cc
@@ -4195,9 +4195,9 @@ OFCondition DcmItem::convertToUTF8()
// ********************************


-DcmElement* DcmItem::newDicomElement(const DcmTagKey& tag)
+DcmElement* DcmItem::newDicomElement(const DcmTagKey& tag, const char *privateCreator)
{
- DcmTag temp(tag);
+ DcmTag temp(tag, privateCreator);
DcmElement* elem = NULL;
OFBool readAsUN = OFFalse;
newDicomElement(
@@ -4211,9 +4211,9 @@ DcmElement* DcmItem::newDicomElement(const DcmTagKey& tag)


OFCondition DcmItem::newDicomElement(DcmElement*& newElement,
- const DcmTagKey& tag)
+ const DcmTagKey& tag, const char *privateCreator)
{
- DcmTag temp(tag);
+ DcmTag temp(tag, privateCreator);
newElement = NULL;
OFBool readAsUN = OFFalse;
return newDicomElement(

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

Re: DcItem::newDicomElement for private tags

#2 Post by Michael Onken »

Hi,

that should be no problem.

Could you write a patch for the current git version? (there have been recent changes for newDicomElement()).

Best,
Michael

Shaeto
Posts: 147
Joined: Tue, 2009-01-20, 17:50
Location: CA, USA
Contact:

Re: DcItem::newDicomElement for private tags

#3 Post by Shaeto »

cant attach file to this forum please download .patch from https://ufile.io/e1448

thanks!

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

Re: DcItem::newDicomElement for private tags

#4 Post by Michael Onken »

Thank you; I'll have a look and post an update.

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

Re: DcItem::newDicomElement for private tags

#5 Post by Michael Onken »

Hi Shaeto,

I committed the patch today to DCMTK. The related commit #26750f will show up in the next days on the public git.

Thanks for the suggestion,
Michael

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest