@ALDAOperator(genericExecutionMode=ALL,
level=APPLICATION,
allowBatchMode=false)
public class FeatureColorMapper
extends MTBOperator
The input images are assumed to be label images with the label corresponding
to an object ID in the given feature table file. The IDs are assumend to be
larger than zero.
For each image the range of feature values in the selected column of the
feature table is determined, and the values are linearly mapped to the color
range defined by the given minimal and maximal color.
Finally, each pixel an image with a value larger than zero gets the color
value corresponding to the color of its feature value as derived from the
feature value in the corresponding row of the feature table.
The minimal and maximal size threshold can be used to exclude too small or too large cells from mapping. The thresholds are always applied to the cell areas and sizes below the minimal or above the maximal threshold are ignored.
All images ending with the given suffix are considered as potential candidates to be matched to found table files. The default suffix "grayscale-result.tif" has been set to allow for maximmal compatibility with PaCeQuant. It is assumed that corresponding table and image files share the same file prefix, i.e., the operator seeks to find matching files by searching for the largest common prefix between table and image file name.
| Modifier and Type | Field and Description |
|---|---|
private static String |
classID
Class identifier.
|
private PaCeQuant_FeatureColorMapperInputData |
inData
Input data.
|
protected String |
inputImgSuffix
Input image suffix.
|
private int |
maxB
Blue color value [0,255] of color for maximal value in range.
|
protected Color |
maxColor
Color for maximal value.
|
private int |
maxG
Green color value [0,255] of color for maximal value in range.
|
private int |
maxR
Red color value [0,255] of color for maximal value in range.
|
protected double |
maxSizeValue
Maximal value threshold.
|
private int |
minB
Blue color value [0,255] of color for minimal value in range.
|
protected Color |
minColor
Color for minimal value.
|
private int |
minG
Green color value [0,255] of color for minimal value in range.
|
private int |
minR
Red color value [0,255] of color for minimal value in range.
|
protected double |
minSizeValue
Minimal size threshold.
|
| Constructor and Description |
|---|
FeatureColorMapper()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
operate()
This method does the actual work.
|
private void |
saveColorLegend(String subfolder,
MTBTableModel tm,
int col,
double[] vMins,
double[] vMaxs,
double[] ranges)
Function to generate and save color legends to sub-directories.
|
void |
setColorRangeMaximum(Color c)
Color for range maximum.
|
void |
setColorRangeMinimum(Color c)
Color for range minimum.
|
void |
setInputData(String indir,
int[] ids)
Set input data.
|
void |
validateCustom() |
readResolveaddOperatorExecutionProgressEventListener, 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, writeHistoryprivate static final String classID
@Parameter(label="Input Data",
required=true,
dataIOOrder=1,
direction=IN,
description="Input experiment directory and column selection, all sub-folders named \'results\' will be considered")
private PaCeQuant_FeatureColorMapperInputData inData
@Parameter(label="Input image suffix",
required=true,
dataIOOrder=2,
direction=IN,
description="Only images matching this suffix are processed.")
protected String inputImgSuffix
@Parameter(label="Color of Range Minimum",
required=true,
dataIOOrder=7,
direction=IN,
description="Color of small values.")
protected Color minColor
@Parameter(label="Color of Range Maximum",
required=true,
dataIOOrder=9,
direction=IN,
description="Color of large values.")
protected Color maxColor
@Parameter(label="Minimal size threshold",
required=true,
dataIOOrder=10,
direction=IN,
description="Values smaller than this one are ignored.")
protected double minSizeValue
@Parameter(label="Maximal size threshold",
required=true,
dataIOOrder=11,
direction=IN,
description="Values larger than this one are ignored.")
protected double maxSizeValue
private transient int minR
private transient int minG
private transient int minB
private transient int maxR
private transient int maxG
private transient int maxB
public FeatureColorMapper()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.public void setInputData(String indir, int[] ids)
indir - Input experiment folder.ids - Selected columns.public void setColorRangeMinimum(Color c)
c - Color to use.public void setColorRangeMaximum(Color c)
c - Color to use.public void validateCustom()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom in class de.unihalle.informatik.Alida.operator.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionprotected void operate()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate in class de.unihalle.informatik.Alida.operator.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException - Thrown in case of failure.private void saveColorLegend(String subfolder, MTBTableModel tm, int col, double[] vMins, double[] vMaxs, double[] ranges) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
subfolder - Folder where result feature maps are stored.tm - Table model with data (currently unused).col - Columns of data for which legend should be generated.vMins - Minimal values of data per column.vMaxs - Maximal values of data per column.ranges - Ranges of data per column.de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case that images cannot be generated/written.Copyright © 2010–2025 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.