@ALDAOperator(genericExecutionMode=NONE) public class ImageValueTools extends MTBOperator
The policy here is to use static functions instead of constructing a new
object, set its parameters and then call runOp()
. Thus the
source code is reduced as the functions of this class are assumed to be
called quite often.
This class is meant to implement convenience functions on images to keep the image classes from bloating. Feel free to extend this class with your convenience functions. Please implement static methods for any functionality to keep the policy of this class. Be aware that the input image is changed, i.e. the input image is also the result image. (You don't need to get the result image, if you still have a reference to the input image, but this method is implemented for completeness)
Modifier and Type | Class and Description |
---|---|
static class |
ImageValueTools.ImageValueModification
Available image value modification methods.
|
Modifier and Type | Field and Description |
---|---|
private double |
fromMaxVal |
private double |
fromMinVal |
private Double |
grayValue |
private MTBImage |
inputImage |
private double |
lowerBound |
private ImageValueTools.ImageValueModification |
modificationMode |
private MTBImage |
resultImage |
private Color |
rgbValue |
private double |
upperBound |
Modifier | Constructor and Description |
---|---|
|
ImageValueTools() |
protected |
ImageValueTools(MTBImage img)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
fill(MTBImage img,
Color rgbvalue) |
protected void |
fill(MTBImage img,
double grayvalue) |
static void |
fillImage(MTBImage img,
Color rgbvalue,
MTBOperator callingOperator)
Fill the image with a RGB color value.
|
static void |
fillImage(MTBImage img,
double grayvalue,
MTBOperator callingOperator)
Fill the specified image with a gray value.
|
protected Double |
getGrayValue() |
MTBImage |
getInputImage() |
protected double |
getLowerBound()
Get lower bound of the normalization to range [lowerBound, upperBound].
|
protected ImageValueTools.ImageValueModification |
getModification() |
MTBImage |
getResultImage() |
protected Color |
getRGBValue() |
protected double |
getUpperBound()
Get upper bound of the normalization to range [lowerBound, upperBound].
|
protected void |
invert(MTBImage img) |
static void |
invertImage(MTBImage img,
MTBOperator callingOperator)
Invert the specified image.
|
protected void |
normFromTo(MTBImage img) |
static void |
normImageFromTo(MTBImage img,
double oldMinVal,
double oldMaxVal,
double newMinVal,
double newMaxVal,
MTBOperator callingOperator)
Normalize the image values to range [lowerBound, upperBound].
|
static void |
normImageTo(MTBImage img,
double lowerBound,
double upperBound,
MTBOperator callingOperator)
Normalize the image values to range [lowerBound, upperBound].
|
protected void |
normTo(MTBImage img,
double lowerBound,
double upperBound) |
protected void |
operate() |
void |
setFill(Color _rgbValue) |
void |
setFill(double _grayValue) |
void |
setInputImage(MTBImage _inputImage) |
void |
setInvert() |
void |
setModification(ImageValueTools.ImageValueModification mod) |
void |
setNormFromTo(double minVal,
double maxVal,
double minVal_new,
double maxVal_new) |
void |
setNormTo(double _lowerBound,
double _upperBound) |
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
@Parameter(label="inputImage", required=true, direction=IN, mode=STANDARD, dataIOOrder=1, description="Input image") private MTBImage inputImage
@Parameter(label="resultImage", required=true, direction=OUT, mode=STANDARD, dataIOOrder=1, description="Result image") private MTBImage resultImage
@Parameter(label="modificationMode", required=true, direction=IN, mode=STANDARD, dataIOOrder=2, description="Image value modification mode") private ImageValueTools.ImageValueModification modificationMode
@Parameter(label="rgbValue", required=false, direction=IN, mode=STANDARD, dataIOOrder=3, description="RGB color value to fill the image") private Color rgbValue
@Parameter(label="grayValue", required=false, direction=IN, mode=STANDARD, dataIOOrder=4, description="Floating point value to fill the image") private Double grayValue
@Parameter(label="lowerBound", required=false, direction=IN, mode=STANDARD, dataIOOrder=5, description="Floating point value for lower normalization bound") private double lowerBound
@Parameter(label="upperBound", required=false, direction=IN, mode=STANDARD, dataIOOrder=6, description="Floating point value for upper normalization bound") private double upperBound
@Parameter(label="fromMinVal", required=false, direction=IN, mode=STANDARD, dataIOOrder=7, description="Floating point reference minimum image value") private double fromMinVal
@Parameter(label="fromMaxVal", required=false, direction=IN, mode=STANDARD, dataIOOrder=8, description="Floating point reference maximum image value") private double fromMaxVal
public ImageValueTools() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected ImageValueTools(MTBImage img) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
img
- de.unihalle.informatik.Alida.exceptions.ALDOperatorException
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
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public static void invertImage(MTBImage img, MTBOperator callingOperator) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public static void fillImage(MTBImage img, double grayvalue, MTBOperator callingOperator) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
img
- grayvalue
- callingOperator
- de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public static void fillImage(MTBImage img, Color rgbvalue, MTBOperator callingOperator) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
img
- rgbvalue
- callingOperator
- de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public static void normImageTo(MTBImage img, double lowerBound, double upperBound, MTBOperator callingOperator) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public static void normImageFromTo(MTBImage img, double oldMinVal, double oldMaxVal, double newMinVal, double newMaxVal, MTBOperator callingOperator) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
img
- lowerBound
- upperBound
- de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public MTBImage getInputImage()
public void setInputImage(MTBImage _inputImage)
public MTBImage getResultImage()
public void setInvert()
public void setFill(Color _rgbValue) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setFill(double _grayValue) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setNormTo(double _lowerBound, double _upperBound) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setNormFromTo(double minVal, double maxVal, double minVal_new, double maxVal_new)
public void setModification(ImageValueTools.ImageValueModification mod)
protected ImageValueTools.ImageValueModification getModification()
protected Double getGrayValue()
protected Color getRGBValue()
protected double getLowerBound()
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected double getUpperBound()
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected void invert(MTBImage img)
protected void fill(MTBImage img, double grayvalue)
protected void normTo(MTBImage img, double lowerBound, double upperBound)
protected void normFromTo(MTBImage img)
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.