Package gov.nih.mipav.model.algorithms
Class AlgorithmHepticLagrangian
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmHepticLagrangian
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
This is a polynomial p of degree 7 which interpolates a given function f at the points x(-3), x(-2), x(-1), x(0),
x(1), x(2), x(3), and x(4) and is given by p(x) = sum from i = -3 to i = 4 of li(x)*f(xi), where li, i =
-3,-2,-1,0,1,2,3,4 which are called the fundamental polynomials, are given by li(x) = product from k = -3 to k = 4
for k != i of (x - xk)/(xi - xk). li(-3) = (x - -2)/(-3 - -2) * (x - -1)/(-3 - -1) * (x - 0)/(-3 - 0) * (x-1)/(-3 -
1) * (x - 2)/(-3 - 2) * (x - 3)/(-3 - 3) * (x - 4)/(-3 - 4) = (x * (x*x - 1) * (x*x - 4) * (x - 3) * (4 - x))/5040
li(-2) = (x - -3)/(-2 - -3) * (x - -1)/(-2 - -1) * (x - 0)/(-2 - 0) * (x-1)/(-2 - 1) * (x-2)/(-2 - 2) * (x-3)/(-2 -
3) * (x - 4)/(-2 - 4) = (x * (x*x - 1) * (x - 2) * (x*x - 9) * (x - 4))/720 li(-1) = (x - -3)/(-1 - -3) * (x -
-2)/(-1 - -2) * (x - 0)/(-1 - 0)* (x-1)/(-1 - 1) * (x - 2)/(-1 - 2) * (x - 3)/(-1 - 3) * (x - 4)/(-1 - 4) = (x * (x -
1) * (x*x- 4) * (x*x - 9) * (4 - x)))/240 li(0) = (x - -3)/(0 - -3) * (x - -2)/(0 - -2) * (x - -1)/(0 - -1) * (x -
1)/(0 - 1) * (x - 2)/(0 - 2) * (x - 3)/(0 - 3) * (x - 4)/(0 - 4) = ((x*x - 1) * (x*x - 4) * (x*x - 9) * (x - 4))/144
li(1) = (x - -3)/(1 - -3) * (x - -2)/(1 - -2) * (x - -1)/(1 - -1) * (x - 0)/(1 - 0) * (x - 2)/(1 - 2) * (x - 3)/(1 -
3) * (x - 4)/(1 - 4) = (x * (x+1) * (x*x - 4) * (x*x - 9) * (4 - x))/144 li(2) = (x - -3)/(2 - -3) * (x - -2)/(2 -
-2) * (x - -1)/(2 - -1) * (x - 0)/(2 - 0) * (x - 1)/(2 - 1) * (x - 3)/(2 - 3) * (x - 4)/(2 - 4) = (x * (x*x - 1) *
(x+2) * (x*x - 9) * (x - 4))/240 li(3) = (x - -3)/(3 - -3) *(x - -2)/(3 - -2) * (x - -1)/(3 - -1) * (x - 0)/(3 - 0) *
(x - 1)/(3 - 1) * (x - 2)/(3 - 2) * (x - 4)/(3 - 4) = (x * (x*x - 1) * (x*x - 4) * (x + 3) * (4 - x))/720 li(4) = (x
- -3)/(4 - -3) * (x - -2)/(4 - -2) * (x - -1)/(4 - -1) * (x - 0)/(4 - 0) * (x - 1)/(4 - 1) * (x - 2)/(4 - 2) * (x -
3)/(4 - 3) = (x * (x*x - 1) * (x*x - 4) * (x*x - 9))/5040
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!private booleanDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!private intDOCUMENT ME!private double[]DOCUMENT ME!private double[][]DOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT 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, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmHepticLagrangian - default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()finalize -doublehepticLagrangian2D(double x, double y) 2D heptic Lagrangian function.double[]hepticLagrangian2DC(double x, double y) 2D heptic Lagrangian function for color.final doublehepticLagrangian3D(double x, double y, double z) 3D heptic Lagrangian function.double[]hepticLagrangian3DC(double x, double y, double z) 3D heptic Lagrangian function for color (3 channel images).voidrun - default method that is not really appropiate for this class but must be defined because this class extends AlgorithmBase.voidsetup2DHepticLagrangian(double[] vol, int[] extents, boolean clip) Setup 2D hepticLagrangian.voidsetup2DHepticLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip) Setup 2D hepticLagrangian for color.voidsetup3DHepticLagrangian(double[] vol, int[] extents, boolean clip) Setup 3D heptic Lagrangian.voidsetup3DHepticLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip) Setup 3D heptic 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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
alphaMax
private double alphaMaxDOCUMENT ME! -
alphaMin
private double alphaMinDOCUMENT ME! -
blueMax
private double blueMaxDOCUMENT ME! -
blueMin
private double blueMinDOCUMENT ME! -
clip
private boolean clipDOCUMENT ME! -
greenMax
private double greenMaxDOCUMENT ME! -
greenMin
private double greenMinDOCUMENT ME! -
inputMax
private double inputMaxDOCUMENT ME! -
inputMin
private double inputMinDOCUMENT ME! -
redMax
private double redMaxDOCUMENT ME! -
redMin
private double redMinDOCUMENT ME! -
sliceSize
private int sliceSizeDOCUMENT ME! -
volume
private double[] volumeDOCUMENT ME! -
wt
private double[][] wtDOCUMENT ME! -
xD
private int xDDOCUMENT ME! -
yD
private int yDDOCUMENT ME! -
zD
private int zDDOCUMENT ME! -
xdim
private int xdimDOCUMENT ME! -
ydim
private int ydimDOCUMENT ME! -
zdim
private int zdimDOCUMENT ME!
-
-
Constructor Details
-
AlgorithmHepticLagrangian
public AlgorithmHepticLagrangian()AlgorithmHepticLagrangian - default constructor.
-
-
Method Details
-
finalize
public void finalize()finalize -- Overrides:
finalizein classAlgorithmBase
-
hepticLagrangian2D
public double hepticLagrangian2D(double x, double y) 2D heptic Lagrangian function.- Parameters:
x- double point indexy- double point index- Returns:
- the heptic Lagrangian interpolated data point
-
hepticLagrangian2DC
public double[] hepticLagrangian2DC(double x, double y) 2D heptic Lagrangian function for color.- Parameters:
x- double point indexy- double point index- Returns:
- the heptic Lagrangian interpolated data point
-
hepticLagrangian3D
public final double hepticLagrangian3D(double x, double y, double z) 3D heptic Lagrangian function.- Parameters:
x- double point indexy- double point indexz- double point index- Returns:
- the hepticLagrangian3D interpolated data point
-
hepticLagrangian3DC
public double[] hepticLagrangian3DC(double x, double y, double z) 3D heptic Lagrangian function for color (3 channel images).- Parameters:
x- double point indexy- double point indexz- double point index- Returns:
- the hepticLagrangian3D 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
-
setup2DHepticLagrangian
public void setup2DHepticLagrangian(double[] vol, int[] extents, boolean clip) Setup 2D hepticLagrangian.- Parameters:
vol- volume comprising control points for the heptic Lagrangianextents- vol extents (xdim, ydim)clip- if true clip output to range of input image
-
setup2DHepticLagrangianC
public void setup2DHepticLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip) Setup 2D hepticLagrangian for color.- Parameters:
vol- volume comprising control points for the heptic Lagrangianextents- vol extents (xdim, ydim)argbMax- maximum possible color valueclip- if true clip output to range of input image
-
setup3DHepticLagrangian
public void setup3DHepticLagrangian(double[] vol, int[] extents, boolean clip) Setup 3D heptic Lagrangian.- Parameters:
vol- volume comprising control points for the heptic Lagrangianextents- vol extents (xdim, ydim, zdim)clip- if true clip output to range of input image
-
setup3DHepticLagrangianC
public void setup3DHepticLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip) Setup 3D heptic Lagrangian for color.- Parameters:
vol- volume comprising control points for the heptic Lagrangianextents- vol extents (xdim, ydim, zdim)argbMax- maximum possible color valueclip- if true clip output to range of input image
-