Check the consistency of data before send it to the server

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Horst Balthasar
Posts: 27
Joined: Mon, 2021-02-01, 11:32

Check the consistency of data before send it to the server

#1 Post by Horst Balthasar »

In one use, the server received the data to store an image, but it could not interpret it and rejected it. I would like to check the data
to see if the error is occurring on my end.

Is there a way to check the data for correctness and consistency before send it to the server?

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

Re: Check the consistency of data before send it to the server

#2 Post by J. Riesmeier »

You could e.g. use dciodvfy for this purpose... depending on what you mean by "check the data for correctness and consistency".

Horst Balthasar
Posts: 27
Joined: Mon, 2021-02-01, 11:32

Re: Check the consistency of data before send it to the server

#3 Post by Horst Balthasar »

Here's what I want to check:

1. do the data contain all necessary attributes (for Patient and image data, we use Secondary Image Capture to store the images)
2. is the content of the attributes DICOM conform
3. are attributes duplicated.
4. does the data contain illegal characters.

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

Re: Check the consistency of data before send it to the server

#4 Post by J. Riesmeier »

I'm not 100% sure about item 4 but, in general, dciodvfy should do what you want. In addition, you could use dcentvfy (also from dicom3tools) to make sure that the data on patient, study and series level is consistent over multiple DICOM instances of a patient, study, series...

Horst Balthasar
Posts: 27
Joined: Mon, 2021-02-01, 11:32

Re: Check the consistency of data before send it to the server

#5 Post by Horst Balthasar »

Thank you for your reply.

I found the issue. The value for StudyID was too long and the PACS rejected the data.

In our application, I check the StudyID to see if it is empty. If yes, I create a new ID with the function dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT).
According to the DICOM standard, the StudyID can be empty. I.e. I don't have to generate a new one. Is this correct?

The helper functions you mentioned are command line applications from another package. Are there any functions in DCMTK to check the data (e.g. for required length, format etc.) ?

Thank you very much.

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

Re: Check the consistency of data before send it to the server

#6 Post by J. Riesmeier »

In our application, I check the StudyID to see if it is empty. If yes, I create a new ID with the function dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT).
According to the DICOM standard, the StudyID can be empty. I.e. I don't have to generate a new one. Is this correct?
Study ID is not a unique identifier (UID) but just an identifier (ID). Therefore, using dcmGenerateUniqueIdentifier() makes no sense.

Yes, Study ID (as part of the General Study Module, i.e. contained in a Composite IOD) can be left empty if unknown since it is of Type 2.

By the way, what is the background of generating a new value for Study ID?
The helper functions you mentioned are command line applications from another package. Are there any functions in DCMTK to check the data (e.g. for required length, format etc.) ?
Right. Within DCMTK, you could e.g. use the checkElement() method on the particular data element. However, please be warned that the length check (maximum number of bytes or characters) does not yet work in all cases as expected since the value of Specific Character Set (0008,0005) would need to be known in order to determine the number of bytes per character. This also applies to Study ID, which uses the Value Representation (VR) "Short String" (SH).

Horst Balthasar
Posts: 27
Joined: Mon, 2021-02-01, 11:32

Re: Check the consistency of data before send it to the server

#7 Post by Horst Balthasar »

Thank you for your reply.

I assumed that the StudyID would be mandatory and therefore i wanted to create a new ID if it was not defined.

This was my mistake, which I have now fixed.

Thanks again for your great support.

Post Reply

Who is online

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