Facemorph.psychomorph
Class Average

java.lang.Object
  extended by Facemorph.psychomorph.Average
All Implemented Interfaces:
Batchable

public class Average
extends java.lang.Object
implements Batchable

Batchable for making averages


Constructor Summary
Average(PsychoMorphForm parent, java.io.File f, boolean overlap)
          Constructor for averages
Average(PsychoMorphForm parent, java.io.File f, boolean mrfTransform, Template avTem, boolean overlap)
          Constructor for averages
 
Method Summary
 void finish()
          Performs any processing required at the end of the batch loading,
 Template getAverageTemplate()
          Get the average template
 java.util.ArrayList<FloatImage> getFloatImages()
          Get the float image array of the intensity channel
 java.lang.String getName()
          Gets the name of the Batchable, used in to put them on the psychomorph menu in the form (for "My Bachable"): - My Batchable - Batch My Batchable
 boolean getReadTemplate()
          Indicates if templates should be read in during batch operation
 java.util.ArrayList<Template> getTemplates()
          Get the set of templates to average
 boolean getWriteImage()
          Indicates if images should be written out during batch operation
 boolean getWriteTemplate()
          Indicates if templates should be written out during batch operation
 boolean initialise(PsychoMorphForm psychomorph)
          Initialise the Batchable This is called each time the batchable is selected
 boolean process(ImageZoomPanel izp, boolean single)
          The process method is called for each image in the list, or for the current image in single mode
 void setAverageTemplate(Template tem)
          Set the average template
 void setOutputSize(int w, int h)
          Set the size of the output image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Average

public Average(PsychoMorphForm parent,
               java.io.File f,
               boolean overlap)
Constructor for averages

Parameters:
parent - the parent component
f - the file containing the image - template list
overlap - should overlap control be used when warping

Average

public Average(PsychoMorphForm parent,
               java.io.File f,
               boolean mrfTransform,
               Template avTem,
               boolean overlap)
Constructor for averages

Parameters:
parent - the parent component
f - the file containing the image - template list
mrfTransform - should MRF processing be used
avTem - the average template, if null it is calculated from the file
overlap - should overlap control be used when warping
Method Detail

process

public boolean process(ImageZoomPanel izp,
                       boolean single)
Description copied from interface: Batchable
The process method is called for each image in the list, or for the current image in single mode

Specified by:
process in interface Batchable
Parameters:
izp - The ImageZoomPanel holds the image and Template to process
single - this indicates that we are (or are not) in bacth mode. Useful for things like saving undo data (for single) or not (for batch)
Returns:
returns true if the processing was successfule, or false if not

finish

public void finish()
Description copied from interface: Batchable
Performs any processing required at the end of the batch loading,

Specified by:
finish in interface Batchable

setOutputSize

public void setOutputSize(int w,
                          int h)
Set the size of the output image

Parameters:
w - width
h - height

getTemplates

public java.util.ArrayList<Template> getTemplates()
Get the set of templates to average

Returns:
return the set of templates

getAverageTemplate

public Template getAverageTemplate()
Get the average template

Returns:
the average template

setAverageTemplate

public void setAverageTemplate(Template tem)
Set the average template

Parameters:
tem - teh average template to use

getFloatImages

public java.util.ArrayList<FloatImage> getFloatImages()
Get the float image array of the intensity channel

Returns:
returns the float image array

getName

public java.lang.String getName()
Description copied from interface: Batchable
Gets the name of the Batchable, used in to put them on the psychomorph menu in the form (for "My Bachable"): - My Batchable - Batch My Batchable

Specified by:
getName in interface Batchable
Returns:
return the name of your Batchable aas a String

initialise

public boolean initialise(PsychoMorphForm psychomorph)
Description copied from interface: Batchable
Initialise the Batchable This is called each time the batchable is selected

Specified by:
initialise in interface Batchable
Parameters:
psychomorph - the main psychomorph object
Returns:
returns true if initialised OK

getReadTemplate

public boolean getReadTemplate()
Description copied from interface: Batchable
Indicates if templates should be read in during batch operation

Specified by:
getReadTemplate in interface Batchable
Returns:
return true if the template should be read

getWriteTemplate

public boolean getWriteTemplate()
Description copied from interface: Batchable
Indicates if templates should be written out during batch operation

Specified by:
getWriteTemplate in interface Batchable
Returns:
return true if the template should be written

getWriteImage

public boolean getWriteImage()
Description copied from interface: Batchable
Indicates if images should be written out during batch operation

Specified by:
getWriteImage in interface Batchable
Returns:
return true if the image should be written