| rec_convert | Convert REC file into Analyze formats |
| dcm_convert | Convert DICOM image files into other formats |
| dcm_unconvert | Recreate DICOM image files |
| dcm_dump_file | Display contents of DICOM image header |
| dcm_dump_element | Display a DICOM image header element |
| dcm_x_disp/dcm_w_disp | Quick display of DICOM image |
| dcm_move | Rename and move DICOM image files |
| dcm_count | Count number of images in DICOM directory by series |
| dcm_combine | Combine multi NEX series into single series |
| dcm_study | Show study number of DICOM image |
| send_image | Send an image to a DICOM server |
| simple_storage | DICOM server daemon |
| runDicom | Daemon to keep simple_storage running |
| Full Downloads | All programs in gzipped tar file or zip file |
| <input-recfile> | is the Philips REC file to convert into Anaylze format. These files are trasnsferred from the scanner to your directory with names of the form <iden>_<n>_1.rec where <iden> is an identifying name selected when the data is exported into REC file form and <n> is the acquistion number. The final 1 indicates it is the first reconstruction - post-processing can increment this number. |
| <output root> | is an optional output filename root. If not given, the root of the input file is used. It can include a path if you want the output files in a different directory than the input REC file. The output root for 4D Analyze format has .img appended for the image data file and .hdr appended for the Analyze header file. For 3D Analyze files, the volume number is appended ahead of the .img or .hdr suffix. |
| -n | do not swap bytes. By default byte swapping is performed to make files that are SunOS or Macintosh compatible. Do not swap bytes for use on IBM PC compatibles (all Windows variants) or DEC systems. |
| -3 | output 3D Analyze files rather than 4D. |
| -q | Run quietly. |
| -s | Make a subdirectory for output files named using root of the input file. |
| -d | Delete REC file after conversion. |
The Philips REC data input file's name can have any form but must end with ".REC" or ".rec". There must be a parameter file with root name matching the rec file and ending in ".PAR" or ".par". The PAR file is used for header info and data ordering so no DICOM file is needed as for version 1.x. Since it reads the PAR file ordering information the REC file does not need to be sorted.
It can convert rec files containing magnitude, real, imaginary and/or phase data. Output file name has Philips "type" code appened when not magnitude. (_1 real, _2 imaginary, _3 phase).
Binary: Solaris2/g1/jgillen> rec_convert 20070418bsa18_6_1.rec JHU REC File Conversion Utility v2.3.3 (samfs) Header Info: date: 2007.04.18 time: 18:25:25 name: bsa18 iden: none orig: FM Kirby Research Center desc: nrows: 512 ncols: 512 bits: 16 xspc: 0.449000 yspc: 0.449000 slthk: 5.000000 slspc: 0.000000 FOVap: 230.000000 FOVfh: 5.000000 FOVrh: 186.875000 echos: 1 phases: 1 dynamics: 34 slices: 1 plane: 0 TR: 6000.000000 echo phase dynamic 1 1 34 done /g1/jgillen>The input file is acquistion 6 of a study identified as 20070418bsa18. The output files have the same root as the input and are in the same directory since no output root was given. All 34 dynamics for all slices are in the .img file./g1/jgillen> rec_convert -s -3 rl10_7_1.rec JHU REC File Conversion Utility v2.3.3 (samfs) Header Info: date: 2006.04.20 time: 14:57:15 name: xxxxxx xxxxxx iden: #-#/g2/xxxxx/Emergent2 orig: FM Kirby Research Center desc: nrows: 128 ncols: 128 bits: 16 xspc: 1.875000 yspc: 1.875000 slthk: 3.000000 slspc: 0.000000 FOVap: 216.000000 FOVfh: 150.000000 FOVrh: 240.000000 echos: 1 phases: 1 dynamics: 239 slices: 50 plane: 0 TR: 3000.000000 echo phase dynamic 1 1 239 done /g1/jgillen> ls rl10_7_1 rl10_7_1.001.hdr rl10_7_1.061.hdr rl10_7_1.121.hdr rl10_7_1.181.hdr rl10_7_1.001.img rl10_7_1.061.img rl10_7_1.121.img rl10_7_1.181.img rl10_7_1.002.hdr rl10_7_1.062.hdr rl10_7_1.122.hdr rl10_7_1.182.hdr rl10_7_1.002.img rl10_7_1.062.img rl10_7_1.122.img rl10_7_1.182.img rl10_7_1.003.hdr rl10_7_1.063.hdr rl10_7_1.123.hdr rl10_7_1.183.hdr . . . rl10_7_1.058.hdr rl10_7_1.118.hdr rl10_7_1.178.hdr rl10_7_1.238.hdr rl10_7_1.058.img rl10_7_1.118.img rl10_7_1.178.img rl10_7_1.238.img rl10_7_1.059.hdr rl10_7_1.119.hdr rl10_7_1.179.hdr rl10_7_1.239.hdr rl10_7_1.059.img rl10_7_1.119.img rl10_7_1.179.img rl10_7_1.239.img rl10_7_1.060.hdr rl10_7_1.120.hdr rl10_7_1.180.hdr rl10_7_1.060.img rl10_7_1.120.img rl10_7_1.180.img /g1/jgillen>Output is to a directory named rl10_7_1. 3D files are selected so the is a header and image file for each of the 239 dynamics containing 1 volume (time point).
Note: This program was written to handle images from a Philips ACS/NT scanner. Many features are aimed at those images. It may also work for GE Signa images but more testing is required.dcm_convert -h
Philips ACS/NT 6.x naming convention is:
series slice dynamic
vv v v
1.3.46.670589.11.5406.9.955073100000002870301.3.1.1.1.0.44
^--------------^ ^----^
^-----^^--------^
^^ ^
Philips MR scanner
patient
study
recon echo
Philips Interra 8.x naming convention is:
series slice dynamic
vv v v
1.3.46.670589.11.5406.9.955073100000002870301.3.1.1.1.0.0.2
^--------------^ ^----^
^-----^^--------^
^^ ^
Philips MR scanner
patient
study
recon echo
GE Signa naming convention is:
scanner
image*
v--------v
v-v
1.2.840.113619.2.5.1762527352.1600.969534116.278
^----------------^
^------------^
Signa
MR
study/series**
* this number increments but bears no relation
to the image or phase number. It increments through multiple series
until
reaching 999 then resets to 1 and the field to the left increments by 1.
** this number changes with exam but otherwise
increments only when the image number goes over 999.
Because of this GE images can't be identified
as to study, series or image from the DICOM filename (which is the UID).
Siemens Magnetom naming convention is:
series date slice
v------v v-v
1.3.12.2.1107.5.2.6.21601.20001003125935000022329
^---^ ^----^ ^^
system serial
number ser time series
A menu will be presented showing all dicom series found in the current, the MR and the numbered directories below the current working directory. Each line in the menu is numbered in the left column. You are prompted to enter the number of one series to be converted. After conversion, the menu is shown again and you can select another series. Any series you convert will appear in subsequent menus with an asterisk (*) below the selection number (like #1 in the example below). Enter return when you are done to exit dcm_convert.
Example menu
Studies found:When the menu is used to select series, dynamics will be computed by count of files, not from info in the header. This corrects a miscount that occurs from off-line recon of multiple NSA series. When these are recombined using dcm_combine, the number of dynamics in the header will be off by a factor of 2 (or more depending on the NSA used).
--------------------------------------------------------------------------------
# |Physician |Identity |Name |Date |Time |Cols|Rows|Slic|Dyn |
|Description |
--------------------------------------------------------------------------------
1| |1232 |Hartford,J|04/26/2000|09:45:31.800| 256| 256| 12| 2|
*|MOSER se no filter TRA SE 504 25 90 |
--------------------------------------------------------------------------------
2| |1232 |Hartford,J|04/26/2000|09:31:39.790| 256| 256| 12| 2|
|Stability T1W/SE/no TRA SE 504 25 90 |
--------------------------------------------------------------------------------
3| |1232 |Hartford,J|04/26/2000|09:38:52.580| 256| 256| 12| 2|
|Stability T1W/SE/yes TRA SE 504 25 90 |
--------------------------------------------------------------------------------Number (1-3) [done] ->
This format contains the parts of the image names that are constant for all slices and all dynamics and a conversion specifier where the changing numbers appear that represent the slice and dynamic numbers. The usual conversion specifier is %d which converts an integer into it's decimal representation without leading blanks or zeroes. The format specifier is used in dcm_convert with two integer arguments: i and j where i is a slice number and j is a dynamic number to step through all your DICOM images.
The format can include a path as well if the DICOM files are not in the current directory.
example (using Philips UID named images):
-f 1.3.46.670589.11.5406.9.955073100000002870201.%d.1.1.%d.0.41image names that match:
| slice 1 dyn 1: | 1.3.46.670589.11.5406.9.955073100000002870201.1.1.1.1.0.41 |
| slice 1 dyn 2: | 1.3.46.670589.11.5406.9.955073100000002870201.1.1.1.2.0.41 |
| slice 2 dyn 1: | 1.3.46.670589.11.5406.9.955073100000002870201.2.1.1.1.0.41 |
| slice 12 dyn 145: | 1.3.46.670589.11.5406.9.955073100000002870201.12.1.1.145.0.41 |
example (using images renamed by dcm_move -f) note: the conversion specifier %03d means 3 digit long decimal integer padded with leading zeroes:
-f 01284.003.%03d.%03dimage names that match (this was exam id 1284, series 3):
slice 1 dyn 1,2,3: 01284.003.001.001 01284.003.001.002 01284.003.001.003
slice 2 dyn 1,2,3: 01284.003.002.001 01284.003.002.002 01284.003.002.003
| -d | delete DICOM input files after conversion |
| -dyn | override number of dynamics specified in dicom header. This is used only with the -f option. |
| -f | C sprintf format specifier for the input file name (see above). |
A Mayo Clinic Analyze compatible header file is made describing the data. It has a .hdr file extension. Info from the DICOM header is put into all appropriate fields of the Analyze header (specifications).
Additionally a file is created with file extension .dcm containing all image DICOM headers concatenated together (specifications). This file along with the .img and .hdr files permits the original DICOM images files to be recreated using the dcm_unconvert program. This allows users to safely delete the original DICOM files. You can also feed this file to dcm_dump_file or dcm_dump_element to display DICOM header elements from the first (slice 1, dynamic 1) header.
A single Mayo Clinic Analyze compatible header file is made describing the data named with extension .001.hdr. Links are made to this file for all other time points with names .002.hdr, .003.hdr, etc. This header file therefore consumes only the space of the single original file but has multiple names.
The concatenated DICOM header file (.dcm) is also created. The -n switch cannot be combined with -a.
A Mayo Clinic Analyze compatible header file (.hdr) and concatenated DICOM header file (.dcm) are also made. These would be needed if the original DICOM images were to be recreated using dcm_unconvert. The -a switch cannot be combined with -n.
| -o | The argument following -o specifies the output filename root.
This
name is prepended to the filename extensions of all output files
created
by dcm_convert. This root can include pathname elements to store the
output
files outside to current directory. The destination directory must
already
exist.
Using the series menus you will be prompted for an output file root, if you don't specify one on the command line or the one specified already exists . You will always be prompted for series selected beyond the first one. Using the -f switch, if you don't specify a output file root on the command line, the name "output" will be used. If a file specified or the default already exists, an error message will be displayed. |
| -a | AFNI format output. |
| -n | 3D Analyze format for FIDAP. |
Binary: Solaris2
This program will recreate all the individual DICOM images files in a series using the 4D or 3D image data file (.img, .<nnn>.img or .BRIK), the concatenated DICOM header file (.dcm) and optionally the Analyze header file (.hdr) made by dcm_convert. The switches -a and -n indicate that the input image data is in 3D Analyze (-n) or AFNI (-a) format. If neither switch is present, 4D Analyze is assumed.dcm_unconvert -h
The Analyze .hdr file is needed only to determine the dimensions of the image data. If the dimensions are specified on the command line using the -d switch, unconversion can proceed without the .hdr file.
| -a | AFNI format input. |
| -n | 3D Analyze format input. |
| -d | Image dimensions x (columns), y (rows), z (slices), t (time points) separated by colons. |
Binary: included with dcm_convert
| -b | Input files are stored in big-endian byte order |
| -e | Exit on file open error. Do not process other files |
| -g | Remove group length elements |
| -l | Use (retired) length-to-end attribute for object length |
| -t | Part 10 file |
| -v | Place DCM facility in verbose mode |
| -z | Perform format conversion (verification) on data in files |
|
file |
One or more information objects to be dumped |
| -b | Read file assuming big endian transfer syntax |
| -t | Read file assuming DICOM Part 10 format |
| -v | Place DCM facility in verbose mode |
|
group element |
The tag of the element to be dumped |
| filein fileout | Input and output files |
| -b | Read file assuming big endian transfer syntax |
| -t | Read file assuming DICOM Part 10 format |
Binaries: (dcm_x_disp) Solaris2
(dcm_w_disp) NT
| -s <source-dir> | is a dicom storage directory, default is $DCMMOVE_DIR if set, otherwise the present working directory. |
| -m <modality> | is a dicom modality, default is $DCMMOVE_MOD if set, otherwise it is "MR". |
| -f | rename flat files (see below). |
| -n | no dynamic (see below). |
| -d | debug - show what would be done, but no moves are performed. |
| <directory> | is the writable & searchable destination directory, default is present working directory. dcm_move moves images from the dicom storage directory for the named modality into this destination directory. |
Images are renamed according to the study, series and image number found in the dicom header. If images are Philips dynamic images, they are renamed according to the study, series, slice and dynamic number. If images are GE cardiac multiphase images, they are renamed according to study, series, slice and phase number. If a file has an invalid dicom header it is moved to a directory named "bad". The program dcm_dump_file is used to read Dicom header information and must be in a directory in your PATH.
if -f (flat) is not specified for an anatomic series (i.e. no dynamics/multiphase):
if -f is specified for anatomic series:images are stored in the destination directory in a directory named using the 5 digit exam number in a directory named using the 3 digit series number in a file using <3 digit slice>.<4 digit dynamic number>
/g1/dave/smith419> dcm_count
Philips MR/1.3.46.670589.11.5406.9.1067676100000012170901 22 x 1 = 22
Philips MR/1.3.46.670589.11.5406.9.1067676100000012171101 17 x 60 = 1020
Philips MR/1.3.46.670589.11.5406.9.1067676100000012171306 12 x 360 = 4320
Philips MR/1.3.46.670589.11.5406.9.1067676100000012171401 12 x 1 = 12
/g1/dave/smith419>
If -n is not given, 2 recons are assumed. Dynamics are interleaved
to
make new recon. For example, with 2 recons:
| This becomes | this |
| recon1/dyn1 | recon3/dyn1 |
| recon2/dyn1 | recon3/dyn2 |
| recon1/dyn2 | recon3/dyn3 |
| recon2/dyn2 | recon3/dyn4 |
| recon1/dyn3 | recon3/dyn5 |
| recon2/dyn3 | recon3/dyn6 |
Run from the simple_storage directory (not inside the MR directory). This script expects a directory named MR to exist in the present working directory.
<root-filename> is the image name up to but not including the recon digits (red parts below).
The script assumes consecutive recons are being combined, but they don't necessarily need to start at 1. The usual case is for recons 1 and 2 to be combined to make a new recon 3. If some error occurs starting the first recon, you could have recons 2 and 3 combined to make 4. Output is to a recon numbered one greater than the highest found.
For reference Philips naming convention is:
series slice dynamic
vv v
v
1.3.46.670589.11.5406.9.955073100000002870301.3.1.1.1.0.44
^--------------^ ^----^
^-----^^--------^
^^
^
Philips MR scanner
patient
study
recon echo
| -a | Set application title of this (calling) application |
| -c | Set called AE title to title in Association RQ |
| -m | Set maximum PDU in Association RQ to maxPDU |
| -p | Alter image by sending minimal pixel data |
| -q | Quiet mode. Suppresses some messages to stdout |
| -r | Make program sensitive to response status. If not success, stop |
| -s | Force an initial Association using one SOP Class based on SOPName (CR, CT, MR, NM, SC, US) |
| -v | Place DUL and SRV facilities in verbose mode |
| -x | Place one facility(DCM, DUL, SRV) in verbose mode |
|
node |
Node name for network connection |
| port | TCP / IP port number of server application |
| image | A list of one or more images to send |
Binaries: Solaris2
NT
gzipped
test image zipped
test image
| -a | Abort Association after receiving one image (debugging tool) |
| -c | Set the AE title of this server |
| -d | Place one facility (DCM, DUL, SRV) in verbose mode |
| -f | Fork a new process for each connection |
| -i | Ignore some incorrect parameters in Association request |
| -j | Use thread model. Spawn a new thread for each connection |
| -k | Kill (delete) files immediately after they are received |
| -l | Log stdout and stderr to named log file (JHU addition) |
| -m | Set the maximum received PDU in the Association RP to maxPDU |
| -n | <naming> contains naming convention for files stored |
| -p | Dump the Association RQ parameters |
| -s | Silent mode. Don't dump attributes of received images |
| -t | Execute the main loop trips times (debugging tool) |
| -u | Run as this alternate uid when not running as root (JHU addition) |
| -v | Place DUL and SRV facilities in verbose mode |
| -w | Wait flag. Wait for 1 second in callback routines (debugging) |
| -x | Set base directory for image creation. Default is current directory |
| -z | Wait for sec seconds before releasing association |
| port | The TCP/IP port number to use |
If command line switches are provided, they are used when starting simple_storage, unless the first switch is one of the following:
| -help | prints this message |
| -kill | kills runDicom and simple_storage |
| -restart | kills runDicom and simple_storage, then restarts both |
If no command line switches for simple_storage are given on the command line, runDicom looks for the file /usr/local/sbin/runDicom.<hostname>, where <hostname> is the name returned by the gethostname system call. That file must contain valid switches and switch parameters for simple_storage, one switch or parameter to a line. For example:
-lIf that file does not exist, the following switches are used for starting simple_storage:
/tmp/simple_storage.log
-s
-c
DICOM_STORAGE
-u
600
-f
-x
/g1/dicom
3010
-l /tmp/simple_storage.log -s -f -c DICOM_STORAGE -u 0 3010runDicom logs starts and shutdowns of simple_storage in the file /tmp/simple_storage.log. This same file can be used for simple_storage
Source & Binary: Solaris2
Solaris 2.x binaries and shell scripts in a gzipped tar file
Windows
NT binaries in a zip file
libctn.so CTN dynamic library