send dicom files to pacs with dcm4che2

6,602 views
Skip to first unread message

Enrique ruiz

unread,
Feb 4, 2015, 8:46:51 AM2/4/15
to dcm...@googlegroups.com
Hi,

i'm trying create a program with dcm4che2 in JAVA. The last function send files DICOM to PACS. However i don't know to do it and I don't find information.

Please, help me!

Xavier

unread,
Feb 4, 2015, 9:08:04 AM2/4/15
to dcm...@googlegroups.com
Hi Enrique, 
DCMSEND command pretty simple and details available at http://www.dcm4che.org/confluence/display/d2/dcmsnd

example :dcmsnd DCM4CHEE@localhost:11112 D:\DICOM\Studies\

also you may try DCMSEND desktop utility available at https://groups.google.com/forum/#!topic/dcm4che/xgVpR6YY7y8

Thanks

Ludovic MICHON

unread,
Feb 4, 2015, 9:35:29 AM2/4/15
to dcm...@googlegroups.com
Hi,

I would like to know wich is the command line to send a serie from my DCM4CHEE PACS to an other DICOM serveur. I know how sending dicom files from a directory (with dcmsnd) but not a particular serie of the DCM4CHEE server.
Thank you so much for your reply!:))

--
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 http://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/d/optout.

fleetwoodfc

unread,
Feb 4, 2015, 10:20:09 AM2/4/15
to dcm...@googlegroups.com
Look at the dcmqr tool


On Wednesday, February 4, 2015 at 9:35:29 AM UTC-5, Ludovic wrote:
Hi,

I would like to know wich is the command line to send a serie from my DCM4CHEE PACS to an other DICOM serveur. I know how sending dicom files from a directory (with dcmsnd) but not a particular serie of the DCM4CHEE server.
Thank you so much for your reply!:))
2015-02-04 15:08 GMT+01:00 Xavier <aifaz...@gmail.com>:
Hi Enrique, 
DCMSEND command pretty simple and details available at http://www.dcm4che.org/confluence/display/d2/dcmsnd

example :dcmsnd DCM4CHEE@localhost:11112 D:\DICOM\Studies\

also you may try DCMSEND desktop utility available at https://groups.google.com/forum/#!topic/dcm4che/xgVpR6YY7y8

Thanks


On Wednesday, 4 February 2015 19:16:51 UTC+5:30, Enrique ruiz wrote:
Hi,

i'm trying create a program with dcm4che2 in JAVA. The last function send files DICOM to PACS. However i don't know to do it and I don't find information.

Please, help me!

--
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+unsubscribe@googlegroups.com.

Enrique ruiz

unread,
Feb 4, 2015, 11:05:06 AM2/4/15
to dcm...@googlegroups.com
Hi Xavier,

thank you for your response, it's interesting however i'm looking for a solution in java code without the necessary to call at external program.

Thank for your attention.

Alvaro [Andor]

unread,
Feb 4, 2015, 11:17:58 AM2/4/15
to dcm...@googlegroups.com
Hi,

I think you should check this page:

http://www.dcm4che.org/confluence/display/d2/dcm4che2+DICOM+Toolkit

Go to the "Developing Applications with dcm4che2" section, read the "dcm4che2" cookbook with the code examples for doing some basic operations so you get a grasp of how things are done, then read the API documentation and download the source for dcmsend.

Thanks

El 04/02/15 a las 17:05, Enrique ruiz escribió:
--
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.

Enrique ruiz

unread,
Feb 4, 2015, 11:24:30 AM2/4/15
to dcm...@googlegroups.com
thanks Andor

I know this information :) My program take a PDF, convert to DICOM and send by PACS ;)

Alvaro [Andor]

unread,
Feb 4, 2015, 11:30:56 AM2/4/15
to dcm...@googlegroups.com
Then you can check the source for dcmsnd, a Java application whose exact mission is sending files to a PACS.
It's just 58kbytes and has nice DICOM methods like "send()"

:D

http://sourceforge.net/projects/dcm4che/files/dcm4che2/2.0.28/

El 04/02/15 a las 17:24, Enrique ruiz escribió:

Alvaro [Andor]

unread,
Feb 4, 2015, 11:34:00 AM2/4/15
to dcm...@googlegroups.com
Just to be clear: The answers were for Enrique :D

Ludovic MICHON

unread,
Feb 5, 2015, 6:55:01 PM2/5/15
to dcm...@googlegroups.com
Hi,
Thank you fleetwoodfc for your answer.

 It's ok to download all the study, but i can't download a specific serie.
Here's my command line:

