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 double
alphaMax
DOCUMENT ME!private double
alphaMin
DOCUMENT ME!private double
blueMax
DOCUMENT ME!private double
blueMin
DOCUMENT ME!private boolean
clip
DOCUMENT ME!private double
greenMax
DOCUMENT ME!private double
greenMin
DOCUMENT ME!private double
inputMax
DOCUMENT ME!private double
inputMin
DOCUMENT ME!private double
redMax
DOCUMENT ME!private double
redMin
DOCUMENT ME!private int
rX
DOCUMENT ME!private int
rY
DOCUMENT ME!private int
rZ
DOCUMENT ME!private double
scaleX
DOCUMENT ME!private double
scaleY
DOCUMENT ME!private double
scaleZ
DOCUMENT ME!private int
sliceSize
DOCUMENT ME!private double[]
volume
Global variables.private double[]
wSincXT
DOCUMENT ME!private double[]
wSincYT
DOCUMENT ME!private double[]
wSincZT
DOCUMENT ME!private int
xD
DOCUMENT ME!private int
xdim
DOCUMENT ME!private int
yD
DOCUMENT ME!private int
ydim
DOCUMENT ME!private int
zD
DOCUMENT ME!private int
zdim
DOCUMENT 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 void
finalize()
finalize -void
runAlgorithm()
Default method that is not really appropiate for this class but must be defined because this class extends AlgorithmBase.void
setup2DWSinc(double[] vol, int[] extents, boolean clip)
Setup 2D wSinc.void
setup2DWSinc(double[] vol, int[] extents, int[] range, boolean clip)
Setup 2D wSinc.void
setup2DWSincC(double[] vol, int[] extents, float argbMax, boolean clip)
Setup 2D wSinc for coor image.void
setup3DWSinc(double[] vol, int[] extents, boolean clip)
Setup 3D wSinc.void
setup3DWSinc(double[] vol, int[] extents, int[] range, boolean clip)
Setup 3D wSinc.void
setup3DWSincC(double[] vol, int[] extents, float argbMax, boolean clip)
Setup 3D wSinc for color.double
wSinc2D(double x, double y)
2D windowed sinc function.double[]
wSinc2DC(double x, double y)
2D windowed sinc function for color.double
wSinc3D(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:
finalize
in 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:
runAlgorithm
in 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
-
-