Class AlgorithmIHN3Correction
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmIHN3Correction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmIHN3Correction extends AlgorithmBase
N3 Inhomogeneity correction This is based on code by John G. Sled, McConnell Brain Imaging Centre, Montreal Neurological Institute, McGill University Information may be found at: http://www.bic.mni.mcgill.ca/software/N3/ Bibliography:
1. J.G. Sled, A.P. Zijdenbos, and A.C. Evans, "A non-parametric method for automatic correction of intensity non-uniformity in MRI data," IEEE Transactions on Medical Imaging, vol. 17, pp. 87-97, February, 1998.
2. J.G. Sled, A.P. Zijdenbos, and A.C. Evans, "A comparison of retrospective intensity non-uniformity correction methods for MRI," in Information Processing in Medical Imaging, pp. 459-464, 1997.
3. J.G. Sled, "A non-parametric method for automatic correction of intensity non-uniformity in MRI data," Master's thesis, McGill University, Montreal, QC, May, 1997.
The N3 method should work with any MR volume including raw (non-stereotaxic) data.
An artifact often seen in MRI is for the signal intensity to vary smoothly across an image. Variously referred to as RF inhomogeneity, shading artifact, or intensity non-uniformity, it is usually attributed to such factors as poor radio frequency(RF) field uniformity, eddy currents driven by switching of field gradients, and patient anatomy both inside and outside the field of view.
This code corrects intensity non-uniformity in MR data without requiring supervision. This method can be applied without a tissue intensity or geometric model. Described as Non-parametric Non_uniform intensity Normalization (N3), the method is independent of pulse sequence and insensitive to pathological data that might otherwise violate model assumptions. To eliminate the dependence of the field estimate on anatomy, an iterative approach is employed to estimate both the multiplicative bias field and the distribution of true tissue intensities. Preprocessing of MR data using N3 has been shown to substantially improve the accuracy of anatomical analysis techniques such as tissue classification and cortical surface extraction.
From John G. Sled's original N3 code:
Copyright 1996, John G. Sled McConnell Brain Imaging Centre, Montreal Neurological Institute, McGill University. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies. The author and McGill University make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
-
-
Field Summary
Fields Modifier and Type Field Description private float[][]
AtA
DOCUMENT ME!private int
AtAP
DOCUMENT ME!private double[][]
AtF
DOCUMENT ME!private int
AtFP
DOCUMENT ME!private boolean
autoThreshold
If true determines the threshold by histogram analysis.private float[][][][]
bendingMatrix
DOCUMENT ME!private int
binNumber
DOCUMENT ME!private float
binWidth
Histogram bin width.private int
blockInt
DOCUMENT ME!private float[]
blurI
DOCUMENT ME!private float[]
blurR
DOCUMENT ME!private float[]
buffer
Buffer for original source image.private float[][]
bW
DOCUMENT ME!private float[]
CArray
DOCUMENT ME!private float
class_max
DOCUMENT ME!private float
class_min
DOCUMENT ME!private double[][]
coef
DOCUMENT ME!private float[]
correctedBuffer
DOCUMENT ME!private int
currentOffset
DOCUMENT ME!private float[][]
d1Spline
DOCUMENT ME!private float[][]
DArray
DOCUMENT ME!private float
denom
DOCUMENT ME!private int[]
derivative
DOCUMENT ME!private int[]
dloc_i
DOCUMENT ME!private int[]
dloc_j
DOCUMENT ME!private float[][]
domain
DOCUMENT ME!private int
DP
DOCUMENT ME!private float
endTol
The measure used to terminate the iterations is the coefficient of variation of change in field estimates between successive iterations.private boolean
entireImage
Ideally the Weiner filter noise equals the white noise of the image.private float[]
estimateBuffer
DOCUMENT ME!private float
estimateOffset
DOCUMENT ME!private float
estimateScale
DOCUMENT ME!private float
estimateSlope
DOCUMENT ME!private float[]
fHist
DOCUMENT ME!private float[]
fHistPaddedI
DOCUMENT ME!private float[]
fHistPaddedR
DOCUMENT ME!private float
field_floor
Lowest allowable field value.private float[]
fieldBuffer
DOCUMENT ME!private float
fieldDistance
Characteristic distance over which the field varies.private ModelImage
fieldImage
DOCUMENT ME!private float[]
filterI
DOCUMENT ME!private float[]
filterR
DOCUMENT ME!private float
fIndex
DOCUMENT ME!private int
first
DOCUMENT ME!private double
firstMoment0
DOCUMENT ME!private double
firstMoment1
DOCUMENT ME!private float
fOffset
DOCUMENT ME!static int
FORWARD
forward FFTprivate int
four
DOCUMENT ME!private int
FP
DOCUMENT ME!private float
frac
DOCUMENT ME!private double
fwhm
DOCUMENT ME!private double
fwhmFactor
DOCUMENT ME!private double
fwhmScale
DOCUMENT ME!private double
halfBin
DOCUMENT ME!private int[]
hist
DOCUMENT ME!private float
histFactor
DOCUMENT ME!private double
histMean
DOCUMENT ME!private float
histOffset
DOCUMENT ME!private double
histSum
Sum of contents of hisotogram bins.private int
iLoc
DOCUMENT ME!private float
incr
DOCUMENT ME!private int
index
DOCUMENT ME!private int
index1
DOCUMENT ME!private float[][]
integral
DOCUMENT ME!private int
interval
DOCUMENT ME!static int
INVERSE
inverse FFTprivate int
iters
DOCUMENT ME!private double[][]
JArray
DOCUMENT ME!private float
kernelfwhm
Width of deconvolution kernel used to sharpen the histogram.private float[][]
knots
DOCUMENT ME!private float
lambda
DOCUMENT ME!private int
last
DOCUMENT ME!private int
length
DOCUMENT ME!private float
loc
DOCUMENT ME!private int[]
locations
DOCUMENT ME!private float[]
logBuffer
Log transformed data.private float
logOffset
If minimum value of shrunken buffer < 1.0f, amount that must be added to make it 1.0f.private int[]
lower
DOCUMENT ME!private java.util.BitSet
mask
DOCUMENT ME!private int
maxIters
Maximum number of iterations.private float
mean
DOCUMENT ME!private int
mid
DOCUMENT ME!private float[]
momentI
DOCUMENT ME!private float[]
momentR
DOCUMENT ME!private int[]
nArray
Number of basis functions in each dimension.private int
nBins
Number of histogram bins for shrunken buffer.private int
nDimensions
DOCUMENT ME!private int[]
newDim
DOCUMENT ME!private float
newRes
DOCUMENT ME!private float[]
newResol
DOCUMENT ME!private int
newSliceSize
DOCUMENT ME!private int
newVolSize
DOCUMENT ME!private int
nMax
DOCUMENT ME!private float
noise
Noise used in Weiner filter.private int
nProduct
DOCUMENT ME!private float
numVoxels
DOCUMENT ME!private int
offset
DOCUMENT ME!private int
offset1
DOCUMENT ME!private int
offset2
DOCUMENT ME!private int[][]
offsetSp
DOCUMENT ME!private int
offsetStep
DOCUMENT ME!private int
order
DOCUMENT ME!private int[]
orgDim
DOCUMENT ME!private float[]
orgResol
Distance per pixel in millimeters.private int
padded_size
DOCUMENT ME!private int
pDloc_i
DOCUMENT ME!private int
pDloc_j
DOCUMENT ME!private int
pLocation
DOCUMENT ME!private int
pLocation2
DOCUMENT ME!private int
pOffset
DOCUMENT ME!private float
product
DOCUMENT ME!private int
pSpline
DOCUMENT ME!private int
pValue
DOCUMENT ME!private int
region
DOCUMENT ME!private float[]
residueBuffer
DOCUMENT ME!private float
rfrac
DOCUMENT ME!private float[]
sBuffer
Buffer for sampled image.private float
scale
DOCUMENT ME!private float
shrink
The factor by which the data is subsampled to a lower resolution in estimating the slowly varying non-uniformity field.private int
sizeC
DOCUMENT ME!private int
sliceSize
DOCUMENT ME!private double
slope
DOCUMENT ME!private int[]
smallN
DOCUMENT ME!private java.util.BitSet
sMask
Mask for shrunken buffer.private float
sMax
Maximum value of shrunken buffer.private float
sMin
Minimum value of shrunken buffer.private float
sourceMax
DOCUMENT ME!private float
sourceMin
DOCUMENT ME!static int
spline
DOCUMENT ME!private float
spline_lambda
DOCUMENT ME!private float
spline_subsample
DOCUMENT ME!private double
sqrtNum
DOCUMENT ME!private int
start
DOCUMENT ME!private float
startK
DOCUMENT ME!private float
stddev
DOCUMENT ME!private int[]
step
DOCUMENT ME!private float
sum2Value
DOCUMENT ME!private float
sumValue
DOCUMENT ME!private double
Sx
DOCUMENT ME!private double
Sy
DOCUMENT ME!private double
Sz
DOCUMENT ME!private float
temp
DOCUMENT ME!private float
temp2
DOCUMENT ME!private float
threshold
Values at less than threshold are treated as part of the background.private int
tiflat
DOCUMENT ME!private int[]
tiindex
DOCUMENT ME!private int[]
tistep
DOCUMENT ME!private int
tjflat
DOCUMENT ME!private int[]
tjindex
DOCUMENT ME!private int[]
tjstep
DOCUMENT ME!private java.util.BitSet
tMask
Mask that meets threshold and sMask requirements for shrunken volume.private int
transformDir
FORWARD or INVERSE for FFT.private int
UP
DOCUMENT ME!private int[]
upper
DOCUMENT ME!private boolean
useScript
If true, the program is run from a script.private float
value
DOCUMENT ME!private float
value_k
DOCUMENT ME!private float
value1
DOCUMENT ME!private float
value2
DOCUMENT ME!private float[]
values
DOCUMENT ME!private double
vari
DOCUMENT ME!private double
varMax
DOCUMENT ME!private int
volSize
DOCUMENT ME!private float
volumeFactor
Factor by which to shrink volume.private float[]
workingBuffer
DOCUMENT ME!private float
xf
DOCUMENT ME!private int
xo
DOCUMENT ME!private float
xv
DOCUMENT ME!private int
xyo
DOCUMENT ME!private float
xyv
DOCUMENT ME!private float[]
yMat
DOCUMENT ME!private float[]
ys
DOCUMENT ME!private float[]
zero
DOCUMENT ME!private double
zeroMoment0
DOCUMENT ME!private double
zeroMoment1
DOCUMENT ME!-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmIHN3Correction(ModelImage destImg, ModelImage fieldImg, ModelImage srcImg, float _threshold, int _maxIters, float _endTol, float _fieldDistance, float _shrink, float _kernelfwhm, float _noise, boolean _entireImage, boolean _autoThreshold, boolean useScript)
Creates a new AlgorithmIHN3Correction object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
cleanUp()
Prepares this class for destruction.private void
fft(float[] rData, float[] iData)
This is the method that calculates the FFT.void
finalize()
Prepares this class for destruction.private void
fitSplinesToVolumeLookup2D()
DOCUMENT ME!private void
fitSplinesToVolumeLookup3D()
DOCUMENT ME!private void
IHN3Correction2()
IHN3Correction2().private void
IHN3Correction3()
IHN3Correction3.void
runAlgorithm()
Start algorithm.private void
smoothVolumeLookup2D()
DOCUMENT ME!private void
smoothVolumeLookup3D()
DOCUMENT ME!private void
TBSplineVolume()
DOCUMENT ME!private void
transformBilinear(float[] imgBuf, TransMatrix xfrm)
Transforms and resamples volume using bilinear interpolation.private void
transformNearestNeighbor2D(float[] imgBuf, TransMatrix xfrm)
Transforms and resamples volume using nearest neighbor interpolation.private void
transformNearestNeighbor3D(float[] imgBuf, TransMatrix xfrm)
Transforms and resamples volume using nearest neighbor interpolation.private void
transformTrilinear(float[] imgBuffer, TransMatrix matrix)
Transforms and resamples volume using trilinear interpolation.private void
volumeDomain()
Allocates and initializes important buffers.-
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
-
INVERSE
public static final int INVERSE
inverse FFT- See Also:
- Constant Field Values
-
FORWARD
public static final int FORWARD
forward FFT- See Also:
- Constant Field Values
-
spline
public static final int spline
DOCUMENT ME!- See Also:
- Constant Field Values
-
AtA
private float[][] AtA
DOCUMENT ME!
-
AtAP
private int AtAP
DOCUMENT ME!
-
AtFP
private int AtFP
DOCUMENT ME!
-
UP
private int UP
DOCUMENT ME!
-
DP
private int DP
DOCUMENT ME!
-
FP
private int FP
DOCUMENT ME!
-
AtF
private double[][] AtF
DOCUMENT ME!
-
autoThreshold
private boolean autoThreshold
If true determines the threshold by histogram analysis. If true a VOI cannot be used and the input threshold is ignored.
-
bendingMatrix
private float[][][][] bendingMatrix
DOCUMENT ME!
-
binNumber
private final int binNumber
DOCUMENT ME!- See Also:
- Constant Field Values
-
binWidth
private float binWidth
Histogram bin width.
-
blockInt
private int blockInt
DOCUMENT ME!
-
currentOffset
private int currentOffset
DOCUMENT ME!
-
blurI
private float[] blurI
DOCUMENT ME!
-
blurR
private float[] blurR
DOCUMENT ME!
-
buffer
private float[] buffer
Buffer for original source image.
-
bW
private final float[][] bW
DOCUMENT ME!
-
CArray
private float[] CArray
DOCUMENT ME!
-
class_max
private float class_max
DOCUMENT ME!
-
class_min
private float class_min
DOCUMENT ME!
-
coef
private double[][] coef
DOCUMENT ME!
-
correctedBuffer
private float[] correctedBuffer
DOCUMENT ME!
-
d1Spline
private float[][] d1Spline
DOCUMENT ME!
-
DArray
private float[][] DArray
DOCUMENT ME!
-
denom
private float denom
DOCUMENT ME!
-
derivative
private int[] derivative
DOCUMENT ME!
-
dloc_i
private int[] dloc_i
DOCUMENT ME!
-
dloc_j
private int[] dloc_j
DOCUMENT ME!
-
domain
private float[][] domain
DOCUMENT ME!
-
endTol
private float endTol
The measure used to terminate the iterations is the coefficient of variation of change in field estimates between successive iterations.
-
entireImage
private boolean entireImage
Ideally the Weiner filter noise equals the white noise of the image. The performance of the N3 method is enhanced by supplying a mask for the region of interest. If true, the N3 method is applied to the entire image.
-
estimateBuffer
private float[] estimateBuffer
DOCUMENT ME!
-
estimateOffset
private float estimateOffset
DOCUMENT ME!
-
estimateScale
private float estimateScale
DOCUMENT ME!
-
estimateSlope
private float estimateSlope
DOCUMENT ME!
-
fHist
private float[] fHist
DOCUMENT ME!
-
fHistPaddedI
private float[] fHistPaddedI
DOCUMENT ME!
-
fHistPaddedR
private float[] fHistPaddedR
DOCUMENT ME!
-
field_floor
private final float field_floor
Lowest allowable field value.- See Also:
- Constant Field Values
-
fieldBuffer
private float[] fieldBuffer
DOCUMENT ME!
-
fieldDistance
private float fieldDistance
Characteristic distance over which the field varies. The distance between adjacent knots in bspline fitting with at least 4 knots going in every dimension. The default in the dialog is one third the distance (resolution * extents) of the smallest dimension.
-
fieldImage
private ModelImage fieldImage
DOCUMENT ME!
-
filterI
private float[] filterI
DOCUMENT ME!
-
filterR
private float[] filterR
DOCUMENT ME!
-
fIndex
private float fIndex
DOCUMENT ME!
-
firstMoment0
private double firstMoment0
DOCUMENT ME!
-
firstMoment1
private double firstMoment1
DOCUMENT ME!
-
fOffset
private float fOffset
DOCUMENT ME!
-
fwhm
private double fwhm
DOCUMENT ME!
-
fwhmFactor
private double fwhmFactor
DOCUMENT ME!
-
fwhmScale
private double fwhmScale
DOCUMENT ME!
-
halfBin
private double halfBin
DOCUMENT ME!
-
hist
private int[] hist
DOCUMENT ME!
-
histFactor
private float histFactor
DOCUMENT ME!
-
histMean
private double histMean
DOCUMENT ME!
-
histOffset
private float histOffset
DOCUMENT ME!
-
histSum
private double histSum
Sum of contents of hisotogram bins.
-
iLoc
private int iLoc
DOCUMENT ME!
-
incr
private float incr
DOCUMENT ME!
-
value_k
private float value_k
DOCUMENT ME!
-
index
private int index
DOCUMENT ME!
-
index1
private int index1
DOCUMENT ME!
-
integral
private float[][] integral
DOCUMENT ME!
-
interval
private int interval
DOCUMENT ME!
-
iters
private int iters
DOCUMENT ME!
-
JArray
private double[][] JArray
DOCUMENT ME!
-
kernelfwhm
private float kernelfwhm
Width of deconvolution kernel used to sharpen the histogram. Larger values give faster convergence while smaller values give greater accuracy.
-
knots
private float[][] knots
DOCUMENT ME!
-
lambda
private float lambda
DOCUMENT ME!
-
loc
private float loc
DOCUMENT ME!
-
locations
private int[] locations
DOCUMENT ME!
-
logBuffer
private float[] logBuffer
Log transformed data.
-
logOffset
private float logOffset
If minimum value of shrunken buffer < 1.0f, amount that must be added to make it 1.0f. Otherwise == 0.0f.
-
lower
private int[] lower
DOCUMENT ME!
-
mask
private java.util.BitSet mask
DOCUMENT ME!
-
maxIters
private int maxIters
Maximum number of iterations.
-
momentI
private float[] momentI
DOCUMENT ME!
-
momentR
private float[] momentR
DOCUMENT ME!
-
nArray
private int[] nArray
Number of basis functions in each dimension.
-
nBins
private int nBins
Number of histogram bins for shrunken buffer.
-
nDimensions
private int nDimensions
DOCUMENT ME!
-
newDim
private int[] newDim
DOCUMENT ME!
-
newRes
private float newRes
DOCUMENT ME!
-
newResol
private float[] newResol
DOCUMENT ME!
-
newSliceSize
private int newSliceSize
DOCUMENT ME!
-
newVolSize
private int newVolSize
DOCUMENT ME!
-
nMax
private int nMax
DOCUMENT ME!
-
noise
private float noise
Noise used in Weiner filter.
-
nProduct
private int nProduct
DOCUMENT ME!
-
four
private int four
DOCUMENT ME!
-
offset
private int offset
DOCUMENT ME!
-
offset1
private int offset1
DOCUMENT ME!
-
offset2
private int offset2
DOCUMENT ME!
-
offsetSp
private int[][] offsetSp
DOCUMENT ME!
-
offsetStep
private int offsetStep
DOCUMENT ME!
-
first
private int first
DOCUMENT ME!
-
last
private int last
DOCUMENT ME!
-
order
private int order
DOCUMENT ME!
-
orgDim
private int[] orgDim
DOCUMENT ME!
-
orgResol
private final float[] orgResol
Distance per pixel in millimeters.
-
padded_size
private int padded_size
DOCUMENT ME!
-
pLocation
private int pLocation
DOCUMENT ME!
-
pLocation2
private int pLocation2
DOCUMENT ME!
-
pValue
private int pValue
DOCUMENT ME!
-
pDloc_i
private int pDloc_i
DOCUMENT ME!
-
pDloc_j
private int pDloc_j
DOCUMENT ME!
-
product
private float product
DOCUMENT ME!
-
pSpline
private int pSpline
DOCUMENT ME!
-
pOffset
private int pOffset
DOCUMENT ME!
-
region
private int region
DOCUMENT ME!
-
residueBuffer
private float[] residueBuffer
DOCUMENT ME!
-
sBuffer
private float[] sBuffer
Buffer for sampled image.
-
scale
private float scale
DOCUMENT ME!
-
shrink
private float shrink
The factor by which the data is subsampled to a lower resolution in estimating the slowly varying non-uniformity field. Reduce sampling in the finest sampling direction by the shrink factor. Reduce other sampling directions only if resolution is less than shrink times original minimum resolution. Uses nearest neighbor resampling.
-
sizeC
private int sizeC
DOCUMENT ME!
-
sliceSize
private int sliceSize
DOCUMENT ME!
-
slope
private double slope
DOCUMENT ME!
-
smallN
private int[] smallN
DOCUMENT ME!
-
sMask
private java.util.BitSet sMask
Mask for shrunken buffer.
-
sMax
private float sMax
Maximum value of shrunken buffer.
-
sMin
private float sMin
Minimum value of shrunken buffer.
-
sourceMin
private float sourceMin
DOCUMENT ME!
-
sourceMax
private float sourceMax
DOCUMENT ME!
-
spline_lambda
private final float spline_lambda
DOCUMENT ME!- See Also:
- Constant Field Values
-
spline_subsample
private final float spline_subsample
DOCUMENT ME!- See Also:
- Constant Field Values
-
sqrtNum
private double sqrtNum
DOCUMENT ME!
-
start
private int start
DOCUMENT ME!
-
length
private int length
DOCUMENT ME!
-
mid
private int mid
DOCUMENT ME!
-
startK
private float startK
DOCUMENT ME!
-
stddev
private float stddev
DOCUMENT ME!
-
mean
private float mean
DOCUMENT ME!
-
numVoxels
private float numVoxels
DOCUMENT ME!
-
sumValue
private float sumValue
DOCUMENT ME!
-
sum2Value
private float sum2Value
DOCUMENT ME!
-
step
private int[] step
DOCUMENT ME!
-
Sx
private double Sx
DOCUMENT ME!
-
Sy
private double Sy
DOCUMENT ME!
-
Sz
private double Sz
DOCUMENT ME!
-
temp
private float temp
DOCUMENT ME!
-
temp2
private float temp2
DOCUMENT ME!
-
threshold
private float threshold
Values at less than threshold are treated as part of the background.
-
tiflat
private int tiflat
DOCUMENT ME!
-
tiindex
private int[] tiindex
DOCUMENT ME!
-
tistep
private int[] tistep
DOCUMENT ME!
-
tjflat
private int tjflat
DOCUMENT ME!
-
tjindex
private int[] tjindex
DOCUMENT ME!
-
tjstep
private int[] tjstep
DOCUMENT ME!
-
tMask
private java.util.BitSet tMask
Mask that meets threshold and sMask requirements for shrunken volume.
-
transformDir
private int transformDir
FORWARD or INVERSE for FFT.
-
upper
private int[] upper
DOCUMENT ME!
-
useScript
private boolean useScript
If true, the program is run from a script.
-
value
private float value
DOCUMENT ME!
-
value1
private float value1
DOCUMENT ME!
-
value2
private float value2
DOCUMENT ME!
-
frac
private float frac
DOCUMENT ME!
-
rfrac
private float rfrac
DOCUMENT ME!
-
values
private float[] values
DOCUMENT ME!
-
vari
private double vari
DOCUMENT ME!
-
varMax
private double varMax
DOCUMENT ME!
-
volSize
private int volSize
DOCUMENT ME!
-
volumeFactor
private float volumeFactor
Factor by which to shrink volume.
-
workingBuffer
private float[] workingBuffer
DOCUMENT ME!
-
xf
private float xf
DOCUMENT ME!
-
xo
private int xo
DOCUMENT ME!
-
xyo
private int xyo
DOCUMENT ME!
-
xv
private float xv
DOCUMENT ME!
-
xyv
private float xyv
DOCUMENT ME!
-
yMat
private float[] yMat
DOCUMENT ME!
-
ys
private float[] ys
DOCUMENT ME!
-
zero
private float[] zero
DOCUMENT ME!
-
zeroMoment0
private double zeroMoment0
DOCUMENT ME!
-
zeroMoment1
private double zeroMoment1
DOCUMENT ME!
-
-
Constructor Detail
-
AlgorithmIHN3Correction
public AlgorithmIHN3Correction(ModelImage destImg, ModelImage fieldImg, ModelImage srcImg, float _threshold, int _maxIters, float _endTol, float _fieldDistance, float _shrink, float _kernelfwhm, float _noise, boolean _entireImage, boolean _autoThreshold, boolean useScript)
Creates a new AlgorithmIHN3Correction object.- Parameters:
destImg
- image model where result image is to storedfieldImg
- image model where used field is storedsrcImg
- source image model_threshold
- Values at less than _threshold are treated as part of the background_maxIters
- Maximum number of iterations_endTol
- The measure used to terminate the iterations is the coefficient of variation of change in field estimates between successive iterations._fieldDistance
- Characteristic distance over which the field varies. The distance between adjacent knots in bspline fitting with at least 4 knots going in every dimension. The default in the dialog is one third the distance (resolution * extents) of the smallest dimension._shrink
- The factor by which the data is subsampled to a lower resolution in estimating the slowly varying non-uniformity field. Reduce sampling in the finest sampling direction by the shrink factor._kernelfwhm
- Width of deconvolution kernel used to sharpen the histogram. Larger values give faster convergence while smaller values give greater accuracy._noise
- Noise used in Weiner filter_entireImage
- If true, the N3 method is applied to the entire image. If false, the N3 method is applied only to the region of interest._autoThreshold
- If true determines the threshold by histogram analysis. If true a VOI cannot be used and the input threshold is ignored.useScript
- If true, the program is run from a script
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Start algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
cleanUp
private void cleanUp()
Prepares this class for destruction.
-
fft
private void fft(float[] rData, float[] iData)
This is the method that calculates the FFT.- Parameters:
rData
- real dataiData
- imaginary data
-
fitSplinesToVolumeLookup2D
private void fitSplinesToVolumeLookup2D()
DOCUMENT ME!
-
fitSplinesToVolumeLookup3D
private void fitSplinesToVolumeLookup3D()
DOCUMENT ME!
-
IHN3Correction2
private void IHN3Correction2()
IHN3Correction2(). Derived from PERL file nu_estimate_np_and_em.in Iteratively estimates intensity non-uniformity artifacts in MRI areas.
-
IHN3Correction3
private void IHN3Correction3()
IHN3Correction3. Derived from PERL file nu_estimate_np_and_em.in Iteratively estimates intensity non-uniformity artifacts in MRI volumes.
-
smoothVolumeLookup2D
private void smoothVolumeLookup2D()
DOCUMENT ME!
-
smoothVolumeLookup3D
private void smoothVolumeLookup3D()
DOCUMENT ME!
-
TBSplineVolume
private void TBSplineVolume()
DOCUMENT ME!
-
transformBilinear
private void transformBilinear(float[] imgBuf, TransMatrix xfrm)
Transforms and resamples volume using bilinear interpolation.- Parameters:
imgBuf
- - image arrayxfrm
- - TransMatrix to be applied
-
transformNearestNeighbor2D
private void transformNearestNeighbor2D(float[] imgBuf, TransMatrix xfrm)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- image arrayxfrm
- transformation matrix to be applied
-
transformNearestNeighbor3D
private void transformNearestNeighbor3D(float[] imgBuf, TransMatrix xfrm)
Transforms and resamples volume using nearest neighbor interpolation.- Parameters:
imgBuf
- image arrayxfrm
- transformation matrix to be applied
-
transformTrilinear
private void transformTrilinear(float[] imgBuffer, TransMatrix matrix)
Transforms and resamples volume using trilinear interpolation.- Parameters:
imgBuffer
- image arrayxfrm
- transformation matrix to be applied
-
volumeDomain
private void volumeDomain()
Allocates and initializes important buffers.
-
-