I have DICOM MRI files in JPEG 2000 transfer syntax (1.2.840.10008.1.2.4.91).
Setup: orthancteam/orthanc:26.4.2 with GDCM plugin, default configuration.
Web UI upload (REST API): Uploading 602 files (all unique SOPInstanceUIDs) via Orthanc Explorer — only 568 are stored. The error report lists the missing files but shows no error message. Orthanc logs show no errors.
DICOM port upload (storescu): Fails on the first file. Orthanc’s SCP does not accept JPEG 2000 as a transfer syntax, and storescu cannot convert locally:
$ storescu -aec PACS +sd +r -xx 127.0.0.1 4242 jpeg2000_series/
W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)
W: DIMSE Warning: (STORESCU,PACS): sendMessage: unable to convert dataset
from 'JPEG 2000 (Lossless or Lossy)' transfer syntax to 'Little Endian Explicit'
E: Store Failed, file: jpeg2000_series/1.2.826...914.dcm:
E: 0006:020e DIMSE Failed to send message
The same storescu command works fine with a different dataset that uses a standard transfer syntax:
$ storescu -aec PACS +sd +r -xx 127.0.0.1 4242 regular_series/
(no errors - all files accepted)
How can I reliably import JPEG 2000 DICOM files into Orthanc?
The error you are getting with “storescu” is a client-side error. storescu is trying to convert the DICOM file from JPEG 2000 to Little Endian. You have requested “-xx” as the proposed transfer syntax, which is JPEG Lossy TS for 12 bit data, which doesn’t match the actual DICOM files’ syntax of “JPEG 2000 Lossy or Lossless”. I assume that storescu must fall back to trying to use Little Endian in this scenario, but it also doesn’t have the capability to convert between the syntaxes. If you instead use -xw (which matches the Transfer Syntax of your DICOM files), then it should work:
This assumes that your Orthanc server is configured to allow JPEG2000 files to be sent, i.e. AcceptedTransferSyntaxes must include 1.2.840.10008.1.2.4.91, or AcceptedTransferSyntaxes must not be present.
For the issues when uploading, have you turned on Verbose or Trace error level reporting in System Info? That may provide more information.
2 Likes
Thanks @gmancuso, -xw did work for some of my series - good catch on the transfer syntax mismatch with -xx.
However, it turned out that my dataset contains a mix of 6 different transfer syntaxes (JPEG2000, JPEG2000LosslessOnly, JPEGLSLossless, JPEGExtended, JPEGLossless Process14, JPEGLossless 1stOrderPrediction), and getting storescu to reliably negotiate all of them was a struggle.
What ended up working reliably for all files was bypassing DICOM C-STORE entirely and using the REST API - the same upload path as the web UI:
find paired_output/ -name '*.dcm' | while read f; do
curl -s -u $myuser:$mypass -X POST http://127.0.0.1:8042/instances --data-binary "@$f"
done
No transfer syntax negotiation, no conversion - Orthanc handles everything server-side. This also resolved the silent frame dropping I was seeing with the web UI upload.
Clicking the “Verbose” button in the webUI unfortunately did not show more details for the “orthanc eats frames during upload”-issue.
1 Like