Class AlgorithmMaximumIntensityProjection
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmMaximumIntensityProjection
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
Computes the maximum or the minimum intensity along each projection of a 3D image.
The user can specify theshold values in image intensity for the calculation, as well as
which projection to compute along (X,Y, or Z), the start and end slice used in the calculation,
the size of a sliding 'window' in number of slices to use in the calculation, and whether to calculate the minimum,
maximum or both projections.
When the sliding window size is not equal to the number of slices used in the calculation the output is a 3D image,
where each slice of the output image is computed using the number of slices in the sliding window. When the
sliding window size is equal to the number of slices used in the calculation the output image is a 2D image.
- Author:
- joshim2
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intWhen the image is a color image, the colorFactor is set to 4, otherwise it defaults to 1.private booleanWhen true, computes the maximum intensity projection.private booleanWhen true, computes the minimum intensity projection.(package private) float[]Source Image Resolutions(package private) int[]Source Image Units of Measureprivate double[]Maximum intensity threshold value.private double[]Minimum intensity threshold value.private intDefault Projection is along the z-Axis.private booleanprivate Vector<ModelImage> Array of Result Imagesprivate intThe first slice in the intensity projection calculation:private intThe last slice in the intensity projection calculation:private intThe number of slices used in the intensity projection, represents a sliding window.static final intProject along the X-Axis.static final intProject along the Y-Axis.static final intProject along the Z-Axis.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
ConstructorsConstructorDescriptionAlgorithmMaximumIntensityProjection(ModelImage srcImg, int _startSlice, int _stopSlice, int _window, double _minIntensity, double _maxIntensity, boolean _computeMaximum, boolean _computeMinimum, int _projectionDirection) Estimates the maximum intensity projection in each direction of a 3D black and white imageAlgorithmMaximumIntensityProjection(ModelImage srcImg, int _startSlice, int _stopSlice, int _window, double _minR, double _maxR, double _minG, double _maxG, double _minB, double _maxB, boolean _computeMaximum, boolean _computeMinimum, int _projectionDirection) Estimates the maximum intensity projection of a 3D color image -
Method Summary
Modifier and TypeMethodDescriptionprivate voidCalculates the X Projection for color or black and white images.private voidCalculates the Y Projection for color or black and white images.private voidCalculates the Z Projection for color or black and white images.voidfinalize()Prepares this class for destruction.double[]double[]intThis method returns the projection images in a Vector.intintintbooleanbooleanvoidRuns the Intensity Projection algorithm.voidsetComputeMaximum(boolean computeMaximum) voidsetComputeMinimum(boolean computeMinimum) voidsetMaxIntensity(double[] maxIntensity) voidsetMinIntensity(double[] minIntensity) voidsetProjectionDirection(int projectionDirection) voidsetQuiet(boolean quiet) voidsetSrcImage(ModelImage srcImage) Sets the source image of the algorithmvoidsetStartSlice(int startSlice) voidsetStopSlice(int stopSlice) voidsetWindow(int window) 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, 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
-
resultImages
Array of Result Images -
imResolutions
float[] imResolutionsSource Image Resolutions -
imUnitsOfMeasure
int[] imUnitsOfMeasureSource Image Units of Measure -
startSlice
private int startSliceThe first slice in the intensity projection calculation: -
stopSlice
private int stopSliceThe last slice in the intensity projection calculation: -
window
private int windowThe number of slices used in the intensity projection, represents a sliding window. When this number is not the difference between the stop and start slices, the output image is a 3D that is a collection of projections. Otherwise the output image is a single 2D projection. -
minIntensity
private double[] minIntensityMinimum intensity threshold value. -
maxIntensity
private double[] maxIntensityMaximum intensity threshold value. -
computeMaximum
private boolean computeMaximumWhen true, computes the maximum intensity projection. -
computeMinimum
private boolean computeMinimumWhen true, computes the minimum intensity projection. -
X_PROJECTION
public static final int X_PROJECTIONProject along the X-Axis.- See Also:
-
Y_PROJECTION
public static final int Y_PROJECTIONProject along the Y-Axis.- See Also:
-
Z_PROJECTION
public static final int Z_PROJECTIONProject along the Z-Axis.- See Also:
-
projectionDirection
private int projectionDirectionDefault Projection is along the z-Axis. -
colorFactor
private int colorFactorWhen the image is a color image, the colorFactor is set to 4, otherwise it defaults to 1. -
quiet
private boolean quiet
-
-
Constructor Details
-
AlgorithmMaximumIntensityProjection
public AlgorithmMaximumIntensityProjection(ModelImage srcImg, int _startSlice, int _stopSlice, int _window, double _minIntensity, double _maxIntensity, boolean _computeMaximum, boolean _computeMinimum, int _projectionDirection) Estimates the maximum intensity projection in each direction of a 3D black and white image- Parameters:
srcImg- source image_startSlice- the first slice used in the projection calculation._stopSlice- the last slice used in the projection calculation._window- the number of slices to use in the projection._minIntensity- minimum intensity threshold._maxIntensity- maximum intensity threshold._computeMaximum- when true compute the maximum intensity projection._computeMinimum- when true compute the minimum intensity projection._projectionDirection- image axis to project along (X, Y, or Z).
-
AlgorithmMaximumIntensityProjection
public AlgorithmMaximumIntensityProjection(ModelImage srcImg, int _startSlice, int _stopSlice, int _window, double _minR, double _maxR, double _minG, double _maxG, double _minB, double _maxB, boolean _computeMaximum, boolean _computeMinimum, int _projectionDirection) Estimates the maximum intensity projection of a 3D color image- Parameters:
srcImg- source image_startSlice- the first slice used in the projection calculation._stopSlice- the last slice used in the projection calculation._window- the number of slices to use in the projection._minR- minimum Red intensity threshold._maxR- maximum Red intensity threshold._minG- minimum Green intensity threshold._maxG- maximum Green intensity threshold._minB- minimum Blue intensity threshold._maxB- maximum Blue intensity threshold._computeMaximum- when true compute the maximum intensity projection._computeMinimum- when true compute the minimum intensity projection._projectionDirection- image axis to project along (X, Y, or Z).
-
-
Method Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
setQuiet
public void setQuiet(boolean quiet) - Parameters:
quiet-
-
runAlgorithm
public void runAlgorithm()Runs the Intensity Projection algorithm.- Specified by:
runAlgorithmin classAlgorithmBase
-
calcZProjection
private void calcZProjection()Calculates the Z Projection for color or black and white images. -
calcYProjection
private void calcYProjection()Calculates the Y Projection for color or black and white images. -
calcXProjection
private void calcXProjection()Calculates the X Projection for color or black and white images. -
getStartSlice
public int getStartSlice()- Returns:
- the startSlice
-
getStopSlice
public int getStopSlice()- Returns:
- the stopSlice
-
getMinIntensity
public double[] getMinIntensity()- Returns:
- the minIntensity
-
getMaxIntensity
public double[] getMaxIntensity()- Returns:
- the maxIntensity
-
isComputeMaximum
public boolean isComputeMaximum()- Returns:
- the computeMaximum
-
isComputeMinimum
public boolean isComputeMinimum()- Returns:
- the computeMinimum
-
getProjectionDirection
public int getProjectionDirection()- Returns:
- the projectionDirection
-
getResultImage
This method returns the projection images in a Vector. -
getWindow
public int getWindow()- Returns:
- the window
-
setStartSlice
public void setStartSlice(int startSlice) - Parameters:
startSlice- the startSlice to set
-
setStopSlice
public void setStopSlice(int stopSlice) - Parameters:
stopSlice- the stopSlice to set
-
setMinIntensity
public void setMinIntensity(double[] minIntensity) - Parameters:
minIntensity- the minIntensity to set
-
setMaxIntensity
public void setMaxIntensity(double[] maxIntensity) - Parameters:
maxIntensity- the maxIntensity to set
-
setComputeMaximum
public void setComputeMaximum(boolean computeMaximum) - Parameters:
computeMaximum- the computeMaximum to set
-
setComputeMinimum
public void setComputeMinimum(boolean computeMinimum) - Parameters:
computeMinimum- the computeMinimum to set
-
setProjectionDirection
public void setProjectionDirection(int projectionDirection) - Parameters:
projectionDirection- the projectionDirection to set
-
setSrcImage
Description copied from class:AlgorithmBaseSets the source image of the algorithm- Overrides:
setSrcImagein classAlgorithmBase- Parameters:
srcImage- the source image
-
setWindow
public void setWindow(int window) - Parameters:
window- the window to set
-