de.unihalle.informatik.MiToBo.segmentation.snakes.datatypes
Class MTBSnake

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDData
      extended by de.unihalle.informatik.MiToBo.core.datatypes.MTBPolygon2D
          extended by de.unihalle.informatik.MiToBo.segmentation.snakes.datatypes.MTBSnake
All Implemented Interfaces:
MTBSegmentationInterface, Cloneable

@ALDDerivedClass
public class MTBSnake
extends MTBPolygon2D
implements MTBSegmentationInterface

Active Contour (Snake) datatype.

The snake is implemented with its control points and a large variety of convenience methods for using the snakes, e.g., methods to plot the snake to an image. A snake can be open or closed. In the latter case it also has an orientation, i.e., the snake points are ordered clockwise or counter-clockwise.

The snake interior is always located left of the snake segments. In case of a closed snake in counter-clockwise ordering the area enclosed by the snake polygon is defined as its interior. In case of counter-clockwise ordering the enclosed region is the exterior part of the domain or the background, respectively.

The snake datatype implements the MTBSegmentationInterface, i.e., allows for querying if certain pixels belong to foreground/interior or background/exterior. Note that the interior or foreground class is always labeled with 1, the background or exterior region always with 0.

A pixel or position in the domain of the snake can be visible or not. The visibility is stored in an internal visibility map. Note that this map can be altered from external and does not need to have the same size as the snakes domain.

Author:
misiak, moeller

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.unihalle.informatik.MiToBo.segmentation.basics.MTBSegmentationInterface
MTBSegmentationInterface.SegmentationDimension
 
Field Summary
protected  int[][] classmap
          2D map marking the region enclosed by the snake.
protected  int mapHeight
          Height of class map.
protected  int mapMaxX
          Maximal x coordinate of class map.
protected  int mapMaxY
          Maximal y coordinate of class map.
protected  int mapMinX
          Minimal x coordinate of class map.
protected  int mapMinY
          Minimal y coordinate of class map.
protected  int mapWidth
          Width of class map.
protected  int visibilityMapHeight
          Height of visibility map.
protected  int visibilityMapWidth
          Width of visibility map.
protected  boolean[][] visiblemap
          Visibility map for hiding individual pixels.
protected  int visibleMapMaxX
          Maximal x coordinate of visibility map.
protected  int visibleMapMaxY
          Maximal y coordinate of visibility map.
protected  int visibleMapMinX
          Minimal x coordinate of visibility map.
protected  int visibleMapMinY
          Minimal y coordinate of visibility map.
 
Fields inherited from class de.unihalle.informatik.MiToBo.core.datatypes.MTBPolygon2D
isClosed, points
 
Constructor Summary
MTBSnake()
          Standard constructor to create a new and empty snake object.
MTBSnake(Vector<MTBSnakePoint2D> spoints, boolean cycle)
          Constructor to create a new Snake object.
MTBSnake(Vector<MTBSnakePoint2D> spoints, boolean cycle, double scale, boolean isScaled)
          Constructor to create a new Snake object.
 
Method Summary
 void addPoint(double x, double y)
          Overwrites Polygon2D method.
 MTBSnake clone()
          Override java.lang.Object.clone() to create and return a copy of this object.
static MTBSnake convertContourToSnake(MTBContour2D contour)
          Converts a contour into a snake.
static MTBPolygon2DSet convertRegionsToSnakes(MTBImage image)
          Converts the regions of a label/binary image into a set of snakes.
