de.unihalle.informatik.MiToBo.segmentation.regions.labeling
Class LabelComponentsSequential

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperator
          extended by de.unihalle.informatik.MiToBo.segmentation.regions.labeling.LabelComponentsSequential
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator, de.unihalle.informatik.Alida.operator.events.ALDOperatorExecutionProgressEventListener, EventListener

@ALDAOperator(genericExecutionMode=ALL,
              level=STANDARD)
public class LabelComponentsSequential
extends MTBOperator

Sequential component labeling for binarized 2D images to find connected components. Foreground pixels are assumed to have a value > 0, all pixels with value <= 0 are assumed to be background. Algorithm:
W. Burger and M. Burge, Digital image processing: an algorithmic introduction using Java, 2008, Springer-Verlag New York Inc

Author:
gress

Nested Class Summary
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider
 
Constructor Summary
LabelComponentsSequential()
          Constructor
LabelComponentsSequential(MTBImage img, boolean diagonalNeighbors)
          Constructor
 
Method Summary
 MTBImage getColorImage()
          Get image of randomly colored regions, if the create-color-image-flag was set to true.
 boolean getCreateColorImageFlag()
          Get the flag that determines the creation of an image with randomly colored regions.
 boolean getCreateLabelImageFlag()
          Get the flag that determines the creation of an image with region labels.
 boolean getDiagonalNeighborsFlag()
          Get the neighborhood flag.
 MTBImage getInputImage()
          Get reference to the current input image.
 MTBImage getLabelImage()
          Get image of region labels (of type MTB_INT), if the create-label-image-flag was set to true.
 MTBRegion2DSet getResultingRegions()
          Get the resulting regions.
protected  MTBRegion2DSet labelComponents(MTBImage img, boolean diagonalNeighbors)
          Sequential component labeling
protected  void operate()
           
protected  void setColorImage(MTBImage colorImage)
          Add the label image to the parameter object
 void setCreateColorImageFlag(boolean createColorImage)
          Set the flag that determines the creation of an image with randomly colored regions.
 void setCreateLabelImageFlag(boolean createLabelImage)
          Set the flag that determines the creation of an image with region labels.
 void setDiagonalNeighborsFlag(boolean diagonalNeighbors)
          Set the neighborhood flag.
 void setInputImage(MTBImage inputImage)
          Set a new input image.
protected  void setLabelImage(MTBImage labelImage)
          Set image of region labels
protected  void setResultingRegions(MTBRegion2DSet regions)
          Attach the vector of resulting regions.
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator
readResolve
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
addOperatorExecutionProgressEventListener, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getHidingMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, runOp, runOp, runOp, setConstructionMode, setHidingMode, setName, setParameter, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelComponentsSequential

public LabelComponentsSequential()
                          throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

LabelComponentsSequential

public LabelComponentsSequential(MTBImage img,
                                 boolean diagonalNeighbors)
                          throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor

Parameters:
img - input image
diagonalNeighbors - set true for 8-neighborhood or false for 4-neighborhood
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

getInputImage

public MTBImage getInputImage()
Get reference to the current input image.

Returns:
Input image to work on.

setInputImage

public void setInputImage(MTBImage inputImage)
Set a new input image.


getDiagonalNeighborsFlag

public boolean getDiagonalNeighborsFlag()
Get the neighborhood flag.

Returns:
true if 8-neighborhood is used, false if 4-neighborhood is used

setDiagonalNeighborsFlag

public void setDiagonalNeighborsFlag(boolean diagonalNeighbors)
Set the neighborhood flag.

Parameters:
diagonalNeighbors - set true for 8-neighborhood and false for 4-neighborhood

getCreateLabelImageFlag

public boolean getCreateLabelImageFlag()
Get the flag that determines the creation of an image with region labels.


setCreateLabelImageFlag

public void setCreateLabelImageFlag(boolean createLabelImage)
Set the flag that determines the creation of an image with region labels.


getCreateColorImageFlag

public boolean getCreateColorImageFlag()
Get the flag that determines the creation of an image with randomly colored regions.


setCreateColorImageFlag

public void setCreateColorImageFlag(boolean createColorImage)
Set the flag that determines the creation of an image with randomly colored regions.


setResultingRegions

protected void setResultingRegions(MTBRegion2DSet regions)
Attach the vector of resulting regions.


getResultingRegions

public MTBRegion2DSet getResultingRegions()
Get the resulting regions.


setLabelImage

protected void setLabelImage(MTBImage labelImage)
Set image of region labels


getLabelImage

public MTBImage getLabelImage()
Get image of region labels (of type MTB_INT), if the create-label-image-flag was set to true. Otherwise returns null.


setColorImage

protected void setColorImage(MTBImage colorImage)
Add the label image to the parameter object


getColorImage

public MTBImage getColorImage()
Get image of randomly colored regions, if the create-color-image-flag was set to true. Otherwise returns null.


operate

protected 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

labelComponents

protected MTBRegion2DSet labelComponents(MTBImage img,
                                         boolean diagonalNeighbors)
Sequential component labeling

Parameters:
img - (binary) input image
diagonalNeighbors - set true for 8-neighborhood components, set false for 4-neighborhood
Returns:
returns a vector of regions


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.