Getting data from DICOM

936 views
Skip to first unread message

Dawid Ładyko

unread,
Jun 1, 2017, 9:50:17 AM6/1/17
to Fellow Oak DICOM
Hi,

I have problem with getting StudyDescription data from DICOM file.
At attachment can u see DICOM parameters.
Here is the code that i use to getting StudyDescrption

                                try
                               
{
                                    jobdescription
= obj.Dataset.Get<string>(DicomTag.StudyDescription, null);
                               
}
                               
catch
                               
{
                                    jobdescription
= "Empty";
                               
}

Always when i need to get StudyDescription i get "Empty".

Is there some way to get this data by ID ? I know that the BodyPartExamined ID's is (0018,0015).

Need help :c

Anders Gustafsson Cureos AB

unread,
Jun 1, 2017, 10:45:52 AM6/1/17
to Fellow Oak DICOM
Hi Dawid,

have you verified, e.g. via a DICOM text viewer, that the Study Description is defined in your DICOM file? Which fo-dicom version are you using?

Since you are using a default value (null) in the Get call, you should not need to put the call inside a try block. However, you might want to try a different default value, for example an empty string.

If you want to Get a tag via its explicit group and element number, you could use "new DicomTag(group, element)" instead, but that should not be necessary in this case since Study Description, as well as all other defined tags in the recent DICOM standard, are already predefined in fo-dicom.

Regards,
Anders @ Cureos

Dawid Ładyko

unread,
Jun 6, 2017, 2:56:03 AM6/6/17
to Fellow Oak DICOM
StudyDescription are null :x.
Description are in (0032,1060) RequestedProcedureDescription
but when im using this DicomTag.RequestedProcedrueDescription that i get empty string.
Can u please show me how to get this value with "new DicomTag(group, element)" ?

Anders Gustafsson Cureos AB

unread,
Jun 6, 2017, 3:20:06 AM6/6/17
to Fellow Oak DICOM
There is no point in using the "new DicomTag()" approach in this case, since the tag is already defined in fo-dicom. Open the file in a DICOM editor and check if the tag is really present. If it is a part of a sequence item, you first need to access the sequence and find its items. Check the DicomDatasetTest class in fo-dicom's unit tests for examples of accessing sequences and their items.

Dawid Ładyko

unread,
Jun 6, 2017, 4:38:31 AM6/6/17
to Fellow Oak DICOM
Sure, but when i try to get :



im getting empty strings, maybe this tag are incorrect so i wish to try get it with (group, element)
Auto Generated Inline Image 1

Anders Gustafsson Cureos AB

unread,
Jun 6, 2017, 4:56:41 AM6/6/17
to Fellow Oak DICOM
As I mentioned in my previous response, if the tags are part of a sequence item, you first need to open up the sequence and then access its items. In this particular case the tags you are looking for are indeed inside the RequestAttributesSequence (0040,0275), so you need to do this:

    var seq = obj.Dataset.Get<DicomSequence>(DicomTag.RequestAttributesSequence);
    var itm = seq.Items.Single(); // or .First(), or [0], or ...
    var procDescr= itm.Get<string>(DicomTag.RequestedProcedureDescription);

Maybe you should also consider removing the image from your previous post, since it seems to contain real patient information.

Regards,
Anders

Dawid Ładyko

unread,
Jun 6, 2017, 5:15:41 AM6/6/17
to Fellow Oak DICOM
Thank You very much, i do not know too well operating on DICOM files :).
Reply all
Reply to author
Forward
0 new messages