Bug 6

Summary: Upload through REST API fails on DICOM RT files (plan, dose, structures)
Product: Orthanc Reporter: Sébastien Jodogne <s.jodogne>
Component: Orthanc CoreAssignee: Sébastien Jodogne <s.jodogne>
Status: RESOLVED FIXED    
Severity: normal    
Priority: ---    
Version: unspecified   
Hardware: All   
OS: All   

Description Sébastien Jodogne 2020-06-29 15:11:11 CEST
[BitBucket user: Michael Folkerts]
[BitBucket date: 2015-10-30.05:35:11]

I set up orthanc with postgresql plugins.

**What steps will reproduce the problem?**
Import DICOM and DICOM-RT data from local storage using the ‘ImportDicomFiles.py’ script provided in this repository.

**What is the expected output? What do you see instead?**
I'd expect that the DICOM RT files would upload with "success" (as the DICOM Image files do) through the REST API.
Instead, I see messages like this for all DICOM RT Plan, Dose, and Structure files:
```

Importing ../OrthancBuild/OrthancStorage/fa/53/fa535c9a-cf5e-4cb6-889c-90e7b2087d44 => failure (Is it a DICOM file?)

```

The server is throwing an error 400, and the Orthanc.log says:

```

E1029 23:48:57.931741 HttpOutput.cpp:71] This HTTP answer has not sent the proper number of bytes in its body

```

**What version of the product are you using? On what operating system?**
The compiled default branch from this repository at the time of this post. Ubuntu 14.04 Server.
Comment 1 Sébastien Jodogne 2020-06-29 15:18:39 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2015-10-30.07:20:56]

Uploading DICOM-RT files through the REST API works fine. Two reasons can explain your issue:

1. Your Orthanc instance is protected by HTTP authentication, in which case you have to add the username and password at the last command-line arguments to "ImportDicomFiles.py".
2. The content of your local storage is compressed (check the "StorageCompression" in the configuration file of Orthanc), which prevents "ImportDicomFiles.py" to properly read the DICOM files. In this case, you will have to use generic replication: https://orthanc.chu.ulg.ac.be/book/users/replication.html#generic-replication
Comment 2 Sébastien Jodogne 2020-06-29 15:18:39 CEST
[BitBucket user: Michael Folkerts]
[BitBucket date: 2015-11-02.17:23:15]

I had authentication disabled. I double checked and my StorageCompression setting for local storage was 'false'. The ImportDicomFiles.py script still failed (however only on DICOMRT files - the standard DICOM CT files uploaded fine).

Generic replication worked!!

Thanks for the help.
Comment 3 Sébastien Jodogne 2020-06-29 15:18:40 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2015-11-04.16:48:33]

Fine, I close the issue.