de.unihalle.informatik.MiToBo.segmentation.basics
Class SegmentationInitializer

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

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

Operator for initializing objects of type MTBSegmentationInterface.

Author:
moeller

Nested Class Summary
static class SegmentationInitializer.InputMode
          Available data sources.
static class SegmentationInitializer.SegmentationDimension
          Available dimensions for segmentations.
static class SegmentationInitializer.ShapeType
          Available shape types.
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
protected  MTBImage binaryImage
           
protected  SegmentationInitializer.InputMode inMode
           
protected  MTBImage labelImage
           
protected  boolean regionBinaryMode
           
protected  MTBRegion2DSet regionSet
           
protected  SegmentationInitializer.SegmentationDimension segDim
           
protected  MTBSegmentationInterface segObject
           
protected  SegmentationInitializer.ShapeType shape
           
protected  double shapeDimX
           
protected  double shapeDimY
           
protected  double shapeDimZ
           
protected  int shapeMaskSizeX
           
protected  int shapeMaskSizeY
           
protected  int shapeMaskSizeZ
           
protected  double shapePosX
           
protected  double shapePosY
           
protected  double shapePosZ
           
protected  double threshold
           
protected  MTBImage thresholdImage
           
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider
 
Constructor Summary
SegmentationInitializer()
          Default constructor.
 
Method Summary
protected  void generateSegmentation()
          Generates segmentation objects given specified data.
protected  MTBSegmentation2D get2DInterface(MTBImage labelImg, boolean binaryMode)
          Generates 2D segmentation.
protected  MTBSegmentation2D get2DMask()
          Generates a synthetic 2D mask according to given specification.
protected  MTBSegmentation3D get3DInterface(MTBImage labelImg, boolean binaryMode)
          Generates 3D segmentation.
 MTBSegmentation3D get3DMask()
          Generates a synthetic 3D mask according to given specification.
 MTBImage getBinaryImage()
          Get the image for binary mode.
 SegmentationInitializer.InputMode getInputMode()
          Get input mode.
 MTBImage getLabelImage()
          Get the label image.
 MTBRegion2DSet getRegionSet()
          Get the region set.
 SegmentationInitializer.SegmentationDimension getSegDim()
          Get target dimension.
 MTBSegmentationInterface getSegmentation()
          Get the generated segmentation object.
 SegmentationInitializer.ShapeType getShape()
          Get the selected shape.
 double getShapeDimX()
          Get extent of shape in x dimension.
 double getShapeDimY()
          Get extent of shape in y dimension.
 double getShapeDimZ()
          Get extent of shape in z dimension.
 int getShapeMaskSizeX()
          Get size of shape mask in x dimension.
 int getShapeMaskSizeY()
          Get size of shape mask in y dimension.
 int getShapeMaskSizeZ()
          Get size of shape mask in z dimension.
 double getShapePosX()
          Get position of shape in x dimension.
 double getShapePosY()
          Get position of shape in y dimension.
 double getShapePosZ()
          Get position of shape in z dimension.
protected  MTBSegmentationInterface getSynthMask(SegmentationInitializer.SegmentationDimension sDim)
          Generate synthetic mask.
 double getThreshold()
          Get threshold to be applied to image.
 MTBImage getThresholdImage()
          Get image for thresholding
 boolean isRegionBinaryMode()
          Check for region input mode.
protected  void operate()
           
 void setBinaryImage(MTBImage _binaryImage)
          Set the binary image.
 void setInputMode(SegmentationInitializer.InputMode _mode)
          Set input mode.
 void setLabelImage(MTBImage _labelImage)
          Set the label image.
 void setRegionBinaryMode(boolean _regionBinaryMode)
          Specify region input mode.
 void setRegionSet(MTBRegion2DSet _regionSet)
          Set the region set.
 void setSegDim(SegmentationInitializer.SegmentationDimension _segDim)
          Set target dimension.
 void setShape(SegmentationInitializer.ShapeType _shape)
          Specify shape for synthetic initialization.
 void setShapeDimX(double _shapeDimX)
          Set extent of shape in x dimension.
 void setShapeDimY(double _shapeDimY)
          Set extent of shape in y dimension.
 void setShapeDimZ(double _shapeDimZ)
          Set extent of shape in z dimension.
 void setShapeMaskSizeX(int _shapeMaskSizeX)
          Set size of shape mask in x dimension.
 void setShapeMaskSizeY(int _shapeMaskSizeY)
          Set size of shape mask in y dimension.
 void setShapeMaskSizeZ(int _shapeMaskSizeZ)
          Set size of shape mask in z dimension.
 void setShapePosX(double _shapePosX)
          Set position of shape in x dimension.
 void setShapePosY(double _shapePosY)
          Set position of shape in y dimension.
 void setShapePosZ(double _shapePosZ)
          Set position of shape in z dimension.
 void setThreshold(double _threshold)
          Set threshold for threshold mode.
 void setThresholdImage(MTBImage _thresholdImage)
          Set image for thresholding.
 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
 

Field Detail

inMode

@Parameter(label="Input Mode",
           required=true,
           dataIOOrder=0,
           direction=IN,
           description="Source from where to read the data.")
