| Download | Install | Usage (1) (2) | How to | Problems | Limitations | Performances | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Usage (2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Control output | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The default behavior of dicom2 is to display nothing
but warnings and errors, but processing hundreds of files may take some
time... Therefore, one may want to display the rank or the name of the
file that is currently processed, which will convey a rough evaluation
of the remaining operations. The name of the file may also be helpful to
locate the one that produced an error.
Warnings do not stop the conversion process, but it may be annoying to get the same messages hundreds of times. Hence, it is possible to prevent these warnings (prefixed with [W]) from being displayed. Errors (prefixed with [E]) will always be shown. For these willing to time each call to dicom2, the corresponding --timer option may be used. You might use these parameters in the DICOM2 environment variable to set new default options. Let's have a look at some examples, where mframe is a multi-frame file, which stores 5 frames: [1] [2] [3]
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Renaming pattern | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The default behavior of dicom2 is to use the name
of the file being processed to build the destination filename. The extension
of the destination format is added to that name (for example, .bmp,
.tga, .txt, etc., see conversion
formats). An optional frame number is added also if the file is a multi-frame
file.
Unfortunately, filenames automatically created by acquisition software's are most of the time hard to manage, and convey no special meanings in a human-readable form. It would be interesting to implement a simple mechanism able to rename the destination file depending on its contents (its DICOM tags) or its rank. This may be achieved by specifying a renaming pattern made of
fields separated by semi-colons (':'). A field is related to a
unit of information that may be found in the file: it is similar
to a DICOM data-element, although more meaningful.
Every field is processed one after the other, from the left to the right. If the field is found in the field-dictionary and if the information is available in the file, its value is used to build a part of the destination filename. Otherwise, it is copied as is in the name, allowing the user to include strings too. In both cases, fields are concatenated and separated by minus signs ('-') in the destination filename.
The frame-related fields (cur_fr, cur_fr0) have no influence on single-frame files. It is also safe to use them in any cases, as dicom2 do not output anything but single-frame files. Therefore, DO NOT forget to use these fields in the pattern if you want to be sure that you will save the frames stored in a multiple-frame file. If not, there won't be any difference between the filenames of each resulting frame, as they are computed from the name of the original multi-frame file: you will most probably overwrite all frames within the same single-frame file. Several aliases are available to specify the most usual combinations of fields. If the first field of the whole renaming pattern is a digit (0..9), the corresponding alias is used:
Do not be afraid about this syntax, and feel free to experiment, it is worth it :) Although the field dictionary may be hard to remember, all fields have been chosen to sound like their counterparts. Let's have a look at some examples, where mframe is a multi-frame file, which stores 5 frames. The -w conversion (BMP) adds .bmp to the filename.
Study Date (0008,0020) 1 DA [1997.05.29]
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Image processing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Some very rudimentary image processing tasks may be performed
on the pixels before converting them to another format. Multiple tasks
may be applied during the same pass, allowing you to save a lot
of time... be aware that they are performed in the following order:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Note that the resulting DICOM file is not a logic file in that it does not relate to any existing study or patient: it just contains the mandatory tags necessary to describe an image. Be aware that most modes do not support samples per pixel greater than 1, as they have to compare or order pixels based on their value. Therefore, do not forget that a pixel with a value = 0 is NOT always darker than a pixel with a value = 255, 1024, or higher. It depends on the Photometric Interpretation: it is true for MONOCHROME2, where 0 is black and higher values are lighter, but false for MONOCHROME1, where 0 is white and higher values are darker.
This buffer might be useful to create a mask by attributing a zero to the points that you want to save (using a painting program). Check the corresponding real-life examples in the "How to" section. Use the 'min' mode to achieve the same effect on MONOCHROME1 images.
Use the 'max' mode to achieve the same effect on MONOCHROME1 images.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
--mask=zero[:file]:
mask every image (or frames). The contents of the resulting file is computed
from the combination of the original file and the mask, and vary depending
on the mode. You can specify the name of the mask, or dicom2
will use mask-mode.bmp as default (where mode
is actually replaced by the chosen mode). The mask has to be stored in
Window's BMP format, 8 bits/sample, 1 sample/pixel, which corresponds
to a 256 indexed-color picture (the color lookup table is ignored).
A 'zero' mask might have been created from an accumulation buffer after attributing a zero to the points that you wanted to save (using a painting program). Check the corresponding real-life examples in the "How to" section.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --crop=x:y:w:h: build
a destination frame that is a sub-part of the original frame. It
starts at pixel x:y and its width and height are w:h
(upper-left corner at 0:0).
Using accumulating, masking
and cropping together might become a very common way to clean images. Check
the corresponding real-life examples
in the "How to" section.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
--halve[=n]: halve
the original frame. Both dimensions (width, height) must be even, but you
still can crop the frame a little to achieve the
right size. You may also provide a parameter n to halve the frame
n times instead of 1 (ex: --halve=3 will halve a 512x512
image to 64x64).
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --fliph --flipv:
flip frame horizontally or vertically.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --get=[max][:min][:mean]:
get maximum/minimum/mean pixel values in the frame. Parameters are optional
and may be specified in any order. This option can not be used on image
where pixels are made of more than 1 sample (anything different from MONOCHROME).
[max: 4000] [min: 0] [mean: 1273] [min: 0] |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Download | Install | Usage (1) (2) | How to | Problems | Limitations | Performances | ||||||||||||||||||||||||||||||||||||||||||||||||||||||