|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread gov.nih.mipav.model.algorithms.AlgorithmBase gov.nih.mipav.model.algorithms.AlgorithmConvolver
public class AlgorithmConvolver
Convolves kernel with a 2D or 3D image - only pixels where the kernel is completely contained in the image are convolved, otherwise they are set to zero. This is reasonable since data at the edges of images is rarely used and large kernels should not be used since it is much faster to perform FFT, filter, and IFFT. The break even point is probably around a kernel size of 11 or so.
Since this class extends the AlgorithmBase class that extends the Thread class it can be run in its own thread by invoking algoConvolver3DObj.start(); It can also be invoked without a new thread by calling the the run() method directly (ie. algoConvolver3DObj.run()).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase |
---|
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, srcImage, threadStopped |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
AlgorithmConvolver(ModelImage srcImage,
float[] kernelX,
float[] kernelY,
float[] kernelZ,
float[] kernelXX,
float[] kernelXY,
float[] kernelYY,
float[] kernelXZ,
float[] kernelYZ,
float[] kernelZZ,
boolean entireImage,
int[] kExtents)
|
|
AlgorithmConvolver(ModelImage srcImage,
float[] kernelX,
float[] kernelY,
float[] kernelZ,
float[] kernelXX,
float[] kernelXY,
float[] kernelYY,
float[] kernelXZ,
float[] kernelYZ,
float[] kernelZZ,
float[] kernelXXX,
float[] kernelXXY,
float[] kernelXYY,
float[] kernelYYY,
float[] kernelXXZ,
float[] kernelXZZ,
float[] kernelXYZ,
float[] kernelYYZ,
float[] kernelYZZ,
float[] kernelZZZ,
int[] kExtents,
boolean entireImage)
|
|
AlgorithmConvolver(ModelImage srcImage,
float[] kernelX,
float[] kernelY,
float[] kernelXX,
float[] kernelXY,
float[] kernelYY,
float[] kernelXXX,
float[] kernelXXY,
float[] kernelXYY,
float[] kernelYYY,
int[] kExtents,
boolean entireImage)
|
|
AlgorithmConvolver(ModelImage srcImage,
float[] kernelX,
float[] kernelY,
float[] kernelXX,
float[] kernelXY,
float[] kernelYY,
int[] kExtents,
boolean entireImage)
|
|
AlgorithmConvolver(ModelImage srcImage,
float[] kernelX,
float[] kernelY,
float[] kernelZ,
float[] kernelX2,
float[] kernelY2,
int[] kExtents,
boolean entireImage,
boolean combined2D3D)
|
|
AlgorithmConvolver(ModelImage srcImage,
float[] kernelX,
float[] kernelY,
float[] kernelZ,
int[] kExtents,
boolean entireImage)
|
|
AlgorithmConvolver(ModelImage srcImage,
float[] kernelX,
float[] kernelY,
int[] kExtents,
boolean entireImage,
boolean sqrtXY)
|
|
AlgorithmConvolver(ModelImage srcImage,
float[] kernel,
int[] kExtents,
boolean entireImage,
boolean image25D)
|
|
AlgorithmConvolver(ModelImage srcImg,
ModelImage kern)
Sets the source and kernel images and calls the appropriate method based on image dimensionality. |
Method Summary | |
---|---|
static float |
convolve2DPt(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an image at a position. |
static float |
convolve2DPt(WildMagic.LibFoundation.Mathematics.Vector2f pt,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an image at a position. |
static float |
convolve2DPtMed(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an image at a position. |
static float |
convolve2DPtNMS(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernelX,
float[] kernelY,
float[] kernelXX,
float[] kernelXY,
float[] kernelYY)
A static function that convolves a kernel with an image at a position. |
static float |
convolve2DPtNMSE(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernelX,
float[] kernelY,
float[] kernelXXX,
float[] kernelXXY,
float[] kernelXYY,
float[] kernelYYY)
A static function that convolves a kernel with an image at a position. |
static float |
convolve2DPtSqrtXY(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernelX,
float[] kernelY)
A static function that convolves a kernel with an image at a position. |
static float |
convolve2DRGBPt(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an RGB image at a position. |
static float |
convolve2DRGBPtSqrtXY(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernelX,
float[] kernelY)
A static function that convolves a kernel with an RGB image at a position. |
static float |
convolve3DPt(float[] pt,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an image at a position. |
static float |
convolve3DPt(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an image at a position. |
static float |
convolve3DPtMed(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an image at a position. |
static float |
convolve3DPtNMS(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernelX,
float[] kernelY,
float[] kernelZ,
float[] kernelXX,
float[] kernelXY,
float[] kernelYY,
float[] kernelXZ,
float[] kernelYZ,
float[] kernelZZ)
A static function that convolves a kernel with an image at a position. |
static float |
convolve3DPtNMSE(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernelX,
float[] kernelY,
float[] kernelZ,
float[] kernelXXX,
float[] kernelXXY,
float[] kernelXYY,
float[] kernelYYY,
float[] kernelXXZ,
float[] kernelXZZ,
float[] kernelXYZ,
float[] kernelYYZ,
float[] kernelYZZ,
float[] kernelZZZ)
A static function that convolves a kernel with an image at a position. |
static float |
convolve3DPtXYZ(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernelX,
float[] kernelY,
float[] kernelZ)
A static function that convolves a kernel with an image at a position. |
static float |
convolve3DRGBPt(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an RGB image at a position. |
static float |
convolve3DRGBPtXYZ(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernelX,
float[] kernelY,
float[] kernelZ)
A static function that convolves a kernel with an RGB image at a position. |
static void |
convolveBlock3D(int start,
int end,
int lpv,
float[] iImage,
int[] iExtents,
int[] kExtents,
float[] kernel,
ModelImage oImage)
|
static float |
convolveWhole2DPt(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an image at a position. |
static float |
convolveWhole3DPt(int pix,
int[] iExtents,
float[] image,
int[] kExtents,
float[] kernel)
A static function that convolves a kernel with an image at a position The convolution is performed only if the whole kernel fits inside the image. |
void |
finalize()
Prepares this class for destruction. |
float[] |
getOutputBuffer()
|
boolean |
isBlue()
|
boolean |
isGreen()
|
boolean |
isRed()
|
void |
run2D()
Begins the excution of the 2D convolver. |
void |
run3D()
Begins the excution of the 3D convolver. |
void |
run4D()
|
void |
runAlgorithm()
Begins execution of the convolver. |
void |
setBlue(boolean blue)
|
void |
setColorChannels(boolean red,
boolean green,
boolean blue)
|
void |
setGreen(boolean green)
|
void |
setKernelImage(ModelImage kern)
Accessor that sets the and kernel image. |
void |
setRed(boolean red)
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AlgorithmConvolver(ModelImage srcImg, ModelImage kern)
srcImg
- Source image to be convolved with kernel.kern
- Kernel image.public AlgorithmConvolver(ModelImage srcImage, float[] kernel, int[] kExtents, boolean entireImage, boolean image25D)
public AlgorithmConvolver(ModelImage srcImage, float[] kernelX, float[] kernelY, int[] kExtents, boolean entireImage, boolean sqrtXY)
public AlgorithmConvolver(ModelImage srcImage, float[] kernelX, float[] kernelY, float[] kernelZ, int[] kExtents, boolean entireImage)
public AlgorithmConvolver(ModelImage srcImage, float[] kernelX, float[] kernelY, float[] kernelXX, float[] kernelXY, float[] kernelYY, int[] kExtents, boolean entireImage)
public AlgorithmConvolver(ModelImage srcImage, float[] kernelX, float[] kernelY, float[] kernelXX, float[] kernelXY, float[] kernelYY, float[] kernelXXX, float[] kernelXXY, float[] kernelXYY, float[] kernelYYY, int[] kExtents, boolean entireImage)
public AlgorithmConvolver(ModelImage srcImage, float[] kernelX, float[] kernelY, float[] kernelZ, float[] kernelXX, float[] kernelXY, float[] kernelYY, float[] kernelXZ, float[] kernelYZ, float[] kernelZZ, boolean entireImage, int[] kExtents)
public AlgorithmConvolver(ModelImage srcImage, float[] kernelX, float[] kernelY, float[] kernelZ, float[] kernelXX, float[] kernelXY, float[] kernelYY, float[] kernelXZ, float[] kernelYZ, float[] kernelZZ, float[] kernelXXX, float[] kernelXXY, float[] kernelXYY, float[] kernelYYY, float[] kernelXXZ, float[] kernelXZZ, float[] kernelXYZ, float[] kernelYYZ, float[] kernelYZZ, float[] kernelZZZ, int[] kExtents, boolean entireImage)
public AlgorithmConvolver(ModelImage srcImage, float[] kernelX, float[] kernelY, float[] kernelZ, float[] kernelX2, float[] kernelY2, int[] kExtents, boolean entireImage, boolean combined2D3D)
Method Detail |
---|
public boolean isRed()
public void setRed(boolean red)
public boolean isBlue()
public void setBlue(boolean blue)
public boolean isGreen()
public void setGreen(boolean green)
public void setColorChannels(boolean red, boolean green, boolean blue)
public static final float convolve2DPt(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
public static final float convolve2DPtSqrtXY(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernelX, float[] kernelY)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernelX
- kernel datakernelY
- kernel data
public static final float convolve2DPtNMS(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernelX, float[] kernelY, float[] kernelXX, float[] kernelXY, float[] kernelYY)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernelX
- kernel datakernelY
- kernel datakernelXX
- kernel datakernelXY
- kernel datakernelYY
- kernel data
public static final float convolve2DPtNMSE(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernelX, float[] kernelY, float[] kernelXXX, float[] kernelXXY, float[] kernelXYY, float[] kernelYYY)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernelX
- kernel datakernelY
- kernel datakernelXXX
- kernel datakernelXXY
- kernel datakernelXYY
- kernel datakernelYYY
- kernel data
public static final float convolve2DPt(WildMagic.LibFoundation.Mathematics.Vector2f pt, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pt
- floating point indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
public static final float convolve2DPtMed(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
AlgorithmLapMedianess
public static final float convolve2DRGBPt(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
public static final float convolve2DRGBPtSqrtXY(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernelX, float[] kernelY)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernelX
- kernel datakernelY
- kernel data
public static final float convolve3DPt(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
public static final float convolve3DPtXYZ(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernelX, float[] kernelY, float[] kernelZ)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernelX
- kernel datakernelY
- kernel datakernelZ
- kernel data
public static final float convolve3DPtNMS(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernelX, float[] kernelY, float[] kernelZ, float[] kernelXX, float[] kernelXY, float[] kernelYY, float[] kernelXZ, float[] kernelYZ, float[] kernelZZ)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernelX
- kernel datakernelY
- kernel datakernelZ
- kernel datakernelXX
- kernel datakernelXY
- kernel datakernelYY
- kernel datakernelXZ
- kernel datakernelYZ
- kernel datakernelZZ
- kernel data
public static final float convolve3DPtNMSE(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernelX, float[] kernelY, float[] kernelZ, float[] kernelXXX, float[] kernelXXY, float[] kernelXYY, float[] kernelYYY, float[] kernelXXZ, float[] kernelXZZ, float[] kernelXYZ, float[] kernelYYZ, float[] kernelYZZ, float[] kernelZZZ)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernelX
- kernel datakernelY
- kernel datakernelZ
- kernel datakernelXXX
- kernel datakernelXXY
- kernel datakernelXYY
- kernel datakernelYYY
- kernel datakernelXXZ
- kernel datakernelXZZ
- kernel datakernelXYZ
- kernel datakernelYZZ
- kernel datakernelZZZ
- kernel data
public static final void convolveBlock3D(int start, int end, int lpv, float[] iImage, int[] iExtents, int[] kExtents, float[] kernel, ModelImage oImage)
start
- end
- lpp
- length per voxel, for example 4 for RGB image.iImage
- iExtents
- kExtents
- kernel
- oImage
- public static final float convolve3DPt(float[] pt, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pt
- floating point indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
public static final float convolve3DPtMed(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
AlgorithmLapMedianess
public static final float convolve3DRGBPt(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
public static final float convolve3DRGBPtXYZ(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernelX, float[] kernelY, float[] kernelZ)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernelX
- kernel datakernelY
- kernel datakernelZ
- kernel data
public static final float convolveWhole2DPt(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
public static final float convolveWhole3DPt(int pix, int[] iExtents, float[] image, int[] kExtents, float[] kernel)
pix
- index indicating location of convolutioniExtents
- image dimensionsimage
- image datakExtents
- kernel dimensionskernel
- kernel data
public void finalize()
finalize
in class AlgorithmBase
public void run2D()
public void run3D()
public void run4D()
public void runAlgorithm()
runAlgorithm
in class AlgorithmBase
public void setKernelImage(ModelImage kern)
kern
- Kernel image.public float[] getOutputBuffer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |