How to get the dicom file header info

Hi, I have a CT with many dicom files, but the file’s SOPClassUID and SOPInstanceUID all are same with Ano (please see the atachment), so when i upload the files to my orthanc, i only get one Instance. But the file have header info with MediaStorageSOPClassUID and MediaStorageSOPInstanceUID, document says the value are the same, so i want to get the value of MediaStorageSOPInstanceUID and MediaStorageSOPClassUID from header, then modify the tags with the value, so it will ok to store in orthanc, right?
But i can’t find a way to get the value from header, please help, thank you all.

i use this link to parse dicom link :
https://www.orthanc-server.com/external/wasm-dicom-parser/

demo.png

Here are 2 dcm files for test.
Thanks

IMG00004.dcm (526 KB)

IMG00000.dcm (526 KB)

Hello,

Your DICOM files are subject to multiple violations of the DICOM standard, as reported by the “dciodvfy” tool from “dicom3tools”, notably:

$ dciodvfy IMG00000.dcm
[…]

Error - Media Storage SOP Instance UID different from SOP Instance UID
Error - Media Storage SOP Class UID different from SOP Class UID
Error - Illegal root for UID - “Ano” in (0x0008,0x0016) SOP Class UID
Error - Illegal root for UID - “Ano” in (0x0008,0x0018) SOP Instance UID

[…]

Furthermore, the DICOM standard says that if two instances share the same “SOP Instance UID”, those instances correspond to the same real-world object (as this tag is a globally unique identifier). So, it is normal that Orthanc considers your two files as identical:
https://book.orthanc-server.com/dicom-guide.html#dicom-identifiers

Regarding the last part of your question, you can retrieve the meta-header of a DICOM instance stored in Orthanc using the “/instances/…/header” URI. For instance:

$ curl https://demo.orthanc-server.com/instances/1f187aa4-ea5a9326-a2c15524-deda77f3-36647f6c/header?simplify
{
“FileMetaInformationGroupLength” : “194”,
“ImplementationClassUID” : “1.2.40.0.13.1.1.1”,
“ImplementationVersionName” : “dcm4che-1.4.35”,
“MediaStorageSOPClassUID” : “1.2.840.10008.5.1.4.1.1.2”,
“MediaStorageSOPInstanceUID” : “1.3.6.1.4.1.14519.5.2.1.2193.7172.282519327510551790486601708007”,
“TransferSyntaxUID” : “1.2.840.10008.1.2”
}

Sébastien-

Thanks, i can get the meta-data after uploaded to orthanc with

curl https://10.209.156.109/orthanc/m/instances/643cf824-6a5ae98b-55be5e01-00f5e09d-d0b5e375/header?simplify -k

{
“FileMetaInformationGroupLength” : “126”,
“ImplementationClassUID” : “1.2.276.0.7230010.3.0.3.6.6”,
“ImplementationVersionName” : “OFFIS_DCMTK_366”,
“MediaStorageSOPClassUID” : “Ano”,
“MediaStorageSOPInstanceUID” : “Ano”,
“TransferSyntaxUID” : “1.2.840.10008.1.2.1”
}
the MediaStorageSOPInstanceUID is rewrite to Ano.

I can get MediaStorageSOPInstanceUID with pydicom:

ds = dcmread(‘IMG00000.dcm’)

ds.file_meta

{(0002, 0000): (0002, 0000) File Meta Information Group Length UL: 198,
(0002, 0001): (0002, 0001) File Meta Information Version OB: b’\x00\x01’,
(0002, 0002): (0002, 0002) Media Storage SOP Class UID UI: CT Image Storage,
(0002, 0003): (0002, 0003) Media Storage SOP Instance UID UI: 1.3.12.2.1107.5.1.4.73433.30000018072300131666300021372,
(0002, 0010): (0002, 0010) Transfer Syntax UID UI: Explicit VR Big Endian,
(0002, 0012): (0002, 0012) Implementation Class UID UI: 1.2.528.1.1001.2.20040707.2,
(0002, 0013): (0002, 0013) Implementation Version Name SH: ‘AMI_DICOM03_2’}

So can i gei the meta-header before store it in orthanc, and rewrite the SOP Instance UID and SOP Class UID?

If your DICOM file is not stored within Orthanc, your question is not related to Orthanc, and you’re asking on the wrong user forum.

As you are visibly using pydicom, here is the link to the proper user forum:
https://groups.google.com/g/pydicom

Thanks a lot