public class MTBLevelsetMembership
extends de.unihalle.informatik.Alida.operator.ALDData
Modifier and Type | Field and Description |
---|---|
static short |
BG_PHASE
Level set function value to represent the background phase
|
static short |
INVALID_PHASE
Level set function value to represent invalid pixels
|
static int |
MAX_ALLOWED_NUM_PHASES
Maximal number of phases which may be represented including background phase.
|
private int |
numPhases |
private short[][][] |
phi |
private int[] |
sizePhases |
private int |
sizeX |
private int |
sizeY |
private int |
sizeZ |
private int |
sumSizeObject |
Constructor and Description |
---|
MTBLevelsetMembership(int sizeX,
int sizeY,
int sizeZ)
Constructs a two phase level set function which is initialized with
a circle or sphere of radius 0.5*(sizeX+sizeY+sizeZ)/3.
|
MTBLevelsetMembership(int sizeX,
int sizeY,
int sizeZ,
MTBImage invalidImg)
Constructs a two phase level set function which is initialiazed with
a circle or sphere of radius 0.5*(sizeX+sizeY+sizeZ)/3.
|
MTBLevelsetMembership(int sizeX,
int sizeY,
int sizeZ,
MTBImage img,
int threshold,
MTBImage invalidImg)
Creates a two phase level set function from an image via thresholding.
|
MTBLevelsetMembership(int sizeX,
int sizeY,
MTBRegion2DSet regions,
MTBImage invalidImg,
boolean multiphase)
Constructor for given size which is initialized from a MTBRegion2DSet for a 2D level set function.
|
MTBLevelsetMembership(int sizeX,
int sizeY,
Vector<MTBRegion2D> regions,
MTBImage invalidImg,
boolean multiphase)
Constructor for given size which is initialized from a list of 2D regions for a 2D level set function.
|
MTBLevelsetMembership(MTBImage initLabelImg,
MTBImage invalidImg)
Constructor for a two phase level set function from a label image.
|
MTBLevelsetMembership(MTBImage initLabelImg,
MTBImage invalidImg,
boolean multiphase)
Constructor for a level set function from a label image.
|
MTBLevelsetMembership(MTBLevelsetMembership phi)
Creates a copy of
phi . |
Modifier and Type | Method and Description |
---|---|
void |
changePhase(int x,
int y,
int z,
short phase)
Change a pixel/voxel to a new phase.
|
void |
changePhase(int x,
int y,
short phase)
Change a pixel to a new phase.
|
MTBImageShort |
getMTBImage()
Creates a bi-level MTBImageShort of the level set function.
|
MTBImageShort |
getMTBImageLabel()
Creates a MTBImageShort of the level set function.
|
int |
getNumPhases()
Return .e. number phases.
|
short |
getPhase(int x,
int y)
Return phase for a pixel/voxel, z coordinate defaults to zero
|
short |
getPhase(int x,
int y,
int z)
Return phase for a pixel/voxel
|
short |
getPhaseCheckXY(int x,
int y)
Return phase for a pixel checking limits of all coordinates.
|
short |
getPhaseCheckXYZ(int x,
int y,
int z)
Return phase for a pixel/voxel checking limits of all coordinates.
|
int |
getPixelInside()
Return number of pixels of all object phases.
|
int |
getPixelOutside()
Return number of pixels of background phase.
|
int |
getSizePhase(short phase)
Return the size, i.e. number of pixel/voxels of a phase.
|
int |
getSizeX()
Return X size of the level set function.
|
int |
getSizeY()
Return Y size of the level set function.
|
int |
getSizeZ()
Return Z size of the level set function.
|
private void |
initFromLabels(MTBImage initLabelImg,
MTBImage invalidImg,
boolean multiphase)
Helper for constructors from a label image.
|
private void |
initLevelset(MTBImage invalidImg)
Helper to initialize a two phase level set function of size as
given by invalidImg with a circle/sphere
of radius 0.5*(sizeX+sizeY+sizeZ)/3.
|
private void |
initLevelset(MTBImage img,
int threshold,
MTBImage invalidImg)
Initialize a two phase level set function by thresholding an image.
|
boolean |
isValid(MTBImage invalidImg,
int x,
int y,
int z)
returns true, if pixel/voxel is valid.
|
String |
toString()
Return a string representation.
|
public static final short BG_PHASE
public static final short INVALID_PHASE
public static final int MAX_ALLOWED_NUM_PHASES
private short[][][] phi
private int sumSizeObject
private int[] sizePhases
private final int sizeX
private final int sizeY
private final int sizeZ
private int numPhases
public MTBLevelsetMembership(int sizeX, int sizeY, int sizeZ)
sizeX
- sizeY
- sizeZ
- public MTBLevelsetMembership(int sizeX, int sizeY, int sizeZ, MTBImage invalidImg)
If invalidImg is non null, than pixels <> zero in invalidImg are invalid
sizeX
- sizeY
- sizeZ
- invalidImg
- public MTBLevelsetMembership(int sizeX, int sizeY, int sizeZ, MTBImage img, int threshold, MTBImage invalidImg)
If invalidImg is non null, than pixels <> zero in invalidImg are invalid
sizeX
- sizeY
- sizeZ
- img
- Images tp be thresholdedthreshold
- All pixels with intensities greater equal are object pixelsinvalidImg
- public MTBLevelsetMembership(MTBLevelsetMembership phi)
phi
.phi
- levelset function to copypublic MTBLevelsetMembership(int sizeX, int sizeY, Vector<MTBRegion2D> regions, MTBImage invalidImg, boolean multiphase)
If invalidImg is non null, than pixels <> zero in invalidImg are invalid
sizeX
- sizeY
- regions
- Vector of regions to initialize frominvalidImg
- pixels which are non zero are assumed invalidmultiphase
- if true create one phase for each region, otherwise two phasespublic MTBLevelsetMembership(int sizeX, int sizeY, MTBRegion2DSet regions, MTBImage invalidImg, boolean multiphase)
sizeX
- sizeY
- regions
- Region2D set to initialize frominvalidImg
- pixels which are non zero are assumed invalidmultiphase
- if true create one phase for each region, otherwise two phasespublic MTBLevelsetMembership(MTBImage initLabelImg, MTBImage invalidImg)
initLabelImg
- Label image for initializationinvalidImg
- Image indicating invalid pixels with values <> 0public MTBLevelsetMembership(MTBImage initLabelImg, MTBImage invalidImg, boolean multiphase)
If invalidImg is non null, than pixels <> zero in invalidImg are invalid
initLabelImg
- Label image for initializationinvalidImg
- Image indicating invalid pixels with values <> 0private void initFromLabels(MTBImage initLabelImg, MTBImage invalidImg, boolean multiphase)
Otherwise a two phase level set function is created, where all non zero labels are interpreted as foreground.
If invalidImg is non null, than pixels <> zero in invalidImg are invalid
initLabelImg
- Label image for initializationinvalidImg
- Image indicating invalid pixels with values <> 0multiphase
- Construct multi or two phase level set function iff true or false, resp.private void initLevelset(MTBImage invalidImg)
If invalidImg is non null, than pixels <> zero in invalidImg are invalid
private void initLevelset(MTBImage img, int threshold, MTBImage invalidImg)
If invalidImg is non null, than pixels <> zero in invalidImg are invalid
threshold
- threshold
- All pixels with intensities greater equal are object pixelsinvalidImg
- public void changePhase(int x, int y, int z, short phase)
x
- y
- z
- phase
- public void changePhase(int x, int y, short phase)
x
- y
- phase
- public short getPhase(int x, int y, int z)
x
- y
- z
- public short getPhaseCheckXYZ(int x, int y, int z)
x
- y
- z
- public short getPhase(int x, int y)
x
- y
- public short getPhaseCheckXY(int x, int y)
x
- y
- public MTBImageShort getMTBImage()
public MTBImageShort getMTBImageLabel()
public int getPixelInside()
public int getPixelOutside()
public int getSizeX()
public int getSizeY()
public int getSizeZ()
public int getSizePhase(short phase)
public int getNumPhases()
public String toString()
public boolean isValid(MTBImage invalidImg, int x, int y, int z)
invalidImg
- x
- y
- z
- Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.