DSRTypes::checkForValidReference too strict ?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Tim
Posts: 17
Joined: Wed, 2009-04-29, 10:08
Location: Zaragoza
Contact:

DSRTypes::checkForValidReference too strict ?

#1 Post by Tim »

Hi there,

I happened to have a UID which was rejected by DSRTypes::checkForValidReference because it has a zero. Something like "1.2.276.0.7230010". To be fair, it says in the header " Both the integer number 0 and a leading 0 for the numbers are forbidden.".

However, I think that a single zero does constitute a valid DICOM UID.

Doesn't it ?

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

Re: DSRTypes::checkForValidReference too strict ?

#2 Post by J. Riesmeier »

The purpose of DSRTypes::checkForValidReference() is not to check Unique Identifiers (UID) as you seem to assume. The documentation clearly says: "check string for valid reference (as used for by-reference relationships)". Therefore, your sample string is invalid. See DICOM PS3.3 Section C.17.3.2.5 for details.

Tim
Posts: 17
Joined: Wed, 2009-04-29, 10:08
Location: Zaragoza
Contact:

Re: DSRTypes::checkForValidReference too strict ?

#3 Post by Tim »

Ah. :oops:

Yes - I was assuming that it should check for UIDs. I think I used to use a UID test function, and I changed it to this whilst upgrading to DCMTK 3.6.3.

Worse than that, I think that I am using the UID as the reference value for an image. I suppose there should be an extra layer of indirection, so the UID should go into a single Image node, and that any nodes refering to the image should use the node-based reference.

Well, I will go and read again and hopefully understand better this time :-)

Many thanks for putting me right !

Tim

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

Re: DSRTypes::checkForValidReference too strict ?

#4 Post by J. Riesmeier »

Yes - I was assuming that it should check for UIDs. I think I used to use a UID test function, and I changed it to this whilst upgrading to DCMTK 3.6.3.
There are other methods that check a given UID for validity, both in DCMTK's dcmdata and dcmsr module.
Worse than that, I think that I am using the UID as the reference value for an image. I suppose there should be an extra layer of indirection, so the UID should go into a single Image node, and that any nodes refering to the image should use the node-based reference.
By-reference relationships and Image/Composite references are two different things in DICOM Structured Reporting. You should read the relevant parts of the DICOM standard in order to better understand the underlying concepts.

Post Reply

Who is online

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