com.grocottlab.atlas_toolkit
Class OrthogonalTransformSequence

java.lang.Object
  extended by com.grocottlab.atlas_toolkit.OrthogonalTransformSequence
All Implemented Interfaces:
Serializable

public class OrthogonalTransformSequence
extends Object
implements Serializable

A class for storing a sequence of orthogonal 2D transformation coefficients generated by bUnwarpJ. To transform 3D (XYZ) image stack, a set of 2D transformation coefficients is applied in each of three orthogonal planes (e.g. XY, YZ, ZX). Transformation can be initiated in any plane, and three orthogonal transformations are applied per iteration. The class also provides methods for saving and re-opening the orthogonal transform sequence.

See Also:
Serialized Form

Nested Class Summary
static class OrthogonalTransformSequence.OrthogonalPlane
           
 
Constructor Summary
OrthogonalTransformSequence(OrthogonalTransform[][] ot, int[] dimensions)
          Constructor.
 
Method Summary
 double[][] getCoefficientsX(OrthogonalTransformSequence.OrthogonalPlane orthoplane, int iteration)
          Gets the X coefficients of the 2D (XY) transform for the specified orthogonal plane and iteration.
 double[][] getCoefficientsY(OrthogonalTransformSequence.OrthogonalPlane orthoplane, int iteration)
          Gets the Y coefficients of the 2D (XY) transform for the specified orthogonal plane and iteration.
 int[] getDimensions()
           
 int getIntervals(OrthogonalTransformSequence.OrthogonalPlane orthoplane, int iteration)
           
 int getIterations()
          Gets the number of iterations in this OrthogonalTransformSequence.
 OrthogonalTransform getOrthogonalTransform(OrthogonalTransformSequence.OrthogonalPlane orthoplane, int iteration)
          Gets the transformation coefficients (as an OrthogonalTransform object) for the given orthogonal plane and iteration.
static OrthogonalTransformSequence openOTS(String path)
          Generates an OrthogonalTransformSequence object from a previously saved ".ots" file.
 void saveToFile(String path)
          Saves this OrthogonalTransformSequence object to an ".ots" file.
 void setOrthogonalTransform(OrthogonalTransform ot, OrthogonalTransformSequence.OrthogonalPlane orthoplane, int iteration)
          Sets the transformation coefficients (as an OrthogonalTransform object) for the given orthogonal plane and iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrthogonalTransformSequence

public OrthogonalTransformSequence(OrthogonalTransform[][] ot,
                                   int[] dimensions)
Constructor. Takes a list of OrthogonalTransform objects - one for each orthogonal plane (= three), with three orthogonal planes per iteration.

Parameters:
ot - A 2D array of OrthogonalTransform objects, each containing a set of 2D transformation coefficients generated by bUnwarpJ.
The first index refers to iteration and the second to orthogonal plane.
dimensions -
Method Detail

openOTS

public static OrthogonalTransformSequence openOTS(String path)
Generates an OrthogonalTransformSequence object from a previously saved ".ots" file.

Parameters:
path - The absolute file path.
Returns:
The re-opened OrthogonalTransformSequence object.

setOrthogonalTransform

public void setOrthogonalTransform(OrthogonalTransform ot,
                                   OrthogonalTransformSequence.OrthogonalPlane orthoplane,
                                   int iteration)
Sets the transformation coefficients (as an OrthogonalTransform object) for the given orthogonal plane and iteration.

Parameters:
ot - OrthogonalTransform object containing transformation coefficients for a single plane.
orthoplane - Specifies the orthogonal plane for these coefficients as defined by the Enum OrthogonalTransformSequence.OrthogonalPlane.
iteration - Specifies the iteration number.

getOrthogonalTransform

public OrthogonalTransform getOrthogonalTransform(OrthogonalTransformSequence.OrthogonalPlane orthoplane,
                                                  int iteration)
Gets the transformation coefficients (as an OrthogonalTransform object) for the given orthogonal plane and iteration.

Parameters:
orthoplane - Specifies the orthogonal plane for these coefficients as defined by the Enum OrthogonalTransformSequence.OrthogonalPlane.
iteration - Specifies the iteration number.
Returns:
An OrthogonalTransform object containing the transformation coefficients.

getCoefficientsX

public double[][] getCoefficientsX(OrthogonalTransformSequence.OrthogonalPlane orthoplane,
                                   int iteration)
Gets the X coefficients of the 2D (XY) transform for the specified orthogonal plane and iteration.

Parameters:
orthoplane - Specifies the orthogonal plane for these coefficients as defined by the Enum OrthogonalTransformSequence.OrthogonalPlane.
iteration - Specifies the iteration number.
Returns:
A double[][] containing the X coefficients.

getCoefficientsY

public double[][] getCoefficientsY(OrthogonalTransformSequence.OrthogonalPlane orthoplane,
                                   int iteration)
Gets the Y coefficients of the 2D (XY) transform for the specified orthogonal plane and iteration.

Parameters:
orthoplane - Specifies the orthogonal plane for these coefficients as defined by the Enum OrthogonalTransformSequence.OrthogonalPlane.
iteration - Specifies the iteration number.
Returns:
A double[][] containing the Y coefficients.

getIntervals

public int getIntervals(OrthogonalTransformSequence.OrthogonalPlane orthoplane,
                        int iteration)

getIterations

public int getIterations()
Gets the number of iterations in this OrthogonalTransformSequence.

Returns:
The number of iterations.

getDimensions

public int[] getDimensions()

saveToFile

public void saveToFile(String path)
Saves this OrthogonalTransformSequence object to an ".ots" file. The ".ots" file can be re-opened using the static method openOTS().

Parameters:
path - The absolute file path.


Copyright © 2009-2015 ImageJ. All Rights Reserved.