Class AlgorithmSwapSlicesVolume
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmSwapSlicesVolume
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
Title: AlgorithmSwapSlicesVolume
Description: Allows user to re-slice/re-volume and associates fileInfo. This allows for slice/volume duplication, deletion, or insertion.
- Version:
- 0.9
- Author:
- Justin Senseney
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intInternal sorting variables for sorting slices on images of greater than 3 dimensionsprivate intInternal sorting variables for sorting slices on images of greater than 3 dimensionsSwap mode, either 3D or 4D.private intNumber of slices in mode.private int[][]Reordering of slices/volumes.private intNumber of pixels used by a slice/volume, includes colorFactor.private boolean[]Slices that have been examined in recursive structure for swapping slices.private int[]Original extents arrayprivate FileInfoBase[]Original FileInfoBase array.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
ConstructorsConstructorDescriptionAlgorithmSwapSlicesVolume(ModelImage destImage, JDialogSwapSlicesVolumes.SwapMode mode, int[][] sliceRenum, ModelImage srcImage) Import source and destination images into the class. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanprivate FileInfoBase[]collectFileInfos(int in, int tDim) Gets the fileInfos from the specified position.voidfinalize()Prepares this class for destruction.protected intCalculates and returns the color factor based on the srcImage.Return the images extracted from the source image.private voidimportFileInfos(ModelImage destImage, FileInfoBase[] fileIn, int in, int tDim) Inserts the fileInfos into the specified position.private voidreallocate(ModelImage image) Reallocate destImage so that fileInfo and buffer equal required lengthvoidCalculates the final output.private voidCalculates the final output and stores it in the source image.private booleantransferIn(int in) Starts method of file/image transferringprivate booleantransferIn(FileInfoBase[] fileIn, Number[] bufferIn, int in, int tDim) Transfers the given buffer into the given location.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
-
mode
Swap mode, either 3D or 4D. -
nSlices
private int nSlicesNumber of slices in mode. -
sliceRenum
private int[][] sliceRenumReordering of slices/volumes. -
sliceSize
private int sliceSizeNumber of pixels used by a slice/volume, includes colorFactor. -
sliceTouched
private boolean[] sliceTouchedSlices that have been examined in recursive structure for swapping slices. -
extentSrc
private int extentSrcInternal sorting variables for sorting slices on images of greater than 3 dimensions -
extentDest
private int extentDestInternal sorting variables for sorting slices on images of greater than 3 dimensions -
srcFileInfos
Original FileInfoBase array. -
srcExtents
private int[] srcExtentsOriginal extents array
-
-
Constructor Details
-
AlgorithmSwapSlicesVolume
public AlgorithmSwapSlicesVolume(ModelImage destImage, JDialogSwapSlicesVolumes.SwapMode mode, int[][] sliceRenum, ModelImage srcImage) Import source and destination images into the class.- Parameters:
destImage- destination imagemode- type of swapping operationsliceRenum- list of locations for slices that should be extracted/movedsrcImage- source image (image to extract from)
-
-
Method Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
getSwappedVolume
Return the images extracted from the source image.- Returns:
- The extracted images.
-
runAlgorithm
public void runAlgorithm()Calculates the final output.- Specified by:
runAlgorithmin classAlgorithmBase
-
getColorFactor
protected int getColorFactor()Calculates and returns the color factor based on the srcImage.- Returns:
- DOCUMENT ME!
-
allSlicesTouched
private boolean allSlicesTouched() -
collectFileInfos
Gets the fileInfos from the specified position. -
importFileInfos
Inserts the fileInfos into the specified position. -
reallocate
Reallocate destImage so that fileInfo and buffer equal required length- Parameters:
image- ModelImage
-
swapSlices
private void swapSlices()Calculates the final output and stores it in the source image. -
transferIn
private boolean transferIn(int in) Starts method of file/image transferring- Parameters:
in- location to import data- Returns:
- whether import was successful
-
transferIn
Transfers the given buffer into the given location. Also recursively transfers all the old data to the location(s) where the old data is used.- Parameters:
bufferIn- relieves the symptoms of arthritisin- location to import data- Returns:
- whether import was successful
-