MEDCON(1)

NAME
medcon - MedCon conversion of medical image formats

SYNOPSIS

medcon [options] -f files ...

DESCRIPTION

MedCon is a conversion utility intended for reconstructed nuclear medical images.

The supported formats are:

Format | Explanation | Notation
------ | ----------- | --------
Gif89a | annimated GIF with colormap | `gif'
Acr/Nema | Papyrus, Siemens (vers 2.0) | `acr'
INW | RUG local format (vers 1.0) | `inw'
InterFile | version 3.3 | `intf'
Ecat | Ecat951 PET-scanner (vers 6.4) | `ecat'
Analyze | with consideration to SPM software | `anlz'
DICOM | uses the VT-DICOM library | `dicom'
Binary | Raw binary image arrays without header | `bin'
Ascii | Raw ascii image arrays without header | `ascii'

FLAGS

-f files ...
    Read a list of files.

OPTIONS

-anon
    Make patient and study related entries anonymous (filled with 'X'). This option can not be used with option -ident.

-ar Reverse Analyze (SPM) planes, rows and columns. The images sequence is reversed and the rows/columns are handled from bottom-to-top/right-to-left. This option is especially necessary when you convert our Ecat 951 files to Analyze for the use in SPM. See also -spm & -optspm.

-b8, -b16, -b16.12
    Force writing of Uint8 or Int16 pixels. Ofcourse you'll lose the quantified pixel values. The special option -b16.12 uses only 12 bits, as unsigned however.

-big
    Force writing of big endian files when supported by the format.

-c format ...
    Convert with a list of formats to convert to. Use the notation without quotes as specified in the above table. You can not use this option with -p.

-d  Show debug info. After reading a file, the program will display the contents of the internal FILEINFO structure.

-e  An interactive routine to extract images. In normal style it is also possible to reorder the sequence of images. You need to specify an output conversion format (see option -c).

Selection Type? 1=normal 2=ecat

Normal Style
------------

- Finish the list with a negative number
- Any number must be one-based (0 = All reversed)
- The syntax of a range: X...Y
- The list is sequence sensitive!

Give a list of images to extract?

Ecat Style
----------

- Finish the list with a negative number
- Any number must be one-based (0 = All)
- The syntax of a range: X...Y

Give planes list?
Give frames list?
Give gates list?
Give beds list?

-fb-none, -fb-anlz, -fb-dicom, -fb-ecat
    Disable or specify a fallback read format in case autodetect failed.

-g  Remap coloured images to gray. This is necessary when you convert to formats which only support a grayscale colormap!

-hackacr
    Enables you to hack a file that contains Acr/Nema tags hidden somewhere. Some proprietary image formats do contain tags but are placed after some unknown headerinformation. This option will try to find some readable tags in the first 2048 bytes after which it will give some possible hints to get the images out of the file with the use of the interactive reading procedure (see option `-i'). Ofcourse, this experimental procedure can fail badly ...

-i  Selects the interactive reading procedure. Normally the program automatically detects the format or uses `ecat' (or `dicom') as default. With the interactive procedure it could be possible to read an uncompressed, unsupported format by answering the following questions:

Number of images?
General header offset to binary data?
Image header offset to binary data?
Image header repeated before each image?
Swap the pixel bytes?
Same characteristics for all images?
Absolute offset in bytes?
Image columns?
Image rows?
Pixel data type?
Redo input?

-ident
    An interactive routine to specify the patient and study related information. This option can not be used with the option -anon. The questions asked are:

Give patient name?
Give patient id?
Select patient sex?
Give study discription?
Give study name/p-number?

-little
    Force writing of little endian files when supported by the format.

-lut filename
    Load an external LUT color scheme.

-mh Selects the hotmetal colormap. This is only usefull to GIF89a.

-mr Selects the rainbow colormap. This is only usefull to GIF89a.

-mc Selects the combined colormap. This is only usefull to GIF89a.

-mi Selects the invers colormap. This is only usefull to GIF89a.

-n  Keep negative values in consideration. When not selected all negative values are put to zero. Note that in case of conversion, this option can not be used with -qs or -qc.

-nf Normalize with minimum/maximum values found over images in a frame group (in case the original format has different frames). The default behaviour is normalization with minimum/maximum values found over all images. This can be important when the resulting format requires a rescaling to a new pixeltype. The original pixel values then need to be rescaled to the new pixeltype boundaries based on the minimum/maximum values.

A note to myself: normalization over all images results in a rescaled_fctr identical to all images and could be used in formats that support one rescale factor (like Analyze (SPM)) or in formats you could define your own tag/entry (like Acr/Nema, InterFile). This would make floats unnecessary, integers acceptable, save disk space and still preserve the quantified values. For now we use this in case of Analyze after the -spm option was given and DICOM for which we set the rescale slope tag (0x0028:0x1053).

-optgif
    Define some GIF options when converting to the GIF format. Without this option a loop and background color are defined by default. This interactive routine asks the following questions:

