Class AlgorithmCorrectSpacing
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmCorrectSpacing
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
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 invalid input: '<' thickness: set
thickness = spacing.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intThe number of dimensions in the image.private intVolume for each time step.private intNew Z dimension.private intNumber of blank images, to make up gap.private intNumber of repeated images, to compensate for gap.private intVolume for each time step.private intOriginal Z dimension of the image.private ModelImageResult Image.private intArea of a slice (Xdim * Ydim).private intTime dimension of the image.private intX dimension of the image.private intY 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, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmCorrectSpacing(ModelImage srcImage, ModelImage resultImage, int numRepIm, int numBlanks) Import source image into the class. -
Method Summary
Modifier and TypeMethodDescriptionvoidDispose of local variables that may be taking up lots of room.voidfinalize()Prepares this class for destruction.Returns corrected image.voidRuns 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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
DIM
private int DIMThe number of dimensions in the image. -
newZdim
private int newZdimNew Z dimension. -
numBlanks
private int numBlanksNumber of blank images, to make up gap. -
numRepIm
private int numRepImNumber of repeated images, to compensate for gap. -
oldTimeStepVolume
private int oldTimeStepVolumeVolume for each time step. -
newTimeStepVolume
private int newTimeStepVolumeVolume for each time step. -
oldZdim
private int oldZdimOriginal Z dimension of the image. -
resultImage
Result Image. -
sliceArea
private int sliceAreaArea of a slice (Xdim * Ydim). -
Tdim
private int TdimTime dimension of the image. -
Xdim
private int XdimX dimension of the image. -
Ydim
private int YdimY dimension of the image. -
colorFactor
private int colorFactor
-
-
Constructor Details
-
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 Details
-
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:
finalizein classAlgorithmBase
-
getResultImage
Returns corrected image.- Returns:
- resultImage
-
runAlgorithm
public void runAlgorithm()Runs algorithm.- Specified by:
runAlgorithmin classAlgorithmBase
-