Failed upload dcm file with stow

180 views
Skip to first unread message

Li Bin

unread,
Jun 25, 2016, 10:39:42 PM6/25/16
to dcm4che
Hi,  Gunter

    I use  docker compose ( 5.4.1 ) and failed upload a dcm file via stow. 
   
  Here is my script :


      echo -n -e  "\r\n--myboundary\r\nContent-Type: application/dicom\r\n\r\n" > mime.head
      echo -n -e  "\r\n--myboundary--" > mime.tail
     cat mime.head test4.dcm  mime.tail > mine.body
     curl -H "Content-Type: multipart/related; type=application/dicom; boundary=myboundary" \





here is the part of the log:


    2016-06-26 02:25:39,983 WARN  [org.dcm4chee.arc.store.org.dcm4chee.archive.store.impl.StoreServiceImpl] (default task-1) nu...@172.19.0.1->DCM4CHEE: Failed to encode received object:: java.io.EOFException
at org.dcm4che3.util.StreamUtils.readFully(StreamUtils.java:74)
at org.dcm4che3.io.DicomInputStream.readFully(DicomInputStream.java:400)
at org.dcm4che3.io.DicomInputStream.readHeader(DicomInputStream.java:424)
at org.dcm4che3.io.DicomInputStream.readAttributes(DicomInputStream.java:520)
at org.dcm4che3.imageio.codec.Transcoder.transcode(Transcoder.java:295)


   the Test file can be found in the attachment . 




I have reported this issue in git . pls help check it again . Thanks a lot.
test4.dcm

gunterze

unread,
Jun 27, 2016, 4:57:41 AM6/27/16
to dcm4che
It works on my side:

gunter@gunter-nb:/tmp$ echo -n -e  "\r\n--myboundary--" > mime.tail
gunter@gunter-nb:/tmp$ cat mime.head test4.dcm  mime.tail > mine.body
gunter@gunter-nb:/tmp$ curl -H "Content-Type: multipart/related; type=application/dicom; boundary=myboundary" \
<?xml version="1.0" encoding="UTF-8"?><NativeDicomModel xml:space="preserve"><DicomAttribute keyword="RetrieveURL" tag="00081190" vr="UR"><Value number="1">http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.2.840.113619.2.30.1.1762295590.1623.978668949.886</Value></DicomAttribute><DicomAttribute keyword="ReferencedSOPSequence" tag="00081199" vr="SQ"><Item number="1"><DicomAttribute keyword="ReferencedSOPClassUID" tag="00081150" vr="UI"><Value number="1">1.2.840.10008.5.1.4.1.1.2</Value></DicomAttribute><DicomAttribute keyword="ReferencedSOPInstanceUID" tag="00081155" vr="UI"><Value number="1">1.2.840.113619.2.30.1.1762295590.1623.978668950.130</Value></DicomAttribute><DicomAttribute keyword="RetrieveURL" tag="00081190" vr="UR"><Value number="1">http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.2.840.113619.2.30.1.1762295590.1623.978668949.886/series/1.2.840.113619.2.30.1.1762295590.1623.978668949.890/instances/1.2.840.113619.2.30.1.1762295590.1623.978668950.130</Value></DicomAttribute></Item></DicomAttribute></NativeDicom


Does the md5sum of your mine.body match with mine?

gunter@gunter-nb:/tmp$ md5sum mine.body
78b0f83e6030e81bb6ee24c7f90673b7  mine.body

Li Bin

unread,
Jun 28, 2016, 6:32:29 AM6/28/16
to dcm4che

  It doesn't match with yours. 


  ornot@ubuntu:~/temp$  md5sum mine.body 
 1cfd4cf02169cc85f78a4827ebb679fb  mine.body

gunterze

unread,
Jun 28, 2016, 7:37:08 AM6/28/16
to dcm4che
Lets compare the individual files:
$ md5sum test4.dcm mime.head mime.tail
6a353afcc87eff6ad3b826e74ddacd20  test4.dcm
51e2f9fbc4edc3304fdabda73bb50049  mime.head
7a2251930fe966b85720c3dd2bd363cb  mime.tail

$ xxd mime.head
0000000: 0d0a 2d2d 6d79 626f 756e 6461 7279 0d0a  ..--myboundary..
0000010: 436f 6e74 656e 742d 5479 7065 3a20 6170  Content-Type: ap
0000020: 706c 6963 6174 696f 6e2f 6469 636f 6d0d  plication/dicom.
0000030: 0a0d 0a        

$ xxd mime.tail
0000000: 0d0a 2d2d 6d79 626f 756e 6461 7279 2d2d  ..--myboundary--

Li Bin

unread,
Jun 28, 2016, 8:49:54 PM6/28/16
to dcm4che
 hi, gunter, 
  I got it work now.   The echo command can not be followed by  "-e"  anyway.  Here is the correct format:


echo -n  "\r\n--myboundary\r\nContent-Type: application/dicom\r\n\r\n" > mime.head
echo -n  "\r\n--myboundary--" > mime.tail
cat mime.head test4.dcm  mime.tail > mine.body
curl -H "Content-Type: multipart/related; type=application/dicom; boundary=myboundary" \



Thanks for your time. 

Gunter Zeilinger

unread,
Jun 29, 2016, 2:38:50 AM6/29/16
to dcm...@googlegroups.com
Guess you are working on Windows, and the Windows echo command performs different than the Unix command.

--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at https://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages