@ALDAOperator(genericExecutionMode=ALL, level=APPLICATION) public class GrayscaleImageToHeatmap extends MTBOperator
The given minimal value is mapped to the range minimum color, the given
maximal value to the range maximum color. All gray values in between are
mapped by linear interpolation between both colors.
Values which are smaller than the range minimum or larger than the maximum
are by default mapped to the minimal and maximal colors, respectively.
If they should be handled differently this can be configured using
outOfRangeValueMode
.
Modifier and Type | Class and Description |
---|---|
static class |
GrayscaleImageToHeatmap.OperationMode
Operation mode of the operator.
|
static class |
GrayscaleImageToHeatmap.OutOfRangeValuesHandlingMode
Available modes how to handle values out of range.
|
Modifier and Type | Field and Description |
---|---|
private static String |
classID
Class identifier.
|
protected MTBImageByte |
ignoreMask
Optional binary mask of additional pixels to ignore.
|
private de.unihalle.informatik.Alida.datatypes.ALDDirectoryString |
inDir
Input directory.
|
protected MTBImage |
inputImg
Input image.
|
protected Color |
maxColor
Color for maximal value.
|
protected Color |
minColor
Color for minimal value.
|
GrayscaleImageToHeatmap.OperationMode |
opMode
Mode of operation of the operator.
|
protected GrayscaleImageToHeatmap.OutOfRangeValuesHandlingMode |
outOfRangeValueMode
Mode how to handle values out of range and masked pixels.
|
protected double |
rangeMax
Maximum value of mapping range, will be mapped to second color.
|
protected double |
rangeMin
Minimum value of mapping range, will be mapped to first color.
|
private MTBImageRGB |
resultImg
Generated result image.
|
Constructor and Description |
---|
GrayscaleImageToHeatmap()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
MTBImageRGB |
getHeatmapImage()
Returns the result color heat map.
|
protected void |
operate()
This method does the actual work.
|
protected MTBImageRGB |
processImage(MTBImage img,
double rmin,
double rmax)
Convert a single image to a heatmap.
|
void |
setColorRangeMaximum(Color c)
Color for range maximum.
|
void |
setColorRangeMinimum(Color c)
Color for range minimum.
|
void |
setIgnoreMask(MTBImageByte bImg)
Specfiy additional mask of pixels to ignore.
|
void |
setInputImage(MTBImage inimg)
Set input image.
|
void |
setOutOfRangeValueHandlingMode(GrayscaleImageToHeatmap.OutOfRangeValuesHandlingMode m)
Specify how to handle values out of range.
|
void |
setRangeMaximum(double maxval)
Specify maximum of heat map range.
|
void |
setRangeMinimum(double minval)
Specify minimum of heat map range.
|
private void |
switchOpModeParameters()
Callback routine to change operator mode parameters.
|
void |
validateCustom() |
readResolve
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory
private static final String classID
@Parameter(label="Operation Mode", required=true, direction=IN, dataIOOrder=-5, description="Operation mode of the operator.", callback="switchOpModeParameters", paramModificationMode=MODIFIES_INTERFACE) public GrayscaleImageToHeatmap.OperationMode opMode
@Parameter(label="Input Image", required=true, dataIOOrder=1, direction=IN, description="Input image.") protected MTBImage inputImg
@Parameter(label="Input Directory", required=true, direction=IN, description="Input directory.", dataIOOrder=1) private de.unihalle.informatik.Alida.datatypes.ALDDirectoryString inDir
@Parameter(label="Range Minimum", required=true, dataIOOrder=2, direction=IN, description="Minimum value to map, if NaN minimum image value is used.") protected double rangeMin
@Parameter(label="Color of Range Minimum", required=true, dataIOOrder=3, direction=IN, description="Color of small values.") protected Color minColor
@Parameter(label="Range Maximum", required=true, dataIOOrder=4, direction=IN, description="Maximum value to map, if NaN maximum image value is used.") protected double rangeMax
@Parameter(label="Color of Range Maximum", required=true, dataIOOrder=5, direction=IN, description="Color of large values.") protected Color maxColor
@Parameter(label="How to handle values out of range?", required=true, dataIOOrder=6, direction=IN, description="Mode how values out of range are treated.") protected GrayscaleImageToHeatmap.OutOfRangeValuesHandlingMode outOfRangeValueMode
@Parameter(label="Ignore mask?", required=false, dataIOOrder=1, direction=IN, description="Ignore mask, pixels with values > 0 are ignored.") protected MTBImageByte ignoreMask
Pixels marked white are ignored, i.e. mapped to black or left untouched.
@Parameter(label="Result Image", dataIOOrder=0, direction=OUT, description="Resulting RGB image.") private transient MTBImageRGB resultImg
public GrayscaleImageToHeatmap() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.private void switchOpModeParameters()
public MTBImageRGB getHeatmapImage()
public void setInputImage(MTBImage inimg)
inimg
- Input grayscale image.public void setRangeMinimum(double minval)
minval
- Range minimum.public void setColorRangeMinimum(Color c)
c
- Color to use.public void setRangeMaximum(double maxval)
maxval
- Range maximum.public void setColorRangeMaximum(Color c)
c
- Color to use.public void setOutOfRangeValueHandlingMode(GrayscaleImageToHeatmap.OutOfRangeValuesHandlingMode m)
m
- Handling mode.public void setIgnoreMask(MTBImageByte bImg)
bImg
- Binary mask.public void validateCustom() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
- Thrown in case of failure.protected MTBImageRGB processImage(MTBImage img, double rmin, double rmax)
img
- Image to convert.rmin
- Minimum range value to map on minimum color.rmax
- Maximum range value to map on maximum color.Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.