Purpose

MeVisLab DICOM image importers such as ImageLoad or DirectDicomImport typically do not modify the imported pixel data even if DICOM tags might specify it differently. The module ApplyDicomPixelModifiers actually implements some of these operations which are required by such DICOM tags. Currently supported operations are:

  • Translation of index pixel data to RGB data described in the DICOM tags RedPaletteColorLookupTableDescriptor, GreenPaletteColorLookupTableDescriptor, BluePaletteColorLookupTableDescriptor, RedPaletteColorLookupTableData, GreenPaletteColorLookupTableData, and BluePaletteColorLookupTableData if the tag PhotometricInterpretation is PALETTE COLOR. Independent of the setting of Apply Palette Information the base output connector provides the intensity to RGB LUT, which, for example, can be passed to ApplyLUT alternatively. Also C.8.16.2.1.1.1 Supplemental Palette Color LUTs according to DICOM Standard Part 3 are supported which are indicated by a PixelPresentation tag with value COLOR.
  • Conversion of YBR_FULL image data to RGB if the PhotometricInterpretation tag is YBR_FULL.
  • Inversion of single color channel image data if the PhotometricInterpretation tag is MONOCHROME1.
  • Scaling of pixel data with the value of the tag DoseGridScaling if the Modality tag is RTDOSE. These scalings are performed slice/frame specific if the tag DoseGridScaling tag is specifically available for frames.
  • Scaling and shifting of pixel data with the value of the tags RescaleSlope and RescaleIntercept, respectively. These scalings are performed slice/frame specific if they are specifically available for frames.
  • Optionally adapting the DICOM tags appended to the output image such that they are corresponding to the transformed pixel data. DoseGridScale, RescaleSlope, and RescaleIntercept are set to 1.0 or 0.0, respectively. PhotometricInterpretation is set to RGB in the cases YBR_FULL and PALETTE, and to MONOCHROME2 in the MONOCHROME1 case.
  • Possibly contained DICOM information available in the input image will be displayed at the second output connector. Only overlays according to the current DICOM standard is displayed; overlays according to the retired DICOM standard are not displayed. See http://medical.nema.org/Dicom/2011/11_03pu.pdf, section C.9 for details.

Bugs, Notes and Limitations:

  • Combinations of Rescale Intercept / Rescale Slope values of Supplemental Palette Color LUT are still not fully supported. Currently Rescale Intercept / Rescale Slope values are never applied to the output image if a palette is applied, even if Apply Rescale. This is the normal and correct behaviour. However, values below the minimum LUT value in Supplemental Palette Color LUT shall be mapped as gray values and Rescale Intercept / Rescale Slope values should also be applied on them frame specifically. This implementation is currently performed only with Rescale Intercept / Rescale Slope values from root of DICOM tree, but not frame specifically.
  • AlphaPaletteColorLookupTable related tags are only experimentally supported. If available, then a mapping to an RGBA output image is tried, however, test data is missing to guarantee reliable operations.
  • This module only operates on scalar images; decompose non scalar images to scalar ones if needed.
  • Not all scalar input voxel types are supported; usually those ones work fine which are allowed types according to the DICOM standard. For example float and double image pixel types are not supported in all modes.

Windows

Default Panel

../../../Projects/DICOM/MLDicomModify/Modules/mhelp/Images/Screenshots/ApplyDicomPixelModifiers._default.png

Output Fields

outputLUT

name: outputLUT, type: LUTFLinear(MLBase)

Independent of the setting of Apply Palette Information the base output connector provides the intensity to RGB LUT, which, for example, alternatively can be passed to ApplyLUT. If no PALETTE can be found in the DICOM tree this output connector is NULL.

output1

name: output1, type: Image

If the connected input image contains DICOM overlay information then this possibly will be provided at this output. Typically it can be displayed with a SoView2DOverlay or similar modules on top of the viewer showing the image from output connector 0. If multiple overlays are available, then they will be composed with an OR operation, overlay pixels will have value 1, background pixels 0. This image at this connector will be invalid if no valid DICOM image volume is selected or it does not contain valid overlay information. Only overlays according to the current DICOM standard are displayed; overlays according to the retired DICOM standard are not displayed. See http://medical.nema.org/Dicom/2011/11_03pu.pdf, section C.9 for details. The overlay image data is calculated on demand from the input DICOM information.

Parameter Fields

Visible Fields

Apply Palette Information

name: applyPaletteInformation, type: Bool, default: TRUE

If enabled then the translation of index pixel data to RGB is performed if the corresponding DICOM tags require that and the tag PhotometricInterpretation is PALETTE COLOR. The tags are RedPaletteColorLookupTableDescriptor, GreenPaletteColorLookupTableDescriptor, BluePaletteColorLookupTableDescriptor, RedPaletteColorLookupTableData, GreenPaletteColorLookupTableData, and BluePaletteColorLookupTableData. This operation creates color image output data of voxel type MLuint8 or MLuint16. The index to color translation is only applied to ML images with one color channel and voxel types of one or two byte size.

