Package gov.nih.mipav.model.algorithms
Class AlgorithmWSinc
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmWSinc
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmWSinc extends AlgorithmBase
Sinc function windowed with Hanning window function used for interpolation This function will create images with greater maximums and lower minimums than the original image, so if the input image type is BYTE or UBYTE, the output image type should be a SHORT. Notice that clamping to 0 and 255 is used with ARGB images.This is an example of a cardinal basis function. The cardinal basis function centered at a given original grid point is the definition of how an image that is 1 at that grid point and 0 at all others is to be interpolated into intermediate points. The final image is then constructed by adding together all the basis functions from each original grid point, each one scaled by the intensity at its original grid point. Since a cardinal basis function is zero at all other original grid points except the one at which it is based, interpolation that falls exactly onto an original grid point will always preserve the original value.
-
-
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 intrXDOCUMENT ME!private intrYDOCUMENT ME!private intrZDOCUMENT ME!private doublescaleXDOCUMENT ME!private doublescaleYDOCUMENT ME!private doublescaleZDOCUMENT ME!private intsliceSizeDOCUMENT ME!private double[]volumeGlobal variables.private double[]wSincXTDOCUMENT ME!private double[]wSincYTDOCUMENT ME!private double[]wSincZTDOCUMENT 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 AlgorithmWSinc()AlgorithmWSinc - default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalize()finalize -voidrunAlgorithm()Default method that is not really appropiate for this class but must be defined because this class extends AlgorithmBase.voidsetup2DWSinc(double[] vol, int[] extents, boolean clip)Setup 2D wSinc.voidsetup2DWSinc(double[] vol, int[] extents, int[] range, boolean clip)Setup 2D wSinc.voidsetup2DWSincC(double[] vol, int[] extents, float argbMax, boolean clip)Setup 2D wSinc for coor image.voidsetup3DWSinc(double[] vol, int[] extents, boolean clip)Setup 3D wSinc.voidsetup3DWSinc(double[] vol, int[] extents, int[] range, boolean clip)Setup 3D wSinc.voidsetup3DWSincC(double[] vol, int[] extents, float argbMax, boolean clip)Setup 3D wSinc for color.doublewSinc2D(double x, double y)2D windowed sinc function.double[]wSinc2DC(double x, double y)2D windowed sinc function for color.doublewSinc3D(double x, double y, double z)3D windowed sinc function.double[]wSinc3DC(double x, double y, double z)3D windowed sinc function for color (3 channel images).-
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!
-
rX
private int rX
DOCUMENT ME!
-
rY
private int rY
DOCUMENT ME!
-
rZ
private int rZ
DOCUMENT ME!
-
scaleX
private double scaleX
DOCUMENT ME!
-
scaleY
private double scaleY
DOCUMENT ME!
-
scaleZ
private double scaleZ
DOCUMENT ME!
-
sliceSize
private int sliceSize
DOCUMENT ME!
-
volume
private double[] volume
Global variables.
-
wSincXT
private double[] wSincXT
DOCUMENT ME!
-
wSincYT
private double[] wSincYT
DOCUMENT ME!
-
wSincZT
private double[] wSincZT
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()
finalize -- Overrides:
finalizein classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Default method that is not really appropiate for this class but must be defined because this class extends AlgorithmBase.- Specified by:
runAlgorithmin classAlgorithmBase
-
setup2DWSinc
public void setup2DWSinc(double[] vol, int[] extents, boolean clip)Setup 2D wSinc.- Parameters:
vol- volume comprising control points for the wSincextents- vol extents (xdim, ydim)clip- if true clip output to range of input image
-
setup2DWSinc
public void setup2DWSinc(double[] vol, int[] extents, int[] range, boolean clip)Setup 2D wSinc.- Parameters:
vol- volume comprising control points for the wSincextents- vol extents (xdim, ydim)range- determines number of pixels used along each axisclip- if true clip output to range of input image
-
setup2DWSincC
public void setup2DWSincC(double[] vol, int[] extents, float argbMax, boolean clip)Setup 2D wSinc for coor image.- Parameters:
vol- volume comprising control points for the wSincextents- vol extents (xdim, ydim)argbMax- maximum possible color valueclip- if true clip output to range of input image
-
setup3DWSinc
public void setup3DWSinc(double[] vol, int[] extents, boolean clip)Setup 3D wSinc.- Parameters:
vol- volume comprising control points for the wSincextents- vol extents (xdim, ydim, zdim)clip- if true clip output to range of input image
-
setup3DWSinc
public void setup3DWSinc(double[] vol, int[] extents, int[] range, boolean clip)Setup 3D wSinc.- Parameters:
vol- volume comprising control points for the wSincextents- vol extents (xdim, ydim, zdim)range- determines number of pixels used along each axisclip- if true clip output to range of input image
-
setup3DWSincC
public void setup3DWSincC(double[] vol, int[] extents, float argbMax, boolean clip)Setup 3D wSinc for color.- Parameters:
vol- volume comprising control points for the wSincextents- vol extents (xdim, ydim, zdim)argbMax- maximum possible color valueclip- if true clip output to range of input image
-
wSinc2D
public double wSinc2D(double x, double y)2D windowed sinc function.- Parameters:
x- double point indexy- double point index- Returns:
- the wSinc2D interpolated data point
-
wSinc2DC
public double[] wSinc2DC(double x, double y)2D windowed sinc function for color.- Parameters:
x- double point indexy- double point index- Returns:
- the wSinc2D interpolated data point
-
wSinc3D
public final double wSinc3D(double x, double y, double z)3D windowed sinc function.- Parameters:
x- double point indexy- double point indexz- double point index- Returns:
- the wSinc3D interpolated data point
-
wSinc3DC
public double[] wSinc3DC(double x, double y, double z)3D windowed sinc function for color (3 channel images).- Parameters:
x- double point indexy- double point indexz- double point index- Returns:
- the wSinc3D interpolated data point
-
-