• Like
Medianet manual
Upcoming SlideShare
Loading in...5
×
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
298
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. dcm4che Media and Network Applications by Thomas Hacklaender, MD, MSc (hacklaender@iftm.de) covers dcm4che version 1.0.3 This manual describes how to use the sample applications of the dcm4che library as PACS communication tools for the ImageJ framework.Table of Contents1 Getting Started ........................................................................................................................ 2 1.1 Installation ....................................................................................................................... 22 Example Scenario ................................................................................................................... 43 Applications ............................................................................................................................. 6 3.1 General ............................................................................................................................ 6 3.2 dcmdir.............................................................................................................................. 6 3.3 dcmrcv............................................................................................................................. 7 3.4 dcmsnd............................................................................................................................ 84 References ............................................................................................................................ 10Document Version: 22 August 2002 1
  • 2. 1 Getting Started1.1 InstallationInstall ImageJ and the “DICOM Import and Export Plugins” as described in the accompanyingmanual. The installation directory will be referenced in the following as <IMAGEJ_HOME>.The standard installation leads to a Java 1.4 JRE and a subdirectory <IMAGEJ_HOME>/libwith the following library files:File/Directory Descriptiondcm4che.jar The dcm4che library.log4j.jar The logger used by dcm4che.links.txt A list of links to obtain the source code and other information to the libraries.Download the media and network support archive. Unzip the medianet.zip file to<IMAGEJ_HOME>. You will receive the new directory medianet including the following files:File/Directory Descriptiondcmdir_a.bat A dummy batch file to add file references.dcmdir_c.bat A dummy batch file to create a file-set.dcmdir_x.bat A dummy batch file to remove file references.dcmdir_z.bat A dummy batch file to compact a file-set.dcmdir.cfg The configuration file containing the default properties of dcmdir.dcmdir.jar The dcmdir application.dcmrcv_file.bat A dummy batch file to start the server. Stores objects as files in ./tmp.dcmrcv_dir.bat A dummy batch file to start the server. Stores objects in file-set ./tmp/DICOMDIR.dcmrcv.cfg Configuration file containing the default properties of dcmrcv.dcmrcv.jar The dcmrcv application.dcmrcv.key A file containing security keys for dcmrcv.dcmsnd.bat A dummy batch file to send a file to a server.dcmsnd_echo.bat A dummy batch file to test the connection with DICOM Echo.dcmsnd.cfg Configuration file containing the default properties of dcmsnd.dcmsnd.jar The dcmsnd application.dcmsnd.key A file containing security keys for dcmsnd./doc The directory containing documentation files: manual.pdf – This manual as PDF fille. manual.rtf – This manual as Rich Text File.getopt.jar A library for command-line options used by all applications.log4j.properties Property file for the log4j logger used by dcm4che.SMPTE A sample DICOM image./tmp A direc tory for temporary files used by the dummy batch files: SMPTE2 - A sample DICOM image.Document Version: 22 August 2002 2
  • 3. Document Version: 22 August 2002 3
  • 4. 2 Example ScenarioIn the DICOM network communication context each node is defined by three information usuallyprovided by the manufacturer: 1. The application entity title (AET) 2. The internet protocol (IP) address 3. The port numberTo exchange information between two nodes, both must know from each other. Therefore eachnode has a list of possible communication partners. Typically you have to ask your equipmentmanufacturer to enter the three information of a new DICOM node to this list.In the following it is explained how to send an image from a modality (e.g. MR imager) to aworkstation, postprocess the image using ImageJ and store the result into a PACS archive. Theworkflow is shown on the diagram on the next page. Application Entity Title IP Address Port Number Patient Patient Study Series Instance ID Name ID Number NumberModality SCANNER 192.168.0.5 5104Archive ARCHIVE 192.168.0.6 7120dcmrcv DCMRCV 192.168.0.7 104dcmsnd DCMSND 192.168.0.8 104Image 1234567890 Test 29 17 1First we have to create an empty DICOMDIR in the file-set. In the example the DICOM file-setshould be stored in the directory ./tmp:java -jar dcmdir.jar -c ./tmp/DICOMDIRNext the image server has to be started:java -jar dcmrcv.jar --dest=./tmp/DICOMDIR 104Now the image may be send from the modality to the image server. The image is stored in thefile-set at ./tmp/TEST/29/17/1 and an entry in DICOMDIR is made.Start ImageJ and import the received image using the Dcm_Import plugin. Use the DICOMDIR-Tab to select the image.Process the image.Export the processed image to the file-set using the Dcm_export plugin. Use the DICOMDIR-Tab to select the file-set as destination.Send the image to the archive:java -jar dcmsnd.jar dicom://ARCHIVE:DCMSND@192.168.0.6:7120 ./tmp/TEST/29/17/1Delete the image (and all other images of the patient) in the file-set:java -jar dcmdir.jar -X ./tmp/DICOMDIR --pat 1234567890 ./tmpjava -jar dcmdir.jar -z ./tmp/DICOMDIRDocument Version: 22 August 2002 4
  • 5. Modality Archive Application Entity Title: <mod_AET> Application Entity Title: <arc_AET> IP Address: <mod_IP> IP Address: <arc_IP> Port Number: <mod_PORT> Port Number: <arc_PORT> Image <patient_ID> <study_instance_UID> <series_instance_UID> <PatientName> <StudyID> <SeriesNumber> <ImageInstanceNumber> (i.e. Image Number) Workstation dcmrcv dcmsnd Application Entity Title: <rcv_AET> Application Entity Title: <snd_AET> IP Address: <rcv_IP> IP Address: <snd_IP> Port Number: <rcv_PORT> Port Number: <snd_PORT> DICOMDIR Path: <dir_path> dcmdir ImageJ Standard Commands: CD-Writer Plugins: • Create Software • Dcm_Import • Add • Dcm_Export • Remove • Dcm_Inspector • Purge • CompactDocument Version: 22 August 2002 5
  • 6. 3 Applications3.1 GeneralIn the following files and directories may be referenced either by an absolute or a relative refer-ence. A relative reference is relative to the current directory and starts with the string ./ . Theparent directory is referenced by ../ . The path delimiter is independent of the operating sys-tem the character / . References not starting with a . are absolute. On systems running under aWindows OS these references start with the drive letter, e.g. C:/tmp/foo.dcm . On Linux sys-tems they start with a /, e.g. /tmp/foo.dcm .3.2 dcmdirThis application processes DICOM file-sets, as described in part 10 of the DICOM standard.Keep in mind, that DICOM restricts possible file-names: A file-set must contain one file, withname DICOMDIR, that contains information concerning the file-set. You can only add files to afile-set, which are stored in the directory of the DICOMDIR file or in sub-directories up to eightlevels. The name of such files and directories may only be 8 characters long and the charactersmust be capital letters or numbers. The character ‘.’ is not allowed.Using standard CD-writing software it is possible to create a DICOM-CD. Just write the wholecontents of the directory containing the DICOMDIR file and all its subdirectories to a CD.Examples:java -jar dcmdir.jar -c ./tmp/DICOMDIRCreates an empty file-set in the subdirectory tmp.java -jar dcmdir.jar -a ./tmp/DICOMDIR ./tmp/SMPTE2Adds the existing DICOM object ./tmp/SMPTE2 to the existing file-set ./tmp/DICOMDIR .java -jar dcmdir.jar -x ./tmp/DICOMDIR --pat 1234567890 ./tmpMarks in the file-set ./tmp/DICOMDIR all entries as “not in use”, if the referenced files are indirectory ./tmp or its subdirectories and have a patient ID equal to 1234567890.java -jar dcmdir.jar -P ./tmp/DICOMDIRMarks in the file-set ./tmp/DICOMDIR all entries as “not in use”, if the referenced files are notphysical present at the referenced position in the filesystem.java -jar dcmdir.jar -z ./tmp/DICOMDIRRemoves all entries in the file-set ./tmp/DICOMDIR which are marked as “not in use”.Document Version: 22 August 2002 6
  • 7. Usage:java -jar dcmdir.jar -{tcaxXzP} dir-file [OPTION]... [FILE]...Command: -c dir-file create new DICOMDIR file with references to files... -a dir-file add file references to existing DICOMDIR file -x dir-file remove record(s) from existing DICOMDIR, with specified --pat id Patient ID --study uid Study Instance UID --series uid Series Instance UID --sop uid SOP Instance UID [FILE]... referenced files -X dir-file same as -x dir-file, but also deletes referenced files -P dir-file purge records from existing DICOMDIR file, with referenced files do not exist anymore -z dir-file compact existing DICOMDIR file by removing inactive recordsOptions (override presets defined in resource dcmdir.cfg): --id id defines File-set ID of created DICOMDIR file --uid uid defines SOP Instance UID of created DICOMDIR file --readme readme-file add README file reference to created DICOMDIR file --readme-charset code specifies character set used in README file --grouplen encode with (gggg,0000) group length attributes --seqlen encode sequence attributes with explicit length --itemlen encode sequence items with explicit length --onlyInUse hide inactive records in content list --maxlen line-len maximal line length in listing; default=79 --vallen val-len displayed value length in listing; default=64 --help display this help and exit --version output version information and exit3.3 dcmrcvThis application implements a DICOM server listening on PORT. It acts as a Storage SCP. Thereceived images are stored to the local file-system or in a DICOM file-set, depending on thedest option. If the destination is a file-set, the received objects are stored in subdirectories ofthe file-set directory. The names of the subdirectories are derived from the received object: Pa-tientName, StudyID and SeriesNumber. The name of the file the object is stored is the In-stanceNumber. This behavior may be configured by the fs-file-id option.Example:java -jar dcmrcv.jar --dest=./tmp 104Starts the server, listening on port 104. The received DICOM objects are stored as plain files inthe subdirectory tmp.Usage:java -jar dcmrcv.jar [OPTION]... PORTOptions (override presets defined in resource dcmrcv.cfg):--called-aets=AET1,.. only association requests with matching called and--calling-aets=AET1,.. calling AET will be accepted--max-pdu-len=LEN set maximal length of receiving PDUs [default=16352]--max-op-invoked=NUM set maximal number of invoked operations with outstanding responseDocument Version: 22 August 2002 7
  • 8. --rsp-delay=SEC define additional delay of response (useful for testing async mode)--dest=DEST define storage destination for received objects, if DEST specifies a DICOMDIR file path (=last component = "DICOMDIR"), the received objects will be stored as DICOM File-set, further specified by --fs-id=NAME the File-set Identifier [default=<none>], --fs-uid=UID the File-set SOP Instance UID [default=<auto>], --fs-file-id=TAG_PATH specifies schema for generated file IDs [default= StudyDate,StudyID,SeriesNumber,InstanceNumber], --fs-lazy-update defer update of DICOMDIR at association release, instead immedately at each object receipt. --set=TAG:VAL Replace value of specified attribute with specified value in received object (e.g.: --set=PatientName:anonymous).--buf-len=LEN set length byte buffer, used to store data to file--tls=CIPHERSUITE1,.. accept TLS connection with specified Cipher Suites eg.: SSL_RSA_WITH_NULL_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA--tls-key=KEYSTORE get key from specified resource [default:dcmrcv.key]--tls-key-passwd=PASS password for keystore and key specified by --tls-key [default: dcm4che]--tls-cacerts=KEYSTORE read trusted CA Certificats from specified resource [default:cacerts]--tls-cacerts-passwd=PASS password for keystore specified by --tls-cacerts [default: dcm4che]--help display this help and exit--version output version information and exit3.4 dcmsndThis application send DICOM objects to an Storage SCP, e.g. an archive. It acts as a StorageSCU. The objects are read from the local file-system and are send to an Storage SCP which isdefined by URL. FILE may be the name of a single file, a list of files separated by whitespacesor the name of a directory. In the later case all files in the directory and all subdirectories aresend. If FILE is omitted, the connection to the remote node will be verified by DICOM Echo.Examples:java -jar dcmsnd.jar dicom://DCMRCV:DCMSND@localhost:104 ./SMPTEOpens association to local server, listening on port 104, with calling application entity titleDCMSND and called application entity title DCMRCV. Sends the DICOM file ./SMPTE to theserver.java -jar dcmsnd.jar dicom://DCMRCV:DCMSND@localhost:104Opens association to local server, listening on port 104, with calling application entity titleDCMSND and called application entity title DCMRCV. Verifies the connection with DICOM Echo.Usage:java -jar dcmsnd.jar [OPTION]... URL [FILE]...Url:dicom://CALLED[:CALLING]@HOST[:PORT] CALLED Called AET in association request CALLING Calling AET in association request [default=ANONYMOUS]Document Version: 22 August 2002 8
  • 9. HOST Name or IP address of host, where the server is running PORT TCP port address, on which the server is listing for incoming TCP Transport Connection Indication [default=104]Options (override presets defined in resource dcmsnd.cfg):--prior-high HIGH priority of storage requests [default=NORMAL]--prior-low LOW priority of storage requests [default=NORMAL]--max-pdu-len=LEN set maximal length of receiving PDUs [default=16352]--max-op-invoked=NUM set maximal number of invoked operations with outstanding response [default=0 -> unlimited]--max-pdu-len=LEN maximal length of receiving PDUs [default=16352]--buf-len=LEN byte buffer length, used to store data to file [default=2048]--repeat-dimse=NUM Number of times to repeat single request [default=1]--repeat-assoc=NUM Number of times to repeat whole operation [default=1]--buf-len=LEN set length byte buffer, used to store data to file--set=TAG:VAL Replace value of specified attribute with specified value in transmitted object (e.g.: --set=PatientName:anonymous).--tls=CIPHERSUITE1,.. accept TLS connection with specified Cipher Suites eg.: SSL_RSA_WITH_NULL_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA--tls-key=KEYSTORE get key from specified resource [default:dcmsnd.key]--tls-key-passwd=PASS password for keystore and key specified by --tls-key [default: dcm4che]--tls-cacerts=KEYSTORE read trusted CA Certificats from specified resource [default:cacerts]--tls-cacerts-passwd=PASS password for keystore specified by --tls-cacerts [default: dcm4che]--poll-dir=DIR Poll the specified directory for DICOM files - e.g. received by application dcmrcv - and forward them to the remote DICOM node. [default: <none>]--poll-period=PERIOD Poll period in s. The default is 5s.--poll-retry-open=TIME Retry open connection to remote host with specified time interval. The default is 60s.--poll-delta-last-modified=TIME Only consider files, which modification time differs with the current time more than the specified value. The default is 3s.--poll-done-dir=DIR Moves sent files to the specified directory, instead of removing it from poll-dir.--help display this help and exit--version output version information and exitDocument Version: 22 August 2002 9
  • 10. 4 ReferencesThe ImageJ framework: http://rsb.info.nih.gov/ij/The dcm4che project homepage: http://sourceforge.net/projects/dcm4che/The DICOM normative text: http://www.dclunie.com/Document Version: 22 August 2002 10