static MTBSnake convertRegionToSnake(MTBRegion2D region)
          Converts a region into a snake.
 void denormalize()
          Denormalizes the snake coordinates.
 void drawPolygon(MTBImage img, int color)
          Draw snake into an image.
 void drawPolygonPoints(MTBImage img, int color, int mode)
          Draw snake points into an image (as crosses).
 int[][] getBinaryMask(int w, int h)
          Generates binary mask for inside part of the snake.
 int getClass(int x, int y)
          Returns the class label of position (x,y).
 int getClass(int x, int y, int z)
          Returns the class label of position (x,y,z).
 double getCOMx()
          Returns the center of mass of the snake in x-direction.
 double getCOMy()
          Returns the center of mass of the snake in y-direction.
 MTBSegmentationInterface.SegmentationDimension getDimension()
          Returns the dimension of the given membership.
 int getDomainXMaxCoordinate()
          Returns maximal x coordinate represented in class map.
 int getDomainXMinCoordinate()
          Returns minimal x coordinate represented in class map.
 int getDomainYMaxCoordinate()
          Returns maximal y coordinate represented in visibility map.
 int getDomainYMinCoordinate()
          Returns minimal y coordinate represented in class map.
 MTBImage getMask(int class_)
          Gets the mask of the specified class (0 Background, 255 Foreground)
 int getMaxLabel()
          Returns the maximal label used in the membership representation.
 int getNumberOfClasses()
          Returns the number of classes represented in the membership.
 double getPartialDiffX(int position)
          Get approximation of partial derivative in x-direction at point with given index.
 double getPartialDiffY(int position)
          Get approximation of partial derivative in y-direction at point with given index.
 double getScaleFactor()
          Get the scaling factor of the snake.
 int getSizeX()
          Returns the size of the segmentation domain in x direction.
 int getSizeY()
          Returns the size of the segmentation domain in y direction.
 int getSizeZ()
          Returns the size of the segmentation domain in z direction.
 Vector<MTBSnakePoint2D> getSnakePoints()
          Get snake points as vector of SnakePoint2D objects.
 double getSndPartialDiffX(int position)
          Get approximation of 2nd order partial derivative in x-direction.
 double getSndPartialDiffY(int position)
          Get approximation of 2nd order partial derivative in y-direction.
 int getVisibilityMapHeight()
          Returns height of the visibility map.
 int getVisibilityMapWidth()
          Returns width of the visibility map.
 int getVisibilityMapXMaxCoordinate()
          Returns maximal x coordinate represented in visibility map.
 int getVisibilityMapXMinCoordinate()
          Returns minimal x coordinate represented in visibility map.
 int getVisibilityMapYMaxCoordinate()
          Returns maximal y coordinate represented in visibility map.
 int getVisibilityMapYMinCoordinate()
          Returns minimal y coordinate represented in visibility map.
 double getWeight(int x, int y)
          Returns the pixel weight of position (x,y).
 double getWeight(int x, int y, int z)
          Returns the pixel weight of position (x,y,z).
 boolean isVisible(int x, int y)
          Get visibility of a certain pixel position.
 boolean isVisible(int x, int y, int z)
          True, if position (x,y,z) is visible.
 void makeSimple()
          Makes the polygon simple, i.e. removes self-overlaps.
 void normalize(double scale)
          Normalizes the snake coordinates.
 void printPoints()
          Prints points of snake to standard output stream.
 void resample(double segLength)
           Method to re-sample the line segments of the snake in a range of a given segment length.
 void reversePolypoints()
          Overwrite reversePolypoints method of Polygon2D.
 void setClass(int x, int y, int c)
          Deprecated. 
 void setClass(int x, int y, int z, int c)
          Deprecated. 
 void setInvisible(int x, int y)
          Set position (x,y) invisible.
 void setInvisible(int x, int y, int z)
          Set position (x,y,z) invisible.
 void setPoints(Vector<Point2D.Double> ps)
          Overwrite Polygon2D method to set all points of the snake from the specified point vector object.
 void setSegmentationDomain(int xmin, int xmax, int ymin, int ymax)
          Specify the domain of the underlying segmentation.
 void setSnakePoints(Vector<MTBSnakePoint2D> ps)
          Set all points of the snake from the specified SnakePoint2D vector object.
 void setVisibilityMask(boolean[][] mask, int mMinX, int mMinY, int mMaxX, int mMaxY)
          Set the valid mask from external mask data.
 void setVisible(int x, int y)
          Set position (x,y) visible.
 void setVisible(int x, int y, int z)
          Set position (x,y,z) visible.
 void setWeight(int x, int y, double c)
          Sets the pixel weight of position (x,y) to c.
 void setWeight(int x, int y, int z, double c)
          Sets the pixel weight of position (x,y,z) to c.
 void shift(double shift, int imageSizeX, int imageSizeY)
          Method to shift the whole snake outward (positive value) ore inward (negative value) to its normal vector from every line segment.
 MTBImage toMTBImage(String file, MTBImage img)
          Method to draw and save the snake in a given MTBImage.
 MTBImageByte toMTBImageByte(String file, int w, int h)
          Method to draw and save the snake in a binary image.
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.datatypes.MTBPolygon2D
contains, containsPoint, drawPolygon, drawPolygonPoints, equals, getBoundingBox, getLength, getPointNum, getPoints, getPolygon, getSignedArea, isClosed, isConvex, isOrderedClockwise, isOrderedCounterClockwise, isSimple, setClosed, setOpen, simplify, standardization
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDData
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classmap

