|
||||||||
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.segmentation.thresholds.ImgThresh
@ALDAOperator(genericExecutionMode=ALL, level=STANDARD) public class ImgThresh
Image thresholding class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode |
Field Summary | |
---|---|
private boolean |
actualSliceOnly
|
private double |
bgValue
|
private MTBImage |
destinationImage
|
private double |
fgValue
|
private MTBImage |
inputImage
|
private MTBImage |
resultImage
|
private MTBDoubleData |
threshold
|
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
completeDAG, name, portHashAccess, verbose, versionProvider |
Constructor Summary | |
---|---|
ImgThresh()
|
|
ImgThresh(MTBImage img,
double thres)
Constructor for thresholding using 255 as foreground and 0 as background value. |
|
ImgThresh(MTBImage img,
double thres,
double fg,
double bg)
Constructor for thresholding using 'fgValue' as foreground and 'bgValue' as background value. |
Method Summary | |
---|---|
boolean |
getActualSliceOnly()
Get flag for thresholding only the actual slice (true) or the whole image (false) |
double |
getBGValue()
Get background value |
MTBImage |
getDestinationImage()
Get value of Input argument DestinationImage. |
double |
getFGValue()
Get foreground value |
MTBImage |
getInputImage()
Get input image |
MTBImage |
getResultImage()
Get the result image |
java.lang.Double |
getThreshold()
Get threshold. |
boolean |
isBGOriginalValue()
Test if background pixels keep their original pixel values |
boolean |
isFGOriginalValue()
Test if foreground pixels keep their original pixel values |
protected void |
operate()
|
void |
setActualSliceOnly()
Only actual slice is thresholded, this will force the output image type to be of the same type as the input image (or destination image type) |
void |
setBGOriginalValue()
Tell the thresholder to use the original pixel value for background pixels |
void |
setBGValue(double value)
Set value of Parameter argument BGValue. |
void |
setDestinationImage(MTBImage img)
Set value of Input argument DestinationImage. |
void |
setFGOriginalValue()
Tell the thresholder to use the original pixel value for foreground pixels |
void |
setFGValue(double value)
Set value of Parameter argument FGValue. |
void |
setInputImage(MTBImage img)
Set input image |
protected void |
setResultImage(MTBImage img)
Set result image. |
void |
setThreshold(double thres)
Set threshold |
protected MTBImage |
threshold(MTBImage img,
double thresh,
double _fgValue,
double _bgValue,
boolean _actualSliceOnly)
Apply threshold to an MTBImage and create a new thresholded MTBImage. |
protected void |
threshold(MTBImage img,
MTBImage threshImg,
double thresh,
double fgValue,
double bgValue,
boolean actualSliceOnly)
Apply threshold to an MTBImage and write results to a destination MTBImage. |
void |
unsetActualSliceOnly()
The whole image is thresholded (default) |
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, validateCustom, 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="Current slice only", required=false, direction=IN, mode=STANDARD, dataIOOrder=5, description="Threshold only the current slice") private boolean actualSliceOnly
@Parameter(label="BG-value", required=true, direction=IN, mode=STANDARD, dataIOOrder=4, description="Gray value for pixels >= threshold (background pixels). If value is INFINITY then the original pixel values are used.") private double bgValue
@Parameter(label="Destination image", required=false, direction=IN, mode=STANDARD, dataIOOrder=6, description="Optional destination image to draw to. If ommited a new image is created.") private transient MTBImage destinationImage
@Parameter(label="FG-value", required=true, direction=IN, mode=STANDARD, dataIOOrder=3, description="Gray value for pixels >= threshold (foreground pixels). If value is INFINITY then the original pixel values are used.") private double fgValue
@Parameter(label="Input image", required=true, direction=IN, mode=STANDARD, dataIOOrder=1, description="Input image") private transient MTBImage inputImage
@Parameter(label="Result image", required=true, direction=OUT, mode=STANDARD, dataIOOrder=1, description="Result image") private transient MTBImage resultImage
@Parameter(label="Threshold", required=true, direction=IN, mode=STANDARD, dataIOOrder=2, description="Threshold") private MTBDoubleData threshold
Constructor Detail |
---|
public ImgThresh() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public ImgThresh(MTBImage img, double thres) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
img
- input imagethreshold
- values < threshold are set to 0, value >= threshold are set to 255
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public ImgThresh(MTBImage img, double thres, double fg, double bg) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
img
- input imagethres
- values < threshold are set to 'fgValue', value >= threshold are set to 'bgValue'fg
- foreground value (POSITIVE_INFINITY is interpreted as use original value)bg
- background value (POSITIVE_INFINITY is interpreted as use original value)
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail |
---|
public boolean getActualSliceOnly()
public double getBGValue()
public MTBImage getDestinationImage()
public double getFGValue()
public MTBImage getInputImage()
public MTBImage getResultImage()
public java.lang.Double getThreshold()
public boolean isBGOriginalValue()
public boolean isFGOriginalValue()
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 setActualSliceOnly()
public void setBGOriginalValue()
public void setBGValue(double value)
value
- New value for BGValuepublic void setDestinationImage(MTBImage img)
img
- destination imagepublic void setFGOriginalValue()
public void setFGValue(double value)
value
- New value for FGValuepublic void setInputImage(MTBImage img)
protected void setResultImage(MTBImage img)
img
- result imagepublic void setThreshold(double thres)
protected MTBImage threshold(MTBImage img, double thresh, double _fgValue, double _bgValue, boolean _actualSliceOnly)
img
- source MTBImagethresh
- ThresholdfgValue
- Foreground pixel value. If set to Double.POSITIVE_INFINITY, pixels higher than/equal to the threshold are set to their original values.bgValue
- Background pixel value. If set to Double.POSITIVE_INFINITY, pixels lower to the threshold are set to their original values.actualSliceOnly
- flag for only thresholding actual slice (true) or whole image (false)
protected void threshold(MTBImage img, MTBImage threshImg, double thresh, double fgValue, double bgValue, boolean actualSliceOnly) throws java.lang.IllegalArgumentException
img
- source MTBImagethreshImg
- destination image to write the thresholded result tothresh
- ThresholdfgValue
- Foreground pixel value. If set to Double.POSITIVE_INFINITY, pixels higher than/equal to the threshold are set to their original values.bgValue
- Background pixel value. If set to Double.POSITIVE_INFINITY, pixels lower to the threshold are set to their original values.actualSliceOnly
- flag for only thresholding actual slice (true) or whole image (false)
java.lang.IllegalArgumentException
public void unsetActualSliceOnly()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |