bunwarpj
Class FinalAction

java.lang.Object
  extended by bunwarpj.FinalAction
All Implemented Interfaces:
java.lang.Runnable

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

Class to launch the registration in bUnwarpJ. This is the class called from the main plugin class after recollecting the registration parameters from the main dialog.


Field Summary
private  int accurate_mode
          level of accuracy
private  double consistencyWeight
          weight for the deformations consistency
private  double curlWeight
          curl weight
private  MainDialog dialog
          dialog for bUnwarpJ interface
private  double divWeight
          divergence weight
private  double imageWeight
          weight for image similarity
private  double landmarkWeight
          landmark weight
private  int max_scale_deformation
          maximum scale deformation
private  int maxImageSubsamplingFactor
          image subsampling factor at highest resolution level
private  int min_scale_deformation
          minimum scale deformation
private  int min_scale_image
          minimum image scale
private  int outputLevel
          flag to specify the level of resolution in the output
private  boolean showMarquardtOptim
          flag to show the optimizer
private  BSplineModel source
          source image model
private  double[][] sourceAffineMatrix
          source initial affine matrix
private  ij.ImagePlus sourceImp
          image representation for the source
private  Mask sourceMsk
          source image mask
private  PointHandler sourcePh
          point handler for the landmarks in the source image
private  double stopThreshold
          stopping threshold
private  java.lang.Thread t
          thread to run the registration method
private  BSplineModel target
          target image model
private  double[][] targetAffineMatrix
          target initial affine matrix
private  ij.ImagePlus targetImp
          image representation for the target
private  Mask targetMsk
          target image mask
private  PointHandler targetPh
          point handler for the landmarks in the target image
 
Constructor Summary
FinalAction(MainDialog dialog)
          Start a thread under the control of the main event loop.
 
Method Summary
 java.lang.Thread getThread()
          Get the thread.
 ij.ImagePlus[] initializeOutputIPs()
          Initialize output image plus
 void run()
          Perform the registration
 void setup(ij.ImagePlus sourceImp, ij.ImagePlus targetImp, BSplineModel source, BSplineModel target, PointHandler sourcePh, PointHandler targetPh, Mask sourceMsk, Mask targetMsk, double[][] sourceAffineMatrix, double[][] targetAffineMatrix, int min_scale_deformation, int max_scale_deformation, int min_scale_image, double divWeight, double curlWeight, double landmarkWeight, double imageWeight, double consistencyWeight, double stopThreshold, int outputLevel, boolean showMarquardtOptim, int accurate_mode, int maxImageSubsamplingFactor)
          Pass parameter from MainDialog to FinalAction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

t

private java.lang.Thread t
thread to run the registration method


dialog

private MainDialog dialog
dialog for bUnwarpJ interface


sourceImp

private ij.ImagePlus sourceImp
image representation for the source


targetImp

private ij.ImagePlus targetImp
image representation for the target


source

private BSplineModel source
source image model


target

private BSplineModel target
target image model


sourcePh

private PointHandler sourcePh
point handler for the landmarks in the source image


targetPh

private PointHandler targetPh
point handler for the landmarks in the target image


sourceMsk

private Mask sourceMsk
source image mask


targetMsk

private Mask targetMsk
target image mask


sourceAffineMatrix

private double[][] sourceAffineMatrix
source initial affine matrix


targetAffineMatrix

private double[][] targetAffineMatrix
target initial affine matrix


min_scale_deformation

private int min_scale_deformation
minimum scale deformation


max_scale_deformation

private int max_scale_deformation
maximum scale deformation


min_scale_image

private int min_scale_image
minimum image scale


outputLevel

private int outputLevel
flag to specify the level of resolution in the output


showMarquardtOptim

private boolean showMarquardtOptim
flag to show the optimizer


divWeight

private double divWeight
divergence weight


curlWeight

private double curlWeight
curl weight


landmarkWeight

private double landmarkWeight
landmark weight


imageWeight

private double imageWeight
weight for image similarity


consistencyWeight

private double consistencyWeight
weight for the deformations consistency


stopThreshold

private double stopThreshold
stopping threshold


accurate_mode

private int accurate_mode
level of accuracy


maxImageSubsamplingFactor

private int maxImageSubsamplingFactor
image subsampling factor at highest resolution level

Constructor Detail

FinalAction

public FinalAction(MainDialog dialog)
Start a thread under the control of the main event loop. This thread has access to the progress bar, while methods called directly from within MainDialog do not because they are under the control of its own event loop.

Method Detail

getThread

public java.lang.Thread getThread()
Get the thread.

Returns:
the thread associated with this FinalAction object

run

public void run()
Perform the registration

Specified by:
run in interface java.lang.Runnable

setup

public void setup(ij.ImagePlus sourceImp,
                  ij.ImagePlus targetImp,
                  BSplineModel source,
                  BSplineModel target,
                  PointHandler sourcePh,
                  PointHandler targetPh,
                  Mask sourceMsk,
                  Mask targetMsk,
                  double[][] sourceAffineMatrix,
                  double[][] targetAffineMatrix,
                  int min_scale_deformation,
                  int max_scale_deformation,
                  int min_scale_image,
                  double divWeight,
                  double curlWeight,
                  double landmarkWeight,
                  double imageWeight,
                  double consistencyWeight,
                  double stopThreshold,
                  int outputLevel,
                  boolean showMarquardtOptim,
                  int accurate_mode,
                  int maxImageSubsamplingFactor)
Pass parameter from MainDialog to FinalAction.

Parameters:
sourceImp - image representation for the source
targetImp - image representation for the target
source - source image model
target - target image model
sourcePh - point handler for the landmarks in the source image
targetPh - point handler for the landmarks in the target image
sourceMsk - source image mask
targetMsk - target image mask
sourceAffineMatrix - source initial affine matrix
targetAffineMatrix - target initial affine matrix
min_scale_deformation - minimum scale deformation
max_scale_deformation - maximum scale deformation
min_scale_image - minimum image scale
outputLevel - flag to specify the level of resolution in the output
showMarquardtOptim - flag to show the optimizer
divWeight - divergence weight
curlWeight - curl weight
landmarkWeight - landmark weight
imageWeight - weight for image similarity
consistencyWeight - weight for the deformations consistency
stopThreshold - stopping threshold
accurate_mode - level of accuracy
maxImageSubsamplingFactor - image subsampling factor at highest resolution level

initializeOutputIPs

public ij.ImagePlus[] initializeOutputIPs()
Initialize output image plus

Returns:
target and source output image plus