@ALDAOperator(genericExecutionMode=ALL,
level=APPLICATION)
public class GammaCorrection2D
extends MTBOperator
| Modifier and Type | Field and Description |
|---|---|
private Boolean |
auto |
private Integer |
channel |
private Double |
gamma |
private MTBImage |
inputImage |
private MTBImage |
resultImage |
| Constructor and Description |
|---|
GammaCorrection2D()
Standard constructor.
|
GammaCorrection2D(MTBImage inimg,
Double _gamma,
Integer _channel)
Constructor to create a new gamma correction 2D operator.
|
GammaCorrection2D(MTBImage inimg,
Integer _channel)
No gamma value is set.
|
| Modifier and Type | Method and Description |
|---|---|
private MTBImage |
correctGamma(MTBImage inputImg,
double gamma,
int channel)
Perform gamma correction to the specified channel of the input image, using
the given gamma value.
|
private MTBImage |
correctGammaAuto(MTBImage inputImg,
int channel)
Perform gamma correction to the specified channel of the input image.
|
Integer |
getChannel()
Get the image channel.
|
Double |
getGamma()
Get the gamma value.
|
boolean |
getGammaToAuto()
Get if gamma should be calculated automatically or not.
|
MTBImage |
getInputImage()
Get the input image.
|
MTBImage |
getResultImage()
Get the gamma corrected image.
|
protected void |
operate()
This method does the actual work.
|
void |
setChannel(Integer _channel)
Set the image channel.
|
void |
setGamma(Double _gamma)
Set the gamma value.
|
void |
setGammaToAuto(boolean a)
Set if gamma should be calculated automatically or not.
|
void |
setInputImage(MTBImage inImg)
Set the input image.
|
private void |
useAutoGamma()
Callback routine to change parameters.
|
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, writeHistory@Parameter(label="Input Image",
required=true,
direction=IN,
description="Input image",
mode=STANDARD,
dataIOOrder=0)
private transient MTBImage inputImage
@Parameter(label="Gamma Value",
required=false,
direction=INOUT,
description="Gamma value.",
mode=STANDARD,
dataIOOrder=1)
private Double gamma
@Parameter(label="Image Channel",
required=true,
direction=IN,
description="Channel of image.",
mode=STANDARD,
dataIOOrder=2)
private Integer channel
@Parameter(label="Auto Gamma",
required=false,
direction=IN,
description="Automatic gamma value computation.",
mode=STANDARD,
callback="useAutoGamma",
paramModificationMode=MODIFIES_INTERFACE,
dataIOOrder=3)
private Boolean auto
@Parameter(label="Result Image",
direction=OUT,
description="Gamma corrected image.")
private transient MTBImage resultImage
public GammaCorrection2D()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic GammaCorrection2D(MTBImage inimg, Double _gamma, Integer _channel) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
inimg - 2D input image for gamma correction_gamma - gamma value to apply gamma correction_channel - image channel to apply gamma correction, starts with 1de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic GammaCorrection2D(MTBImage inimg, Integer _channel) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
gamma = log(r/maxInt)/ log(mean/maxInt)
maxInt is the maximum pixel intensity for all pixels in the image, for example 65535 for a 16-Bit pixel image
mean is the mean value over all image pixels
r is the half value of the pixel intensity range (32768 for 16-bit image)
inimg - 2D input image for gamma correction_channel - image channel to apply gamma correctionde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic void validateCustom()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom in class de.unihalle.informatik.Alida.operator.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionprivate void useAutoGamma()
public MTBImage getInputImage()
public void setInputImage(MTBImage inImg)
public Double getGamma()
public void setGamma(Double _gamma)
public Integer getChannel()
public void setChannel(Integer _channel)
public MTBImage getResultImage()
public void setGammaToAuto(boolean a)
public boolean getGammaToAuto()
protected void operate()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
operate in class de.unihalle.informatik.Alida.operator.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDProcessingDAGExceptionde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionprivate MTBImage correctGamma(MTBImage inputImg, double gamma, int channel)
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.