protected int[][] classmap
2D map marking the region enclosed by the snake.

Note that the enclosed region contains always values of 1, independent of the order of the snake. The getClass()-methods take care of returning correct class labels.


mapMinX

protected int mapMinX
Minimal x coordinate of class map.


mapMaxX

protected int mapMaxX
Maximal x coordinate of class map.


mapMinY

protected int mapMinY
Minimal y coordinate of class map.


mapMaxY

protected int mapMaxY
Maximal y coordinate of class map.


mapWidth

protected int mapWidth
Width of class map.


mapHeight

protected int mapHeight
Height of class map.


visiblemap

protected boolean[][] visiblemap
Visibility map for hiding individual pixels.


visibleMapMinX

protected int visibleMapMinX
Minimal x coordinate of visibility map.


visibleMapMaxX

protected int visibleMapMaxX
Maximal x coordinate of visibility map.


visibleMapMinY

protected int visibleMapMinY
Minimal y coordinate of visibility map.


visibleMapMaxY

protected int visibleMapMaxY
Maximal y coordinate of visibility map.


visibilityMapWidth

protected int visibilityMapWidth
Width of visibility map.


visibilityMapHeight

protected int visibilityMapHeight
Height of visibility map.

Constructor Detail

MTBSnake

public MTBSnake()
Standard constructor to create a new and empty snake object.


MTBSnake

public MTBSnake(Vector<MTBSnakePoint2D> spoints,
                boolean cycle)
Constructor to create a new Snake object.

Parameters:
spoints - vector of 2D snake points as control points for the snake
cycle - true if snake forms a closed polygon

MTBSnake

public MTBSnake(Vector<MTBSnakePoint2D> spoints,
                boolean cycle,
                double scale,
                boolean isScaled)
Constructor to create a new Snake object.

Parameters:
spoints - vector of 2D snake points as control points for the snake
cycle - true if snake forms a closed polygon
scale - scaling factor
isScaled - true if snake is already scaled
Method Detail

getScaleFactor

public double getScaleFactor()
Get the scaling factor of the snake.

Returns:
Scaling factor.

clone

public MTBSnake clone()
Override java.lang.Object.clone() to create and return a copy of this object.

Overrides:
clone in class MTBPolygon2D
Throws:
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

setPoints

public void setPoints(Vector<Point2D.Double> ps)
Overwrite Polygon2D method to set all points of the snake from the specified point vector object. Intern a vector of SnakePoint2D object is created. The old position of every point within the snake is set to -1 by default.

Overrides:
setPoints in class MTBPolygon2D
Parameters:
ps - vector with new points of the polygon

setSnakePoints

public void setSnakePoints(Vector<MTBSnakePoint2D> ps)
Set all points of the snake from the specified SnakePoint2D vector object. The old position of every point within the snake is kept.


addPoint

public void addPoint(double x,
                     double y)
Overwrites Polygon2D method. Appends a new point to the end of the snake. Old position of the point is set to -1 by default.

Overrides:
addPoint in class MTBPolygon2D
Parameters:
x - Point x coordinate.
y - Point y coordinate.

getSnakePoints

public Vector<MTBSnakePoint2D> getSnakePoints()
Get snake points as vector of SnakePoint2D objects.

Returns:
Vector with 2D snake points.

normalize

public void normalize(double scale)
Normalizes the snake coordinates.

All snake points are scaled by the given scale factor. A factor larger than 1.0 expands the snake, a factor smaller than 1.0 shrinks it, and the default factor of 1.0 does not change anything. The factor is stored internally for later de-normalization of the snake.

Parameters:
scale - Scale factor for normalization.

denormalize

