public class MTBSegmentation2D extends Object implements MTBSegmentationInterface
MTBSegmentationInterface.SegmentationDimension| Modifier and Type | Field and Description |
|---|---|
protected int[][] |
classmap
2D map with class labels.
|
protected int |
height
Height of segmentation domain.
|
protected int |
maxLabel
Maximal label appearing in the label list.
|
protected int |
numRegions
Number of represented regions.
|
protected boolean[][] |
visiblemap
Visibility map for hiding individual pixels.
|
protected double[][] |
weightmap
Map of weights for the segmentation.
|
protected int |
width
Width of segmentation domain.
|
| Modifier | Constructor and Description |
|---|---|
protected |
MTBSegmentation2D()
Default constructor with empty segmentation.
|
|
MTBSegmentation2D(int w,
int h,
int numClasses,
byte[][] bitfield)
Constructor.
|
|
MTBSegmentation2D(int w,
int h,
int numClasses,
int[][] cmap,
boolean[][] vmap,
double[][] wmap)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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).
|
MTBSegmentationInterface.SegmentationDimension |
getDimension()
Returns the dimension of the given membership.
|
MTBImage |
getLabelImage()
Returns a label image visualizing the segmentation.
|
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.
|
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.
|
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)
True, if position (x,y) is visible.
|
boolean |
isVisible(int x,
int y,
int z)
True, if position (x,y,z) is visible.
|
void |
setClass(int x,
int y,
int c)
Set the label of position (x,y) to c.
|
void |
setClass(int x,
int y,
int z,
int c)
Set the label of position (x,y,z) to c.
|
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 |
setVisibilityMask(boolean[][] mask)
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.
|
protected int numRegions
protected int maxLabel
protected int height
protected int width
protected int[][] classmap
protected boolean[][] visiblemap
protected double[][] weightmap
protected MTBSegmentation2D()
public MTBSegmentation2D(int w,
int h,
int numClasses,
int[][] cmap,
boolean[][] vmap,
double[][] wmap)
w - Width of segmentation domain.h - Height of segmentation domain.numClasses - Number of segmented classes.cmap - Map of class labels.vmap - Visibility map.wmap - Map of pixels weights.public MTBSegmentation2D(int w,
int h,
int numClasses,
byte[][] bitfield)
w - Width of segmentation domain.h - Height of segmentation domain.numClasses - Number of segmented classes.bitfield - Bitfield representing the segmentation.public MTBSegmentationInterface.SegmentationDimension getDimension()
getDimension in interface MTBSegmentationInterfacepublic int getSizeX()
MTBSegmentationInterfacegetSizeX in interface MTBSegmentationInterfacepublic int getSizeY()
MTBSegmentationInterfacegetSizeY in interface MTBSegmentationInterfacepublic int getSizeZ()
MTBSegmentationInterfacegetSizeZ in interface MTBSegmentationInterfacepublic int getNumberOfClasses()
getNumberOfClasses in interface MTBSegmentationInterfacepublic int getMaxLabel()
Note that the maximal label is not required to coincide with the number of classes represented by the membership function. Labels should always be larger or equal to zero.
getMaxLabel in interface MTBSegmentationInterfacepublic boolean isVisible(int x,
int y,
int z)
MTBSegmentationInterfaceisVisible in interface MTBSegmentationInterfacepublic boolean isVisible(int x,
int y)
MTBSegmentationInterfaceisVisible in interface MTBSegmentationInterfacepublic int getClass(int x,
int y,
int z)
MTBSegmentationInterfacegetClass in interface MTBSegmentationInterfacepublic int getClass(int x,
int y)
MTBSegmentationInterfacegetClass in interface MTBSegmentationInterfacepublic void setClass(int x,
int y,
int z,
int c)
MTBSegmentationInterfacesetClass in interface MTBSegmentationInterfacepublic void setClass(int x,
int y,
int c)
MTBSegmentationInterfacesetClass in interface MTBSegmentationInterfacepublic void setVisible(int x,
int y)
MTBSegmentationInterfacesetVisible in interface MTBSegmentationInterfacepublic void setVisible(int x,
int y,
int z)
MTBSegmentationInterfacesetVisible in interface MTBSegmentationInterfacepublic void setInvisible(int x,
int y)
MTBSegmentationInterfacesetInvisible in interface MTBSegmentationInterfacepublic void setInvisible(int x,
int y,
int z)
MTBSegmentationInterfacesetInvisible in interface MTBSegmentationInterfacepublic void setVisibilityMask(boolean[][] mask)
Note that the parameter object is cloned for internal representation!
public double getWeight(int x,
int y)
MTBSegmentationInterfacegetWeight in interface MTBSegmentationInterfacepublic double getWeight(int x,
int y,
int z)
MTBSegmentationInterfacegetWeight in interface MTBSegmentationInterfacepublic void setWeight(int x,
int y,
double c)
MTBSegmentationInterfacesetWeight in interface MTBSegmentationInterfacepublic void setWeight(int x,
int y,
int z,
double c)
MTBSegmentationInterfacesetWeight in interface MTBSegmentationInterfacepublic MTBImage getMask(int class_)
MTBSegmentationInterfacegetMask in interface MTBSegmentationInterfacepublic MTBImage getLabelImage()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.