Class DemonsRegistrationLite
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.registration.DemonsRegistrationLite
-
public class DemonsRegistrationLite extends java.lang.ObjectThis algorithm handles registration algorithms of images with the Demons algorithm and a simple multiscale technique (Demons variant from Tom Vercauteren's 2009 paper, "Diffeomorphic demons: Efficient non-parametric image registration by Tom Vercauteren, Xavier Pennec, Aymeric Perchant, and Nicholas Ayache, NeuroImage, 45, 2009, S61-S72.)- Version:
- November 2009
- Author:
- Pierre-Louis Bazin
-
-
Field Summary
Fields Modifier and Type Field Description private float[][]cprivate static booleandebugstatic intDIFFUSIONprivate booleando2Dprivate float[]fixedstatic intFLUIDprivate float[][]gaussKernelprivate float[]imageprivate floatimaxprivate floatiminprivate static floatINFprivate booleanisCompletedprivate booleanisWorkingprivate intkxprivate intkyprivate intkzprivate intlevelsprivate float[]movingprivate intnfxprivate intnfyprivate intnfzprivate intNiterprivate int[]nixprivate int[]niyprivate int[]nizprivate intnmxprivate intnmyprivate intnmzprivate int[]ntxprivate int[]ntyprivate int[]ntzprivate intregTypeprivate floatrfxprivate floatrfyprivate floatrfzprivate floatrixprivate floatriyprivate floatrizprivate floatrmxprivate floatrmyprivate floatrmzprivate floatrtxprivate floatrtyprivate floatrtzprivate float[][]sprivate floatsigma2private floatsmoothingKernelprivate floatspatialScaleprivate static intTprivate float[]targetprivate floattmaxprivate floattminprivate float[][]transformprivate float[][]uprivate static booleanverboseprivate static intXprivate static intYprivate static intZprivate static floatZERO
-
Constructor Summary
Constructors Constructor Description DemonsRegistrationLite(float[] image_, float[] target_, int nix_, int niy_, int niz_, float rix_, float riy_, float riz_, int ntx_, int nty_, int ntz_, float rtx_, float rty_, float rtz_, float smoothing_, float scale_, int lev_, int Ni_, int reg_, float[][] trans_)constructor note: the membership function mems_ must have sum = 0 on the masked areas
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]exportTransformedImage()returns the transformed imagefloat[]exportTransformField()returns the transform field v defined as X' = X+v (=s)voidfinalize()float[][]getCurrentTransform()float[][]getCurrentUpdate()private voidinitializeImages(int lvl)create an image pyramid from the original data, initialize Jacobians, etcprivate voidinitializeImages2D(int lvl)create an image pyramid from the original data, initialize Jacobians, etcprivate voidinitializeTransform(int lvl)initialize the transform from previous estimate, if existsprivate voidinitializeTransform2D(int lvl)initialize the transform from previous estimate, if existsbooleanisCompleted()booleanisWorking()private floatlinearInterpolation(float[] image, float value, float x, float y, float z, int nx, int ny, int nz)linear interpolation, with value outside the imageprivate floatlinearInterpolation(float[] image, float value, float x, float y, int nx, int ny)linear interpolation, with value outside the imageprivate voidpreprocessInputImages(float[] img, float[] trg)private voidpreprocessInputImages2D(float[] img, float[] trg)voidregisterImageToTarget(int lvl, int iterations)compute the image position given the target for a given level l performs only one iterationvoidregisterImageToTarget2D(int lvl, int iterations)compute the image position given the target for a given level l performs only one iterationvoidrunGaussianPyramid()runs the gaussian pyramid algorithmprivate float[]separableConvolution(float[] image, int nx, int ny, float[][] kernel, int kx, int ky)convolution with a separable kernel (the kernel is 3x{kx,ky,kz})private float[]separableConvolution(float[] image, int nx, int ny, int nz, float[][] kernel, int kx, int ky, int kz)convolution with a separable kernel (the kernel is 3x{kx,ky,kz})private float[][]separableGaussianKernel(float sx, float sy)private float[][]separableGaussianKernel(float sx, float sy, float sz)private float[]subsample(float[] image, int nx, int ny, int factor)scale down by a factorprivate float[]subsample(float[] image, int nx, int ny, int nz, int factor)scale down by a factor
-
-
-
Field Detail
-
INF
private static final float INF
- See Also:
- Constant Field Values
-
ZERO
private static final float ZERO
- See Also:
- Constant Field Values
-
X
private static final int X
- See Also:
- Constant Field Values
-
Y
private static final int Y
- See Also:
- Constant Field Values
-
Z
private static final int Z
- See Also:
- Constant Field Values
-
T
private static final int T
- See Also:
- Constant Field Values
-
FLUID
public static final int FLUID
- See Also:
- Constant Field Values
-
DIFFUSION
public static final int DIFFUSION
- See Also:
- Constant Field Values
-
image
private float[] image
-
target
private float[] target
-
fixed
private float[] fixed
-
moving
private float[] moving
-
c
private float[][] c
-
s
private float[][] s
-
u
private float[][] u
-
nix
private int[] nix
-
niy
private int[] niy
-
niz
private int[] niz
-
ntx
private int[] ntx
-
nty
private int[] nty
-
ntz
private int[] ntz
-
rix
private float rix
-
riy
private float riy
-
riz
private float riz
-
rtx
private float rtx
-
rty
private float rty
-
rtz
private float rtz
-
imin
private float imin
-
imax
private float imax
-
tmin
private float tmin
-
tmax
private float tmax
-
nmx
private int nmx
-
nmy
private int nmy
-
nmz
private int nmz
-
nfx
private int nfx
-
nfy
private int nfy
-
nfz
private int nfz
-
rmx
private float rmx
-
rmy
private float rmy
-
rmz
private float rmz
-
rfx
private float rfx
-
rfy
private float rfy
-
rfz
private float rfz
-
transform
private float[][] transform
-
levels
private int levels
-
Niter
private int Niter
-
smoothingKernel
private float smoothingKernel
-
spatialScale
private float spatialScale
-
regType
private int regType
-
sigma2
private float sigma2
-
gaussKernel
private float[][] gaussKernel
-
kx
private int kx
-
ky
private int ky
-
kz
private int kz
-
isWorking
private boolean isWorking
-
isCompleted
private boolean isCompleted
-
debug
private static final boolean debug
- See Also:
- Constant Field Values
-
verbose
private static final boolean verbose
- See Also:
- Constant Field Values
-
do2D
private boolean do2D
-
-
Constructor Detail
-
DemonsRegistrationLite
public DemonsRegistrationLite(float[] image_, float[] target_, int nix_, int niy_, int niz_, float rix_, float riy_, float riz_, int ntx_, int nty_, int ntz_, float rtx_, float rty_, float rtz_, float smoothing_, float scale_, int lev_, int Ni_, int reg_, float[][] trans_)constructor note: the membership function mems_ must have sum = 0 on the masked areas
-
-
Method Detail
-
finalize
public final void finalize()
- Overrides:
finalizein classjava.lang.Object
-
getCurrentTransform
public final float[][] getCurrentTransform()
-
getCurrentUpdate
public final float[][] getCurrentUpdate()
-
isWorking
public final boolean isWorking()
-
isCompleted
public final boolean isCompleted()
-
preprocessInputImages2D
private final void preprocessInputImages2D(float[] img, float[] trg)
-
preprocessInputImages
private final void preprocessInputImages(float[] img, float[] trg)
-
initializeImages2D
private final void initializeImages2D(int lvl)
create an image pyramid from the original data, initialize Jacobians, etc
-
initializeImages
private final void initializeImages(int lvl)
create an image pyramid from the original data, initialize Jacobians, etc
-
initializeTransform2D
private final void initializeTransform2D(int lvl)
initialize the transform from previous estimate, if exists
-
initializeTransform
private final void initializeTransform(int lvl)
initialize the transform from previous estimate, if exists
-
registerImageToTarget2D
public final void registerImageToTarget2D(int lvl, int iterations)compute the image position given the target for a given level l performs only one iteration
-
registerImageToTarget
public final void registerImageToTarget(int lvl, int iterations)compute the image position given the target for a given level l performs only one iteration
-
runGaussianPyramid
public final void runGaussianPyramid()
runs the gaussian pyramid algorithm
-
exportTransformedImage
public final float[] exportTransformedImage()
returns the transformed image
-
exportTransformField
public final float[] exportTransformField()
returns the transform field v defined as X' = X+v (=s)
-
separableGaussianKernel
private float[][] separableGaussianKernel(float sx, float sy)
-
separableGaussianKernel
private float[][] separableGaussianKernel(float sx, float sy, float sz)
-
subsample
private float[] subsample(float[] image, int nx, int ny, int factor)scale down by a factor
-
subsample
private float[] subsample(float[] image, int nx, int ny, int nz, int factor)scale down by a factor
-
linearInterpolation
private float linearInterpolation(float[] image, float value, float x, float y, int nx, int ny)linear interpolation, with value outside the image
-
linearInterpolation
private float linearInterpolation(float[] image, float value, float x, float y, float z, int nx, int ny, int nz)linear interpolation, with value outside the image
-
separableConvolution
private float[] separableConvolution(float[] image, int nx, int ny, float[][] kernel, int kx, int ky)convolution with a separable kernel (the kernel is 3x{kx,ky,kz})
-
separableConvolution
private float[] separableConvolution(float[] image, int nx, int ny, int nz, float[][] kernel, int kx, int ky, int kz)convolution with a separable kernel (the kernel is 3x{kx,ky,kz})
-
-