Issues with retrieving of .dcm file via dicom-web

Hello,
I have an application on C# which sends .dcm files to Orthanc using fo-dicom library. I'm trying to use dicom-web queries for retrieve .dcm files back from Orthanc.
I faced with several problems and inconsistencies:

1) There is my request:
http://127.0.0.1:8042/dicom-web/studies/1.2.276.0.7230010.3.0.3.5.1.7594707.4132704665/series/1.2.276.0.7230010.3.0.3.5.1.7594710.4273966501/instances/1.2.276.0.7230010.3.0.3.5.1.7594710.3747968508

Response starts from some header info:
"--5c55cdd8-4954-4c61-9f4b-43954da4bdad\r\nContent-Type: application/dicom\r\nContent-Length: 3716\r\nMIME-Version: 1.0\r\n\r\n\0\0\0\0\0\0\0\0\0\0\0\0\0\<byte data>

and ends with:
"<byte data>\r\n--5c55cdd8-4954-4c61-9f4b-43954da4bdad--\r\n"

Do I correctly understand, that I should remove these parts and save left data as .dcm? Otherwise, how to parse response correctly?

2) If to save left data as .dcm and read it, dataset is diffirent from original image (look at comparison in attachments). For some files I got "(7F3F,0010) PrivateCreator" with pixel data size tag instead of "(7FE0,0010) PixelData" . For some files pixel data lost somewhere in the file, but size of retrieved file the same as original.

Do you have an idea what I'm doing wrong?

dcm_diff.png

Small addition:
- Orthanc Explorer shows tags and pixel data of source instance correctly
- I can't open retrieved files in any viewer

If you expect someone to have a look at your problem, please provide meaningful information:

  • what viewer are you using ?
  • how is your setup configured ?
  • what kind of files do you want to visualize ?
  • any chance we can have access to one of those files ?

It looks like your message was an addendum to another, but it doesn't
look like the list server received it. Can you re-send it?

I'm using Orthanc Explorer, ImageJ and RadiAnt as viewers.
Setup of Orthanc - just defaults:
    "DicomWeb" : {
  "Enable" : true,
  "Root" : "/dicom-web/",
  "EnableWado" : true, enabled
  "WadoRoot" : "/wado",
  "Host" : "localhost",
  "Ssl" : false

There are no specific files, I'm using public kits with dicom\diconde files.
For example: https://www.astm.org/COMMIT/DICONDE/dicondeExampleFiles.zip

Hello,
I have an application on C# which sends .dcm files to Orthanc using fo-dicom library. I'm trying to use dicom-web queries for retrieve .dcm files back from Orthanc.
I faced with several problems and inconsistencies:
1) There is my request:
http://127.0.0.1:8042/dicom-web/studies/1.2.276.0.7230010.3.0.3.5.1.7594707.4132704665/series/1.2.276.0.7230010.3.0.3.5.1.7594710.4273966501/instances/1.2.276.0.7230010.3.0.3.5.1.7594710.3747968508

Response starts from some header info:
"--5c55cdd8-4954-4c61-9f4b-43954da4bdad\r\nContent-Type: application/dicom\r\nContent-Length: 3716\r\nMIME-Version: 1.0\r\n\r\n\0\0\0\0\0\0\0\0\0\0\0\0\0\<byte data>

and ends with:
"<byte data>\r\n--5c55cdd8-4954-4c61-9f4b-43954da4bdad--\r\n"

Do I correctly understand, that I should remove these parts and save left data as .dcm? Otherwise, how to parse response correctly?

2) If to save left data as .dcm and read it, dataset is diffirent from original image (look at comparison in attachments). For some files I got "(7F3F,0010) PrivateCreator" with pixel data size tag instead of "(7FE0,0010) PixelData" . For some files pixel data lost somewhere in the file, but size of retrieved file the same as original.

Do you have an idea what I'm doing wrong?

Small addition:
- Orthanc Explorer shows tags and pixel data of source instance correctly
- I can't open retrieved files in any viewer

> > Small addition:
> > - Orthanc Explorer shows tags and pixel data of source instance
> > correctly
> > - I can't open retrieved files in any viewer
>
> It looks like your message was an addendum to another, but it doesn't
> look like the list server received it. Can you re-send it?
> --
> Thibault Nélis <tn@osimis.io>
> Osimis

Hello,
I have an application on C# which sends .dcm files to Orthanc using
fo-dicom library. I'm trying to use dicom-web queries for retrieve .dcm
files back from Orthanc.
I faced with several problems and inconsistencies:
1) There is my request:
http://127.0.0.1:8042/dicom-web/studies/1.2.276.0.7230010.
3.0.3.5.1.7594707.4132704665/series/1.2.276.0.7230010.3.0.
3.5.1.7594710.4273966501/instances/1.2.276.0.7230010.3.
0.3.5.1.7594710.3747968508

Response starts from some header info:
"--5c55cdd8-4954-4c61-9f4b-43954da4bdad\r\nContent-Type:
application/dicom\r\nContent-Length: 3716\r\nMIME-Version:
1.0\r\n\r\n\0\0\0\0\0\0\0\0\0\0\0\0\0\<byte data>

and ends with:
"<byte data>\r\n--5c55cdd8-4954-4c61-9f4b-43954da4bdad--\r\n"

Do I correctly understand, that I should remove these parts and save left
data as .dcm? Otherwise, how to parse response correctly?

This is a standard MIME multipart message (
MIME - Wikipedia). You should
probably find a lib in C# that parses them correctly to avoid
reimplementing the standard by yourself.

2) If to save left data as .dcm and read it, dataset is diffirent from
original image (look at comparison in attachments). For some files I got
"(7F3F,0010) PrivateCreator" with pixel data size tag instead of
"(7FE0,0010) PixelData" . For some files pixel data lost somewhere in the
file, but size of retrieved file the same as original.

Do you have an idea what I'm doing wrong?

With which of the sample DICONDE files do you have issues ?

Small addition:
- Orthanc Explorer shows tags and pixel data of source instance correctly
- I can't open retrieved files in any viewer

With which of the sample DICONDE files do you have issues ? The ones I
have tried do open correctly in the Osimis viewer

Let me write again steps to repeat the problem:
1. Take any .dcm file from https://www.astm.org/COMMIT/DICONDE/dicondeExampleFiles.zip (or any publick package)
2. Upload it into Orthanc using Orthanc Explorer or any other way. At this step, uploaded file (tags and pixel data) looks fine

3. Then try to get .dcm file from Orthanc using dicomWeb request:
http://127.0.0.1:8042/dicom-web/studies/\{studyUID\}/series/\{seriesUID\}/instances/\{instanceUiD\}

4. Compare datasets of original and received dcm. files and you will find inconsistencies. And received .dcm will be impossible to open in the viewers

Here are 3 files:

test.dcm and original.dcm are identical and displays correctly in a viewer. I think you should really check the way you handle the multipart files.

test.dcm_multipart (3.78 KB)

test.dcm (3.63 KB)

test.dcm (3.63 KB)

Thx a lot for test files, I found a problem in my C# code. Now files are identical.