Select color map?
Insert a display loop?
Delay 1/100ths of a second?
Insert a transparent color?
Transparent color?
Background color?

-optspm
    Define some SPM options (origins) when converting to the Analyze format. The quantification is not set. See also '-spm' & '-ar'. The interactive routine asks the following questions:

Origin X?
Origin Y?
Origin Z?

-p  Show some specified pixel values. This is an interactive routine. Calibration and negative pixels are preserved automatically. You need to specify the -qs to preserve the quantification instead of the calibration. You can not use this option with -c.

- Finish the list with a negative number
- Any number must be one-based (0 = All)
- The syntax of a range: X...Y

Selection Type? 1=normal 2=ecat

Normal Style
------------

Give a list of image numbers?
Give a list of pixels x,y ?

Ecat Style
----------

Give planes list?
Give frames list?
Give gates list?
Give beds list?
Give a list of pixels x,y ?

-q  Obsolete option, the option -qc will be used instead.

-qs Preserve the (ECAT) quantification (or in case of other formats, consider their scaling factors when available).

qpv = ppv * quant_scale [counts/second/pixel]

qpv = quantified pixel value
ppv = plain pixel value

The `quant_scale' factor normalizes all images in the file; quite important for merging purposes. When the corresponding official format can not hold a `quant_scale' factor for each image, the pixel values will be rescaled to floats. Therefore, the highest precision pixel type for correct quantification is float and NOT double!

If the format does not support floats, the pixel values will be quantified and rescaled to an integer type. The images are still normalized, but the real quantification value will be lost! The program will notify this.

For Analyze: you should also specify the -spm option only for SPM Analyze files with scale factor. For DICOM: the rescale slope/intercept OR window center/width will be applied on the pixel values.

Note that in case of conversion, this option can not be used with -n, -qc.

-qc Preserve the (ECAT) quantification and (ECAT) calibration (or in case of other formats, consider their scaling factors when available).

cpv = ppv * quant_scale * calibr_fctr [uCi/ml]

cpv = calibrated pixel value
ppv = plain pixel value
qpv = quantified pixel value = ppv * quant_scale

The `quant_scale' factor normalizes all images in the file; quite important for merging purposes. The `calibr_fctr' rescales the qpv-values to a new unit. When the corresponding official format can not hold a compound factor for each image, the pixel values will be rescaled to floats. Therefore, the highest precision pixel type for correct quantification is float and NOT double!

If the format does not support floats, the pixel values will be calibrated and rescaled to an integer type. The images are still normalized, but the real calibration value will be lost! The program will notify this.

For Analyze: you should also specify the -spm option only for SPM Analyze files with scale factor. For DICOM: the rescale slope/intercept OR window center/width will be applied on the pixel values.

Note that in case of conversion, this option can not be used with -n, -qs.

-r  Rename the file basename. This option is only useful in case of conversion.

-spm
    Considering Analyze files for/from SPM. In this case the global scaling factor hidden in imd.funused[1] will be interpreted and the hidden offset value in imd.funused[0] too. In order to use the scaling factor you must select a quantification option '-qs' or '-qc' as well. See also -ar & -optspm.

-v  Verbose mode. Show some explaining messages during the reading and writing of files.

-vifi
    An interactive routine for editing voxel,array,slice and orient related entries in the FILEINFO struct.

NOTES

When no conversion was specified, the program will display the header information of each image.

When conversion was specified, the program will automatically create new filenames in the current directory with the following syntax:

mXX-filename.ext

`XX-' a number representing the XX-th conversion
`ext' a corresponding extension of the new format

Gif89a | -> | .gif
Acr/Nema | -> | .ima
INW | -> | .im
Interfile | -> | .h33 + .i33
Ecat | -> | .img
Analyze | -> | .hdr + .img
Binary raw | -> | .bin
Ascii raw | -> | .asc
Dicom | -> | .dcm

EXAMPLES

1. To display the image headers:
medcon -f filename1 filename2

2. To convert the images:
medcon -f filename1 filename2 -c gif acr intf

3. To read interactively:
medcon -i -f filename -c ecat

4. To extract images:
medcon -e -f filename -c gif

5. To print out pixel values
medcon -p -f filename

FILES

/usr/local/xmedcon/include/ | Directory with header files.
/usr/local/xmedcon/lib/ | Directory with libraries.
/usr/local/xmedcon/bin/ | Directory with executables.
/usr/local/xmedcon/man/ | Directory with man-pages.
/usr/local/xmedcon/etc/ | Directory with rcfiles.

SEE ALSO

xmedcon(1)

m-acr(4), m-anlz(4), m-gif(4), m-inw(4), m-intf(4), m-ecat(4)

medcon(3)

AUTHOR

(X)MedCon project was written by Erik Nolf (eNlf) for the PET-Centre at Ghent University (Belgium).

e-mail: | enlf@users.sourceforge.net | www: | http://xmedcon.sourceforge.net