Package gov.nih.mipav.model.algorithms
Class TVL1FLOW
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.TVL1FLOW
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) final int(package private) final int(package private) final int(package private) final int(package private) final intprivate ModelImageprivate ModelImageprivate double(package private) final doubleprivate double(package private) final int(package private) final intprivate intprivate int(package private) final double(package private) final double(package private) final int(package private) final int(package private) final double(package private) final double(package private) final int(package private) final double(package private) final int(package private) final doubleprivate ModelImageprivate ModelImage(package private) final intprivate doubleprivate doubleprivate booleanprivate double(package private) final doubleFields 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
ConstructorsConstructorDescriptionTVL1FLOW()TVL1FLOW(ModelImage destuImg, ModelImage destvImg, ModelImage srcImg1, ModelImage srcImg2, double tau, double lambda, double theta, int nscales, double zfactor, int nwarps, double epsilon, boolean verbose) -
Method Summary
Modifier and TypeMethodDescriptiondoublebicubic_interpolation_at(double[] input, double uu, double vv, int nx, int ny, boolean border_out) Compute the bicubic interpolation of a point in an image.doublebicubic_interpolation_cell(double[][] p, double x, double y) Bicubic interpolation in two dimensionsvoidbicubic_interpolation_warp(double[] input, double[] u, double[] v, double[] output, int nx, int ny, boolean border_out) Compute the bicubic interpolation of an image.voidcentered_gradient(double[] input, double[] dx, double[] dy, int nx, int ny) Function to compute the gradient with centered differencesdoublecubic_interpolation_cell(double[] v, double x) Cubic interpolation in one dimensionvoiddivergence(double[] v1, double[] v2, double[] div, int nx, int ny) Function to compute the divergence with backward differences (see [2] for details)voidDual_TVL1_optic_flow(double[] I0, double[] I1, double[] u1, double[] u2, int nx, int ny, double tau, double lambda, double theta, int warps, double epsilon, boolean verbose) Function to compute the optical flow in one scalevoidDual_TVL1_optic_flow_multiscale(double[] I0, double[] I1, double[] u1, double[] u2, int nxx, int nyy, double tau, double lambda, double theta, int nscales, double zfactor, int warps, double epsilon, boolean verbose) Function to compute the optical flow using multiple scalesvoidforward_gradient(double[] f, double[] fx, double[] fy, int nx, int ny) Function to compute the gradient with forward differences (see [2] for details)voidgaussian(double[] I, int xdim, int ydim, double sigma) In-place Gaussian smoothing of an imagevoidgetminmax(double[] min, double[] max, double[] x, int n) Compute the max and min of an arrayprivate doublehypot(double x, double y) voidimage_normalization(double[] I0, double[] I1, double[] I0n, double[] I1n, int size) Function to normalize the images between 0 and 255intneumann_bc(int x, int nx, boolean[] out) Neumann boundary condition testintperiodic_bc(int x, int nx, boolean[] out) Periodic boundary condition testvoidActually runs the algorithm.intsymmetric_bc(int x, int nx, boolean[] out) Symmetric boundary condition testvoidzoom_in(double[] I, double[] Iout, int nx, int ny, int nxx, int nyy) Function to upsample the imagevoidzoom_out(double[] I, double[] Iout, int nx, int ny, double factor) Downsample an imagevoidzoom_size(int nx, int ny, int[] nxx, int[] nyy, double factor) Compute the size of a zoomed image from the zoom factorMethods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, 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
-
Neumann
final int Neumann- See Also:
-
Periodic
final int Periodic- See Also:
-
Symmetric
final int Symmetric- See Also:
-
BOUNDARY_CONDITION
int BOUNDARY_CONDITION -
PAR_DEFAULT_TAU
final double PAR_DEFAULT_TAU- See Also:
-
PAR_DEFAULT_LAMBDA
final double PAR_DEFAULT_LAMBDA- See Also:
-
PAR_DEFAULT_THETA
final double PAR_DEFAULT_THETA- See Also:
-
PAR_DEFAULT_NSCALES
final int PAR_DEFAULT_NSCALES- See Also:
-
PAR_DEFAULT_ZFACTOR
final double PAR_DEFAULT_ZFACTOR- See Also:
-
PAR_DEFAULT_NWARPS
final int PAR_DEFAULT_NWARPS- See Also:
-
PAR_DEFAULT_EPSILON
final double PAR_DEFAULT_EPSILON- See Also:
-
PAR_DEFAULT_VERBOSE
final int PAR_DEFAULT_VERBOSE- See Also:
-
srcImage1
-
srcImage2
-
destuImage
-
destvImage
-
tau
private double tau -
lambda
private double lambda -
theta
private double theta -
nscales
private int nscales -
zfactor
private double zfactor -
nwarps
private int nwarps -
epsilon
private double epsilon -
verbose
private boolean verbose -
BOUNDARY_CONDITION_DIRICHLET
final int BOUNDARY_CONDITION_DIRICHLET- See Also:
-
BOUNDARY_CONDITION_REFLECTING
final int BOUNDARY_CONDITION_REFLECTING- See Also:
-
BOUNDARY_CONDITION_PERIODIC
final int BOUNDARY_CONDITION_PERIODIC- See Also:
-
DEFAULT_GAUSSIAN_WINDOW_SIZE
final int DEFAULT_GAUSSIAN_WINDOW_SIZE- See Also:
-
DEFAULT_BOUNDARY_CONDITION
final int DEFAULT_BOUNDARY_CONDITION- See Also:
-
ZOOM_SIGMA_ZERO
final double ZOOM_SIGMA_ZERO- See Also:
-
MAX_ITERATIONS
final int MAX_ITERATIONS- See Also:
-
PRESMOOTHING_SIGMA
final double PRESMOOTHING_SIGMA- See Also:
-
GRAD_IS_ZERO
final double GRAD_IS_ZERO- See Also:
-
-
Constructor Details
-
TVL1FLOW
public TVL1FLOW() -
TVL1FLOW
public TVL1FLOW(ModelImage destuImg, ModelImage destvImg, ModelImage srcImg1, ModelImage srcImg2, double tau, double lambda, double theta, int nscales, double zfactor, int nwarps, double epsilon, boolean verbose)
-
-
Method Details
-
runAlgorithm
public void runAlgorithm()Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-
hypot
private double hypot(double x, double y) -
neumann_bc
public int neumann_bc(int x, int nx, boolean[] out) Neumann boundary condition test -
periodic_bc
public int periodic_bc(int x, int nx, boolean[] out) Periodic boundary condition test -
symmetric_bc
public int symmetric_bc(int x, int nx, boolean[] out) Symmetric boundary condition test -
cubic_interpolation_cell
public double cubic_interpolation_cell(double[] v, double x) Cubic interpolation in one dimension -
bicubic_interpolation_cell
public double bicubic_interpolation_cell(double[][] p, double x, double y) Bicubic interpolation in two dimensions -
bicubic_interpolation_at
public double bicubic_interpolation_at(double[] input, double uu, double vv, int nx, int ny, boolean border_out) Compute the bicubic interpolation of a point in an image. Detect if the point goes outside the image domain. -
bicubic_interpolation_warp
public void bicubic_interpolation_warp(double[] input, double[] u, double[] v, double[] output, int nx, int ny, boolean border_out) Compute the bicubic interpolation of an image. -
divergence
public void divergence(double[] v1, double[] v2, double[] div, int nx, int ny) Function to compute the divergence with backward differences (see [2] for details) -
forward_gradient
public void forward_gradient(double[] f, double[] fx, double[] fy, int nx, int ny) Function to compute the gradient with forward differences (see [2] for details) -
centered_gradient
public void centered_gradient(double[] input, double[] dx, double[] dy, int nx, int ny) Function to compute the gradient with centered differences -
gaussian
public void gaussian(double[] I, int xdim, int ydim, double sigma) In-place Gaussian smoothing of an image -
zoom_size
public void zoom_size(int nx, int ny, int[] nxx, int[] nyy, double factor) Compute the size of a zoomed image from the zoom factor -
zoom_out
public void zoom_out(double[] I, double[] Iout, int nx, int ny, double factor) Downsample an image -
zoom_in
public void zoom_in(double[] I, double[] Iout, int nx, int ny, int nxx, int nyy) Function to upsample the image -
Dual_TVL1_optic_flow
public void Dual_TVL1_optic_flow(double[] I0, double[] I1, double[] u1, double[] u2, int nx, int ny, double tau, double lambda, double theta, int warps, double epsilon, boolean verbose) Function to compute the optical flow in one scale -
getminmax
public void getminmax(double[] min, double[] max, double[] x, int n) Compute the max and min of an array -
image_normalization
public void image_normalization(double[] I0, double[] I1, double[] I0n, double[] I1n, int size) Function to normalize the images between 0 and 255 -
Dual_TVL1_optic_flow_multiscale
public void Dual_TVL1_optic_flow_multiscale(double[] I0, double[] I1, double[] u1, double[] u2, int nxx, int nyy, double tau, double lambda, double theta, int nscales, double zfactor, int warps, double epsilon, boolean verbose) Function to compute the optical flow using multiple scales
-