public void denormalize()
Denormalizes the snake coordinates.

The internally stored scale factor is used for the denormalization and subsequently set to 1.0.


getPartialDiffX

public double getPartialDiffX(int position)
Get approximation of partial derivative in x-direction at point with given index.

For calculating partial derivatives point differences are used, i.e. forward differences. Note, that the partial derivative for the last point of a non-closed snake is always zero!

Parameters:
position - Index of snake point.
Returns:
Value of discrete approximation of x-derivative.

getPartialDiffY

public double getPartialDiffY(int position)
Get approximation of partial derivative in y-direction at point with given index.

For calculating partial derivatives point differences are used, i.e. forward differences. Note, that the partial derivative for the last point of a non-closed snake is always zero!

Parameters:
position - Index of snake point.
Returns:
Value of discrete approximation of y-derivative.

getSndPartialDiffX

public double getSndPartialDiffX(int position)
Get approximation of 2nd order partial derivative in x-direction.

For calculating partial derivatives point differences are used, i.e. forward differences. Note, that the partial derivatives for the first and last point of a non-closed snake are always zero!

Parameters:
position - Index of snake point.
Returns:
Value of discrete approximation of 2nd order x-derivative.

getSndPartialDiffY

public double getSndPartialDiffY(int position)
Get approximation of 2nd order partial derivative in y-direction.

For calculating partial derivatives point differences are used, i.e. forward differences. Note, that the partial derivatives for the first and last point of a non-closed snake are always zero!

Parameters:
position - Index of snake point.
Returns:
Value of discrete approximation of 2nd order y-derivative.

getCOMx

public double getCOMx()
Returns the center of mass of the snake in x-direction.


getCOMy

public double getCOMy()
Returns the center of mass of the snake in y-direction.


drawPolygon

public void drawPolygon(MTBImage img,
                        int color)
Draw snake into an image.

Overrides:
drawPolygon in class MTBPolygon2D
Parameters:
img - Image where to draw the polygon into.

drawPolygonPoints

public void drawPolygonPoints(MTBImage img,
                              int color,
                              int mode)
Draw snake points into an image (as crosses).

Overrides:
drawPolygonPoints in class MTBPolygon2D
Parameters:
img - Image where to draw the polygon points into.
color - Color to be used.
mode - Shape of points to be applied.

getBinaryMask

public int[][] getBinaryMask(int w,
                             int h)
Generates binary mask for inside part of the snake.

The area enclosed by the snake will be painted in white. Note that the coordinates of the mask start with (0,0).

Overrides:
getBinaryMask in class MTBPolygon2D
Parameters:
w -
h -
Returns:
Binary mask, 0= outside / 1=inside
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

makeSimple

public void makeSimple()
Description copied from class: MTBPolygon2D
Makes the polygon simple, i.e. removes self-overlaps.

Overrides:
makeSimple in class MTBPolygon2D

reversePolypoints

public void reversePolypoints()
Overwrite reversePolypoints method of Polygon2D. Changes the ordering of the snake points.

If the snake points are ordered clockwise afterwards they are ordered counter-clockwise and vice versa. The old id of a snake point is kept.

Overrides:
reversePolypoints in class MTBPolygon2D

resample

public void resample(double segLength)
 
 Method to re-sample the line segments of the snake in a range of a given
 segment length. The range is calculated from the given length of a segment
 by calculation: 
 - minimum = segment length * 0.5
 - maximum = segment length * 1.5
 
 If a line segment (p,q) is too small, the point q is removed from the list.
 Then the new line segment (p,r) is observed, where r is the successor of q.
 
 If a line segment (p,q) is too large, new points will be added.
 The number of new points is calculated by the possible number of points
 (depending on the given segment length) that fit into the line segment
 between p and q.
 
 The old index of the snake point position in the previous snake is kept for
 all existing snake points. For new snake points the old position index is
 set to -1 by default.
 
 

Overrides:
resample in class MTBPolygon2D

shift

public void shift(double shift,
                  int imageSizeX,
                  int imageSizeY)
Method to shift the whole snake outward (positive value) ore inward (negative value) to its normal vector from every line segment.

ATTENTION!!! After shifting a snake, it can happen that the snake is not simple !!!

