Class CAAMVisualizer


  • public class CAAMVisualizer
    extends java.lang.Object
    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 $ Class that visualizes different aspects of a model. For visualization of e.g. annotations without a model see CAAMUtil.
    Author:
    Ruida Cheng
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private CAAMModel m_pModel
      AAM model reference.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean CombinedMovie​(java.lang.String filename, int nbModes, double range, int steps, boolean whiteBackground)
      Generates movies files showing each mode of combined shape and texture variation by adjusting the each mode of variation to: +/- 'range' times in 2*'step'+1 steps.
      void dispose()
      dispose memory
      void OptimizationMovie​(java.util.Vector<CAAMOptState> optStates, ModelSimpleImage img, java.lang.String filename)
      Wrapper to visualizes the iterations during a model search.
      void OptimizationMovie​(java.util.Vector<CAAMOptState> optStates, ModelSimpleImage img, java.lang.String filename, int frameRate)
      Visualizes the iterations during a model search.
      boolean RegistrationMovie​(java.lang.String filename, java.util.Vector<CDVector> vTexture)
      Generates a movie of the registered training set.
      boolean ShapeMovie​(java.lang.String filename, int nbModes, double range, int steps, boolean whiteBackground)
      Generates movies files showing each mode of shape variation by adjusting the each mode of variation to +/- 'range' times in 2*'step'+1 steps.
      static void ShapeStill​(ModelSimpleImage img, CAAMShape shape, java.lang.String filename)
      Plots a shape into an image and save it to disk.
      boolean TextureMovie​(java.lang.String filename, int nbModes, double range, int steps, boolean whiteBackground)
      Generates movies files showing each mode of texture variation by adjusting the each mode of variation to +/- 'range' times in 2*'step'+1 steps.
      void WriteEigenImages()
      Writes the texture eigen modes as shape-free images.
      void WritePredictionImages()
      Writes the parameter update matrix as shape-free images.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_pModel

        private CAAMModel m_pModel
        AAM model reference.
    • Constructor Detail

      • CAAMVisualizer

        public CAAMVisualizer​(CAAMModel pModel)
        Constructor. Constructor that sets the model pointer.
        Parameters:
        pModel - Pointer to the model that you want visualised.
    • Method Detail

      • dispose

        public void dispose()
        dispose memory
      • OptimizationMovie

        public void OptimizationMovie​(java.util.Vector<CAAMOptState> optStates,
                                      ModelSimpleImage img,
                                      java.lang.String filename)
        Wrapper to visualizes the iterations during a model search.
        Parameters:
        optStates - optimization state vector
        img - image
        filename - file name.
      • OptimizationMovie

        public void OptimizationMovie​(java.util.Vector<CAAMOptState> optStates,
                                      ModelSimpleImage img,
                                      java.lang.String filename,
                                      int frameRate)
        Visualizes the iterations during a model search. This method visualizes the iterations during a model search. Output format is an AVI-file that you can put into e.g. Powerpoint to impress your supervisor with.
        Parameters:
        optStates - An array of optimization states.
        img - The image used for model searching.
        filename - The output movie filename, e.g. 'search.avi'.
        frameRate - The number of frame per second.
      • ShapeStill

        public static void ShapeStill​(ModelSimpleImage img,
                                      CAAMShape shape,
                                      java.lang.String filename)
        Plots a shape into an image and save it to disk.
        Parameters:
        img - Image to plot shape onto.
        shape - Shape in image coordinates.
        fileman - Destination image file, e.g. 'result.bmp'.
      • WriteEigenImages

        public void WriteEigenImages()
        Writes the texture eigen modes as shape-free images. This method converts each column of the texture eigen vectors into corresponding shape-free images and save them to disk in the BMP format.
      • WritePredictionImages

        public void WritePredictionImages()
        Writes the parameter update matrix as shape-free images. This method converts each column of the parameter update matrices into corresponding shape-free images and save them to disk in the BMP format.
      • TextureMovie

        public boolean TextureMovie​(java.lang.String filename,
                                    int nbModes,
                                    double range,
                                    int steps,
                                    boolean whiteBackground)
        Generates movies files showing each mode of texture variation by adjusting the each mode of variation to +/- 'range' times in 2*'step'+1 steps.
        Parameters:
        filename - The output filename excl. extension.
        nbModes - The number of modes to generate movies from.
        range - The rendered range in standard deviations.
        steps - The number of frames to generate to reach 'range'. Thus the total number of frames will be 2*step+1. (the +1 term is the mean texture).
        whiteBackground - If true the background is rendered in white. Default is black.
        Returns:
        true on success, false on file errors.
      • ShapeMovie

        public boolean ShapeMovie​(java.lang.String filename,
                                  int nbModes,
                                  double range,
                                  int steps,
                                  boolean whiteBackground)
        Generates movies files showing each mode of shape variation by adjusting the each mode of variation to +/- 'range' times in 2*'step'+1 steps.
        Parameters:
        filename - The output filename excl. extension.
        nbModes - The number of modes to generate movies from.
        range - The rendered range in standard deviations.
        steps - The number of frames to generate to reach 'range'. Thus the total number of frames will be 2*step+1. (the +1 term is the mean shape).
        whiteBackground - If true the background is rendered in white. Default is black.
        Returns:
        true on success, false on file errors.
      • CombinedMovie

        public boolean CombinedMovie​(java.lang.String filename,
                                     int nbModes,
                                     double range,
                                     int steps,
                                     boolean whiteBackground)
        Generates movies files showing each mode of combined shape and texture variation by adjusting the each mode of variation to: +/- 'range' times in 2*'step'+1 steps.
        Parameters:
        filename - The output filename excl. extension.
        nbModes - The number of modes to generate movies from.
        range - The rendered range in standard deviations.
        steps - The number of frames to generate to reach 'range'. Thus the total number of frames will be 2*step+1. (the +1 term is the mean shape).
        whiteBackground - If true the background is rendered in white. Default is black.
        Returns:
        true on success, false on file errors.
      • RegistrationMovie

        public boolean RegistrationMovie​(java.lang.String filename,
                                         java.util.Vector<CDVector> vTexture)
        Generates a movie of the registered training set. Generates a movie of the registered training set by warping each texture to the mean shape and output this to an AVI-file.
        Parameters:
        filename - The output filename.
        m_vTexture - The vector of textures.
        Returns:
        true on success, false on file errors.