Package gov.nih.mipav.model.algorithms
Class AlgorithmQuinticLagrangian
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmQuinticLagrangian
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmQuinticLagrangian extends AlgorithmBase
This is a polynomial p of degree 5 which interpolates a given function f at the points x(-2), x(-1), x(0), x(1), x(2), and x(3) and is given by p(x) = sum from i = -2 to i = 3 of li(x)*f(xi), where li, i = -2,-1,0,1,2,3 which are called the fundamental polynomials, are given by li(x) = product from k = -2 to k = 3 for k != i of (x - xk)/(xi - xk). li(-2) = (x - -1)/(-2 - -1) * (x - 0)/(-2 - 0) * (x-1)/(-2 - 1) * (x-2)/(-2 - 2) * (x-3)/(-2 - 3) = (x * (x*x - 1) * (2 - x) * (x - 3))/120 li(-1) = (x - -2)/(-1 - -2) * (x - 0)/(-1 - 0)* (x-1)/(-1 - 1) * (x - 2)/(-1 - 2) * (x - 3)/(-1 - 3) = (x * (x*x - 4) * (x - 1) * (x - 3))/24 li(0) = (x - -2)/(0 - -2) * (x - -1)/(0 - -1) * (x - 1)/(0 - 1) (x - 2)/(0 - 2) * (x - 3)/(0 - 3) = ((x*x - 4) * (x*x - 1) * (3 - x))/12 li(1) = (x - -2)/(1 - -2) * (x - -1)/(1 - -1) * (x - 0)/(1 - 0) * (x - 2)/(1 - 2) * (x - 3)/(1 - 3) = (x * (x*x - 4) * (x+1) * (x-3))/12 li(2) = (x - -2)/(2 - -2) * (x - -1)/(2 - -1) * (x - 0)/(2 - 0) * (x - 1)/(2 - 1) * (x - 3)/(2 - 3) = (x * (x*x - 1) * (x+2) * (3 - x))/24 li(3) = (x - -2)/(3 - -2) * (x - -1)/(3 - -1) * (x - 0)/(3 - 0) * (x - 1)/(3 - 1) * (x - 2)/(3 - 2) = (x * (x*x - 1) (x*x - 4))/120
-
-
Field Summary
Fields Modifier and Type Field Description private doublealphaMaxDOCUMENT ME!private doublealphaMinDOCUMENT ME!private doubleblueMaxDOCUMENT ME!private doubleblueMinDOCUMENT ME!private booleanclipDOCUMENT ME!private doublegreenMaxDOCUMENT ME!private doublegreenMinDOCUMENT ME!private doubleinputMaxDOCUMENT ME!private doubleinputMinDOCUMENT ME!private doubleredMaxDOCUMENT ME!private doubleredMinDOCUMENT ME!private intsliceSizeDOCUMENT ME!private double[]volumeDOCUMENT ME!private double[][]wtDOCUMENT ME!private intxDDOCUMENT ME!private intxdimDOCUMENT ME!private intyDDOCUMENT ME!private intydimDOCUMENT ME!private intzDDOCUMENT ME!private intzdimDOCUMENT ME!-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmQuinticLagrangian()AlgorithmQuinticLagrangian - default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalize()Calls garbage collector to release system resources.doublequinticLagrangian2D(double x, double y)2D quintic Lagrangian function.double[]quinticLagrangian2DC(double x, double y)2D quintic Lagrangian function for color.doublequinticLagrangian3D(double x, double y, double z)3D quintic Lagrangian function.double[]quinticLagrangian3DC(double x, double y, double z)3D quintic Lagrangian function for color (3 channel images).voidrunAlgorithm()run - default method that is not really appropiate for this class but must be defined because this class extends AlgorithmBase.voidsetup2DQuinticLagrangian(double[] vol, int[] extents, boolean clip)Setup 2D quinticLagrangian.voidsetup2DQuinticLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip)Setup 2D quinticLagrangian for color.voidsetup3DQuinticLagrangian(double[] vol, int[] extents, boolean clip)Setup 3D quintic Lagrangian.voidsetup3DQuinticLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip)Setup 3D quintic Lagrangian for color.-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
alphaMax
private double alphaMax
DOCUMENT ME!
-
alphaMin
private double alphaMin
DOCUMENT ME!
-
blueMax
private double blueMax
DOCUMENT ME!
-
blueMin
private double blueMin
DOCUMENT ME!
-
clip
private boolean clip
DOCUMENT ME!
-
greenMax
private double greenMax
DOCUMENT ME!
-
greenMin
private double greenMin
DOCUMENT ME!
-
inputMax
private double inputMax
DOCUMENT ME!
-
inputMin
private double inputMin
DOCUMENT ME!
-
redMax
private double redMax
DOCUMENT ME!
-
redMin
private double redMin
DOCUMENT ME!
-
sliceSize
private int sliceSize
DOCUMENT ME!
-
volume
private double[] volume
DOCUMENT ME!
-
wt
private double[][] wt
DOCUMENT ME!
-
xD
private int xD
DOCUMENT ME!
-
yD
private int yD
DOCUMENT ME!
-
zD
private int zD
DOCUMENT ME!
-
xdim
private int xdim
DOCUMENT ME!
-
ydim
private int ydim
DOCUMENT ME!
-
zdim
private int zdim
DOCUMENT ME!
-
-
Method Detail
-
finalize
public void finalize()
Calls garbage collector to release system resources.- Overrides:
finalizein classAlgorithmBase
-
quinticLagrangian2D
public double quinticLagrangian2D(double x, double y)2D quintic Lagrangian function.- Parameters:
x- double point indexy- double point index- Returns:
- the quintic Lagrangian interpolated data point
-
quinticLagrangian2DC
public double[] quinticLagrangian2DC(double x, double y)2D quintic Lagrangian function for color.- Parameters:
x- double point indexy- double point index- Returns:
- the quintic Lagrangian interpolated data point
-
quinticLagrangian3D
public final double quinticLagrangian3D(double x, double y, double z)3D quintic Lagrangian function.- Parameters:
x- double point indexy- double point indexz- double point index- Returns:
- the quinticLagrangian3D interpolated data point
-
quinticLagrangian3DC
public double[] quinticLagrangian3DC(double x, double y, double z)3D quintic Lagrangian function for color (3 channel images).- Parameters:
x- double point indexy- double point indexz- double point index- Returns:
- the quinticLagrangian3D interpolated data point
-
runAlgorithm
public void runAlgorithm()
run - default method that is not really appropiate for this class but must be defined because this class extends AlgorithmBase.- Specified by:
runAlgorithmin classAlgorithmBase
-
setup2DQuinticLagrangian
public void setup2DQuinticLagrangian(double[] vol, int[] extents, boolean clip)Setup 2D quinticLagrangian.- Parameters:
vol- volume comprising control points for the quintic Lagrangianextents- vol extents (xdim, ydim)clip- if true clip output to range of input image
-
setup2DQuinticLagrangianC
public void setup2DQuinticLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip)Setup 2D quinticLagrangian for color.- Parameters:
vol- volume comprising control points for the quintic Lagrangianextents- vol extents (xdim, ydim)argbMax- maximum possible value of a colorclip- if true clip output to range of input image
-
setup3DQuinticLagrangian
public void setup3DQuinticLagrangian(double[] vol, int[] extents, boolean clip)Setup 3D quintic Lagrangian.- Parameters:
vol- volume comprising control points for the quintic Lagrangianextents- vol extents (xdim, ydim, zdim)clip- if true clip output to range of input image
-
setup3DQuinticLagrangianC
public void setup3DQuinticLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip)Setup 3D quintic Lagrangian for color.- Parameters:
vol- volume comprising control points for the quintic Lagrangianextents- vol extents (xdim, ydim, zdim)argbMax- maximum possible value of a colorclip- if true clip output to range of input image
-
-