Class AlgorithmCorrectSpacing
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.utilities.AlgorithmCorrectSpacing
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmCorrectSpacing extends AlgorithmBase
Algorithm to adjust image volume for cases when the slice spacing is not equal to the slice thickness. When spacing > thickness: repeat images from original image set insert blank images (so that in the final image volume, all images will have the same slice thickness and the image volume will be to proper scale. When spacing < thickness: set thickness = spacing.
-
-
Field Summary
Fields Modifier and Type Field Description private int
colorFactor
private int
DIM
The number of dimensions in the image.private int
newTimeStepVolume
Volume for each time step.private int
newZdim
New Z dimension.private int
numBlanks
Number of blank images, to make up gap.private int
numRepIm
Number of repeated images, to compensate for gap.private int
oldTimeStepVolume
Volume for each time step.private int
oldZdim
Original Z dimension of the image.private ModelImage
resultImage
Result Image.private int
sliceArea
Area of a slice (Xdim * Ydim).private int
Tdim
Time dimension of the image.private int
Xdim
X dimension of the image.private int
Ydim
Y dimension of the image.-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmCorrectSpacing(ModelImage srcImage, ModelImage resultImage, int numRepIm, int numBlanks)
Import source image into the class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disposeLocal()
Dispose of local variables that may be taking up lots of room.void
finalize()
Prepares this class for destruction.ModelImage
getResultImage()
Returns corrected image.void
runAlgorithm()
Runs algorithm.-
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
-
DIM
private int DIM
The number of dimensions in the image.
-
newZdim
private int newZdim
New Z dimension.
-
numBlanks
private int numBlanks
Number of blank images, to make up gap.
-
numRepIm
private int numRepIm
Number of repeated images, to compensate for gap.
-
oldTimeStepVolume
private int oldTimeStepVolume
Volume for each time step.
-
newTimeStepVolume
private int newTimeStepVolume
Volume for each time step.
-
oldZdim
private int oldZdim
Original Z dimension of the image.
-
resultImage
private ModelImage resultImage
Result Image.
-
sliceArea
private int sliceArea
Area of a slice (Xdim * Ydim).
-
Tdim
private int Tdim
Time dimension of the image.
-
Xdim
private int Xdim
X dimension of the image.
-
Ydim
private int Ydim
Y dimension of the image.
-
colorFactor
private int colorFactor
-
-
Constructor Detail
-
AlgorithmCorrectSpacing
public AlgorithmCorrectSpacing(ModelImage srcImage, ModelImage resultImage, int numRepIm, int numBlanks)
Import source image into the class.- Parameters:
srcImage
- source image (image to clip from)resultImage
- corrected imagenumRepIm
- number of times to repeat each of original imagesnumBlanks
- number of blank images to insert
-
-
Method Detail
-
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
-
getResultImage
public ModelImage getResultImage()
Returns corrected image.- Returns:
- resultImage
-
runAlgorithm
public void runAlgorithm()
Runs algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
-