de.unihalle.informatik.MiToBo.segmentation.contours.extraction
Class BordersOnLabeledComponents

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.contours.extraction.BordersOnLabeledComponents
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator, de.unihalle.informatik.Alida.operator.events.ALDOperatorExecutionProgressEventListener, EventListener

@ALDAOperator(genericExecutionMode=ALL,
              level=APPLICATION)
public class BordersOnLabeledComponents
extends MTBOperator

Class to extract borders from connected components.

Contrary to contours, for example extracted by the operator ContourOnLabeledComponents, the borders extracted by this operator contain unordered sets of pixels, i.e. the border elements are neither clockwise nor counter-clockwise sorted. The main advantage of this operator is that it is faster than the counterpart, and very often there is no need for ordered contours, but unordered contours are sufficient for the task at hand.

The operator allows to extract outer borders, inner borders or both. If only inner borders are to be extracted a border set is returned which contains empty outer dummy borders which contain the inner borders. This way the inner borders are grouped according to the regions they belong to. But, note that this behavior is different from the ContourOnLabeledComponents operator.

This operator takes a label image as input interpreting all pixels with values larger than zero as foreground pixels. Alternatively you can supply a region set. If both are given, the operator assumes that label image and region set are consistent.

Author:
moeller

Nested Class Summary
static class BordersOnLabeledComponents.BorderType
          Possible types of borders to be extracted.
 
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
BordersOnLabeledComponents()
          Standard constructor.
BordersOnLabeledComponents(MTBImageByte inImg, MTBRegion2DSet inRegions, MTBBorder2D.BorderConnectivity con, BordersOnLabeledComponents.BorderType type, int minLength)
          Constructor.
 
Method Summary
protected  void drawBordersToImage()
          Draws result contours to an image.
protected  void extractBorders()
          Extract requested borders for given input data.
 MTBBorder2DSet getResultBorders()
          Get result borders.
 MTBImageShort getResultImage()
          Get result image with extracted borders.
protected  void operate()
           
 void setBorderType(BordersOnLabeledComponents.BorderType type)
          Set border type to be extracted.
 void setConnectivity(MTBBorder2D.BorderConnectivity bc)
          Specify connectivity for extracted border pixels.
 void setInputImage(MTBImageByte inImg)
          Set input image.
 void setInputRegions(MTBRegion2DSet inRegions)
          Set input regions.
 void setMinimalBorderLength(int length)
          Set the minimal border length.
 void validateCustom()
           
 
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, validateGeneric, writeHistory, writeHistory, writeHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BordersOnLabeledComponents

public BordersOnLabeledComponents()
                           throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Standard constructor.

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

BordersOnLabeledComponents

public BordersOnLabeledComponents(MTBImageByte inImg,
                                  MTBRegion2DSet inRegions,
                                  MTBBorder2D.BorderConnectivity con,
                                  BordersOnLabeledComponents.BorderType type,
                                  int minLength)
                           throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor.

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

setInputImage

public void setInputImage(MTBImageByte inImg)
Set input image.

Parameters:
Image - to process.

setInputRegions

public void setInputRegions(MTBRegion2DSet inRegions)
Set input regions.

Parameters:
Regions - to process.

setConnectivity

public void setConnectivity(MTBBorder2D.BorderConnectivity bc)
Specify connectivity for extracted border pixels.

Parameters:
bc - Connectivity.

setBorderType

public void setBorderType(BordersOnLabeledComponents.BorderType type)
Set border type to be extracted.

Parameters:
Type - of borders to be extracted.

setMinimalBorderLength

public void setMinimalBorderLength(int length)
Set the minimal border length.

Parameters:
length - Minimal length of borders to be extracted.

getResultImage

public MTBImageShort getResultImage()
Get result image with extracted borders.

Returns:
Image with borders.

getResultBorders

public MTBBorder2DSet getResultBorders()
Get result borders.

Returns:
Set of extracted borders.

validateCustom

public void validateCustom()
                    throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Overrides:
validateCustom in class de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

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

extractBorders

protected void extractBorders()
                       throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                              de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Extract requested borders for given input data.

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

drawBordersToImage

protected void drawBordersToImage()
Draws result contours to an image.



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