@ALDParametrizedClass @ALDDerivedClass public class MTBCVFittingEnergyNonPDE extends MTBGenericEnergyNonPDE
Modifier and Type | Field and Description |
---|---|
private double[] |
c
array to hold means of phases, starting with MTBLevelsetMembership.BG_PHASE
|
private MTBImage |
img
Image to be segmented
|
private double[] |
lambdaArray
An array of lambda values to be set in this energy object during initialization,
i.e. the
init() method. |
private double |
lambdaBg
Lambda for background
|
private double |
lambdaFg
Lambda for foreground
|
private double[] |
lambdaForOptimization
array to hold lambdas of phases, starting with MTBLevelsetMembership.BG_PHASE
|
private int |
numPhases
number of phases including background
|
debug, name
Constructor and Description |
---|
MTBCVFittingEnergyNonPDE()
Construct an energy object for the level set function
phi realizing the fitting term of the Chan-Vese energy. |
MTBCVFittingEnergyNonPDE(double lambdaBg,
double lambdaFg)
Construct an energy object realizing the fitting term of the Chan-Vese energy.
|
MTBCVFittingEnergyNonPDE(double lambdaBg,
double lambdaFg,
double[] lambdaArray)
Construct an energy object realizing the fitting term of the Chan-Vese energy.
|
MTBCVFittingEnergyNonPDE(MTBImage img,
MTBLevelsetMembership phi,
double lambdaBg,
double lambdaFg)
Construct an energy object with the initial level set function
phi
realizing the fitting term of the Chan-Vese energy to segment img . |
Modifier and Type | Method and Description |
---|---|
double |
deltaE(int x,
int y,
int z,
MTBLevelsetMembership phi)
Calculate differences of energy if the pixel/voxel (x,y,z) changes its phase in
the levelest function
phi supplied as argument and assumed to be
associated with this energy object. |
double |
deltaE(int x,
int y,
int z,
short newPhase,
MTBLevelsetMembership phi)
Calculate differences of energy if the pixel/voxel (x,y,z) is changed
from its current phase in the level set function
phi supplied
from current phase to newPhase . |
double |
E(MTBLevelsetMembership phi)
Return the complete energy for the level set function
phi . |
protected void |
estimateParams(MTBLevelsetMembership phi)
Estimate internal parameters (if any) for the level set function
phi
assumed to be associated with this energy object. |
double[] |
getLambdaArray() |
MTBGenericEnergyNonPDE |
init(MTBImage img,
MTBLevelsetMembership phi)
Initialize the energy object.
|
void |
print(MTBLevelsetMembership phi,
PrintStream out,
String indent)
Print this energy object - including the value of the energy for
phi assumed to be associated with this energy object. |
void |
setLambdaArray(double[] lambdaArray) |
String |
toString()
Return an ascii representation identifying the energy and internal parameters,
but not the state.
|
void |
updateParams(int x,
int y,
int z,
MTBLevelsetMembership phi)
Update parameters (if any) of the energy object which depend on
the associated level set function.
|
void |
updateParams(int x,
int y,
int z,
short newPhase,
MTBLevelsetMembership phi)
Update parameters (if any) of the energy object which depend on
the associated level set function.
|
getNewIndent, setDebug
@ALDClassParameter(label="Lambda fg", dataIOOrder=1) private double lambdaFg
@ALDClassParameter(label="Lambda bg", dataIOOrder=2) private double lambdaBg
@ALDClassParameter(label="Input image", dataIOOrder=3) private MTBImage img
private int numPhases
private double[] lambdaArray
init()
method. This is an alternative to supply lambdas
besides setting the members lambdaFg
and lambdaBg
:
The first value (with index 0) is taken as the lambda for the background phase, the subsequent
values for the foreground phases. If the array is longer as the number of phases superfluous
values are ignored. If it is shorter then the number of phases lambdaFg
and/or
lambdaBg
are used for the foreground resp. background phase.
null
, which is handled equivalent to a size of zero.private double[] lambdaForOptimization
private double[] c
public MTBCVFittingEnergyNonPDE()
phi
realizing the fitting term of the Chan-Vese energy.public MTBCVFittingEnergyNonPDE(double lambdaBg, double lambdaFg)
lambdaBg
- Weight for background phaselambdaFg
- Weight for foreground phasepublic MTBCVFittingEnergyNonPDE(double lambdaBg, double lambdaFg, double[] lambdaArray)
lambdaBg
- Weight for background phaselambdaFg
- Weight for foreground phasepublic MTBCVFittingEnergyNonPDE(MTBImage img, MTBLevelsetMembership phi, double lambdaBg, double lambdaFg)
phi
realizing the fitting term of the Chan-Vese energy to segment img
.
The weight for the background is lambdaBg and for all for all object phases an identically lambdaFg.img
- Image to be segmentedphi
- Level set function to construct the energy object forlambdaBg
- Weight for background phaselambdaFg
- Weight for foreground phasepublic MTBGenericEnergyNonPDE init(MTBImage img, MTBLevelsetMembership phi)
NOTE: The image provided as argument to this method is only associated with the energy object, if not already set!! This rational behind this is to allow the energy to be supplied generically with the input image and while it is still possible to set an image deviating from this default.
init
in class MTBGenericEnergyNonPDE
img
- Image to be segmentedphi
- Level set function to construct the energy object forpublic double deltaE(int x, int y, int z, MTBLevelsetMembership phi)
MTBGenericEnergyNonPDE
phi
supplied as argument and assumed to be
associated with this energy object.
This version makes sense only for two phase level set function. In the multi phase case any object phase is changed to the background, while a background pixel/voxel is changed to the first object phase.
deltaE
in class MTBGenericEnergyNonPDE
phi
- level set function assumed to be associated with this energy objectpublic double deltaE(int x, int y, int z, short newPhase, MTBLevelsetMembership phi)
MTBGenericEnergyNonPDE
phi
supplied
from current phase to newPhase
.deltaE
in class MTBGenericEnergyNonPDE
newPhase
- new phase to change the pixel/voxel tophi
- level set function assumed to be associated with this energy objectpublic double E(MTBLevelsetMembership phi)
MTBGenericEnergyNonPDE
phi
.
E
in class MTBGenericEnergyNonPDE
phi
- level set function assumed to be associated with this energy objectpublic void updateParams(int x, int y, int z, MTBLevelsetMembership phi)
MTBGenericEnergyNonPDE
This method is called to update the parameters if is is intended to change a pixel/voxel to the other state,
assuming a two phase level set function.
For a multi phase level set function flipping of phases is realized
in MTBGenericEnergyNonPDE.deltaE(int, int, int, short, de.unihalle.informatik.MiToBo.segmentation.levelset.nonPDE.MTBLevelsetMembership)
.
Note: The level set function phi
is still in the old state and is
assumed to be to updated subsequently.
updateParams
in class MTBGenericEnergyNonPDE
phi
- assumed to be associated with this energy objectpublic void updateParams(int x, int y, int z, short newPhase, MTBLevelsetMembership phi)
MTBGenericEnergyNonPDE
This method is called to update the parameters if is is intended to change the
phase of a pixel/voxel to newPhase
.
Note: The level set function phi
is still in the old state and is
assumed to be to updated subsequently.
updateParams
in class MTBGenericEnergyNonPDE
newPhase
- new phase to change pixel/voxel tophi
- assumed to be associated with this energy objectprotected void estimateParams(MTBLevelsetMembership phi)
MTBGenericEnergyNonPDE
phi
assumed to be associated with this energy object.estimateParams
in class MTBGenericEnergyNonPDE
public double[] getLambdaArray()
public void setLambdaArray(double[] lambdaArray)
lambdaArray
- the lambdaArray to setpublic String toString()
MTBGenericEnergyNonPDE
toString
in class MTBGenericEnergyNonPDE
public void print(MTBLevelsetMembership phi, PrintStream out, String indent)
MTBGenericEnergyNonPDE
phi
assumed to be associated with this energy object.
Each line output is prefixed with the string indent
.
Note: this may be an expensive operation.print
in class MTBGenericEnergyNonPDE
phi
- level set function assumed to be associated with this energy objectout
- stream to print toindent
- indentation stringCopyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.