Overrides:
shift in class MTBPolygon2D
Parameters:
shift - positive ore negative value to shift the snake
imageSizeX - width of the image to test whether the coordinates of the shifted snake are valid
imageSizeY - height of the image to test whether the coordinates of the shifted snake are valid

toMTBImageByte

public MTBImageByte toMTBImageByte(String file,
                                   int w,
                                   int h)
                            throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                   de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Method to draw and save the snake in a binary image.

Parameters:
file - file to save the image with the snake on the disk. File can be null, then no file is stored on disk
w - image width
h - image height
Returns:
MTBImageByte including the snake as white contour line on a black background.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

toMTBImage

public MTBImage toMTBImage(String file,
                           MTBImage img)
                    throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                           de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Method to draw and save the snake in a given MTBImage.

Parameters:
file - file to save the image with the snake on the disk. File can be null, then no file is stored on disk
img - image where the snake should be drawn in
Returns:
MTBImage from type of the given image, including the snake as white contour line.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

printPoints

public void printPoints()
Prints points of snake to standard output stream.


convertContourToSnake

public static MTBSnake convertContourToSnake(MTBContour2D contour)
                                      throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                             de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Converts a contour into a snake.

Parameters:
contour - Incoming contour.
Returns:
Snake object.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

convertRegionToSnake

public static MTBSnake convertRegionToSnake(MTBRegion2D region)
                                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                            de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Converts a region into a snake.

Parameters:
region - Incoming region.
Returns:
Resulting snake object.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

convertRegionsToSnakes

public static MTBPolygon2DSet convertRegionsToSnakes(MTBImage image)
                                              throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                                     de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Converts the regions of a label/binary image into a set of snakes.

Parameters:
image - Incoming image.
Returns:
Resulting snake objects.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

setSegmentationDomain

public void setSegmentationDomain(int xmin,
                                  int xmax,
                                  int ymin,
                                  int ymax)
Specify the domain of the underlying segmentation.

Class information is only available for pixels lying in the domain.

Parameters:
xmin - Minimal coordinate in x-direction.
xmax - Maximal coordinate in x-direction.
ymin - Minimal coordinate in y-direction.
ymax - Maximal coordinate in y-direction.

getDimension

public MTBSegmentationInterface.SegmentationDimension getDimension()
Returns the dimension of the given membership.

Specified by:
getDimension in interface MTBSegmentationInterface

getNumberOfClasses

public int getNumberOfClasses()
Returns the number of classes represented in the membership.

Specified by:
getNumberOfClasses in interface MTBSegmentationInterface

getMaxLabel

public int getMaxLabel()
Returns the maximal label used in the membership representation.

Specified by:
getMaxLabel in interface MTBSegmentationInterface

isVisible

public boolean isVisible(int x,
                         int y,
                         int z)
Description copied from interface: MTBSegmentationInterface
True, if position (x,y,z) is visible.

Specified by:
isVisible in interface MTBSegmentationInterface

isVisible

public boolean isVisible(int x,
                         int y)
Get visibility of a certain pixel position.

Note that pixels outside the domain of the visibility map are always assumed to be visible.

Specified by:
isVisible in interface MTBSegmentationInterface
Parameters:
x - x-coordinate of position under consideration.
y - y-coordinate of position under consideration.
Returns:
True, if pixel is visible.

getClass

public int getClass(int x,
                    int y,
                    int z)
Description copied from interface: MTBSegmentationInterface
Returns the class label of position (x,y,z).

Specified by:
getClass in interface MTBSegmentationInterface

getClass

public int getClass(int x,
                    int y)
Description copied from interface: MTBSegmentationInterface
Returns the class label of position (x,y).

Specified by:
getClass in interface MTBSegmentationInterface

setClass

@Deprecated
public void setClass(int x,
                                int y,
                                int z,
                                int c)
Deprecated. 

Description copied from interface: MTBSegmentationInterface
Set the label of position (x,y,z) to c.

Specified by:
setClass in interface MTBSegmentationInterface

setClass

@Deprecated
public void setClass(int x,
                                int y,
                                int c)
Deprecated. 

Description copied from interface: MTBSegmentationInterface
Set the label of position (x,y) to c.

Specified by:
setClass in interface MTBSegmentationInterface