protected SegmentationInitializer.InputMode inMode

segDim

@Parameter(label="Dimension",
           required=true,
           dataIOOrder=1,
           direction=IN,
           description="Dimension of generated segmentation object.")
protected SegmentationInitializer.SegmentationDimension segDim

binaryImage

@Parameter(label="Binary Mode Image",
           required=false,
           dataIOOrder=10,
           direction=IN,
           description="Image for two-class segmentation.")
protected transient MTBImage binaryImage

labelImage

@Parameter(label="Label Mode Image",
           required=false,
           dataIOOrder=11,
           direction=IN,
           description="Label image for n-class segmentation.")
protected transient MTBImage labelImage

regionSet

@Parameter(label="Region Set",
           required=false,
           dataIOOrder=12,
           direction=IN,
           description="Region set for for two- or n-class segmentation.")
protected MTBRegion2DSet regionSet

regionBinaryMode

@Parameter(label="Region Mode",
           required=false,
           dataIOOrder=13,
           direction=IN,
           description="Assign all regions to the common foreground.")
protected boolean regionBinaryMode

thresholdImage

@Parameter(label="Threshold Image",
           required=false,
           dataIOOrder=14,
           direction=IN,
           description="Input image for thresholding.")
protected transient MTBImage thresholdImage

threshold

@Parameter(label="Threshold",
           required=false,
           dataIOOrder=15,
           direction=IN,
           description="Threshold to be applied to threshold image.")
protected double threshold

shape

@Parameter(label="Shape",
           required=false,
           dataIOOrder=16,
           direction=IN,
           description="Type of sythetic shape.")
protected SegmentationInitializer.ShapeType shape

shapeMaskSizeX

@Parameter(label="Shape Mask Size X",
           required=false,
           dataIOOrder=17,
           direction=IN,
           description="Size of mask in x dimension.")
protected int shapeMaskSizeX

shapeMaskSizeY

@Parameter(label="Shape Mask Size Y",
           required=false,
           dataIOOrder=18,
           direction=IN,
           description="Size of mask in y dimension.")
protected int shapeMaskSizeY

shapeMaskSizeZ

@Parameter(label="Shape Mask Size Z",
           required=false,
           dataIOOrder=19,
           direction=IN,
           description="Size of mask in z dimension.")
protected int shapeMaskSizeZ

shapePosX

@Parameter(label="Shape position X",
           required=false,
           dataIOOrder=20,
           direction=IN,
           description="Shape position in x dimension.")
protected double shapePosX

shapePosY

@Parameter(label="Shape position Y",
           required=false,
           dataIOOrder=21,
           direction=IN,
           description="Shape position in y dimension.")
protected double shapePosY

shapePosZ

@Parameter(label="Shape position Z",
           required=false,
           dataIOOrder=22,
           direction=IN,
           description="Shape position in z dimension.")
protected double shapePosZ

shapeDimX

@Parameter(label="Shape dimension X",
           required=false,
           dataIOOrder=23,
           direction=IN,
           description="Extent of shape in x dimension.")
protected double shapeDimX

shapeDimY

@Parameter(label="Shape dimension Y",
           required=false,
           dataIOOrder=24,
           direction=IN,
           description="Extent of shape in y dimension.")
protected double shapeDimY

shapeDimZ

@Parameter(label="Shape dimension Z",
           required=false,
           dataIOOrder=25,
           direction=IN,
           description="Extent of shape in z dimension.")
protected double shapeDimZ

segObject

@Parameter(label="Generated segmentation",
           direction=OUT,
           description="Segmentation.")
protected transient MTBSegmentationInterface segObject
Constructor Detail

SegmentationInitializer

public SegmentationInitializer()
                        throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Default constructor.

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

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

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

getSegDim

public SegmentationInitializer.SegmentationDimension getSegDim()
Get target dimension.

Returns:
Target dimension.

setSegDim

public void setSegDim(SegmentationInitializer.SegmentationDimension _segDim)
Set target dimension.

Parameters:
_segDim - Target dimension to be used.

getInputMode

public SegmentationInitializer.InputMode getInputMode()
Get input mode.

Returns:
Input mode.

setInputMode

public void setInputMode(SegmentationInitializer.InputMode _mode)
Set input mode.

Parameters:
_mode - Input mode to be used.

getBinaryImage

public MTBImage getBinaryImage()
Get the image for binary mode.

Returns:
Binary mode image.

setBinaryImage

public void setBinaryImage(MTBImage _binaryImage)
Set the binary image.

Parameters:
_binaryImage - Binary image for mask initialization.

getLabelImage

public MTBImage getLabelImage()
Get the label image.

Returns:
Label image.

setLabelImage

public void setLabelImage(MTBImage _labelImage)
Set the label image.

Parameters:
_labelImage - Label image for n-class initialization.

getRegionSet

public MTBRegion2DSet getRegionSet()
Get the region set.

Returns:
Region set.

setRegionSet

public void setRegionSet(MTBRegion2DSet _regionSet)
Set the region set.

Parameters:
_regionSet - Set for 2-/n-class initialization.

