@ALDAOperator(genericExecutionMode=ALL, level=STANDARD, allowBatchMode=true) public class ImageContrastReducer extends MTBOperator
This operator performs a reduction of the contrast in an image by reducing the number of gray-scale values to, e.g., 4-bit or 2-bit. Different modes for choosing the gray values in the result image are available. Currently only byte and short gray-scale images are handled, passing color images or images of another type to the operator results in an error.
Note that the result image always shares the type of the input image, irrespective of the actual number of bits used for representing the values. In addition, it is not guaranteed that the whole range of available gray values is used.
Modifier and Type | Class and Description |
---|---|
static class |
ImageContrastReducer.ResultValueMode
Modes for choosing result values.
|
static class |
ImageContrastReducer.TargetContrast
Available target contrast modes.
|
Modifier and Type | Field and Description |
---|---|
protected MTBImage |
inImg
Input image.
|
protected MTBImage |
resultImg
Result image.
|
protected ImageContrastReducer.ResultValueMode |
resultValueMode
Result value mode.
|
protected ImageContrastReducer.TargetContrast |
targetContrast
Target contrast of result image.
|
Constructor and Description |
---|
ImageContrastReducer()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
MTBImage |
getInImg()
Get input image.
|
MTBImage |
getResultImg()
Get result image.
|
protected void |
operate() |
void |
setInImg(MTBImage img)
Set input image.
|
void |
setResultValueSelectionMode(ImageContrastReducer.ResultValueMode vsm)
Set value selection mode.
|
void |
setTargetContrast(ImageContrastReducer.TargetContrast tc)
Set target contrast.
|
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="Input Image", required=true, direction=IN, mode=STANDARD, dataIOOrder=0, description="Input image to transform.") protected MTBImage inImg
@Parameter(label="Target Contrast", required=true, direction=IN, mode=STANDARD, dataIOOrder=1, description="Target contrast, i.e., number of bits.") protected ImageContrastReducer.TargetContrast targetContrast
@Parameter(label="Result Value Mode", required=true, direction=IN, mode=STANDARD, dataIOOrder=2, description="Mode for selecting the result values.") protected ImageContrastReducer.ResultValueMode resultValueMode
@Parameter(label="Result Image", required=true, direction=OUT, mode=STANDARD, dataIOOrder=0, description="Result image.") protected MTBImage resultImg
public ImageContrastReducer() 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
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setInImg(MTBImage img)
img
- Input image to process.public MTBImage getInImg()
public void setTargetContrast(ImageContrastReducer.TargetContrast tc)
tc
- Target contrast.public void setResultValueSelectionMode(ImageContrastReducer.ResultValueMode vsm)
vsm
- Mode for selecting result values.public MTBImage getResultImg()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.