Orthanc will not handle the DICOMDIR anyway so no need to upload it.BTW, if you’re uploading all files one by one, Orthanc will indeed reject the non DICOM files but will still accept the valid files.
I’m just performing an import right now with a lot of garbage in the import folder, Orthanc is displaying a lot of errors but the DICOM files are going in.
Thank you for your quick response.
We’re using Orthanc REST API (API Endpoint used: “/instances”) to upload scans from our web application.
End-user will upload the entire CD/DVD they received from hospitals, this CD/DVD will have DICOM files, DICOMDIR and other garbage files, when this CD/DVD uploading from our web application and we’re converting the entire directory into ZIP and uploading the ZIP file using integrated Orthanc REST API. The response we’re getting is HTTP error "Not Found ", Error is “Inexistent Tag” which is failing us to continue other tasks because we’re not receiving a valid response from API such as Instance id, modality, etc…
Let me know how this can be fixed, such a way API should accept Zip without having this error for the DICOMDIR file.
Could you paste your logs in verbose mode. I just tried to upload a zip with 2 dicoms and a txt file and both dicoms are uploaded into orthanc:
I1119 03:58:13.318677 HttpServer.cpp:1238] (http) POST /instances
I1119 03:58:13.318939 OrthancRestApi.cpp:173] (http) Receiving a DICOM file of 32144 bytes through HTTP
I1119 03:58:13.319332 OrthancRestApi.cpp:193] Uploading DICOM file from ZIP archive: CT_small.dcm
I1119 03:58:13.321841 FilesystemStorage.cpp:124] Creating attachment “5489291c-4fff-42e8-9b48-56e5e2bc65ea” of “DICOM” type (size: 1MB)
I1119 03:58:13.326311 FilesystemStorage.cpp:258] Deleting attachment “5489291c-4fff-42e8-9b48-56e5e2bc65ea” of type 1
I1119 03:58:13.326427 ServerContext.cpp:628] Already stored
I1119 03:58:13.327707 OrthancRestApi.cpp:193] Uploading DICOM file from ZIP archive: verbose_trace_logs.txt
W: DcmItem: Length of element (3157,3131) is odd
E: DcmElement: Unknown Tag & Data (3157,3131) larger (942743603) than remaining bytes (27438) in file, premature end of stream
E1119 03:58:13.327883 OrthancException.cpp:57] Bad file format: Cannot parse an invalid DICOM file (size: 27446 bytes)
E1119 03:58:13.327967 OrthancRestApi.cpp:212] Cannot import non-DICOM file from ZIP archive: verbose_trace_logs.txt
I1119 03:58:13.328104 OrthancRestApi.cpp:193] Uploading DICOM file from ZIP archive: eb564592-2806-4d7e-be71-3a34f4d707d8.dcm
I1119 03:58:13.333287 FilesystemStorage.cpp:124] Creating attachment “80be5d87-ee54-4a7e-a705-99a4b022721d” of “DICOM” type (size: 1MB)
I1119 03:58:13.336629 FilesystemStorage.cpp:258] Deleting attachment “80be5d87-ee54-4a7e-a705-99a4b022721d” of type 1
I1119 03:58:13.336713 ServerContext.cpp:628] Already stored
And, when uploading a zip with aDICOMDIR, other dicom files are uploaded correctly:
I1119 04:00:38.314810 OrthancRestApi.cpp:193] Uploading DICOM file from ZIP archive: IMAGES/IM96
I1119 04:00:38.317291 FilesystemStorage.cpp:124] Creating attachment “b1735c08-b55f-4e38-bfe2-1c341f1e821b” of “DICOM” type (size: 1MB)
I1119 04:00:38.320513 FilesystemStorage.cpp:258] Deleting attachment “b1735c08-b55f-4e38-bfe2-1c341f1e821b” of type 1
I1119 04:00:38.320641 ServerContext.cpp:628] Already stored
I1119 04:00:38.320976 OrthancRestApi.cpp:193] Uploading DICOM file from ZIP archive: DICOMDIR
E1119 04:00:38.321985 DicomMap.cpp:1010] Store has failed because all the required tags (PatientID, StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID) are missing (is it a DICOMDIR file?)
E1119 04:00:38.322027 OrthancRestApi.cpp:221] Ignoring what is probably a DICOMDIR file within a ZIP archive: “DICOMDIR”