Class AlgorithmSWI
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.AlgorithmSWI
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmSWI extends AlgorithmBase
This class recalculates mo and dceFullTre to provide better estimates using the inverse Ernst equation- Author:
- Justin Senseney (SenseneyJ@mail.nih.gov)
-
-
Field Summary
Fields Modifier and Type Field Description private ModelImage
brainMask
Denotes which pixels undergo SWI processing.private ModelImage
iCenter
private ModelImage
iFinal
private ModelImage
iImage
private boolean
inScript
Denotes whether the algorithm is run in a script/JIST, if so showInterImages just stores images for later access.private ModelImage
kCenterImage
private ModelImage
kImage
private ModelImage
magImage
private double
maskThreshold
private int
multFactor
private ModelImage
phaseImage
private ModelImage
phaseMask
private boolean
showInterImages
Whether intermediate images should be displayed during pipeline processingprivate int
xDim
X dimension lengthprivate int
xFilterSize
private double
xFilterTopLeft
private int
yDim
Y dimension lengthprivate int
yFilterSize
private double
yFilterTopLeft
private int
zDim
Z dimension length-
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 AlgorithmSWI(boolean inScript, ModelImage resultImage, ModelImage magImage, ModelImage phaseImage, double maskThreshold, int roFilterSize, int peFilterSize, int multFactor, boolean showInterImages)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calc2D()
private void
calc3D()
private ModelImage
createBrainMask()
private ModelImage
createiImage(double[] realData, double[] imagData)
private ModelImage
createKCenterImage(ModelImage kImage)
private ModelImage
createkImage(ModelImage iImage)
void
finalize()
Prepares this class for destruction.private ModelImage
generateIFinal(ModelImage iImage, ModelImage iCenterImage, java.util.BitSet brainMaskSet, double[] ixRealFinal, double[] ixImagFinal)
private ModelImage
generateMagEnhanced(double[] phaseMaskData, ModelImage magnitude)
private ModelImage
generatePhaseMask(java.util.BitSet brainMaskSet, double[] ixRealFinal, double[] ixImagFinal, double[] phaseMaskData)
ModelImage
getBrainMask()
ModelImage
getiCenter()
ModelImage
getiFinal()
ModelImage
getiImage()
ModelImage
getkCenterImage()
ModelImage
getkImage()
ModelImage
getPhaseMask()
private void
rescaleToComplex(ModelImage magImage, ModelImage phaseImage, double[] realData, double[] imagData)
void
runAlgorithm()
Starts the algorithm.private ModelImage
runiFFTonKCenter(ModelImage kCenterImage)
-
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, 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
-
magImage
private ModelImage magImage
-
phaseImage
private ModelImage phaseImage
-
maskThreshold
private double maskThreshold
-
xFilterSize
private int xFilterSize
-
yFilterSize
private int yFilterSize
-
multFactor
private int multFactor
-
xDim
private int xDim
X dimension length
-
yDim
private int yDim
Y dimension length
-
zDim
private int zDim
Z dimension length
-
xFilterTopLeft
private double xFilterTopLeft
-
yFilterTopLeft
private double yFilterTopLeft
-
showInterImages
private boolean showInterImages
Whether intermediate images should be displayed during pipeline processing
-
kImage
private ModelImage kImage
-
iImage
private ModelImage iImage
-
brainMask
private ModelImage brainMask
Denotes which pixels undergo SWI processing.
-
kCenterImage
private ModelImage kCenterImage
-
iFinal
private ModelImage iFinal
-
phaseMask
private ModelImage phaseMask
-
inScript
private boolean inScript
Denotes whether the algorithm is run in a script/JIST, if so showInterImages just stores images for later access.
-
iCenter
private ModelImage iCenter
-
-
Constructor Detail
-
AlgorithmSWI
public AlgorithmSWI(boolean inScript, ModelImage resultImage, ModelImage magImage, ModelImage phaseImage, double maskThreshold, int roFilterSize, int peFilterSize, int multFactor, boolean showInterImages)
Constructor.- Parameters:
resultImage
- Result image modelsrcImg
- Source image model.
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the algorithm. At the conclusion of this method, AlgorithmBase reports to any algorithm listeners that this algorithm has completed. This method is not usually called explicitly by a controlling dialog. Instead, see AlgorithmBase.run() or start().- Specified by:
runAlgorithm
in classAlgorithmBase
-
calc2D
private void calc2D()
-
calc3D
private void calc3D()
-
generateMagEnhanced
private ModelImage generateMagEnhanced(double[] phaseMaskData, ModelImage magnitude)
-
generatePhaseMask
private ModelImage generatePhaseMask(java.util.BitSet brainMaskSet, double[] ixRealFinal, double[] ixImagFinal, double[] phaseMaskData)
-
generateIFinal
private ModelImage generateIFinal(ModelImage iImage, ModelImage iCenterImage, java.util.BitSet brainMaskSet, double[] ixRealFinal, double[] ixImagFinal)
-
runiFFTonKCenter
private ModelImage runiFFTonKCenter(ModelImage kCenterImage)
-
createKCenterImage
private ModelImage createKCenterImage(ModelImage kImage)
-
createkImage
private ModelImage createkImage(ModelImage iImage)
-
createiImage
private ModelImage createiImage(double[] realData, double[] imagData)
-
createBrainMask
private ModelImage createBrainMask()
-
rescaleToComplex
private void rescaleToComplex(ModelImage magImage, ModelImage phaseImage, double[] realData, double[] imagData)
-
getkImage
public ModelImage getkImage()
-
getiImage
public ModelImage getiImage()
-
getBrainMask
public ModelImage getBrainMask()
-
getkCenterImage
public ModelImage getkCenterImage()
-
getiFinal
public ModelImage getiFinal()
-
getPhaseMask
public ModelImage getPhaseMask()
-
getiCenter
public ModelImage getiCenter()
-
-