Class AlgorithmN4MRIBiasFieldCorrectionFilter
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.AlgorithmN4MRIBiasFieldCorrectionFilter
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmN4MRIBiasFieldCorrectionFilter extends AlgorithmBase
- Version:
- 0.1 May 16, 2014
- Author:
- William Gandler This a a port of itkN4MRIBiasFieldCorrectionImageFilter.txx, itkN4MRIBiasFieldCorrectionImageFilter.h, itkCoxDeBoorBSplineKernelFunctionTest2.cxx, itkBSplineScatteredDataPointSetToImageFilterTest, itkBSplineScatteredDataPointSetToImageFilterTest2, and itkBSplineControlPointImageFilterTest from the itk package. Here is the original itk header: Program: Advanced Normalization Tools Module: $RCSfile: itkN4MRIBiasFieldCorrectionImageFilter.txx,v $ Language: C++ Date: $Date: 2009/06/09 16:22:05 $ Version: $Revision: 1.6 $ Copyright (c) ConsortiumOfANTS. All rights reserved. See accompanying COPYING.txt or http://sourceforge.net/projects/advants/files/ANTS/ANTSCopyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information.
-
-
Field Summary
-
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 AlgorithmN4MRIBiasFieldCorrectionFilter(ModelImage destImg, ModelImage fieldImage, ModelImage srcImg, int maximumIterations, double convergenceThreshold, double biasFieldFullWidthAtHalfMaximum, double WienerFilterNoise, int fittingLevels, int controlPoints, ModelImage confidenceImage, boolean maskFlag)
Constructor which sets the source and destination images
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double
calculateConvergenceMeasurement(double[] fieldEstimate1, double[] fieldEstimate2)
void
finalize()
Prepares this class for destruction.void
runAlgorithm()
Starts the program.private void
selfTest()
private double[]
sharpen(double[] unsharpened)
private double[]
updateBiasFieldEstimate(double[] fieldEstimate)
-
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
-
fieldImage
private ModelImage fieldImage
-
entireImage
private boolean entireImage
Flag, if true, indicates that the whole image should be processed. If false either: 1.) Process where the mask is set true 2.) Make sure the mask is set false and process where the confidence image is > 0.0
-
confidenceImage
private ModelImage confidenceImage
-
confidence
private double[] confidence
-
nDims
private int nDims
-
numberOfHistogramBins
private int numberOfHistogramBins
-
logBiasFieldControlPointLattice
private ModelImage logBiasFieldControlPointLattice
-
WienerFilterNoise
private double WienerFilterNoise
-
biasFieldFullWidthAtHalfMaximum
private double biasFieldFullWidthAtHalfMaximum
-
splineOrder
private int[] splineOrder
-
fittingLevels
private int fittingLevels
-
originalNumberOfFittingLevels
private int[] originalNumberOfFittingLevels
-
controlPoints
private int controlPoints
-
originalNumberOfControlPoints
private int[] originalNumberOfControlPoints
-
sigmoidNormalizedAlpha
private double sigmoidNormalizedAlpha
-
sigmoidNormalizedBeta
private double sigmoidNormalizedBeta
-
maximumIterations
private int maximumIterations
-
maximumNumberOfIterations
private int[] maximumNumberOfIterations
-
convergenceThreshold
private double convergenceThreshold
-
length
private int length
-
origin
private float[] origin
-
resolutions
private float[] resolutions
-
xDim
private int xDim
-
sliceSize
private int sliceSize
-
xyzSize
private int xyzSize
-
maskOrigin
private float[] maskOrigin
-
maskIndex
private int[] maskIndex
-
maskLargest
private int[] maskLargest
-
maskExtents
private int[] maskExtents
-
latticeExtents
private int[] latticeExtents
-
latticeExtentsLength
private int latticeExtentsLength
-
selfTest
private boolean selfTest
-
CoxDeBoorBSplineKernelFunctionTest
private boolean CoxDeBoorBSplineKernelFunctionTest
-
CoxDeBoorBSplineKernelFunctionTest2
private boolean CoxDeBoorBSplineKernelFunctionTest2
-
BSplineScatteredDataPointSetToImageFilterTest
private boolean BSplineScatteredDataPointSetToImageFilterTest
-
BSplineScatteredDataPointSetToImageFilterTest2
private boolean BSplineScatteredDataPointSetToImageFilterTest2
-
BSplineControlPointImageFilterTest
private boolean BSplineControlPointImageFilterTest
-
BSplineKernelFunctionTest
private boolean BSplineKernelFunctionTest
-
-
Constructor Detail
-
AlgorithmN4MRIBiasFieldCorrectionFilter
public AlgorithmN4MRIBiasFieldCorrectionFilter(ModelImage destImg, ModelImage fieldImage, ModelImage srcImg, int maximumIterations, double convergenceThreshold, double biasFieldFullWidthAtHalfMaximum, double WienerFilterNoise, int fittingLevels, int controlPoints, ModelImage confidenceImage, boolean maskFlag)
Constructor which sets the source and destination images- Parameters:
destImg
- the destination imagefieldImage
-srcImg
- the source imageconfidenceImage
-maskFlag
- the mask flag
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
sharpen
private double[] sharpen(double[] unsharpened)
-
updateBiasFieldEstimate
private double[] updateBiasFieldEstimate(double[] fieldEstimate)
-
calculateConvergenceMeasurement
private double calculateConvergenceMeasurement(double[] fieldEstimate1, double[] fieldEstimate2)
-
selfTest
private void selfTest()
-
-