Class DemonsRegistrationLite
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.registration.DemonsRegistrationLite
-
public class DemonsRegistrationLite extends java.lang.Object
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
Fields Modifier and Type Field Description private float[][]
c
private static boolean
debug
static int
DIFFUSION
private boolean
do2D
private float[]
fixed
static int
FLUID
private float[][]
gaussKernel
private float[]
image
private float
imax
private float
imin
private static float
INF
private boolean
isCompleted
private boolean
isWorking
private int
kx
private int
ky
private int
kz
private int
levels
private float[]
moving
private int
nfx
private int
nfy
private int
nfz
private int
Niter
private int[]
nix
private int[]
niy
private int[]
niz
private int
nmx
private int
nmy
private int
nmz
private int[]
ntx
private int[]
nty
private int[]
ntz
private int
regType
private float
rfx
private float
rfy
private float
rfz
private float
rix
private float
riy
private float
riz
private float
rmx
private float
rmy
private float
rmz
private float
rtx
private float
rty
private float
rtz
private float[][]
s
private float
sigma2
private float
smoothingKernel
private float
spatialScale
private static int
T
private float[]
target
private float
tmax
private float
tmin
private float[][]
transform
private float[][]
u
private static boolean
verbose
private static int
X
private static int
Y
private static int
Z
private static float
ZERO
-
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)void
finalize()
float[][]
getCurrentTransform()
float[][]
getCurrentUpdate()
private void
initializeImages(int lvl)
create an image pyramid from the original data, initialize Jacobians, etcprivate void
initializeImages2D(int lvl)
create an image pyramid from the original data, initialize Jacobians, etcprivate void
initializeTransform(int lvl)
initialize the transform from previous estimate, if existsprivate void
initializeTransform2D(int lvl)
initialize the transform from previous estimate, if existsboolean
isCompleted()
boolean
isWorking()
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 imageprivate float
linearInterpolation(float[] image, float value, float x, float y, int nx, int ny)
linear interpolation, with value outside the imageprivate void
preprocessInputImages(float[] img, float[] trg)
private void
preprocessInputImages2D(float[] img, float[] trg)
void
registerImageToTarget(int lvl, int iterations)
compute the image position given the target for a given level l performs only one iterationvoid
registerImageToTarget2D(int lvl, int iterations)
compute the image position given the target for a given level l performs only one iterationvoid
runGaussianPyramid()
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:
finalize
in 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})
-
-