Class CAAMModelMS
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.AAM.CAAMObject
-
- gov.nih.mipav.view.renderer.WildMagic.AAM.CAAMModel
-
- gov.nih.mipav.view.renderer.WildMagic.AAM.CAAMModelMS
-
public class CAAMModelMS extends CAAMModel
This is the Java modified version of C++ active appearance model API (AAM_API). It is modified with a subset of required functions for automatic MRI prostate segmentation. AAM-API LICENSE - file: license.txt This software is freely available for non-commercial use such as research and education. Please see the full disclaimer below. All publications describing work using this software should cite the reference given below. Copyright (c) 2000-2003 Mikkel B. Stegmann, mbs@imm.dtu.dk IMM, Informatics & Mathematical Modelling DTU, Technical University of Denmark Richard Petersens Plads, Building 321 DK-2800 Lyngby, Denmark http://www.imm.dtu.dk/~aam/ REFERENCES Please use the reference below, when writing articles, reports etc. where the AAM-API has been used. A draft version the article is available from the homepage. I will be happy to receive pre- or reprints of such articles. /Mikkel ------------- M. B. Stegmann, B. K. Ersboll, R. Larsen, "FAME -- A Flexible Appearance Modelling Environment", IEEE Transactions on Medical Imaging, IEEE, 2003 (to appear) ------------- 3RD PART SOFTWARE The software is partly based on the following libraries: - The Microsoft(tm) Vision Software Developers Kit, VisSDK - LAPACK DISCLAIMER This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any non-commercial purpose, and to alter it, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. -- No guarantees of performance accompany this software, nor is any responsibility assumed on the part of the author or IMM. This software is provided by Mikkel B. Stegmann and IMM ``as is'' and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall IMM or Mikkel B. Stegmann be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. $Revision: 1.4 $ $Date: 2003/04/23 14:49:15 $ Multi-scale derivation of CAAModel. Smaller models are stored in m_vModels.- Author:
- Ruida Cheng
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Vector<ModelSimpleImage>
m_vImagePyr
Image VOIs vector.protected java.util.Vector<CAAMModel>
m_vModels
Model vector.-
Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.AAM.CAAMModel
m_bUseConvexHull, m_bUseTangentSpace, m_CombinedPCA, m_dAddExtents, m_dAMFVersion, m_dBuildTime, m_DisplacementPCA, m_dMeanShapeSize, m_iCombinedTrunc, m_iLearningMethod, m_iModelReduction, m_iNShapes, m_iShapeTrunc, m_iTextureSamples, m_iTextureTrunc, m_mQgEV, m_mQsEV, m_mShape2PixelWeights, m_mShapeInstance, m_mTextureInstance, m_pAnalyzeSynthesize, m_pReferenceFrame, m_pShapeBasis, m_pTextureBasis, m_pTextureTF, m_R_c, m_R_t, m_sCurrentAnalyzeId, m_ShapePCA, m_sMeanAShape, m_TexturePCA, m_vMeanTexture, m_vMeanTextureOrg, m_vPoseParameterUpdateConstraints, m_vShapeParameterConstraintsMean, m_vShapeParameterConstraintsSD, m_vTextureVar
-
-
Constructor Summary
Constructors Constructor Description CAAMModelMS()
Default multi-scale constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
BuildAllLevels(int nLevels, java.lang.String inDir, java.lang.String acf)
Wrapper for automate model generation.void
BuildAllLevels(int nLevels, java.lang.String inDir, java.lang.String acf, int modelReduction, int excludeShape)
Driver method for model generation.void
BuildAllLevels(int nLevels, java.util.Vector<java.lang.String> asfFiles, java.lang.String acf, int modelReduction, int excludeShape)
Driver method for model generation.void
BuildPyr(ModelSimpleImage image)
Builds an image pyramid (if its not cached beforehand).void
dispose()
dispose memoryCAAMModel
GetSmallest()
Get the smallest modelCAAMModel
Model(int i)
Get the model at level i.int
NLevels()
Get the number of levels.CAAMOptRes
OptimizeModel(ModelSimpleImage image, CAAMShape s, CDVector c, int maxIterations, java.util.Vector<CAAMOptState> pOptStates, boolean disableDamping)
Performs AAM optimization of a shape containing initial pose using a model pyramid.boolean
ReadModel(java.lang.String basename)
Reads the complete AAMModel from disk.boolean
WriteModel(java.lang.String filename, boolean txt_only)
Writes the complete multi-scale AAMModel to disk as a set of .txt and an .amf files.-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.AAM.CAAMModel
AddExtents, ApproxExample, assign, Combined2ShapeParam, Combined2TexParam, CombinedPCA, ConstrainSearchParameters, EstimatePose, getNumberShapeParameters, IsConvexHullUsed, MeanShape, MeanShapeSize, MeanTexture, ModelEstimateTexDiff, ModelEstimateTexDiff, ModelImage, ModelImage, ModelImageEx, ModelReduction, NBands, NormalizeTexture, NTextureSamples, OptimizeModel, OptimizeModel, OptimizeModelByFineTuning, Qg, Qs, Rc, ReductionFactor, ReferenceFrame, ReferenceShape, Rt, SampleShape, SampleShape, SampleShape, SampleShape, SetPoseParameterUpdateConstraints, SetShapeParameterUpdateConstraints, Shape2Combined, Shape2Param, Shape2PixelWeights, ShapeBasis, ShapeFreeImage, ShapeFreeImage, ShapeFreeImage, ShapeInstance, ShapePCA, ShapePCAInstance, ShapeTex2Combined, ShapeTex2Param, ShapeTexParam2Combined, ShapeTexParam2Combined, ShapeTexParam2Combined, TextureBasis, TextureInstance, TexturePCA, TextureTF, WriteModel, WriteVarianceMap
-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.AAM.CAAMObject
FromFile, ToFile
-
-
-
-
Field Detail
-
m_vModels
protected java.util.Vector<CAAMModel> m_vModels
Model vector.
-
m_vImagePyr
protected java.util.Vector<ModelSimpleImage> m_vImagePyr
Image VOIs vector.
-
-
Method Detail
-
BuildAllLevels
public void BuildAllLevels(int nLevels, java.lang.String inDir, java.lang.String acf)
Wrapper for automate model generation.- Parameters:
nLevels
- number level in multi-scaleinDir
- input diracf
- aam configuration file
-
BuildAllLevels
public void BuildAllLevels(int nLevels, java.lang.String inDir, java.lang.String acf, int modelReduction, int excludeShape)
Driver method for model generation. This method automates the model generation as much as possible by using the various class methods for all the sequences in the task of producing a model.- Parameters:
nLevels
- The number of levels the multi-scale AAM should be in. Default 3.inDir
- Input directory where annotations (.asf) resides.acf
- Filename of an AAM configuration file. If omitted defaults are used.modelReduction
- Model reduction multiplier. Default off == 1. This sets the size of the lowest level in the model pyramid, i.e. level 0.excludeShape
- Excludes one shape number 'excludeShape' from the input directory. Default -1, i.e. no shapes are removed. Used to perform leave-one-out testing.
-
BuildAllLevels
public void BuildAllLevels(int nLevels, java.util.Vector<java.lang.String> asfFiles, java.lang.String acf, int modelReduction, int excludeShape)
Driver method for model generation. This method automates the model generation as much as possible by using the various class methods for all the sequences in the task of producing a model.- Parameters:
nLevels
- The number of levels the multi-scale AAM should be in. Default 3.asfFiles
- Vector of asf filenames.acf
- Filename of an AAM configuration file. If omitted defaults are used.modelReduction
- Model reduction multiplier. Default off == 1. This sets the size of the lowest level in the model pyramid, i.e. level 0.excludeShape
- Excludes one shape number 'excludeShape' from the input directory. Default -1, i.e. no shapes are removed. Used to perform leave-one-out testing.
-
WriteModel
public boolean WriteModel(java.lang.String filename, boolean txt_only)
Writes the complete multi-scale AAMModel to disk as a set of .txt and an .amf files.- Overrides:
WriteModel
in classCAAMModel
- Parameters:
filename
- Output filename without any extension. Multi-scale prefixes will be added.txt_only
- If true binary model data is not written.- Returns:
- true on success, false on file errors.
-
ReadModel
public boolean ReadModel(java.lang.String basename)
Reads the complete AAMModel from disk.
-
OptimizeModel
public CAAMOptRes OptimizeModel(ModelSimpleImage image, CAAMShape s, CDVector c, int maxIterations, java.util.Vector<CAAMOptState> pOptStates, boolean disableDamping)
Performs AAM optimization of a shape containing initial pose using a model pyramid.- Overrides:
OptimizeModel
in classCAAMModel
- Parameters:
image
- The image to search in (in size corresponding to level zero).s
- The initial shape (also containing the inital pose, thus; not a normalized shape). Actually only the pose of 's' is used (to align the reference shape as the initial shape). NOTE: The optimal shape is returned in 's' after execution. NOTE: 's' is defined at level 0, i.e. shapes should have the same size as when calling CAAMModel::OptimizeModel() directly.c
- The optimal model parameters at level zero. Unlike CAAMModel::OptimizeModel() the content of this vector is not used, since the optimisation is started the smallest (i.e. top) level of the pyramid. NOTE: The optimal model parameters are returned in 'c' after execution.maxIterations
- The maximum iterations allowed at each level.pOptStates
- Optional parameter convergence info (at level zero) can be returned in. See CAAMOptState.disableDamping
- Disables the damping steps (default false).- Returns:
- The results of the optimization in the form of a 'CAAMOptRes' instance.
-
BuildPyr
public void BuildPyr(ModelSimpleImage image)
Builds an image pyramid (if its not cached beforehand). The pyramid is stored in m_VImagePyr.- Parameters:
image
- Input image that should be convertet to a pyramid. This image is assumed to live to the *complete* usage of the pyramid, since level 0 is a pointer to this image.
-
Model
public final CAAMModel Model(int i)
Get the model at level i.- Parameters:
i
- level- Returns:
- model
-
NLevels
public final int NLevels()
Get the number of levels.- Returns:
- levels number
-
GetSmallest
public final CAAMModel GetSmallest()
Get the smallest model- Returns:
- model
-
-