Class AlgorithmTransform
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmTransform
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmTransform extends AlgorithmBase
Transforms Volume by resampling using transformation matrix and the choice of nearest-neighbor, trilinear interpolation, 3rd order Bspline, 4th order Bspline, cubic Lagrangian, quintic Lagrangian, heptic Lagrangian, or windowed sinc. Must indicate output volume's desired resolutions and dimensions.Also includes static methods to transform images. Once caution - these static methods are NOT run in a separate thread. Consequently, if a progress bar is sent into the method to update progress, it should not include a cancel button because the user is unable to cancel a static transformation. If we want a transformation to have the ability to be cancelled, we should NOT use the static method, but rather construct a new AlgorithmTransform and run the algorithm using the standard .run() method.
NOTE for possible improvements in the future. To move images into "mm" space we presently multiple by voxel resolutions as we loop through the dimensions. A more efficent method is to modify the scale values of the the transformation matrix (i.e. the diagonals). This would speed the process by reducing the number of mults and divisions. Not sure how much but faster is better. Change should happen here and in the JDialogTransform interface.
This version of AlgorithmTransform includes a flag (passed as the last parameter) indicating whether to pad the image volume.
- Version:
- 0.1 Nov, 1999
- Author:
- Delia McGarry, William Gandler, Matthew McAuliffe, Zohara Cohen
-
-
Field Summary
Fields Modifier and Type Field Description private static int[]
axisOrient
DOCUMENT ME!static int
BILINEAR
Biilinear interpolation.static int
BSPLINE3
Cubic bspline interpolation.static int
BSPLINE4
Quadratic bspline interpolation.private int
bufferFactor
DOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3f
center
DOCUMENT ME!private boolean
clip
DOCUMENT ME!static int
CUBIC_LAGRANGIAN
Cubic lagrangian interpolation.private ModelImage
destImage
DOCUMENT ME!private float[]
destResolutions
DOCUMENT ME!private int
DIM
DOCUMENT ME!private static int[]
direct
DOCUMENT ME!private boolean
do25D
DOCUMENT ME!private boolean
doCenter
DOCUMENT ME!private float
fillValue
Used for out of bounds values in the transformation routines.private boolean
haveCentered
static int
HEPTIC_LAGRANGIAN
Heptic lagrangian interpolation.private double[]
imgBuf
DOCUMENT ME!private float[]
imgBuf2
DOCUMENT ME!private int
imgLength
DOCUMENT ME!private int
imgLength2
DOCUMENT ME!private static int
imgOrient
DOCUMENT ME!private static float[]
imgOrigin
DOCUMENT ME!private int
interp
DOCUMENT ME!private boolean
isSATransform
flag for determining if the transform is for scanner anatomical (->AXIAL).private int
iTdim
private int
iXdim
DOCUMENT ME!private float
iXres
DOCUMENT ME!private int
iYdim
DOCUMENT ME!private float
iYres
DOCUMENT ME!private int
iZdim
private float
iZres
private static int[]
margins
DOCUMENT ME!private ModelImage
maskImage
DOCUMENT ME!static int
NEAREST_NEIGHBOR
Nearest neighbor interpolation.private int
oTdim
DOCUMENT ME!private int[]
oUnits
DOCUMENT ME!private int
oXdim
DOCUMENT ME!private float
oXres
DOCUMENT ME!private int
oYdim
DOCUMENT ME!private float
oYres
DOCUMENT ME!private int
oZdim
DOCUMENT ME!private float
oZres
private boolean
pad
DOCUMENT ME!static int
QUINTIC_LAGRANGIAN
Quintic lagrangian interpolation.private ModelImage
srcImage
DOCUMENT ME!private static float
startPos
DOCUMENT ME!private static float
startTime
private boolean
suppressProgressBar
private boolean
transformVOI
DOCUMENT ME!private TransMatrix
transMatrix
DOCUMENT ME!static int
TRILINEAR
Trilinear interpolation.private static boolean
updateOrigin
DOCUMENT ME!static int
WSINC
Windowed sinc interpolation.-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmTransform(ModelImage _srcImage, TransMatrix xfrm, int interp, float _oXres, float _oYres, float _oZres, int _oXdim, int _oYdim, int _oZdim, boolean tVOI, boolean clip, boolean pad)
3D constructor for transformation algorithm.AlgorithmTransform(ModelImage _srcImage, TransMatrix xfrm, int interp, float _oXres, float _oYres, float _oZres, int _oXdim, int _oYdim, int _oZdim, int[] units, boolean tVOI, boolean clip, boolean pad)
Creates a new $class.name$ object.AlgorithmTransform(ModelImage _srcImage, TransMatrix xfrm, int interp, float _oXres, float _oYres, float _oZres, int _oXdim, int _oYdim, int _oZdim, int[] units, boolean tVOI, boolean clip, boolean pad, boolean doCenter, WildMagic.LibFoundation.Mathematics.Vector3f center)
Creates a new $class.name$ object.AlgorithmTransform(ModelImage srcImage, TransMatrix xfrm, int interp, float oXres, float oYres, int oXdim, int oYdim, boolean tVOI, boolean clip, boolean pad)
2D constructor for transformation algorithm.AlgorithmTransform(ModelImage srcImage, TransMatrix xfrm, int interp, float oXres, float oYres, int oXdim, int oYdim, int[] units, boolean tVOI, boolean clip, boolean pad)
Creates a new AlgorithmTransform object.AlgorithmTransform(ModelImage srcImage, TransMatrix xfrm, int interp, float oXres, float oYres, int oXdim, int oYdim, int[] units, boolean tVOI, boolean clip, boolean pad, boolean doCenter, WildMagic.LibFoundation.Mathematics.Vector3f center)
Creates a new AlgorithmTransform object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ModelImage
bspline(ModelImage image, ModelImage resultImage, int degree, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs bspline interpolation on black and white image data.static ModelImage
bspline4D(ModelImage image, ModelImage resultImage, int degree, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs bspline interpolation on black and white image data in 4D image.static ModelImage
bsplineC(ModelImage image, ModelImage resultImage, int degree, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs bspline interpolation on color image data.static ModelImage
bsplineC4D(ModelImage image, ModelImage resultImage, int degree, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs bspline interpolation on color image data in 4D image.void
disposeLocal()
Dispose of local variables that may be taking up lots of room.void
finalize()
Prepares this class for destruction.private int[]
getImageMargins(ModelImage srcImage, TransMatrix transMatrix, float dxOut, float dyOut)
Calculate necessary padding for image given applied transform.static int[]
getImageMargins(ModelImage srcImage, TransMatrix transMatrix, float dxOut, float dyOut, float dzOut)
Calculate necessary padding for image given applied transform.ModelImage
getTransformedImage()
Returns transformed volume.static TransMatrix
matrixtoInverseArray(TransMatrix transMatrix)
Converts matrix to inverse array.void
runAlgorithm()
Starts the program.void
setCenter(WildMagic.LibFoundation.Mathematics.Vector3f center)
DOCUMENT ME!void
setDoCenter(boolean doCenter)
DOCUMENT ME!void
setFillValue(float fillValue)
Set value for out of bounds transformation values.void
setPadValue(float padValue)
Deprecated.The value is not just used for padding.void
setSuppressProgressBar(boolean suppressProgressBar)
void
setUpdateOriginFlag(boolean originFlag)
Sets the origin flag used indicated that origin should be changed based using the supplied transformation matrix.void
setUseScannerAnatomical(boolean useSA)
Sets the tranform to set orientation to AXIAL (this is a scanner anatomical transform).private void
transform()
Creates buffer for new image, prepares transformation matrix, and calls transform function for interpolation specified.private void
transform25DVOI(ModelImage image, double[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 3D VOI using nearest neighbor interpolation.private void
transform2DVOI(ModelImage image, double[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 2D VOI using nearest neighbor interpolation.private void
transform3DVOI(ModelImage image, double[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 3D VOI using nearest neighbor interpolation.private void
transform3DVOIByte(ModelImage image, byte[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 3D VOI using nearest neighbor interpolation.private void
transformAlgorithmBspline2D(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.private void
transformAlgorithmBspline2DC(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.private void
transformAlgorithmBspline3D(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.private void
transformAlgorithmBspline3DC(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.private void
transformAlgorithmBspline4D(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.private void
transformAlgorithmBspline4DC(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples color volume using Bspline interpolation.private void
transformBilinear(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation.static void
transformBilinear(float[] imgBuf, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, int oXdim, int oYdim, float oXres, float oYres, ViewJProgressBar progressBar)
Transforms using bilinear interpolation.static void
transformBilinear(float[] imgBuf, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, int oXdim, int oYdim, float oXres, float oYres, ViewJProgressBar progressBar, boolean activeImage)
Transforms using bilinear interpolation.static void
transformBilinear(float[] imgBuf, ModelImage transformedImg, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, ViewJProgressBar progressBar)
Transforms using bilinear interpolation.static void
transformBilinear(float[] imgBuf, ModelImage transformedImg, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, ViewJProgressBar progressBar, boolean activeImage)
Transforms using bilinear interpolation.static void
transformBilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar)
Transforms using bilinear interpolation.static void
transformBilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar, boolean activeImage)
Transforms using bilinear interpolation.static void
transformBilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar, boolean activeImage, float fillValue)
Transforms using bilinear interpolation.private void
transformBilinear3D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation.private void
transformBilinear3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation (2.5D) This version used with color images.private void
transformBilinear4D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation (2.5D) Used as a slice only algorithm on 3D images.private void
transformBilinear4DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation This version used with color images This alogorithm used on a slice by slice basis on 4D images.private void
transformBilinearC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation.static void
transformBilinearC(ModelImage image, ModelImage transformedImg, TransMatrix trans, int oXdim, int oYdim, float oXres, float oYres)
Used on color images.static void
transformBilinearC(ModelImage image, ModelImage transformedImg, TransMatrix trans, int oXdim, int oYdim, float oXres, float oYres, float fillValue)
Used on color images.private void
transformCubicLagrangian2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation.private void
transformCubicLagrangian2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation.private void
transformCubicLagrangian3D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation.private void
transformCubicLagrangian3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation.private void
transformCubicLagrangian3Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation Does a slice by slice cubic Lagrangian interpolation on a 3 dimensional object.private void
transformCubicLagrangian3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 3 dimensional object.private void
transformCubicLagrangian4D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D cubic Lagrangian interpolation.private void
transformCubicLagrangian4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D cubic Lagrangian interpolation.private void
transformCubicLagrangian4Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation Does a slice by slice cubic Lagrangian interpolation on a 4 dimensional object.private void
transformCubicLagrangian4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 4 dimensional object.private void
transformHepticLagrangian2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation.private void
transformHepticLagrangian2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation This version used with color images.private void
transformHepticLagrangian3D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation.private void
transformHepticLagrangian3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation This version used with color images.private void
transformHepticLagrangian3Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation Does a slice by slice heptic Lagrangian interpolation on a 3 dimensional object.private void
transformHepticLagrangian3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 3 dimensional object.private void
transformHepticLagrangian4D(double[] imgBuf, TransMatrix kTM, boolean clip)
transforms and resamples 4 dimensional object using 3D heptic Lagrangian interpolation.private void
transformHepticLagrangian4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM, boolean clip)
transforms and resamples 4 dimensional object using 3D heptic Lagrangian interpolation.private void
transformHepticLagrangian4Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation Does a slice by slice heptic Lagrangian interpolation on a 4 dimensional object.private void
transformHepticLagrangian4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 4 dimensional object.private void
transformNearestNeighbor2D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.static void
transformNearestNeighbor2D(float[] imgBuf, float[] tImgBuf, TransMatrix trans, int xdim, int ydim)
Transforms using Nearest neighbor interpolation.static void
transformNearestNeighbor2D(float[] imgBuf, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, int oXdim, int oYdim, float oXres, float oYres)
Transforms using Nearest neighbor interpolation.private void
transformNearestNeighbor2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.private void
transformNearestNeighbor3D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.static void
transformNearestNeighbor3D(float[] imgBuf, ModelImage transformedImg, int Xdim, int Ydim, int Zdim, TransMatrix trans)
Transforms and resamples volume using nearest neighbor interpolation.private void
transformNearestNeighbor3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.private void
transformNearestNeighbor3Dim2D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.private void
transformNearestNeighbor3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.private void
transformNearestNeighbor4D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples 4 dimensional object using 3D algorithm using nearest neighbor interpolation.private void
transformNearestNeighbor4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM)
Transforms and resamples 4 dimensional object using 3D algorithm using nearest neighbor interpolation.private void
transformNearestNeighbor4Dim2D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.private void
transformNearestNeighbor4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.private void
transformQuinticLagrangian2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation.private void
transformQuinticLagrangian2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation This version used with color images.private void
transformQuinticLagrangian3D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation.private void
transformQuinticLagrangian3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation This version used with color images.private void
transformQuinticLagrangian3Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation Does a slice by slice quintic Lagrangian interpolation on a 3 dimensional object.private void
transformQuinticLagrangian3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 3 dimensional object.private void
transformQuinticLagrangian4D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D quintic Lagrangian interpolation.private void
transformQuinticLagrangian4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional color object using 3D quintic Lagrangian interpolation.private void
transformQuinticLagrangian4Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation Does a slice by slice quintic Lagrangian interpolation on a 4 dimensional object.private void
transformQuinticLagrangian4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 4 dimensional object.private void
transformTrilinear(double[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 3D volume using trilinear interpolation.static void
transformTrilinear(float[] imgBuffer, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, int iZdim, float iXres, float iYres, float iZres, int oXdim, int oYdim, int oZdim, float oXres, float oYres, float oZres, ViewJProgressBar progressBar)
Transforms and resamples volume using trilinear interpolation.static void
transformTrilinear(float[] imgBuffer, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, int iZdim, float iXres, float iYres, float iZres, int oXdim, int oYdim, int oZdim, float oXres, float oYres, float oZres, ViewJProgressBar progressBar, boolean activeImage)
Transforms and resamples volume using trilinear interpolation.static void
transformTrilinear(float[] imgBuffer, ModelImage transformedImg, TransMatrix trans, int iXdim, int iYdim, int iZdim, float iXres, float iYres, float iZres, ViewJProgressBar progressBar)
Transforms and resamples volume using trilinear interpolation.static void
transformTrilinear(float[] imgBuffer, ModelImage transformedImg, TransMatrix trans, int iXdim, int iYdim, int iZdim, float iXres, float iYres, float iZres, ViewJProgressBar progressBar, boolean activeImage)
Transforms and resamples volume using trilinear interpolation.static void
transformTrilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar)
Transforms and resamples volume using trilinear interpolation.static void
transformTrilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar, boolean activeImage)
Transforms and resamples volume using trilinear interpolation.static void
transformTrilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar, boolean activeImage, float fillValue)
Transforms and resamples volume using trilinear interpolation.private void
transformTrilinear4D(double[] imgBuffer, TransMatrix kTM)
Transforms and resamples 4 dimensional object using trilinear interpolation.static ModelImage
transformTrilinear4D(ModelImage image, ModelImage resultImage, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs trilinear interpolation on black and white image data in a 4D image.private void
transformTrilinear4DByteC(byte[] imgBuffer, byte[] imgBuffer2, TransMatrix kTM)
Transforms and resamples 4 dimensional color ARGB object using trilinear interpolation.private void
transformTrilinear4DC(double[] imgBuffer, float[] imgBuffer2, TransMatrix kTM)
Transforms and resamples 4 dimensional color object using trilinear interpolation.private void
transformTrilinearByteC(byte[] imgBuffer, byte[] imgBuffer2, TransMatrix kTM)
Transforms and resamples volume using trilinear interpolation This version is used with ARGB color images.private void
transformTrilinearC(double[] imgBuffer, float[] imgBuffer2, TransMatrix kTM)
Transforms and resamples volume using trilinear interpolation This version is used with color images.static ModelImage
transformTrilinearC(ModelImage image, ModelImage resultImage, float[] imgBuffer, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs trilinear interpolation on color image data.static void
transformTrilinearC(ModelImage image, ModelImage transformedImg, TransMatrix trans, int oXdim, int oYdim, int oZdim, float oXres, float oYres, float oZres)
Transforms and resamples volume using trilinear interpolation Use on color images USE THIS IF OUTPUT IMAGE HAS DIFFERENT DIM/RES THAN INPUT IMAGE.static void
transformTrilinearC(ModelImage image, ModelImage transformedImg, TransMatrix trans, int oXdim, int oYdim, int oZdim, float oXres, float oYres, float oZres, float fillValue)
Transforms and resamples volume using trilinear interpolation Use on color images USE THIS IF OUTPUT IMAGE HAS DIFFERENT DIM/RES THAN INPUT IMAGE.static ModelImage
transformTrilinearC4D(ModelImage image, ModelImage resultImage, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs trilinear interpolation on color image data in a 4D image.private void
transformWSinc2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation.private void
transformWSinc2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation This version used with color images.private void
transformWSinc3D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation.private void
transformWSinc3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation This version used with color images.private void
transformWSinc3Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation Does a slice by slice windowed sinc interpolation on a 3 dimensional object.private void
transformWSinc3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation This version used with color images This version performs a slice by slice algorithm on a 3 dimensional object.private void
transformWSinc4D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D windowed sinc interpolation.private void
transformWSinc4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D windowed sinc interpolation.private void
transformWSinc4Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation Does a slice by slice windowed sinc interpolation on a 4 dimensional object.private void
transformWSinc4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation This version used with color images This version performs a slice by slice algorithm on a 4 dimensional object.private static void
updateFileInfo(ModelImage image, ModelImage resultImage, float[] resolutions, int[] units, TransMatrix matrix, boolean useSATransform, AlgorithmBase srcAlg)
Copy important file information to resultant image structure.private void
updateOrigin()
Translate the image origin from image space to patient space (scanner space).private static void
updateOrigin(TransMatrix xfrm)
Update origin.private void
updateOriginMargins()
Update origin to reflect padding.private void
updateOriginMargins2D()
Update origin to reflect padding.-
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
-
TRILINEAR
public static final int TRILINEAR
Trilinear interpolation.- See Also:
- Constant Field Values
-
BILINEAR
public static final int BILINEAR
Biilinear interpolation.- See Also:
- Constant Field Values
-
NEAREST_NEIGHBOR
public static final int NEAREST_NEIGHBOR
Nearest neighbor interpolation.- See Also:
- Constant Field Values
-
BSPLINE3
public static final int BSPLINE3
Cubic bspline interpolation.- See Also:
- Constant Field Values
-
BSPLINE4
public static final int BSPLINE4
Quadratic bspline interpolation.- See Also:
- Constant Field Values
-
CUBIC_LAGRANGIAN
public static final int CUBIC_LAGRANGIAN
Cubic lagrangian interpolation.- See Also:
- Constant Field Values
-
QUINTIC_LAGRANGIAN
public static final int QUINTIC_LAGRANGIAN
Quintic lagrangian interpolation.- See Also:
- Constant Field Values
-
HEPTIC_LAGRANGIAN
public static final int HEPTIC_LAGRANGIAN
Heptic lagrangian interpolation.- See Also:
- Constant Field Values
-
WSINC
public static final int WSINC
Windowed sinc interpolation.- See Also:
- Constant Field Values
-
updateOrigin
private static boolean updateOrigin
DOCUMENT ME!
-
imgOrigin
private static float[] imgOrigin
DOCUMENT ME!
-
imgOrient
private static int imgOrient
DOCUMENT ME!
-
axisOrient
private static int[] axisOrient
DOCUMENT ME!
-
direct
private static int[] direct
DOCUMENT ME!
-
margins
private static int[] margins
DOCUMENT ME!
-
startPos
private static float startPos
DOCUMENT ME!
-
startTime
private static float startTime
-
bufferFactor
private int bufferFactor
DOCUMENT ME!
-
center
private WildMagic.LibFoundation.Mathematics.Vector3f center
DOCUMENT ME!
-
clip
private boolean clip
DOCUMENT ME!
-
destResolutions
private float[] destResolutions
DOCUMENT ME!
-
DIM
private int DIM
DOCUMENT ME!
-
do25D
private boolean do25D
DOCUMENT ME!
-
doCenter
private boolean doCenter
DOCUMENT ME!
-
imgBuf
private double[] imgBuf
DOCUMENT ME!
-
imgBuf2
private float[] imgBuf2
DOCUMENT ME!
-
imgLength
private int imgLength
DOCUMENT ME!
-
imgLength2
private int imgLength2
DOCUMENT ME!
-
interp
private final int interp
DOCUMENT ME!
-
isSATransform
private boolean isSATransform
flag for determining if the transform is for scanner anatomical (->AXIAL).
-
iXdim
private final int iXdim
DOCUMENT ME!
-
iYdim
private final int iYdim
DOCUMENT ME!
-
iZdim
private int iZdim
-
iTdim
private int iTdim
-
iXres
private float iXres
DOCUMENT ME!
-
iYres
private float iYres
DOCUMENT ME!
-
iZres
private float iZres
-
oUnits
private final int[] oUnits
DOCUMENT ME!
-
oXdim
private int oXdim
DOCUMENT ME!
-
oYdim
private int oYdim
DOCUMENT ME!
-
oZdim
private int oZdim
DOCUMENT ME!
-
oTdim
private int oTdim
DOCUMENT ME!
-
oXres
private final float oXres
DOCUMENT ME!
-
oYres
private final float oYres
DOCUMENT ME!
-
oZres
private float oZres
-
pad
private boolean pad
DOCUMENT ME!
-
fillValue
private float fillValue
Used for out of bounds values in the transformation routines. Set to (float)srcImage.getMin() in the constructors.
-
srcImage
private ModelImage srcImage
DOCUMENT ME!
-
destImage
private ModelImage destImage
DOCUMENT ME!
-
maskImage
private ModelImage maskImage
DOCUMENT ME!
-
transformVOI
private boolean transformVOI
DOCUMENT ME!
-
transMatrix
private final TransMatrix transMatrix
DOCUMENT ME!
-
haveCentered
private boolean haveCentered
-
suppressProgressBar
private boolean suppressProgressBar
-
-
Constructor Detail
-
AlgorithmTransform
public AlgorithmTransform(ModelImage srcImage, TransMatrix xfrm, int interp, float oXres, float oYres, int oXdim, int oYdim, boolean tVOI, boolean clip, boolean pad)
2D constructor for transformation algorithm. Also used for 2.5D algorithms on 3D and 4D images.- Parameters:
srcImage
- ModelImage to be transformedxfrm
- Transformation matrix to be appliedinterp
- Type of interpolation (NEAREST_NEIGHBOR, BILINEAR, BSPLINE3, BSPLINE4, etc)oXres
- X resolution of output imageoYres
- Y resolution of output imageoXdim
- X dimension of output imageoYdim
- Y dimension of output imagetVOI
- iftrue
the VOI should be transformed with the volumeclip
- iftrue
output range is clipped to input rangepad
- iftrue
output image is padded so that none of the image is clipped
-
AlgorithmTransform
public AlgorithmTransform(ModelImage srcImage, TransMatrix xfrm, int interp, float oXres, float oYres, int oXdim, int oYdim, int[] units, boolean tVOI, boolean clip, boolean pad)
Creates a new AlgorithmTransform object.- Parameters:
srcImage
- ModelImage to be transformedxfrm
- Transformation matrix to be appliedinterp
- Type of interpolation (NEAREST_NEIGHBOR, BILINEAR, BSPLINE3, BSPLINE4, etc)oXres
- X resolution of output imageoYres
- Y resolution of output imageoXdim
- X dimension of output imageoYdim
- Y dimension of output imageunits
- DOCUMENT ME!tVOI
- iftrue
the VOI should be transformed with the volumeclip
- iftrue
output range is clipped to input rangepad
- iftrue
output image is padded so that none of the image is clipped
-
AlgorithmTransform
public AlgorithmTransform(ModelImage srcImage, TransMatrix xfrm, int interp, float oXres, float oYres, int oXdim, int oYdim, int[] units, boolean tVOI, boolean clip, boolean pad, boolean doCenter, WildMagic.LibFoundation.Mathematics.Vector3f center)
Creates a new AlgorithmTransform object.- Parameters:
srcImage
- DOCUMENT ME!xfrm
- DOCUMENT ME!interp
- DOCUMENT ME!oXres
- DOCUMENT ME!oYres
- DOCUMENT ME!oXdim
- DOCUMENT ME!oYdim
- DOCUMENT ME!units
- DOCUMENT ME!tVOI
- DOCUMENT ME!clip
- DOCUMENT ME!pad
- DOCUMENT ME!doCenter
-center
-
-
AlgorithmTransform
public AlgorithmTransform(ModelImage _srcImage, TransMatrix xfrm, int interp, float _oXres, float _oYres, float _oZres, int _oXdim, int _oYdim, int _oZdim, boolean tVOI, boolean clip, boolean pad)
3D constructor for transformation algorithm. Also used for 3D algorithms on 4D images.- Parameters:
_srcImage
- ModelImage to be transformedxfrm
- Transformation matrix to be appliedinterp
- Type of interpolation (NEAREST_NEIGHBOR, TRILINEAR, BSPLINE3, BSPLINE4, etc)_oXres
- X resolution of output image_oYres
- Y resolution of output image_oZres
- Z resolution of output image_oXdim
- X dimension of output image_oYdim
- Y dimension of output image_oZdim
- Z dimension of output imagetVOI
- iftrue
the VOI should be transformed with the volumeclip
- iftrue
output range is clipped to input rangepad
- iftrue
output image is padded so that none of the image is clipped
-
AlgorithmTransform
public AlgorithmTransform(ModelImage _srcImage, TransMatrix xfrm, int interp, float _oXres, float _oYres, float _oZres, int _oXdim, int _oYdim, int _oZdim, int[] units, boolean tVOI, boolean clip, boolean pad)
Creates a new $class.name$ object.- Parameters:
_srcImage
- DOCUMENT ME!xfrm
- DOCUMENT ME!interp
- DOCUMENT ME!_oXres
- DOCUMENT ME!_oYres
- DOCUMENT ME!_oZres
- DOCUMENT ME!_oXdim
- DOCUMENT ME!_oYdim
- DOCUMENT ME!_oZdim
- DOCUMENT ME!units
- DOCUMENT ME!tVOI
- DOCUMENT ME!clip
- DOCUMENT ME!pad
- DOCUMENT ME!
-
AlgorithmTransform
public AlgorithmTransform(ModelImage _srcImage, TransMatrix xfrm, int interp, float _oXres, float _oYres, float _oZres, int _oXdim, int _oYdim, int _oZdim, int[] units, boolean tVOI, boolean clip, boolean pad, boolean doCenter, WildMagic.LibFoundation.Mathematics.Vector3f center)
Creates a new $class.name$ object.- Parameters:
_srcImage
- DOCUMENT ME!xfrm
- DOCUMENT ME!interp
- DOCUMENT ME!_oXres
- DOCUMENT ME!_oYres
- DOCUMENT ME!_oZres
- DOCUMENT ME!_oXdim
- DOCUMENT ME!_oYdim
- DOCUMENT ME!_oZdim
- DOCUMENT ME!units
- DOCUMENT ME!tVOI
- DOCUMENT ME!clip
- DOCUMENT ME!pad
- DOCUMENT ME!doCenter
-center
-
-
-
Method Detail
-
setSuppressProgressBar
public void setSuppressProgressBar(boolean suppressProgressBar)
- Parameters:
suppressProgressBar
-
-
bspline
public static ModelImage bspline(ModelImage image, ModelImage resultImage, int degree, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs bspline interpolation on black and white image data.- Parameters:
image
- Image from which the data is derivedresultImage
- Image to put result in; can be null.degree
- Degree of the spline algorithm, either 3 or 4.xfrm
- Transformation to apply.progressBar
- Buffer containing image data.- Returns:
- DOCUMENT ME!
-
bspline4D
public static ModelImage bspline4D(ModelImage image, ModelImage resultImage, int degree, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs bspline interpolation on black and white image data in 4D image. Works time slice by time slice.- Parameters:
image
- Image from which the data is derivedresultImage
- Image to put result in; can be null.degree
- Degree of the spline algorithm, either 3 or 4.xfrm
- Transformation to apply.progressBar
- Buffer containing image data.- Returns:
- DOCUMENT ME!
-
bsplineC
public static ModelImage bsplineC(ModelImage image, ModelImage resultImage, int degree, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs bspline interpolation on color image data.- Parameters:
image
- Image from which the data is derivedresultImage
- Image to put result in; can be null.degree
- Degree of the spline algorithm, either 3 or 4.xfrm
- Transformation to apply.progressBar
- Buffer containing image data.- Returns:
- DOCUMENT ME!
-
bsplineC4D
public static ModelImage bsplineC4D(ModelImage image, ModelImage resultImage, int degree, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs bspline interpolation on color image data in 4D image. Works time slice by time slice.- Parameters:
image
- Image from which the data is derivedresultImage
- Image to put result in; can be null.degree
- Degree of the spline algorithm, either 3 or 4.xfrm
- Transformation to apply.progressBar
- Buffer containing image data.- Returns:
- DOCUMENT ME!
-
getImageMargins
public static int[] getImageMargins(ModelImage srcImage, TransMatrix transMatrix, float dxOut, float dyOut, float dzOut)
Calculate necessary padding for image given applied transform.- Parameters:
srcImage
- DOCUMENT ME!transMatrix
- array with transformation matrixdxOut
- DOCUMENT ME!dyOut
- DOCUMENT ME!dzOut
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
matrixtoInverseArray
public static final TransMatrix matrixtoInverseArray(TransMatrix transMatrix)
Converts matrix to inverse array.- Parameters:
transMatrix
- Matrix to convert.- Returns:
- The inverted array.
-
transformBilinear
public static final void transformBilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar)
Transforms using bilinear interpolation.- Parameters:
image
- Image to be transformedtransformedImg
- Transformed imagetrans
- Transformation matrix to be appliedprogressBar
- Progress bar to update. Can be null. Should NOT have cancel button.
-
transformBilinear
public static final void transformBilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar, boolean activeImage)
Transforms using bilinear interpolation.- Parameters:
image
- Image to be transformedtransformedImg
- Transformed imagetrans
- Transformation matrix to be appliedprogressBar
- Progress bar to update. Can be null. Should NOT have cancel button.activeImage
- true if the algorithm is being run in a separate thread, false otherwise, to control progress bar repainting
-
transformBilinear
public static final void transformBilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar, boolean activeImage, float fillValue)
Transforms using bilinear interpolation.- Parameters:
image
- Image to be transformedtransformedImg
- Transformed imagetrans
- Transformation matrix to be appliedprogressBar
- Progress bar to update. Can be null. Should NOT have cancel button.activeImage
- true if the algorithm is being run in a separate thread, false otherwise, to control progress bar repaintingfillValue
- value used for out of bounds pixels
-
transformBilinear
public static final void transformBilinear(float[] imgBuf, ModelImage transformedImg, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, ViewJProgressBar progressBar)
Transforms using bilinear interpolation.- Parameters:
imgBuf
- Image buffer to be transformedtransformedImg
- Transformed imagetrans
- Transformation matrix to be appliediXdim
- X dimension of input imageiYdim
- Y dimension of input imageiXres
- X resolution of input imageiYres
- Y resolution of input imageprogressBar
- Progress bar to update. Can be null. Should NOT have cancel button.
-
transformBilinear
public static final void transformBilinear(float[] imgBuf, ModelImage transformedImg, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, ViewJProgressBar progressBar, boolean activeImage)
Transforms using bilinear interpolation.- Parameters:
imgBuf
- Image buffer to be transformedtransformedImg
- Transformed imagetrans
- Transformation matrix to be appliediXdim
- X dimension of input imageiYdim
- Y dimension of input imageiXres
- X resolution of input imageiYres
- Y resolution of input imageprogressBar
- Progress bar to update. Can be null. Should NOT have cancel button.activeImage
- true if the algorithm is being run in a separate thread, false otherwise, to control progress bar repainting
-
transformBilinear
public static final void transformBilinear(float[] imgBuf, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, int oXdim, int oYdim, float oXres, float oYres, ViewJProgressBar progressBar)
Transforms using bilinear interpolation.- Parameters:
imgBuf
- Image buffer to be transformedtImgBuf
- Transformed imagetrans
- Transformation matrix to be appliediXdim
- X dimension of input imageiYdim
- Y dimension of input imageiXres
- X resolution of input imageiYres
- Y resolution of input imageoXdim
- X dimension of output imageoYdim
- Y dimension of output imageoXres
- X resolution of output imageoYres
- Y resolution of output imageprogressBar
- Progress bar to be updated. Can be null. Should NOT have cancel button.
-
transformBilinear
public static final void transformBilinear(float[] imgBuf, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, int oXdim, int oYdim, float oXres, float oYres, ViewJProgressBar progressBar, boolean activeImage)
Transforms using bilinear interpolation.- Parameters:
imgBuf
- Image buffer to be transformedtImgBuf
- Transformed imagetrans
- Transformation matrix to be appliediXdim
- X dimension of input imageiYdim
- Y dimension of input imageiXres
- X resolution of input imageiYres
- Y resolution of input imageoXdim
- X dimension of output imageoYdim
- Y dimension of output imageoXres
- X resolution of output imageoYres
- Y resolution of output imageprogressBar
- Progress bar to be updated. Can be null. Should NOT have cancel button.activeImage
- true if the algorithm is being run in a separate thread, false otherwise, to control progress bar repainting
-
transformBilinearC
public static final void transformBilinearC(ModelImage image, ModelImage transformedImg, TransMatrix trans, int oXdim, int oYdim, float oXres, float oYres)
Used on color images. USE THIS IF OUTPUT IMAGE HAS DIFFERENT DIM/RES THAN INPUT IMAGE- Parameters:
image
- Input image to be transformedtransformedImg
- Transformed imagetrans
- Transformation matrix to be appliedoXdim
- Dimensions of output imageoYdim
- Dimensions of output imageoXres
- Resolutions of output imageoYres
- Resolutions of output image
-
transformBilinearC
public static final void transformBilinearC(ModelImage image, ModelImage transformedImg, TransMatrix trans, int oXdim, int oYdim, float oXres, float oYres, float fillValue)
Used on color images. USE THIS IF OUTPUT IMAGE HAS DIFFERENT DIM/RES THAN INPUT IMAGE- Parameters:
image
- Input image to be transformedtransformedImg
- Transformed imagetrans
- Transformation matrix to be appliedoXdim
- Dimensions of output imageoYdim
- Dimensions of output imageoXres
- Resolutions of output imageoYres
- Resolutions of output imagefillValue
- value used for out of bounds pixel transformations
-
transformNearestNeighbor2D
public static final void transformNearestNeighbor2D(float[] imgBuf, float[] tImgBuf, TransMatrix trans, int xdim, int ydim)
Transforms using Nearest neighbor interpolation.- Parameters:
imgBuf
- Image buffer to be transformedtImgBuf
- Transformed image buffertrans
- Transformation matrix to be appliedxdim
- X dimension of input AND output imageydim
- Y dimension of input AND output image
-
transformNearestNeighbor2D
public static final void transformNearestNeighbor2D(float[] imgBuf, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, float iXres, float iYres, int oXdim, int oYdim, float oXres, float oYres)
Transforms using Nearest neighbor interpolation.- Parameters:
imgBuf
- Image buffer to be transformedtImgBuf
- Transformed image buffertrans
- Transformation matrix to be appliediXdim
- X dimension of input imageiYdim
- Y dimension of input imageiXres
- X resolution of input imageiYres
- Y resolution of input imageoXdim
- X dimension of output imageoYdim
- Y dimension of output imageoXres
- X resolution of output imageoYres
- Y resolution of output image
-
transformNearestNeighbor3D
public static final void transformNearestNeighbor3D(float[] imgBuf, ModelImage transformedImg, int Xdim, int Ydim, int Zdim, TransMatrix trans)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- Image array to transformtransformedImg
- Transformed image.Xdim
- X dimension of input imageYdim
- Y dimension of input imageZdim
- Z dimension of input imagetrans
- Transformation matrix to be applied
-
transformTrilinear
public static final void transformTrilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar)
Transforms and resamples volume using trilinear interpolation.- Parameters:
image
- Image to transformtransformedImg
- Transformed image.trans
- Transformation matrix to be appliedprogressBar
- The progress bar. Can be null. Should NOT have a cancel button.
-
transformTrilinear
public static final void transformTrilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar, boolean activeImage)
Transforms and resamples volume using trilinear interpolation.- Parameters:
image
- Image to transformtransformedImg
- Transformed image.trans
- Transformation matrix to be appliedprogressBar
- The progress bar. Can be null. Should NOT have a cancel button.activeImage
- true if the algorithm is being run in a separate thread, false otherwise, to control progress bar repainting
-
transformTrilinear
public static final void transformTrilinear(ModelImage image, ModelImage transformedImg, TransMatrix trans, ViewJProgressBar progressBar, boolean activeImage, float fillValue)
Transforms and resamples volume using trilinear interpolation.- Parameters:
image
- Image to transformtransformedImg
- Transformed image.trans
- Transformation matrix to be appliedprogressBar
- The progress bar. Can be null. Should NOT have a cancel button.activeImage
- true if the algorithm is being run in a separate thread, false otherwise, to control progress bar repaintingfillValue
- value used if transformed pixel is out of bounds
-
transformTrilinear
public static final void transformTrilinear(float[] imgBuffer, ModelImage transformedImg, TransMatrix trans, int iXdim, int iYdim, int iZdim, float iXres, float iYres, float iZres, ViewJProgressBar progressBar)
Transforms and resamples volume using trilinear interpolation.- Parameters:
imgBuffer
- Image arraytransformedImg
- Image after transformtrans
- Transformation matrix to be appliediXdim
- X dimension of input imageiYdim
- Y dimension of input imageiZdim
- Z dimension of input imageiXres
- X resolution of input imageiYres
- Y resolution of input imageiZres
- Z resolution of input imageprogressBar
- Progress bar to update. Can be null. Should NOT have a cancel button.
-
transformTrilinear
public static final void transformTrilinear(float[] imgBuffer, ModelImage transformedImg, TransMatrix trans, int iXdim, int iYdim, int iZdim, float iXres, float iYres, float iZres, ViewJProgressBar progressBar, boolean activeImage)
Transforms and resamples volume using trilinear interpolation.- Parameters:
imgBuffer
- Image arraytransformedImg
- Image after transformtrans
- Transformation matrix to be appliediXdim
- X dimension of input imageiYdim
- Y dimension of input imageiZdim
- Z dimension of input imageiXres
- X resolution of input imageiYres
- Y resolution of input imageiZres
- Z resolution of input imageprogressBar
- Progress bar to update. Can be null. Should NOT have a cancel button.activeImage
- true if the algorithm is being run in a separate thread, false otherwise, to control progress bar repainting
-
transformTrilinear
public static final void transformTrilinear(float[] imgBuffer, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, int iZdim, float iXres, float iYres, float iZres, int oXdim, int oYdim, int oZdim, float oXres, float oYres, float oZres, ViewJProgressBar progressBar)
Transforms and resamples volume using trilinear interpolation.- Parameters:
imgBuffer
- Image buffer to be transformedtImgBuf
- Transformed imagetrans
- Transformation matrix to be appliediXdim
- X dimension of input imageiYdim
- Y dimension of input imageiZdim
- Z dimension of input imageiXres
- X resolution of input imageiYres
- Y resolution of input imageiZres
- Z resolution of input imageoXdim
- X dimension of output imageoYdim
- Y dimension of output imageoZdim
- Z dimension of output imageoXres
- X resolution of output imageoYres
- Y resolution of output imageoZres
- Z resolution of output imageprogressBar
- Progress bar. Can be null. Should NOT have cancel button.
-
transformTrilinear
public static final void transformTrilinear(float[] imgBuffer, float[] tImgBuf, TransMatrix trans, int iXdim, int iYdim, int iZdim, float iXres, float iYres, float iZres, int oXdim, int oYdim, int oZdim, float oXres, float oYres, float oZres, ViewJProgressBar progressBar, boolean activeImage)
Transforms and resamples volume using trilinear interpolation.- Parameters:
imgBuffer
- Image buffer to be transformedtImgBuf
- Transformed imagetrans
- Transformation matrix to be appliediXdim
- X dimension of input imageiYdim
- Y dimension of input imageiZdim
- Z dimension of input imageiXres
- X resolution of input imageiYres
- Y resolution of input imageiZres
- Z resolution of input imageoXdim
- X dimension of output imageoYdim
- Y dimension of output imageoZdim
- Z dimension of output imageoXres
- X resolution of output imageoYres
- Y resolution of output imageoZres
- Z resolution of output imageprogressBar
- Progress bar. Can be null. Should NOT have cancel button.activeImage
- true if the algorithm is being run in a separate thread, false otherwise, to control progress bar repainting
-
transformTrilinear4D
public static ModelImage transformTrilinear4D(ModelImage image, ModelImage resultImage, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs trilinear interpolation on black and white image data in a 4D image. Works time slice by time slice- Parameters:
image
- Image from which the data is derivedresultImage
- Image to put result in; can be null.xfrm
- Transformation to apply.progressBar
- Buffer containing image data.- Returns:
- DOCUMENT ME!
-
transformTrilinearC
public static ModelImage transformTrilinearC(ModelImage image, ModelImage resultImage, float[] imgBuffer, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs trilinear interpolation on color image data.- Parameters:
image
- Image from which the data is derivedresultImage
- Image to put result in; can be null.imgBuffer
- Buffer containing image data.xfrm
- Transformation to apply.progressBar
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
transformTrilinearC
public static final void transformTrilinearC(ModelImage image, ModelImage transformedImg, TransMatrix trans, int oXdim, int oYdim, int oZdim, float oXres, float oYres, float oZres)
Transforms and resamples volume using trilinear interpolation Use on color images USE THIS IF OUTPUT IMAGE HAS DIFFERENT DIM/RES THAN INPUT IMAGE.- Parameters:
image
- Image to transformtransformedImg
- Result image.trans
- Transformation matrix to be appliedoXdim
- DOCUMENT ME!oYdim
- DOCUMENT ME!oZdim
- DOCUMENT ME!oXres
- DOCUMENT ME!oYres
- DOCUMENT ME!oZres
- DOCUMENT ME!
-
transformTrilinearC
public static final void transformTrilinearC(ModelImage image, ModelImage transformedImg, TransMatrix trans, int oXdim, int oYdim, int oZdim, float oXres, float oYres, float oZres, float fillValue)
Transforms and resamples volume using trilinear interpolation Use on color images USE THIS IF OUTPUT IMAGE HAS DIFFERENT DIM/RES THAN INPUT IMAGE.- Parameters:
image
- Image to transformtransformedImg
- Result image.trans
- Transformation matrix to be appliedoXdim
- DOCUMENT ME!oYdim
- DOCUMENT ME!oZdim
- DOCUMENT ME!oXres
- DOCUMENT ME!oYres
- DOCUMENT ME!oZres
- DOCUMENT ME!fillValue
- value if transformed pixel is out of bounds
-
transformTrilinearC4D
public static ModelImage transformTrilinearC4D(ModelImage image, ModelImage resultImage, TransMatrix xfrm, ViewJProgressBar progressBar)
Performs trilinear interpolation on color image data in a 4D image. Works time slice by time slice.- Parameters:
image
- Image from which the data is derivedresultImage
- Image to put result in; can be null.xfrm
- Transformation to apply.progressBar
- Buffer containing image data.- Returns:
- DOCUMENT ME!
-
disposeLocal
public void disposeLocal()
Dispose of local variables that may be taking up lots of room.
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
getImageMargins
private int[] getImageMargins(ModelImage srcImage, TransMatrix transMatrix, float dxOut, float dyOut)
Calculate necessary padding for image given applied transform.- Parameters:
srcImage
- DOCUMENT ME!transMatrix
- array with transformation matrixdxOut
- DOCUMENT ME!dyOut
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getTransformedImage
public ModelImage getTransformedImage()
Returns transformed volume.- Returns:
- destImage
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
setCenter
public void setCenter(WildMagic.LibFoundation.Mathematics.Vector3f center)
DOCUMENT ME!- Parameters:
center
- DOCUMENT ME!
-
setDoCenter
public void setDoCenter(boolean doCenter)
DOCUMENT ME!- Parameters:
doCenter
- DOCUMENT ME!
-
setFillValue
public void setFillValue(float fillValue)
Set value for out of bounds transformation values. Set in constructors to a default of srcImage.getMin().- Parameters:
fillValue
-
-
setPadValue
@Deprecated public void setPadValue(float padValue)
Deprecated.The value is not just used for padding. Please use setFillValue().Set value for out of bounds transformation values. Set in constructors to a default of srcImage.getMin().- Parameters:
padValue
-
-
setUpdateOriginFlag
public void setUpdateOriginFlag(boolean originFlag)
Sets the origin flag used indicated that origin should be changed based using the supplied transformation matrix.- Parameters:
originFlag
- if true sets the updateOrigin flag to true
-
setUseScannerAnatomical
public void setUseScannerAnatomical(boolean useSA)
Sets the tranform to set orientation to AXIAL (this is a scanner anatomical transform).- Parameters:
useSA
- set to axial orientation
-
updateFileInfo
private static void updateFileInfo(ModelImage image, ModelImage resultImage, float[] resolutions, int[] units, TransMatrix matrix, boolean useSATransform, AlgorithmBase srcAlg)
Copy important file information to resultant image structure.- Parameters:
image
- Source image.resultImage
- Resultant image.resolutions
- DOCUMENT ME!units
- DOCUMENT ME!matrix
- DOCUMENT ME!useSATransform
- DOCUMENT ME!m
-
-
updateOrigin
private static void updateOrigin(TransMatrix xfrm)
Update origin. Translate the image origin from image space to patient space (scanner space). The basic ideas, tranlate the (0,0,0) point from scaner space to image space, then subtract the original image origin. The (0, 0, 0) point is the upper left corner of the scanner space's image.- Parameters:
xfrm
- DOCUMENT ME!
-
updateOrigin
private void updateOrigin()
Translate the image origin from image space to patient space (scanner space). The basic ideas, tranlate the (0,0,0) point from scaner space to image space, then multiply the resolution, and subtract the image origin. The (0, 0, 0) point is the upper left corner of the scanner space's image.
-
transform
private void transform()
Creates buffer for new image, prepares transformation matrix, and calls transform function for interpolation specified.
-
transform2DVOI
private void transform2DVOI(ModelImage image, double[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 2D VOI using nearest neighbor interpolation.-
For each VOI in VOIVector:
- Export VOIs as a mask image
- Transform mask
- Extract VOI contours from mask image and put in new image.
- Parameters:
image
- Image where VOIs are storedimgBuffer
- Image arrayxfrm
- Transformation matrix to be applied
-
transform25DVOI
private void transform25DVOI(ModelImage image, double[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 3D VOI using nearest neighbor interpolation.- Export VOIs as a mask image
- Transform mask
- Extract VOI contours from mask image and put in new image.
- Parameters:
image
- Image where VOIs are storedimgBuffer
- Image arraykTM
- Transformation matrix to be applied
-
transform3DVOI
private void transform3DVOI(ModelImage image, double[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 3D VOI using nearest neighbor interpolation.- Export VOIs as a mask image
- Transform mask
- Extract VOI contours from mask image and put in new image.
- Parameters:
image
- Image where VOIs are storedimgBuffer
- Image arraykTM
- Transformation matrix to be applied
-
transform3DVOIByte
private void transform3DVOIByte(ModelImage image, byte[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 3D VOI using nearest neighbor interpolation.- Export VOIs as a mask image
- Transform mask
- Extract VOI contours from mask image and put in new image.
- Parameters:
image
- Image where VOIs are storedimgBuffer
- Image arraykTM
- Transformation matrix to be applied use byte imgBuffer to save a factor of 4 in memory in 3D ARGB color images.
-
transformBilinear
private void transformBilinear(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation.- Parameters:
imgBuf
- Image arraykTM
- Matrix to be applied
-
transformBilinear3D
private void transformBilinear3D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation. Used as a slice-only algorithm on 3D images.- Parameters:
imgBuf
- Image arraykTM
- Matrix to be applied
-
transformBilinear3DC
private void transformBilinear3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation (2.5D) This version used with color images. This alogorithm used on a slice by slice basis on 3D images.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Matrix to be applied
-
transformBilinear4D
private void transformBilinear4D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation (2.5D) Used as a slice only algorithm on 3D images.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be applied
-
transformBilinear4DC
private void transformBilinear4DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation This version used with color images This alogorithm used on a slice by slice basis on 4D images.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Matrix to be applied
-
transformBilinearC
private void transformBilinearC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using bilinear interpolation. This version used with color images- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Matrix to be applied
-
transformAlgorithmBspline2D
private void transformAlgorithmBspline2D(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applieddegree
- degree of polynomial
-
transformAlgorithmBspline2DC
private void transformAlgorithmBspline2DC(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applieddegree
- degree of polynomial
-
transformAlgorithmBspline3D
private void transformAlgorithmBspline3D(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applieddegree
- degree of polynomial
-
transformAlgorithmBspline3DC
private void transformAlgorithmBspline3DC(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applieddegree
- degree of polynomial
-
transformAlgorithmBspline4D
private void transformAlgorithmBspline4D(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples volume using Bspline interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applieddegree
- degree of polynomial
-
transformAlgorithmBspline4DC
private void transformAlgorithmBspline4DC(double[] imgBuf, TransMatrix kTM, int degree)
Transforms and resamples color volume using Bspline interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applieddegree
- degree of polynomial
-
transformCubicLagrangian2D
private void transformCubicLagrangian2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- iftrue
clip output values to be within input range
-
transformCubicLagrangian2DC
private void transformCubicLagrangian2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation. This version used with color images- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- if true clip output values to be within input range
-
transformCubicLagrangian3D
private void transformCubicLagrangian3D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformCubicLagrangian3DC
private void transformCubicLagrangian3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation. This version used with color images- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformCubicLagrangian3Dim2D
private void transformCubicLagrangian3Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation Does a slice by slice cubic Lagrangian interpolation on a 3 dimensional object.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformCubicLagrangian3Dim2DC
private void transformCubicLagrangian3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 3 dimensional object.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformCubicLagrangian4D
private void transformCubicLagrangian4D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D cubic Lagrangian interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- iftrue
clip output values to be within input range
-
transformCubicLagrangian4DC
private void transformCubicLagrangian4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D cubic Lagrangian interpolation.- Parameters:
imgBuf
- Image arrayimgBuffer2
-kTM
- Transformation matrix to be appliedclip
- iftrue
clip output values to be within input range
-
transformCubicLagrangian4Dim2D
private void transformCubicLagrangian4Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation Does a slice by slice cubic Lagrangian interpolation on a 4 dimensional object.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformCubicLagrangian4Dim2DC
private void transformCubicLagrangian4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using cubic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 4 dimensional object.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformHepticLagrangian2D
private void transformHepticLagrangian2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformHepticLagrangian2DC
private void transformHepticLagrangian2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation This version used with color images.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformHepticLagrangian3D
private void transformHepticLagrangian3D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformHepticLagrangian3DC
private void transformHepticLagrangian3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation This version used with color images.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformHepticLagrangian3Dim2D
private void transformHepticLagrangian3Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation Does a slice by slice heptic Lagrangian interpolation on a 3 dimensional object.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformHepticLagrangian3Dim2DC
private void transformHepticLagrangian3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 3 dimensional object.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformHepticLagrangian4D
private void transformHepticLagrangian4D(double[] imgBuf, TransMatrix kTM, boolean clip)
transforms and resamples 4 dimensional object using 3D heptic Lagrangian interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be appliedclip
- if true clip output values to be within input range
-
transformHepticLagrangian4DC
private void transformHepticLagrangian4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM, boolean clip)
transforms and resamples 4 dimensional object using 3D heptic Lagrangian interpolation.- Parameters:
imgBuf
- image arrayimgBuffer2
-kTM
- transformation matrix to be appliedclip
- if true clip output values to be within input range
-
transformHepticLagrangian4Dim2D
private void transformHepticLagrangian4Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation Does a slice by slice heptic Lagrangian interpolation on a 4 dimensional object.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformHepticLagrangian4Dim2DC
private void transformHepticLagrangian4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using heptic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 4 dimensional object.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformNearestNeighbor2D
private void transformNearestNeighbor2D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applied
-
transformNearestNeighbor2DC
private void transformNearestNeighbor2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- input image arrayimgBuf2
- output image arraykTM
- transformation matrix to be applied
-
transformNearestNeighbor3D
private void transformNearestNeighbor3D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applied
-
transformNearestNeighbor3DC
private void transformNearestNeighbor3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- input image arrayimgBuf2
- output image arraykTM
- transformation matrix to be applied
-
transformNearestNeighbor3Dim2D
private void transformNearestNeighbor3Dim2D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applied
-
transformNearestNeighbor3Dim2DC
private void transformNearestNeighbor3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- input image arrayimgBuf2
- output image arraykTM
- transformation matrix to be applied
-
transformNearestNeighbor4D
private void transformNearestNeighbor4D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples 4 dimensional object using 3D algorithm using nearest neighbor interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applied
-
transformNearestNeighbor4DC
private void transformNearestNeighbor4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM)
Transforms and resamples 4 dimensional object using 3D algorithm using nearest neighbor interpolation.- Parameters:
imgBuf
- image arrayimgBufffer2
-kTM
- transformation matrix to be applied
-
transformNearestNeighbor4Dim2D
private void transformNearestNeighbor4Dim2D(double[] imgBuf, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- image arraykTM
- transformation matrix to be applied
-
transformNearestNeighbor4Dim2DC
private void transformNearestNeighbor4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- input image arrayimgBuf2
- output image arraykTM
- transformation matrix to be applied
-
transformQuinticLagrangian2D
private void transformQuinticLagrangian2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformQuinticLagrangian2DC
private void transformQuinticLagrangian2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation This version used with color images.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformQuinticLagrangian3D
private void transformQuinticLagrangian3D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformQuinticLagrangian3DC
private void transformQuinticLagrangian3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation This version used with color images.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformQuinticLagrangian3Dim2D
private void transformQuinticLagrangian3Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation Does a slice by slice quintic Lagrangian interpolation on a 3 dimensional object.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformQuinticLagrangian3Dim2DC
private void transformQuinticLagrangian3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 3 dimensional object.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformQuinticLagrangian4DC
private void transformQuinticLagrangian4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional color object using 3D quintic Lagrangian interpolation.- Parameters:
imgBuf
- Image arrayimgBuf2
-kTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformQuinticLagrangian4D
private void transformQuinticLagrangian4D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D quintic Lagrangian interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformQuinticLagrangian4Dim2D
private void transformQuinticLagrangian4Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation Does a slice by slice quintic Lagrangian interpolation on a 4 dimensional object.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformQuinticLagrangian4Dim2DC
private void transformQuinticLagrangian4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using quintic Lagrangian interpolation This version used with color images This version performs a slice by slice algorithm on a 4 dimensional object.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- iftrue
clip output values to be within input range
-
transformTrilinear
private void transformTrilinear(double[] imgBuffer, TransMatrix kTM)
Transforms and resamples a 3D volume using trilinear interpolation.- Parameters:
imgBuffer
- Image arraykTM
- Transformation matrix to be applied
-
transformTrilinear4D
private void transformTrilinear4D(double[] imgBuffer, TransMatrix kTM)
Transforms and resamples 4 dimensional object using trilinear interpolation.- Parameters:
imgBuffer
- Image arraykTM
- Transformation matrix to be applied
-
transformTrilinear4DByteC
private void transformTrilinear4DByteC(byte[] imgBuffer, byte[] imgBuffer2, TransMatrix kTM)
Transforms and resamples 4 dimensional color ARGB object using trilinear interpolation.- Parameters:
imgBuffer
- Image arrayimgBuf2
-kTM
- Transformation matrix to be applied Byte buffers are used to reduce memory requirements by a factor of 4
-
transformTrilinear4DC
private void transformTrilinear4DC(double[] imgBuffer, float[] imgBuffer2, TransMatrix kTM)
Transforms and resamples 4 dimensional color object using trilinear interpolation.- Parameters:
imgBuffer
- Image arrayimgBuf2
-kTM
- Transformation matrix to be applied
-
transformTrilinearC
private void transformTrilinearC(double[] imgBuffer, float[] imgBuffer2, TransMatrix kTM)
Transforms and resamples volume using trilinear interpolation This version is used with color images.- Parameters:
imgBuffer
- Input image arrayimgBuffer2
- Output image arraykTM
- Transformation matrix to be applied
-
transformTrilinearByteC
private void transformTrilinearByteC(byte[] imgBuffer, byte[] imgBuffer2, TransMatrix kTM)
Transforms and resamples volume using trilinear interpolation This version is used with ARGB color images. Use byte[] rather than float[] to save memory- Parameters:
imgBuffer
- Input image arrayimgBuffer2
- Output image arraykTM
- Transformation matrix to be applied
-
transformWSinc2D
private void transformWSinc2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformWSinc2DC
private void transformWSinc2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation This version used with color images.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformWSinc3D
private void transformWSinc3D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformWSinc3DC
private void transformWSinc3DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation This version used with color images.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformWSinc3Dim2D
private void transformWSinc3Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation Does a slice by slice windowed sinc interpolation on a 3 dimensional object.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformWSinc3Dim2DC
private void transformWSinc3Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation This version used with color images This version performs a slice by slice algorithm on a 3 dimensional object.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformWSinc4D
private void transformWSinc4D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D windowed sinc interpolation.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformWSinc4DC
private void transformWSinc4DC(double[] imgBuf, float[] imgBuffer2, TransMatrix kTM, boolean clip)
Transforms and resamples 4 dimensional object using 3D windowed sinc interpolation.- Parameters:
imgBuf
- Image arrayimgBuffer2
-kTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
transformWSinc4Dim2D
private void transformWSinc4Dim2D(double[] imgBuf, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation Does a slice by slice windowed sinc interpolation on a 4 dimensional object.- Parameters:
imgBuf
- Image arraykTM
- Transformation matrix to be appliedclip
- Iftrue clip output values to be within input range
-
transformWSinc4Dim2DC
private void transformWSinc4Dim2DC(double[] imgBuf, float[] imgBuf2, TransMatrix kTM, boolean clip)
Transforms and resamples volume using windowed sinc interpolation This version used with color images This version performs a slice by slice algorithm on a 4 dimensional object.- Parameters:
imgBuf
- Input image arrayimgBuf2
- Output image arraykTM
- Transformation matrix to be appliedclip
- Iftrue
clip output values to be within input range
-
updateOriginMargins
private void updateOriginMargins()
Update origin to reflect padding.
-
updateOriginMargins2D
private void updateOriginMargins2D()
Update origin to reflect padding.
-
-