de.unihalle.informatik.MiToBo.morphology
Class BasicMorphology
java.lang.Object
de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.MiToBo.core.operator.MTBOperator
de.unihalle.informatik.MiToBo.morphology.BasicMorphology
- All Implemented Interfaces:
- de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator
@ALDAOperator(genericExecutionMode=SWING,
level=APPLICATION)
public class BasicMorphology
- extends MTBOperator
class implementing basic morphological operations (for use with grayscale as well as with binary images)
- Author:
- glass
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode |
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
completeDAG, name, portHashAccess, verbose, versionProvider |
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 |
inImg
@Parameter(label="input image",
required=true,
direction=IN,
supplemental=false,
description="input image")
private transient MTBImage inImg
mask
private MTBStructuringElement mask
maskCenterX
private int maskCenterX
maskCenterY
private int maskCenterY
maskSize
@Parameter(label="mask size",
required=false,
direction=IN,
supplemental=false,
description="side length of structuring element")
private java.lang.Integer maskSize
maskSizeX
private int maskSizeX
maskSizeY
private int maskSizeY
mode
@Parameter(label="mode",
required=false,
direction=IN,
supplemental=false,
description="type of operation")
private BasicMorphology.opMode mode
resultImg
@Parameter(label="result image",
required=true,
direction=OUT,
supplemental=false,
description="resulting image")
private transient MTBImage resultImg
shape
@Parameter(label="mask shape",
required=false,
direction=IN,
supplemental=false,
description="shape of structuring element")
private BasicMorphology.maskShape shape
sizeT
private int sizeT
sizeX
private int sizeX
sizeY
private int sizeY
BasicMorphology
public BasicMorphology()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
BasicMorphology
public BasicMorphology(MTBImage inImg,
MTBStructuringElement mask)
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Parameters:
inImg
- input imagemask
- structuring element used for the morphological operation
- Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
blackTophat
private MTBImage blackTophat(MTBImage img)
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- calculates the black tophat transform, i.e. difference of the closing of the image and the image
(also called closing tophat)
- Parameters:
img
-
- Returns:
- black tophat processed image
- Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
close
private MTBImage close(MTBImage img)
- Parameters:
img
-
- Returns:
- closed image
dilate
private MTBImage dilate(MTBImage img)
- Parameters:
img
-
- Returns:
- dilated image
erode
private MTBImage erode(MTBImage img)
- Parameters:
img
-
- Returns:
- eroded image
generateStructuringElement
private MTBStructuringElement generateStructuringElement()
- Returns:
- structuring element used for the morphological operation
getResultImage
public MTBImage getResultImage()
- Returns:
- result image
morphGradient
private MTBImage morphGradient(MTBImage img)
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Parameters:
img
-
- Returns:
- morphological gradient, i.e. difference of dilation and erosion of
input image
- Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
open
private MTBImage open(MTBImage img)
- Parameters:
img
-
- Returns:
- opened image
operate
public void operate()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
- Specified by:
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
- Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
setMask
public void setMask(BasicMorphology.maskShape shape,
int size)
setMask
public void setMask(MTBStructuringElement mask)
- Parameters:
mask
- structuring element to use
setMode
public void setMode(BasicMorphology.opMode mode)
- Parameters:
mode
- morphological operation to apply
whiteTophat
private MTBImage whiteTophat(MTBImage img)
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- calculates the white tophat transform, i.e. difference of image and the opening of the image
(also called opening tophat)
- Parameters:
img
-
- Returns:
- tophat processed image
- Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException