de.unihalle.informatik.MiToBo.segmentation.snakes.datatypes
Class SnakeHelperOperators.MaskMaker

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.snakes.datatypes.SnakeHelperOperators.MaskMaker
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator
Enclosing class:
SnakeHelperOperators

protected class SnakeHelperOperators.MaskMaker
extends MTBOperator

Operator class to generate 2D array mask for snake interior.

The mask will have size (width x height) and the area enclosed by the polygon will be filled in white. The background will be filled in black. The orientation of the polygon is not considered here. Note that undefined behavior will result if applied to non-closed snakes.

Author:
moeller

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  MTBSnake inSnake
          Input snake.
private  int maskHeight
          Height of the mask to be generated.
private  int maskWidth
          Width of the mask to be generated.
private  int[][] outMask
          Generated mask.
private  int xOffset
          x-offset of the mask coordinate system.
private  int yOffset
          y-offset of the mask coordinate system.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Constructor Summary
SnakeHelperOperators.MaskMaker(MTBSnake input, int w, int h)
          Default constructor with zero offsets.
SnakeHelperOperators.MaskMaker(MTBSnake input, int xoff, int yoff, int w, int h)
          Constructor with non-zero offsets.
 
Method Summary
protected  int[][] getResultMask()
          Returns generated mask.
protected  void operate()
           
 
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

inSnake

@Parameter(label="inSnake",
           direction=IN,
           required=true,
           description="Input snake.")
private MTBSnake inSnake
Input snake.


maskHeight

@Parameter(label="maskHeight",
           direction=IN,
           required=true,
           description="Height of the mask.")
private int maskHeight
Height of the mask to be generated.


maskWidth

@Parameter(label="maskWidth",
           direction=IN,
           required=true,
           description="Width of the mask.")
private int maskWidth
Width of the mask to be generated.


outMask

@Parameter(label="outMask",
           direction=OUT,
           description="Output mask.")
private int[][] outMask
Generated mask.


xOffset

@Parameter(label="xOffset",
           direction=IN,
           required=false,
           description="Origin offset in x.")
private int xOffset
x-offset of the mask coordinate system.


yOffset

@Parameter(label="yOffset",
           direction=IN,
           required=false,
           description="Origin offset in y.")
private int yOffset
y-offset of the mask coordinate system.

Constructor Detail

SnakeHelperOperators.MaskMaker

SnakeHelperOperators.MaskMaker(MTBSnake input,
                               int w,
                               int h)
                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Default constructor with zero offsets.

Parameters:
input - Snake for which the mask is to be generated.
w - Width of mask array.
h - Height of mask array.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

SnakeHelperOperators.MaskMaker

SnakeHelperOperators.MaskMaker(MTBSnake input,
                               int xoff,
                               int yoff,
                               int w,
                               int h)
                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor with non-zero offsets.

Parameters:
input - Snake for which the mask is to be generated.
xoff - Offset in x direction, 1st column will have this coordinate.
yoff - Offset in y direction, 1st row will have this coordinate.
w - Width of mask array.
h - Height of mask array.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

getResultMask

protected int[][] getResultMask()
Returns generated mask.


operate

protected void operate()
Specified by:
operate in class de.unihalle.informatik.Alida.operator.ALDOperator