Use Best Color Type

name: useBestColorType, type: Bool, default: TRUE

If Apply Palette Information is on then we may want to keep the voxel type of the input image if possible, which, however, may have only eight bit while a palette may have 16 bit color values. Older versions of ApplyDicomPixelModifiers kept the input voxel type, the current one, however, preferably uses the data type of the palette values or even float in cases of supplemental palette LUTs according to C.8.16.2.1.1.1 Supplemental Palette Color LUTs in DICOM Standard Part 3. A Supplemental Palette Color LUT may use the look up palette as well as rescale/slope values or VOI LUTs which required a float type to prevent data loss.

Apply Photometric Interpretation

name: applyPhotometricInterpretation, type: Bool, default: TRUE

If the PhotometricInterpretation tag is MONOCHROME1 and this checkbox is enabled, then the ML image data pixels are inverted in the range of the input min/max range. This inversion is performed only on ML images with one color channel and voxel types of one or two byte size.

Apply Dose Grid Scaling

name: applyDoseGridScaling, type: Bool, default: TRUE

If Apply Dose Grid Scaling is enabled, the Modality tag is RTDOSE, and the tag DoseGridScaling is available, then the image data is scaled with this tag value. If the tag is available specifically for a frame then each tag affects only the corresponding slice in the volume. Otherwise - if it is only available as common tag - it affects the entire volume. The frame specific tags are used with priority if both is available. Since this scaling may affect the range of the result image voxel significantly the Rt Dose Output Data Type Selector determines in which way the output voxel type is adopted if the input voxel type is not appropriate for the output voxel values any more.

Rt Dose Output Data Type Selector

name: rtDoseOutputDataTypeSelector, type: Enum, default: Automatic

The Rt Dose Output Data Type Selector determines how the output image voxel type is adjusted to the possibly changed min/max range of the image. Note that the min/max range of the output image is always adjusted independently of the used or determined output voxel type. The modes MLuint8, MLint8, MLuint16, MLint16, MLuint32, MLint32, MLuint64, MLint64, or MLfloat set the same named voxel type for the output image. The NoOperation mode simply bypasses the input voxel type to the output. All these modes set the output type regardless of the range of the output image which therefore may lead to wrong voxel values if any processing result do not fit into the type. The mode MLdouble will be able to hold all ranges safely, however, it might be larger type than needed for most applications. Usually the Automatic mode is recommended, because it safely determines the smallest output voxel type which can always store the results without information loss.

Apply Rescale

name: applyRescale, type: Bool, default: TRUE

If Apply Rescale is enabled and the tags Rescale Slope and/or Rescale Intercept are available, then the image data is scaled with this tag value of Rescale Slope and shifted(added) with by Rescale Intercept afterwards. If the tag(s) are available specifically for a frame then each tag affects only the corresponding slice in the volume. Otherwise - if they are only available as common tags - they affects the entire volume. The frame specific tags are used with priority if both is available. Since this scaling may affect the range of the result image voxel significantly the Rescale Output Data Type Selector determines in which way the output voxel type is adopted if the input voxel type is not appropriate for the output voxel values any more.

Rescale Output Data Type Selector

name: rescaleOutputDataTypeSelector, type: Enum, default: Automatic

The Rescale Output Data Type Selector enumerator determines how the output image voxel type is adjusted to the possibly changed min/max range of the image. The min/max range of the output image is always adjusted regardless of the used or determined output voxel type. For details about the modes see Rt Dose Output Data Type Selector and its values.

Adapt Tags

name: adaptTags, type: Bool, default: TRUE

If Adapt Tags is disabled then the input DICOM tags will be passed unchanged to the output image; if it is enabled then any change which has been applied to the image or the image properties will also lead to the change of the corresponding DICOM tags such that the output DICOM tree remains consistent with the output image. The following changes will be performed:

  • Applied Palette Information tags -> PhotometricInterpretation will be set to RGB after converting the palette index data to RGB image data.
  • Applied MONOCHROME1 PhotometricInterpretation tag -> PhotometricInterpretation will be set to MONOCHROME2 after inverting the image data.
  • Applied YBR_FULL PhotometricInterpretation tag -> PhotometricInterpretation will be set to RGB after converting YBR_FULL image data to RGB image data.
  • Applied DoseGridScaling tags -> DoseGridScaling tags will be set to 1 after scaling the image data with it.
  • Applied RescaleIntercept and RescaleSlope tags -> RescaleIntercept tags will be set to 0 and RescaleSlope to 1 after scaling the image data with the slope and adding the intercept.