Class AlgorithmMaximumIntensityProjection
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.utilities.AlgorithmMaximumIntensityProjection
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmMaximumIntensityProjection extends AlgorithmBase
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
-
-
Field Summary
Fields Modifier and Type Field Description private int
colorFactor
When the image is a color image, the colorFactor is set to 4, otherwise it defaults to 1.private boolean
computeMaximum
When true, computes the maximum intensity projection.private boolean
computeMinimum
When true, computes the minimum intensity projection.(package private) float[]
imResolutions
Source Image Resolutions(package private) int[]
imUnitsOfMeasure
Source Image Units of Measureprivate double[]
maxIntensity
Maximum intensity threshold value.private double[]
minIntensity
Minimum intensity threshold value.private int
projectionDirection
Default Projection is along the z-Axis.private boolean
quiet
private java.util.Vector<ModelImage>
resultImages
Array of Result Imagesprivate int
startSlice
The first slice in the intensity projection calculation:private int
stopSlice
The last slice in the intensity projection calculation:private int
window
The number of slices used in the intensity projection, represents a sliding window.static int
X_PROJECTION
Project along the X-Axis.static int
Y_PROJECTION
Project along the Y-Axis.static int
Z_PROJECTION
Project 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, threadStopped
-
-
Constructor Summary
Constructors Constructor Description 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 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calcXProjection()
Calculates the X Projection for color or black and white images.private void
calcYProjection()
Calculates the Y Projection for color or black and white images.private void
calcZProjection()
Calculates the Z Projection for color or black and white images.void
finalize()
Prepares this class for destruction.double[]
getMaxIntensity()
double[]
getMinIntensity()
int
getProjectionDirection()
java.util.Vector<ModelImage>
getResultImage()
This method returns the projection images in a Vector.int
getStartSlice()
int
getStopSlice()
int
getWindow()
boolean
isComputeMaximum()
boolean
isComputeMinimum()
void
runAlgorithm()
Runs the Intensity Projection algorithm.void
setComputeMaximum(boolean computeMaximum)
void
setComputeMinimum(boolean computeMinimum)
void
setMaxIntensity(double[] maxIntensity)
void
setMinIntensity(double[] minIntensity)
void
setProjectionDirection(int projectionDirection)
void
setQuiet(boolean quiet)
void
setSrcImage(ModelImage srcImage)
Sets the source image of the algorithmvoid
setStartSlice(int startSlice)
void
setStopSlice(int stopSlice)
void
setWindow(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, 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
-
resultImages
private java.util.Vector<ModelImage> resultImages
Array of Result Images
-
imResolutions
float[] imResolutions
Source Image Resolutions
-
imUnitsOfMeasure
int[] imUnitsOfMeasure
Source Image Units of Measure
-
startSlice
private int startSlice
The first slice in the intensity projection calculation:
-
stopSlice
private int stopSlice
The last slice in the intensity projection calculation:
-
window
private int window
The 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[] minIntensity
Minimum intensity threshold value.
-
maxIntensity
private double[] maxIntensity
Maximum intensity threshold value.
-
computeMaximum
private boolean computeMaximum
When true, computes the maximum intensity projection.
-
computeMinimum
private boolean computeMinimum
When true, computes the minimum intensity projection.
-
X_PROJECTION
public static final int X_PROJECTION
Project along the X-Axis.- See Also:
- Constant Field Values
-
Y_PROJECTION
public static final int Y_PROJECTION
Project along the Y-Axis.- See Also:
- Constant Field Values
-
Z_PROJECTION
public static final int Z_PROJECTION
Project along the Z-Axis.- See Also:
- Constant Field Values
-
projectionDirection
private int projectionDirection
Default Projection is along the z-Axis.
-
colorFactor
private int colorFactor
When the image is a color image, the colorFactor is set to 4, otherwise it defaults to 1.
-
quiet
private boolean quiet
-
-
Constructor Detail
-
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 Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
setQuiet
public void setQuiet(boolean quiet)
- Parameters:
quiet
-
-
runAlgorithm
public void runAlgorithm()
Runs the Intensity Projection algorithm.- Specified by:
runAlgorithm
in 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
public java.util.Vector<ModelImage> 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
public void setSrcImage(ModelImage srcImage)
Description copied from class:AlgorithmBase
Sets the source image of the algorithm- Overrides:
setSrcImage
in classAlgorithmBase
- Parameters:
srcImage
- the source image
-
setWindow
public void setWindow(int window)
- Parameters:
window
- the window to set
-
-