Attempted upload of DICOM files results in error 'OrthancStatus: 21' and 'Inexistent Tag'

HI there team,

We are working with the Orthanc Viewer but when we try to upload some of our DICOM data, we get these errors
OrthancStatus: 21
Inexistent Tag

We found this info https://book.orthanc-server.com/faq/orthanc-ids.html#the-inexistent-tag-error

The files are lacking these tags:

  • StudyInstanceUID (0020,000d),
  • SeriesInstanceUID (0020,000e),
  • SOPInstanceUID (0008,0018).
    The dataset we are working with is a microCT we got done at a University scanner privately, so I guess it doesn’t have all the correct tags / info?

Is there a solution for us? I have attached one of the dcm files here.

Appreciate any advice you could offer as to how to get these working.

RabbitSkull0423.dcm (2.13 MB)

Not sure, but you might want to look at:

https://api.orthanc-server.com/index.html#tag/System/paths/~1tools~1generate-uid/get

I think that allows you to create your own DICOM identifiers for:

patient, study, series or instance

e.g.: https://demo.orthanc-server.com/tools/generate-uid?level=study, …

You could maybe create a Lua script or Python script to create the missing tags when the study is received. I haven’t tried it for that instance, but here are some references for that here:

LUA scripting:

https://book.orthanc-server.com/users/lua.html?highlight=lua

Python: (This might be what you need since I’m not sure there is an equivalent Lua function)

https://book.orthanc-server.com/plugins/python.html?highlight=python#modifying-received-instances-new-in-4-0

Kind of surprising that the scanner doesn’t create those.

Stephen D. Scotti, M.D.

Thank you so much Stephen, we will try that :slight_smile:

The dcmdump of that is pretty minimal:

sscotti@Stephens-iMac ORTHANC_DOCKER_RIS % dcmdump /Users/sscotti/Desktop/RabbitSkull0423.dcm

Dicom-File-Format

Dicom-Meta-Information-Header

Used TransferSyntax: Little Endian Explicit

(0002,0000) UL 198 # 4, 1 FileMetaInformationGroupLength
(0002,0001) OB 00\01 # 2, 1 FileMetaInformationVersion
(0002,0002) UI =CTImageStorage # 26, 1 MediaStorageSOPClassUID
(0002,0003) UI [1.2.276.0.7230010.3.1.4.1609306583.5456.1468850392.424] # 54, 1 MediaStorageSOPInstanceUID
(0002,0010) UI =LittleEndianExplicit # 20, 1 TransferSyntaxUID
(0002,0012) UI [1.2.276.0.7230010.3.0.3.5.4] # 28, 1 ImplementationClassUID
(0002,0013) SH [OFFIS_DCMTK_354] # 16, 1 ImplementationVersionName

Dicom-Data-Set

Used TransferSyntax: Little Endian Explicit

W: DcmUniqueIdentifier: Element SOPClassUID (0008,0016) contains one or more space characters, which were removed
(0008,0016) UI =CTImageStorage # 26, 1 SOPClassUID
(0010,0010) PN [Region 1] # 8, 1 PatientName
(0010,0020) LO [volume] # 6, 1 PatientID
(0020,0011) IS [1] # 2, 1 SeriesNumber
(0020,0012) IS [1] # 2, 1 AcquisitionNumber
(0020,0032) DS [0.500000\0.500000-5.305960] # 28, 3 ImagePositionPatient
(0020,0037) DS [1.000000\0.000000\0.000000\0.000000\1.000000\0.000000] # 54, 6 ImageOrientationPatient
(0028,0004) CS [MONOCHROME2] # 12, 1 PhotometricInterpretation
(0028,0010) US 2095 # 2, 1 Rows
(0028,0011) US 1064 # 2, 1 Columns
(0028,0030) DS [0.035000\0.035000] # 18, 2 PixelSpacing
(0028,0100) US 8 # 2, 1 BitsAllocated
(0028,0101) US 8 # 2, 1 BitsStored
(0028,0102) US 7 # 2, 1 HighBit
(0028,0103) US 0 # 2, 1 PixelRepresentation
(0028,1052) DS [0.000000] # 8, 1 RescaleIntercept
(0028,1053) DS [1.000000] # 8, 1 RescaleSlope

(7fe0,0010) OB 00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00… # 2229080, 1 PixelData

/sds

Hello,

The tags “StudyInstanceUID” (0020,000d), “SeriesInstanceUID” (0020,000e), and “SOPInstanceUID” (0008,0018) are indeed missing from your sample DICOM file, as can be seen by standard tools such as “dcm2xml”.

But, those three tags are mandatory, as those are type-1 tags according to the DICOM standard. This means that your imaging modality doesn’t generate conformant DICOM files. You should urgently get in touch with the support team of your modality (you pay them to solve such issues):
https://book.orthanc-server.com/faq/proprietary.html

As a temporary workaround, you can manually inject the missing tags using the “dcmodify” command-line tools from DCMTK, before uploading to Orthanc:

$ dcmodify --gen-stud-uid --gen-ser-uid --gen-inst-uid RabbitSkull0423.dcm

This task can easily be automated by creating a Python plugin that would branch a new route onto the REST API of Orthanc:
https://book.orthanc-server.com/plugins/python.html#extending-the-rest-api

Regards,
Sébastien-

Note that you can also perform this kind of sanitization directly in Orthanc in the python ReceivedInstanceCallback

1 Like