isRegionBinaryMode

public boolean isRegionBinaryMode()
Check for region input mode.

Returns:
True if binary mode is selected.

setRegionBinaryMode

public void setRegionBinaryMode(boolean _regionBinaryMode)
Specify region input mode.

Parameters:
_regionBinaryMode - Flag for region input mode.

getThresholdImage

public MTBImage getThresholdImage()
Get image for thresholding

Returns:
Image to threshold.

setThresholdImage

public void setThresholdImage(MTBImage _thresholdImage)
Set image for thresholding.

Parameters:
_thresholdImage - Image for thresholding.

getThreshold

public double getThreshold()
Get threshold to be applied to image.

Returns:
Threshold.

setThreshold

public void setThreshold(double _threshold)
Set threshold for threshold mode.

Parameters:
_threshold - Threshold to be applied to threshold image.

getShape

public SegmentationInitializer.ShapeType getShape()
Get the selected shape.

Returns:
Selected shape.

setShape

public void setShape(SegmentationInitializer.ShapeType _shape)
Specify shape for synthetic initialization.

Parameters:
_shape - Shape type to be used.

getShapeMaskSizeX

public int getShapeMaskSizeX()
Get size of shape mask in x dimension.

Returns:
Size of shape mask in x.

setShapeMaskSizeX

public void setShapeMaskSizeX(int _shapeMaskSizeX)
Set size of shape mask in x dimension.

Parameters:
_shapeMaskSizeX - Size to be used.

getShapeMaskSizeY

public int getShapeMaskSizeY()
Get size of shape mask in y dimension.

Returns:
Size of shape mask in y.

setShapeMaskSizeY

public void setShapeMaskSizeY(int _shapeMaskSizeY)
Set size of shape mask in y dimension.

Parameters:
_shapeMaskSizeY - Size to be used.

getShapeMaskSizeZ

public int getShapeMaskSizeZ()
Get size of shape mask in z dimension.

Returns:
Size of shape mask in z.

setShapeMaskSizeZ

public void setShapeMaskSizeZ(int _shapeMaskSizeZ)
Set size of shape mask in z dimension.

Parameters:
_shapeMaskSizeZ - Size to be used.

getShapePosX

public double getShapePosX()
Get position of shape in x dimension.

Returns:
Position in x.

setShapePosX

public void setShapePosX(double _shapePosX)
Set position of shape in x dimension.

Parameters:
_shapePosX - Position in x.

getShapePosY

public double getShapePosY()
Get position of shape in y dimension.

Returns:
Position in y.

setShapePosY

public void setShapePosY(double _shapePosY)
Set position of shape in y dimension.

Parameters:
_shapePosY - Position in y.

getShapePosZ

public double getShapePosZ()
Get position of shape in z dimension.

Returns:
Position in z.

setShapePosZ

public void setShapePosZ(double _shapePosZ)
Set position of shape in z dimension.

Parameters:
_shapePosZ - Position in z.

getShapeDimX

public double getShapeDimX()
Get extent of shape in x dimension.

Returns:
Extent in x.

setShapeDimX

public void setShapeDimX(double _shapeDimX)
Set extent of shape in x dimension.

Parameters:
_shapeDimX - Extent to be used.

getShapeDimY

public double getShapeDimY()
Get extent of shape in y dimension.

Returns:
Extent in y.

setShapeDimY

public void setShapeDimY(double _shapeDimY)
Set extent of shape in y dimension.

Parameters:
_shapeDimY - Extent to be used.

getShapeDimZ

public double getShapeDimZ()
Get extent of shape in z dimension.

Returns:
Extent in z.

setShapeDimZ

public void setShapeDimZ(double _shapeDimZ)
Set extent of shape in z dimension.

Parameters:
_shapeDimZ - Extent to be used.

getSegmentation

public MTBSegmentationInterface getSegmentation()
Get the generated segmentation object.

Returns:
Segmentation.

generateSegmentation

protected void generateSegmentation()
                             throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Generates segmentation objects given specified data.

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

get2DInterface

protected MTBSegmentation2D get2DInterface(MTBImage labelImg,
                                           boolean binaryMode)
Generates 2D segmentation.

Parameters:
labelImg - Label image to process.
binaryMode - If true, two-class segmentation is generated.
Returns:
Generated 2D segmentation object.

get3DInterface

protected MTBSegmentation3D get3DInterface(MTBImage labelImg,
                                           boolean binaryMode)
Generates 3D segmentation.

Parameters:
labelImg - Label image to process.
binaryMode - If true, two-class segmentation is generated.
Returns:
Generated 3D segmentation object.

getSynthMask

protected MTBSegmentationInterface getSynthMask(SegmentationInitializer.SegmentationDimension sDim)
Generate synthetic mask.

Returns:
Generated segmentation mask.

get2DMask

protected MTBSegmentation2D get2DMask()
Generates a synthetic 2D mask according to given specification.

Returns:
2D segmentation mask.

get3DMask

public MTBSegmentation3D get3DMask()
Generates a synthetic 3D mask according to given specification.

Returns:
3D segmentation mask.


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