genre | DICOM |
author | Jan-Martin Kuhnigk |
package | MeVisLab/Standard |
dll | MLImageFile |
definition | mlImageFile.def |
see also | Scale, ImagePropertyConvert, MemoryCache, MinMaxScan, VoxelValueRescale |
keywords | intercept, HU, hounsfield, units, CT, normalize, slope, minimum, maximum, scan, data, type, cast, conversion, range |
The module DicomRescale allows for a rescaling of DICOM data to a user-defined intercept, slope, and data type.
For example, this is very useful in order to normalize CT data from different vendors (Siemens, Philips, GE, Toshiba), who mostly use their specific intercept / slope / data type values, on the fly without extensive computational cost.
It can also be used to scale any incoming CT data into uint8 for more memory efficient processing and still have the correct correspondence of intensity values and HU (for example, for display in View2D annotation).
Connect a DICOM image to the input, and select appropriate rescaling parameters.
E.g., to rescale to Siemens standard, use Intercept -1024, slope 1, and data type UInt16. If Int16 is selected instead, values below -1024 HU which occur in most Philips and Toshiba datasets are preserved and result in intensity values below 0 in the output image.
Recommended normalization values for image processing are intercept = 0, slope = 1, data type = Int16, so that densities and HU correspond directly and values below -1024 (noise, masked out areas) are correctly preserved for all vendors. Toshiba and Philips usually generate non-clamped data, which is very useful for noise analysis in quantitative image processing.
Internally, the module computes a scale factor S and an offset O from input and output slopes Si and So and intercepts Ii and Io
S = Si / So
O = (Ii - Io) / So
Respecting the boundaries of the data type Mindt and Maxdt, every input value vi is transformed into an output value vo according to
vo = max(Mindt, min(Maxdt, vi * S + O ))
If the selected data type is an integer type, the resulting value vo is rounded arithmetically. If user-defined bounds are activated, they are used instead of the data type derived boundaries (as long as they lie within the output data type range).
Some remarks on the internal implementation affecting the module performance: If S is 1, O is 0, and no data type change is performed, the data is just relayed in-place to minimize time consumption. If S differs from 1 or the output data type is non-integer, the complete computation is performed in double and afterwards cast into the target data type. For the frequently occurring case that S equals 1, a special loop is used which performs the clamping in the source data type and the computation (which is a mere add operation) in the target data type without necessarily converting to double for that purpose.
Bypassing Only: Bool | Input Valid: Bool | User Min: Double |
Force lower bound: Bool | Output Datatype: String | |
Force upper bound: Bool | Output Maximum: Double | |
Input Datatype: String | Output Minimum: Double | |
Input Intercept: String | Select Datatype: Enum | |
Input Maximum: Double | Select Intercept: Double | |
Input Minimum: Double | Select Slope: Double | |
Input Slope: String | User Max: Double |
Shows whether the data was not processed due to identical input / output parameters (and the module could have been omitted entirely).
Shows whether the input is valid (standard data type and neither Long Double nor Int64).
Shows the intercept value stored in the input image.
Shows the slope value stored in the input image.
Shows the minimum image value stored in the input image.
Shows the maximum image value stored in the input image.
Shows the data type of the input image.
If checked, the data is being clamped to a user-defined lower bound after the data type was determined.
If checked, the data is being clamped to a user-defined upper bound after the data type was determined.
If the upper bound conflicts with the lower bound, it is not applied.
Sets the user defined intercept value.
Shows the minimum image value of the output image.
Shows the maximum image value of the output image.