Unable to retrieve a single string value

33 views
Skip to first unread message

Picasso

unread,
Aug 30, 2024, 7:53:26 PMAug 30
to Fellow Oak DICOM

I am running into an issue that I am searching for second opinion.

I have a DCM file that I would like to retrieve some values.

The following  code  works:

 

var sopUID = dicomDataset.GetSingleValueOrDefault<string>(DicomTag.SOPInstanceUID, "");

if (sopUID == "")

{

    sopUID = "(not set/found)";

}

 

editing code also works for retrieving:

  • DicomTag.SOPInstanceUID
  • DicomTag.StudyInstanceUID
  • DicomTag.FrameOfReferenceUID

However, when trying to retrieve DicomTag.MediaStorageSOPInstanceUID:

var sopInstUID = dicomDataset.GetSingleValueOrDefault<string>(DicomTag.MediaStorageSOPInstanceUID, "");

if (sopInstUID == "")

{

    sopInstUID = "(not set/found)";

}

always returns not set/found

Same behavior for “DicomTag.ImplementationClassUID”

Why can't I read these values?

arnon dukeman

unread,
Sep 1, 2024, 2:19:20 AMSep 1
to Fellow Oak DICOM
Most probably the DCM file does not contain the 0002 group.
example:
(0002,0000) Group Length                                     VR: UL Length: 4  Value: 198
(0002,0001) File Meta Information Version                   VR: OB Length: 2  Value: 0
(0002,0002) Media Storage SOP Class UID                     VR: UI Length: 26  Value: 1.2.840.10008.5.1.4.1.1.4
(0002,0003) Media Storage SOP Instance UID                   VR: UI Length: 58  Value: 1.2.528.1.1001.100.4.4817.4013.113246216.20121031212851640
(0002,0010) Transfer Syntax UID                             VR: UI Length: 20  Value: 1.2.840.10008.1.2.1
....

(0008,0016) SOP Class UID                                   VR: UI Length: 26  Value: 1.2.840.10008.5.1.4.1.1.4
(0008,0018) SOP Instance UID                                 VR: UI Length: 58  Value: 1.2.528.1.1001.100.4.4817.4013.113246216.20121031212851640

ב-יום שבת, 31 באוגוסט 2024 בשעה 02:53:26 UTC+3, Picasso כתב/ה:

Picasso

unread,
Sep 1, 2024, 1:16:35 PMSep 1
to Fellow Oak DICOM

Many thanks for the prompt reply.

The file seems to have the Group Length values.


dcmFile.jpg

Reply all
Reply to author
Forward
0 new messages