setVisible

public void setVisible(int x,
                       int y)
Description copied from interface: MTBSegmentationInterface
Set position (x,y) visible.

Specified by:
setVisible in interface MTBSegmentationInterface

setVisible

public void setVisible(int x,
                       int y,
                       int z)
Description copied from interface: MTBSegmentationInterface
Set position (x,y,z) visible.

Specified by:
setVisible in interface MTBSegmentationInterface

setInvisible

public void setInvisible(int x,
                         int y)
Description copied from interface: MTBSegmentationInterface
Set position (x,y) invisible.

Specified by:
setInvisible in interface MTBSegmentationInterface

setInvisible

public void setInvisible(int x,
                         int y,
                         int z)
Description copied from interface: MTBSegmentationInterface
Set position (x,y,z) invisible.

Specified by:
setInvisible in interface MTBSegmentationInterface

setVisibilityMask

public void setVisibilityMask(boolean[][] mask,
                              int mMinX,
                              int mMinY,
                              int mMaxX,
                              int mMaxY)
Set the valid mask from external mask data.

Note that the parameter object is cloned for internal representation!


getSizeX

public int getSizeX()
Description copied from interface: MTBSegmentationInterface
Returns the size of the segmentation domain in x direction.

Specified by:
getSizeX in interface MTBSegmentationInterface

getSizeY

public int getSizeY()
Description copied from interface: MTBSegmentationInterface
Returns the size of the segmentation domain in y direction.

Specified by:
getSizeY in interface MTBSegmentationInterface

getSizeZ

public int getSizeZ()
Description copied from interface: MTBSegmentationInterface
Returns the size of the segmentation domain in z direction.

Specified by:
getSizeZ in interface MTBSegmentationInterface

getDomainXMinCoordinate

public int getDomainXMinCoordinate()
Returns minimal x coordinate represented in class map.


getDomainXMaxCoordinate

public int getDomainXMaxCoordinate()
Returns maximal x coordinate represented in class map.


getDomainYMinCoordinate

public int getDomainYMinCoordinate()
Returns minimal y coordinate represented in class map.


getDomainYMaxCoordinate

public int getDomainYMaxCoordinate()
Returns maximal y coordinate represented in visibility map.


getVisibilityMapXMinCoordinate

public int getVisibilityMapXMinCoordinate()
Returns minimal x coordinate represented in visibility map.


getVisibilityMapXMaxCoordinate

public int getVisibilityMapXMaxCoordinate()
Returns maximal x coordinate represented in visibility map.


getVisibilityMapYMinCoordinate

public int getVisibilityMapYMinCoordinate()
Returns minimal y coordinate represented in visibility map.


getVisibilityMapYMaxCoordinate

public int getVisibilityMapYMaxCoordinate()
Returns maximal y coordinate represented in visibility map.


getVisibilityMapWidth

public int getVisibilityMapWidth()
Returns width of the visibility map.

Returns:
Width of map.

getVisibilityMapHeight

public int getVisibilityMapHeight()
Returns height of the visibility map.

Returns:
Height of map.

getWeight

public double getWeight(int x,
                        int y)
Description copied from interface: MTBSegmentationInterface
Returns the pixel weight of position (x,y).

Specified by:
getWeight in interface MTBSegmentationInterface

getWeight

public double getWeight(int x,
                        int y,
                        int z)
Description copied from interface: MTBSegmentationInterface
Returns the pixel weight of position (x,y,z).

Specified by:
getWeight in interface MTBSegmentationInterface

setWeight

public void setWeight(int x,
                      int y,
                      double c)
Description copied from interface: MTBSegmentationInterface
Sets the pixel weight of position (x,y) to c.

Specified by:
setWeight in interface MTBSegmentationInterface

setWeight

public void setWeight(int x,
                      int y,
                      int z,
                      double c)
Description copied from interface: MTBSegmentationInterface
Sets the pixel weight of position (x,y,z) to c.

Specified by:
setWeight in interface MTBSegmentationInterface

getMask

public MTBImage getMask(int class_)
Description copied from interface: MTBSegmentationInterface
Gets the mask of the specified class (0 Background, 255 Foreground)

Specified by:
getMask in interface MTBSegmentationInterface


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