@ALDAOperator(genericExecutionMode=ALL,
level=STANDARD,
allowBatchMode=true,
shortDescription="Enhances the contrast by top-hat operations.")
public class TopHatContrastEnhancement
extends MTBOperator
This class enhances the contrast by top-hat operations, especially for gray
value bright filed or DIC images. A white top-hat is added to the original
image (enhance bright objects) and subsequent a black top-hat is subtracted
(enhance dark objects).
This approach works well for DIC images, maybe also for bright field or other
illumination/contrast based images. Mask size of the structuring element
should be small to preserve small structures, like neurites.
NOTE: maybe the result image must be re-scaled, since output gray values can
fall outside the dynamic range of the input image!
Feel free to extend this class!
The approach is adapted from:
author = {Soille, Pierre},
title = {Morphological Image Analysis: Principles
and Applications},
year = {2010},
isbn = {9783642076961},
edition = {2},
pages = {126 -- 127},
publisher = {Springer Berlin Heidelberg}.| Modifier and Type | Field and Description |
|---|---|
private MTBImage |
bthImage
Black top-hat image.
|
private Integer |
bthMaskSize |
private MTBImage |
inputImage |
private MTBImage |
outputImage |
private MTBImage |
wthImage
White top-hat image.
|
private Integer |
wthMaskSize |
| Constructor and Description |
|---|
TopHatContrastEnhancement()
Standard constructor.
|
TopHatContrastEnhancement(MTBImageByte _inputImage,
Integer _wthMaskSize,
Integer _bthMaskSize)
Constructor to create a new IlluminationCorrection object.
|
| Modifier and Type | Method and Description |
|---|---|
private MTBImage |
add(MTBImage img1,
MTBImage img2)
Method to add two images.
|
MTBImage |
getBthImage()
Get black top-hat image.
|
Integer |
getBthMaskSize()
Get mask size of black top-hat.
|
String |
getDocumentation() |
MTBImage |
getInputImage()
Get low contrast input image.
|
MTBImage |
getResultImage()
Get contrast enhanced result image.
|
MTBImage |
getWthImage()
Get white top-hat image.
|
Integer |
getWthMaskSize()
Get mask size of white top-hat.
|
protected void |
operate() |
void |
setBthMaskSize(Integer _bthMaskSize)
Set mask size of black top-hat.
|
void |
setInputImage(MTBImage _inputImage)
Set low contrast input image.
|
void |
setWthMaskSize(Integer _wthMaskSize)
Set mask size of white top-hat.
|
private MTBImage |
sub(MTBImage img1,
MTBImage img2)
Method to sub two images.
|
readResolveaddOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, 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, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory@Parameter(label="Input Image",
required=true,
direction=IN,
description="Low contrast input image.",
mode=STANDARD,
dataIOOrder=0)
private transient MTBImage inputImage
@Parameter(label="WTH Mask Size",
required=true,
direction=IN,
description="Mask size of white top-hat.",
mode=STANDARD,
dataIOOrder=1)
private Integer wthMaskSize
@Parameter(label="BTH Mask Size",
required=true,
direction=IN,
description="Mask size of black top-hat.",
mode=STANDARD,
dataIOOrder=2)
private Integer bthMaskSize
@Parameter(label="Output Image",
required=true,
direction=OUT,
description="Contrast enhanced output image.")
private transient MTBImage outputImage
private MTBImage wthImage
private MTBImage bthImage
public TopHatContrastEnhancement()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic TopHatContrastEnhancement(MTBImageByte _inputImage, Integer _wthMaskSize, Integer _bthMaskSize) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
image - uneven illuminated input image_wthMaskSize - mask size of white top-hat_bthMaskSize - mask size of black top-hatde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic MTBImage getInputImage()
public void setInputImage(MTBImage _inputImage)
public Integer getWthMaskSize()
public void setWthMaskSize(Integer _wthMaskSize)
public Integer getBthMaskSize()
public void setBthMaskSize(Integer _bthMaskSize)
public MTBImage getWthImage()
public MTBImage getBthImage()
public MTBImage getResultImage()
protected void operate()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate in class de.unihalle.informatik.Alida.operator.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionde.unihalle.informatik.Alida.exceptions.ALDProcessingDAGExceptionprivate MTBImage add(MTBImage img1, MTBImage img2)
ImageArithmetics.private MTBImage sub(MTBImage img1, MTBImage img2)
ImageArithmetics.public String getDocumentation()
getDocumentation in class de.unihalle.informatik.Alida.operator.ALDOperatorCopyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.