C:\apps\dcm4che-2.0.28\bin>dcmqr  -L DCMQR  DCM4CHEE@localhost:11112  -q00100020
=1 -q0020000D=1.3.12.2.1107.5.2.30.27235.30000014080806350728100000016  -q002000
0E=1.3.12.2.1107.5.2.30.27235.201408081318204011562472.0.0.0 -cget -cstore MR -c
storedest C:\Test

And the result:
C:\apps\dcm4che-2.0.28\bin>dcmqr  -L DCMQR  DCM4CHEE@localhost:11112  -q00100020
=1 -q0020000D=1.3.12.2.1107.5.2.30.27235.30000014080806350728100000016  -q002000
0E=1.3.12.2.1107.5.2.30.27235.201408081318204011562472.0.0.0 -cget -cstore MR -c
storedest C:\Test
00:50:49,139 INFO   - Association(1) initiated Socket[addr=localhost/127.0.0.1,p
ort=11112,localport=62685]
00:50:49,155 INFO   - DCM4CHEE(1): A-ASSOCIATE-RQ DCM4CHEE << DCMQR
00:50:49,170 INFO   - DCM4CHEE(1): A-ASSOCIATE-AC DCMQR >> DCM4CHEE
00:50:49,170 INFO   - Connected to DCM4CHEE@localhost:11112 in 0.093 s
00:50:49,342 INFO   - Send Query Request using 1.2.840.10008.5.1.4.1.2.2.1/Study
 Root Query/Retrieve Information Model - FIND:
(0008,0020) DA #0 [] Study Date
(0008,0030) TM #0 [] Study Time
(0008,0050) SH #0 [] Accession Number
(0008,0052) CS #6 [STUDY] Query/Retrieve Level
(0010,0020) LO #2 [1] Patient ID
(0020,000D) UI #56 [1.3.12.2.1107.5.2.30.27235.30000014080806350728100000016] St
udy Instance UID
(0020,000E) UI #58 [1.3.12.2.1107.5.2.30.27235.201408081318204011562472.0.0.0] S
eries Instance UID
(0020,0010) SH #0 [] Study ID
(0020,1206) IS #0 [] Number of Study Related Series
(0020,1208) IS #0 [] Number of Study Related Instances

00:50:49,358 INFO   - DCM4CHEE(1) << 1:C-FIND-RQ[pcid=1, prior=0
        cuid=1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information M
odel - FIND
        ts=1.2.840.10008.1.2/Implicit VR Little Endian]
00:50:49,374 INFO   - DCM4CHEE(1) >> 1:C-FIND-RSP[pcid=1, status=ff01H
        cuid=1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information M
odel - FIND
        ts=1.2.840.10008.1.2/Implicit VR Little Endian]
00:50:49,389 INFO   - Query Response #1:
(0008,0005) CS #10 [ISO_IR 100] Specific Character Set
(0008,0020) DA #8 [20140808] Study Date
(0008,0030) TM #14 [131201.984000] Study Time
(0008,0050) SH #0 [] Accession Number
(0008,0052) CS #6 [STUDY] Query/Retrieve Level
(0008,0054) AE #8 [DCM4CHEE] Retrieve AE Title
(0008,0056) CS #6 [ONLINE] Instance Availability
(0010,0020) LO #2 [1] Patient ID
(0020,000D) UI #56 [1.3.12.2.1107.5.2.30.27235.30000014080806350728100000016] St
udy Instance UID
(0020,000E) UI #0 [] Series Instance UID
(0020,0010) SH #2 [1] Study ID
(0020,1206) IS #2 [7] Number of Study Related Series
(0020,1208) IS #2 [81] Number of Study Related Instances
(0088,0130) SH #0 [] Storage Media File-set ID
(0088,0140) UI #0 [] Storage Media File-set UID

00:50:49,389 INFO   - DCM4CHEE(1) >> 1:C-FIND-RSP[pcid=1, status=0H
        cuid=1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information M
odel - FIND]
00:50:49,389 INFO   - Received 1 matching entries in 0.219 s
00:50:49,389 INFO   - Send Retrieve Request using 1.2.840.10008.5.1.4.1.2.2.3/St
udy Root Query/Retrieve Information Model - GET:
(0008,0052) CS #6 [STUDY] Query/Retrieve Level
(0010,0020) LO #2 [1] Patient ID
(0020,000D) UI #56 [1.3.12.2.1107.5.2.30.27235.30000014080806350728100000016] St
udy Instance UID
(0020,000E) UI #0 [] Series Instance UID

What's wrong? Please help me:)

2015-02-04 17:33 GMT+01:00 Alvaro [Andor] <an...@pierdelacabeza.com>:
Just to be clear: The answers were for Enrique :D
--
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+unsubscribe@googlegroups.com.

fleetwoodfc

unread,
Feb 6, 2015, 12:50:40 PM2/6/15
to dcm...@googlegroups.com
dcmqr options:

-S,--series             perform series level query, multiple exclusive
                            with -P and -I, perform study level query by
                            default.

Enrique ruiz

unread,
Feb 9, 2015, 5:56:03 AM2/9/15
to dcm...@googlegroups.com
Hi,

thank you for your response!

I create this function:

   
public static void sendDcmFile(File dcmFile) {
       
// Create DcmSnd object
       
DcmSnd dcmsnd = new DcmSnd("DCMSND");
       
//  AET parameters
        dcmsnd
.setCalledAET("PACSWFM01");
        dcmsnd
.setRemoteHost("10.193.89.106");
        dcmsnd
.setRemotePort(104);
       
// default parameters
        dcmsnd
.setOfferDefaultTransferSyntaxInSeparatePresentationContext(false);
        dcmsnd
.setSendFileRef(false);
        dcmsnd
.setStorageCommitment(false);
        dcmsnd
.setPackPDV(true);
        dcmsnd
.setTcpNoDelay(true);
       
// Add DICOM file
        dcmsnd
.addFile(dcmFile);
       
// Configure TransferCapability
        dcmsnd
.configureTransferCapability();
       
try {
            dcmsnd
.start();
       
} catch (Exception e) {
           
System.out.println("ERROR: Failed to start server for receiving " +
                   
"Storage Commitment results:" + e.getMessage());
           
return;
       
}
       
       
try {
            dcmsnd
.send();
            dcmsnd
.close();
           
System.out.println("Released connection to " + "PACSWFM01");
       
} catch (Exception e) {
           
System.out.println("ERROR: Failed to establish association:"
                   
+ e.getMessage());
       
} finally {
            dcmsnd
.stop();
       
}
   
}

However, I need a previous step: Create a node to send files! How can I create this node?

Thank you for all.

Enrique ruiz

unread,
Feb 9, 2015, 6:14:42 AM2/9/15
to dcm...@googlegroups.com
maybe... I need add this two lines???

dcmsnd.setLocalHost("IP NODO DICOM");
dcmsnd
.setLocalPort(10043); //port to send

Ludovic

unread,
Feb 11, 2015, 2:30:48 AM2/11/15
to dcm...@googlegroups.com
Thank you fleetwoodfc! It works!
Here's the solution:

C:\apps\dcm4che-2.0.28\bin>dcmqr  -L DCMQR  DCM4CHEE@localhost:11112  -q00100020
=1 -q0020000D=1.3.12.2.1107.5.2.30.27235.30000014080806350728100000016  -q002000
0E=1.3.12.2.1107.5.2.30.27235.201408081318204011562472.0.0.0 -cget -cstore MR -c
storedest C:\Test -S
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.

Jesus Pando

unread,
Aug 2, 2016, 6:50:08 AM8/2/16
to dcm4che
Have you found some solution? I have to do the same as you. 
I would be very grateful if you post the code.
Thank you very much

Enrique ruiz

unread,
Aug 2, 2016, 1:44:53 PM8/2/16
to dcm4che
This is my final solution with dcm4che 2.0.25:

         DcmSnd dcmsnd = new DcmSnd(config.getLocalAET());
        dcmsnd.setCalledAET(config.getCalledAET());
        dcmsnd
.setRemoteHost(config.getRemotehost());
        dcmsnd
.setRemotePort(config.getRemotePort());        
        dcmsnd
.setLocalHost(config.getLocalhost());
        dcmsnd
.setLocalPort(config.getLocalhostPort()); //port to send

       

        dcmsnd
.setOfferDefaultTransferSyntaxInSeparatePresentationContext(false);
        dcmsnd
.setSendFileRef(false);
        dcmsnd
.setStorageCommitment(false);
        dcmsnd
.setPackPDV(true);
        dcmsnd
.setTcpNoDelay(true);
       

       
for (File dcmFile : listDcmFile)
            dcmsnd
.addFile(dcmFile);

        dcmsnd
.configureTransferCapability();
           
try {
                dcmsnd
.start();
                dcmsnd
.open();
                dcmsnd
.send();
                dcmsnd
.close();
                dcmsnd
.stop();
           
} catch (Exception e) {
               
try {
                    dcmsnd
.close();
               
} catch (Exception e1) {
               
} finally {
                    dcmsnd
.stop();
               
}

Faisal Naveed

unread,
May 29, 2018, 5:43:03 AM5/29/18
to dcm4che
Respected Mr. E. ruiz,

I can undterstand the code but dont know how to implement. Please if you can give some help!
Reply all
Reply to author
Forward
0 new messages