|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.MiToBo.core.operator.MTBOperator
de.unihalle.informatik.MiToBo.tools.image.ImageValueTools
@ALDAOperator(genericExecutionMode=NONE) public class ImageValueTools
An operator class for different simple operations on the values of an image like inversion, filling with a constant value, etc.
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)
Nested Class Summary | |
---|---|
static class |
ImageValueTools.ImageValueModification
Available image value modification methods. |
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode |
Field Summary | |
---|---|
private double |
fromMaxVal
|
private double |
fromMinVal
|
private java.lang.Double |
grayValue
|
private MTBImage |
inputImage
|
private double |
lowerBound
|
private ImageValueTools.ImageValueModification |
modificationMode
|
private MTBImage |
resultImage
|
private java.awt.Color |
rgbValue
|
private double |
upperBound
|
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
completeDAG, name, portHashAccess, verbose, versionProvider |
Constructor Summary | |
---|---|
|
ImageValueTools()
|
protected |
ImageValueTools(MTBImage img)
Constructor. |
Method Summary | |
---|---|
protected void |
fill(MTBImage img,
java.awt.Color rgbvalue)
|
protected void |
fill(MTBImage img,
double grayvalue)
|
static void |
fillImage(MTBImage img,
java.awt.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 java.lang.Double |
getGrayValue()
|
MTBImage |
getInputImage()
|
protected double |
getLowerBound()
Get lower bound of the normalization to range [lowerBound, upperBound]. |
protected ImageValueTools.ImageValueModification |
getModification()
|
MTBImage |
getResultImage()
|
protected java.awt.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(java.awt.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()
|
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator |
---|
readResolve |
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, isConfigured, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Parameter(label="fromMaxVal", required=false, direction=IN, mode=STANDARD, dataIOOrder=8, description="Floating point reference maximum image value") private double fromMaxVal
@Parameter(label="fromMinVal", required=false, direction=IN, mode=STANDARD, dataIOOrder=7, description="Floating point reference minimum image value") private double fromMinVal
@Parameter(label="grayValue", required=false, direction=IN, mode=STANDARD, dataIOOrder=4, description="Floating point value to fill the image") private java.lang.Double grayValue
@Parameter(label="inputImage", required=true, direction=IN, mode=STANDARD, dataIOOrder=1, description="Input image") private MTBImage inputImage
@Parameter(label="lowerBound", required=false, direction=IN, mode=STANDARD, dataIOOrder=5, description="Floating point value for lower normalization bound") private double lowerBound
@Parameter(label="modificationMode", required=true, direction=IN, mode=STANDARD, dataIOOrder=2, description="Image value modification mode") private ImageValueTools.ImageValueModification modificationMode
@Parameter(label="resultImage", required=true, direction=OUT, mode=STANDARD, dataIOOrder=1, description="Result image") private MTBImage resultImage
@Parameter(label="rgbValue", required=false, direction=IN, mode=STANDARD, dataIOOrder=3, description="RGB color value to fill the image") private java.awt.Color rgbValue
@Parameter(label="upperBound", required=false, direction=IN, mode=STANDARD, dataIOOrder=6, description="Floating point value for upper normalization bound") private double upperBound
Constructor Detail |
---|
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
Method Detail |
---|
protected void fill(MTBImage img, java.awt.Color rgbvalue)
protected void fill(MTBImage img, double grayvalue)
public static void fillImage(MTBImage img, java.awt.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 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
protected java.lang.Double getGrayValue()
public MTBImage getInputImage()
protected double getLowerBound()
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected ImageValueTools.ImageValueModification getModification()
public MTBImage getResultImage()
protected java.awt.Color getRGBValue()
protected double getUpperBound()
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected void invert(MTBImage img)
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
protected void normFromTo(MTBImage img)
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 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
protected void normTo(MTBImage img, double lowerBound, double upperBound)
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 void setFill(java.awt.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 setInputImage(MTBImage _inputImage)
public void setInvert()
public void setModification(ImageValueTools.ImageValueModification mod)
public void setNormFromTo(double minVal, double maxVal, double minVal_new, double maxVal_new)
public void setNormTo(double _lowerBound, double _upperBound) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
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
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |