Class AlgorithmCrop
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmCrop
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
Crops 2D and 3D images using a supplied VOI. Crops 4D images.
- Version:
- 1.0 June 11, 1999
- Author:
- Matthew J. McAuliffe, Ph.D.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intExtra space around VOI in x and y dimensions.private booleanFlag for color or noncolor image.private int[]Storage for VOI.private int[]Storage for VOI.private int[]Storage for VOI.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
ConstructorsConstructorDescriptionAlgorithmCrop(ModelImage destImg, ModelImage srcImg, int _cushion, int[] _x, int[] _y, int[] _z) Creates new algorithms to crop image by specified bounds. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidThis function produces a new image that has been cropped!private voidThis function produces a new image that has been cropped.private voidThis function produces a new image that has been cropped.private voidThis function crops srcImage Must use getSrcImage after running.private voidThis function crops srcImage Must use getSrcImage after running.private voidThis function crops srcImage Must use getSrcImage after running.voidfinalize()Prepares this class for destruction.DOCUMENT ME!private float[]originImg2LPS(float[] origImg, ModelImage img) Switch origin order from image order to LPS order.private float[]originLPS2Img(float[] origLPS, ModelImage img) Switch origin order from LPS order to Img order.voidStarts the program.private voidUpdate special case DICOM format tags.private voidUpdates important image attributes (start locations, orientation ) for the new cropped file by modifing the fileinfo fo the new ( destination ) image.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, 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
-
cushion
private int cushionExtra space around VOI in x and y dimensions. -
RGBImage
private boolean RGBImageFlag for color or noncolor image. -
x
private int[] xStorage for VOI. -
y
private int[] yStorage for VOI. -
z
private int[] zStorage for VOI.
-
-
Constructor Details
-
AlgorithmCrop
public AlgorithmCrop(ModelImage destImg, ModelImage srcImg, int _cushion, int[] _x, int[] _y, int[] _z) Creates new algorithms to crop image by specified bounds. Stores in destImg.- Parameters:
destImg- image model where result image is to stored, use null to do in-place calculationsrcImg- source image model_cushion- extra space around VOI in x and y dimensions._x- VOI xBounds: x[0] = min. bound and x[1] = max. bound_y- VOI yBounds: y[0] = min. bound and y[1] = max. bound_z- VOI zBounds: z[0] = min. bound and z[1] = max. bound
-
-
Method Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
getSrcImage
DOCUMENT ME!- Overrides:
getSrcImagein classAlgorithmBase- Returns:
- ModelImage
-
runAlgorithm
public void runAlgorithm()Starts the program.- Specified by:
runAlgorithmin classAlgorithmBase
-
calcStoreInDest2D
private void calcStoreInDest2D()This function produces a new image that has been cropped! -
calcStoreInDest3D
private void calcStoreInDest3D()This function produces a new image that has been cropped. -
calcStoreInDest4D
private void calcStoreInDest4D()This function produces a new image that has been cropped. -
calcStoreInPlace2D
private void calcStoreInPlace2D()This function crops srcImage Must use getSrcImage after running. -
calcStoreInPlace3D
private void calcStoreInPlace3D()This function crops srcImage Must use getSrcImage after running. -
calcStoreInPlace4D
private void calcStoreInPlace4D()This function crops srcImage Must use getSrcImage after running. -
originImg2LPS
Switch origin order from image order to LPS order.- Parameters:
origImg- DOCUMENT ME!img- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
originLPS2Img
Switch origin order from LPS order to Img order.- Parameters:
origLPS- DOCUMENT ME!img- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
updateDICOM
private void updateDICOM()Update special case DICOM format tags. -
updateFileInfoData
private void updateFileInfoData()Updates important image attributes (start locations, orientation ) for the new cropped file by modifing the fileinfo fo the new ( destination ) image.
-