Class DemonsRegistrationLite
java.lang.Object
gov.nih.mipav.model.algorithms.registration.DemonsRegistrationLite
This 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
FieldsModifier and TypeFieldDescriptionprivate float[][]private static final booleanstatic final intprivate booleanprivate float[]static final intprivate float[][]private float[]private floatprivate floatprivate static final floatprivate booleanprivate booleanprivate intprivate intprivate intprivate intprivate float[]private intprivate intprivate intprivate intprivate int[]private int[]private int[]private intprivate intprivate intprivate int[]private int[]private int[]private intprivate floatprivate floatprivate floatprivate floatprivate floatprivate floatprivate floatprivate floatprivate floatprivate floatprivate floatprivate floatprivate float[][]private floatprivate floatprivate floatprivate static final intprivate float[]private floatprivate floatprivate float[][]private float[][]private static final booleanprivate static final intprivate static final intprivate static final intprivate static final float -
Constructor Summary
ConstructorsConstructorDescriptionDemonsRegistrationLite(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
Modifier and TypeMethodDescriptionfinal float[]returns the transformed imagefinal float[]returns the transform field v defined as X' = X+v (=s)final voidfinalize()final float[][]final float[][]private final voidinitializeImages(int lvl) create an image pyramid from the original data, initialize Jacobians, etcprivate final voidinitializeImages2D(int lvl) create an image pyramid from the original data, initialize Jacobians, etcprivate final voidinitializeTransform(int lvl) initialize the transform from previous estimate, if existsprivate final voidinitializeTransform2D(int lvl) initialize the transform from previous estimate, if existsfinal booleanfinal booleanprivate 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 final voidpreprocessInputImages(float[] img, float[] trg) private final voidpreprocessInputImages2D(float[] img, float[] trg) final voidregisterImageToTarget(int lvl, int iterations) compute the image position given the target for a given level l performs only one iterationfinal voidregisterImageToTarget2D(int lvl, int iterations) compute the image position given the target for a given level l performs only one iterationfinal voidruns 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 Details
-
INF
private static final float INF- See Also:
-
ZERO
private static final float ZERO- See Also:
-
X
private static final int X- See Also:
-
Y
private static final int Y- See Also:
-
Z
private static final int Z- See Also:
-
T
private static final int T- See Also:
-
FLUID
public static final int FLUID- See Also:
-
DIFFUSION
public static final int DIFFUSION- See Also:
-
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:
-
verbose
private static final boolean verbose- See Also:
-
do2D
private boolean do2D
-
-
Constructor Details
-
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 Details
-
finalize
public final void finalize() -
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})
-