Facemorph.mdl
Class multiScaleEdgeMDLFile

java.lang.Object
  extended by Facemorph.mdl.multiScaleEdgeMDLFile
All Implemented Interfaces:
java.lang.Runnable

public class multiScaleEdgeMDLFile
extends java.lang.Object
implements java.lang.Runnable

Multiscale edge minimum description length


Constructor Summary
multiScaleEdgeMDLFile(java.util.ArrayList<java.lang.String> imageFiles)
          Align a set of images
multiScaleEdgeMDLFile(java.util.ArrayList<java.lang.String> imageFiles, PsychoMorphForm psycho, java.lang.String baseDir)
          Align a set of images
multiScaleEdgeMDLFile(java.util.ArrayList<java.lang.String> imageFiles, PsychoMorphForm psycho, java.lang.String baseDir, int minwidth, int maxIts)
          Align a set of images
 
Method Summary
static void createTemplates(Template tem, java.lang.String baseDir, java.util.ArrayList<java.lang.String> outNames)
          Warps the given templates into a set of templates and writes the results to disk
static void createTemplates(Template tem, java.lang.String baseDir, java.util.ArrayList<java.lang.String> imageNames, java.util.ArrayList<java.lang.String> outNames)
          Warps the given templates into a set of templates and writes the results to disk
 java.util.ArrayList<Template> getTemplates(Template tem)
          Warp the given template using the current warping functions
 MultiscaleWarp invertWarp(MultiscaleWarp w)
          Invert a warp
static void main(java.lang.String[] args)
          Main method used for testing
 void optimiseFixed()
          Optimisation with the average fixed throughout each iteration (i.e.
 void optimiseFixedReverse()
          Optimisation with the average fixed throughout each iteration (i.e.
 void optimiseFixedReverse(int i)
          Optimisation with the average fixed throughout each iteration (i.e.
 java.awt.image.BufferedImage readImage(java.lang.String name)
          Read an image from file
static MultiscaleWarp readWarp(java.lang.String name)
          Read a warp from file
 void run()
           
static void writeWarp(MultiscaleWarp lw, java.lang.String name)
          Write a warp to file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

multiScaleEdgeMDLFile

public multiScaleEdgeMDLFile(java.util.ArrayList<java.lang.String> imageFiles)
                      throws java.io.IOException
Align a set of images

Parameters:
imageFiles - the image file names to align
Throws:
java.io.IOException

multiScaleEdgeMDLFile

public multiScaleEdgeMDLFile(java.util.ArrayList<java.lang.String> imageFiles,
                             PsychoMorphForm psycho,
                             java.lang.String baseDir)
                      throws java.io.IOException
Align a set of images

Parameters:
imageFiles - the set of image file names to use
psycho - the psychomorph form (or can be null)
baseDir - the base directory for reading and writing data
Throws:
java.io.IOException

multiScaleEdgeMDLFile

public multiScaleEdgeMDLFile(java.util.ArrayList<java.lang.String> imageFiles,
                             PsychoMorphForm psycho,
                             java.lang.String baseDir,
                             int minwidth,
                             int maxIts)
                      throws java.io.IOException
Align a set of images

Parameters:
imageFiles - the set of image file names to use
psycho - the psychomorph form (or can be null)
baseDir - the base directory for reading and writing data
minwidth - the minimum width
maxIts - the maximum iterations
Throws:
java.io.IOException
Method Detail

writeWarp

public static void writeWarp(MultiscaleWarp lw,
                             java.lang.String name)
                      throws java.io.FileNotFoundException,
                             java.io.IOException
Write a warp to file

Parameters:
lw - the warp to write
name - the file name to write to
Throws:
java.io.FileNotFoundException
java.io.IOException

readWarp

public static MultiscaleWarp readWarp(java.lang.String name)
                               throws java.io.FileNotFoundException,
                                      java.io.IOException,
                                      java.lang.ClassNotFoundException
Read a warp from file

Parameters:
name - the warp to reaad
Returns:
returns the read warp
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

readImage

public java.awt.image.BufferedImage readImage(java.lang.String name)
                                       throws java.io.IOException
Read an image from file

Parameters:
name - the name of the image to read
Returns:
returns the image
Throws:
java.io.IOException

optimiseFixed

public void optimiseFixed()
                   throws java.io.FileNotFoundException,
                          java.io.IOException,
                          java.lang.ClassNotFoundException
Optimisation with the average fixed throughout each iteration (i.e. only recalculated after each pass throught the set)

Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

optimiseFixedReverse

public void optimiseFixedReverse()
                          throws java.io.FileNotFoundException,
                                 java.io.IOException,
                                 java.lang.ClassNotFoundException
Optimisation with the average fixed throughout each iteration (i.e. only recalculated after each pass throught the set) The alignment is performed in the coord system of the subject, not the average.

Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

optimiseFixedReverse

public void optimiseFixedReverse(int i)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException,
                                 java.lang.ClassNotFoundException
Optimisation with the average fixed throughout each iteration (i.e. only recalculated after each pass throught the set) The alignment is performed in the coord system of the subject, not the average.

Parameters:
i - the maximum multiscale levels to go to
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

invertWarp

public MultiscaleWarp invertWarp(MultiscaleWarp w)
Invert a warp

Parameters:
w - the warp to invert
Returns:
the inverse warping function (approximate)

getTemplates

public java.util.ArrayList<Template> getTemplates(Template tem)
                                           throws java.io.FileNotFoundException,
                                                  java.io.IOException,
                                                  java.lang.ClassNotFoundException
Warp the given template using the current warping functions

Parameters:
tem - the Template delineating the mean
Returns:
returns the set of estimated templates
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

createTemplates

public static void createTemplates(Template tem,
                                   java.lang.String baseDir,
                                   java.util.ArrayList<java.lang.String> outNames)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException,
                                   java.lang.ClassNotFoundException
Warps the given templates into a set of templates and writes the results to disk

Parameters:
tem - The basic Template delineating the mean
baseDir - the directory to write to
outNames - the list of file names to write
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

createTemplates

public static void createTemplates(Template tem,
                                   java.lang.String baseDir,
                                   java.util.ArrayList<java.lang.String> imageNames,
                                   java.util.ArrayList<java.lang.String> outNames)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException,
                                   java.lang.ClassNotFoundException
Warps the given templates into a set of templates and writes the results to disk

Parameters:
tem - The basic Template delineating the mean
baseDir - the directory to write to
imageNames - the names of the images to read
outNames - the list of file names to write
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException,
                        java.io.IOException,
                        java.lang.ClassNotFoundException
Main method used for testing

Parameters:
args - the program args
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

run

public void run()
Specified by:
run in interface java.lang.Runnable