public class BSplineModel extends Object implements Runnable
startPyramids
.Modifier and Type | Field and Description |
---|---|
static int |
MAX_OUTPUT_SIZE
maximum output window dimensions
|
int[][] |
prec_xIndex
precomputed x index
|
int[][] |
prec_yIndex
precomputed y index
|
int[] |
xIndex
x index
|
int[] |
yIndex
y index
|
Constructor and Description |
---|
BSplineModel(double[][] c)
Initialize the B-spline model from a set of coefficients.
|
BSplineModel(double[][] img,
boolean isTarget)
The same as before, but take the image from an array.
|
BSplineModel(double[] c,
int Ydim,
int Xdim,
int offset)
Initialize the B-spline model from a set of coefficients.
|
BSplineModel(ij.process.ImageProcessor ip,
boolean isTarget,
int maxImageSubsamplingFactor)
Create image model for image processor: image and coefficient pyramid.
|
BSplineModel(int width,
int height,
int maxImageSubsamplingFactor)
Create image model without image pixel information (for landmark only
registration): empty image and full coefficient pyramid.
|
Modifier and Type | Method and Description |
---|---|
void |
clearPyramids()
Clear the pyramid.
|
double[] |
getCoefficients()
Get b-spline coefficients.
|
int |
getCurrentDepth()
Get current depth.
|
int |
getCurrentHeight()
Get current height.
|
double[] |
getCurrentImage()
Get current image.
|
int |
getCurrentWidth()
Get current width.
|
double |
getFactorHeight()
Get factor height.
|
double |
getFactorWidth()
Get fact or width.
|
int |
getHeight()
Get height.
|
double[] |
getImage()
Get image (at the maximum resolution size determined by the scaling).
|
double[] |
getOriginalImage()
Get original image.
|
int |
getOriginalImageHeight()
Get original image height.
|
int |
getOriginalImageWidth()
Get original image width.
|
double |
getPixelValFromPyramid(int x,
int y)
Get the pixel value from the image pyramid.
|
int |
getPyramidDepth()
Get pyramid depth.
|
int |
getSmallestHeight()
Get smallest height.
|
int |
getSmallestWidth()
Get smallest width.
|
double[] |
getSubImage()
Get subsampled output image.
|
int |
getSubsamplingFactor()
Get sub-sampling factor at highest resolution
|
Thread |
getThread()
Get thread.
|
double |
getWeightDx(int l,
int m)
Get weight dx.
|
double |
getWeightDxDx(int l,
int m)
Get weight dxdx.
|
double |
getWeightDxDy(int l,
int m)
Get weight dxdy.
|
double |
getWeightDy(int l,
int m)
Get weight dy.
|
double |
getWeightDyDy(int l,
int m)
Get weight dydy.
|
double |
getWeightI(int l,
int m)
Get image coefficient weight.
|
int |
getWidth()
Get width.
|
void |
interpolateD(double[] D)
Interpolate the X and Y derivatives of the image at a
given point.
|
void |
interpolateD2(double[] D2)
Interpolate the XY, XX and YY derivatives of the image at a
given point.
|
double |
interpolateDx()
Interpolate the X derivative of the image at a given point.
|
double |
interpolateDxDx()
Interpolate the X derivative of the image at a given point.
|
double |
interpolateDxDy()
Interpolate the X derivative of the image at a given point.
|
double |
interpolateDy()
Interpolate the Y derivative of the image at a given point.
|
double |
interpolateDyDy()
Interpolate the X derivative of the image at a given point.
|
double |
interpolateI()
Interpolate the image at a given point.
|
boolean |
isFinest()
Check if the coefficients pyramid is empty.
|
void |
popFromPyramid()
Pop one element from the coefficients and image pyramids.
|
double |
precomputed_getWeightDx(int l,
int m,
int u,
int v)
Get precomputed weight dx.
|
double |
precomputed_getWeightDxDx(int l,
int m,
int u,
int v)
Get precomputed weight dxdx
|
double |
precomputed_getWeightDxDy(int l,
int m,
int u,
int v)
Get precomputed weight dxdy
|
double |
precomputed_getWeightDy(int l,
int m,
int u,
int v)
Get precomputed weight dy
|
double |
precomputed_getWeightDyDy(int l,
int m,
int u,
int v)
Get precomputed weight dydy
|
double |
precomputed_getWeightI(int l,
int m,
int u,
int v)
Get precomputed weight of coefficient l,m
|
int |
precomputed_getWidth()
Get width of precomputed vectors.
|
void |
precomputed_interpolateD(double[] D,
int u,
int v)
Interpolate the X and Y derivatives of the image at a
given point.
|
void |
precomputed_interpolateD2(double[] D2,
int u,
int v)
Interpolate the XY, XX and YY derivatives of the image at a
given point.
|
double |
precomputed_interpolateI(int u,
int v)
Interpolate the image (or deformation) at a given point using
the precomputed weights.
|
void |
precomputed_prepareForInterpolation(int Ydim,
int Xdim,
int intervals)
Prepare precomputations for a given image size.
|
void |
prepareForInterpolation(double x,
double y,
boolean fromCurrent)
If
fromCurrent is true, the interpolation is prepared to be done
from the current image in the pyramid. |
double |
prepareForInterpolationAndInterpolateI(double x,
double y,
boolean fromSub,
boolean fromCurrent)
Prepare for interpolation and interpolate
fromSub = true: The interpolation is done from the subsampled version
of the image
|
double |
prepareForInterpolationAndInterpolateIAndD(double x,
double y,
double[] D,
boolean fromSub,
boolean fromCurrent)
Prepare for interpolation and interpolate the image value and its
derivatives
fromSub = true: The interpolation is done from the subsampled version
of the image
|
double[] |
reduceCoeffsBy2(double[] c,
int width,
int height)
Reduce coefficients by a factor of 2 (beta)
|
void |
run()
Start the image pre-computations.
|
void |
setCoefficients(double[] c,
int Ydim,
int Xdim,
int offset)
Set spline coefficients.
|
void |
setPyramidDepth(int pyramidDepth)
Sets the depth up to which the pyramids should be computed.
|
void |
setSubsamplingFactor(int maxImageSubsamplingFactor)
Set maximum sub-sampling factor
|
void |
startPyramids()
Start coefficient and image pyramids
|
public static final int MAX_OUTPUT_SIZE
public int[] xIndex
public int[] yIndex
public int[][] prec_xIndex
public int[][] prec_yIndex
public BSplineModel(ij.process.ImageProcessor ip, boolean isTarget, int maxImageSubsamplingFactor)
ip
- image pointer (ImageProcessor)isTarget
- enables the computation of the derivative or notmaxImageSubsamplingFactor
- sub-sampling factor at highest resolution levelpublic BSplineModel(int width, int height, int maxImageSubsamplingFactor)
width
- image widthheight
- image heightmaxImageSubsamplingFactor
- sub-sampling factor at highest resolution levelpublic BSplineModel(double[][] img, boolean isTarget)
img
- image in a double arrayisTarget
- enables the computation of the derivative or notpublic BSplineModel(double[][] c)
c
- Set of B-spline coefficientspublic BSplineModel(double[] c, int Ydim, int Xdim, int offset)
c
- Set of B-spline coefficientsYdim
- Y-dimension of the set of coefficientsXdim
- X-dimension of the set of coefficientsoffset
- Offset of the beginning of the array with respect to the origin of cpublic void startPyramids()
public void clearPyramids()
public int getCurrentHeight()
public double[] getCurrentImage()
public int getCurrentWidth()
public double getFactorHeight()
public double getFactorWidth()
public int getCurrentDepth()
public int getHeight()
public double[] getImage()
public double[] getOriginalImage()
public int getOriginalImageWidth()
public int getOriginalImageHeight()
public double[] getSubImage()
public double[] getCoefficients()
public double getPixelValFromPyramid(int x, int y)
x
- x-coordinate of the pixely
- y-coordinate of the pixelpublic int getPyramidDepth()
public int getSmallestHeight()
public int getSmallestWidth()
public Thread getThread()
public int getWidth()
public double getWeightDx(int l, int m)
public double getWeightDxDx(int l, int m)
public double getWeightDxDy(int l, int m)
public double getWeightDy(int l, int m)
public double getWeightDyDy(int l, int m)
public double getWeightI(int l, int m)
public void interpolateD(double[] D)
D
- output, interpolation the X and Y derivatives of the imagepublic void interpolateD2(double[] D2)
D2
- output, interpolation of the XY, XX and YY derivatives of the imagepublic double interpolateDx()
public double interpolateDxDx()
public double interpolateDxDy()
public double interpolateDy()
public double interpolateDyDy()
public double interpolateI()
public boolean isFinest()
public void popFromPyramid()
public void prepareForInterpolation(double x, double y, boolean fromCurrent)
fromCurrent
is true, the interpolation is prepared to be done
from the current image in the pyramid. Otherwise, the interpolation is
prepared to be done from the original image.x
- x- point coordinatey
- y- point coordinatefromCurrent
- flag to determine the image to do the interpolation frompublic double prepareForInterpolationAndInterpolateI(double x, double y, boolean fromSub, boolean fromCurrent)
else:
x
- x- point coordinatey
- y- point coordinatefromSub
- flat to determine to do the interpolation from the
subsampled version of the imagefromCurrent
- flag to determine the image to do the interpolation from
interpolated valuepublic double prepareForInterpolationAndInterpolateIAndD(double x, double y, double[] D, boolean fromSub, boolean fromCurrent)
else:
x
- x- point coordinatey
- y- point coordinateD
- output, interpolation the X and Y derivatives of the imagefromSub
- flat to determine to do the interpolation from the
subsampled version of the imagefromCurrent
- flag to determine the image to do the interpolation from
interpolated valuepublic int precomputed_getWidth()
public double precomputed_getWeightDx(int l, int m, int u, int v)
l
- m
- u
- v
- public double precomputed_getWeightDxDx(int l, int m, int u, int v)
l
- m
- u
- v
- public double precomputed_getWeightDxDy(int l, int m, int u, int v)
l
- m
- u
- v
- public double precomputed_getWeightDy(int l, int m, int u, int v)
l
- m
- u
- v
- public double precomputed_getWeightDyDy(int l, int m, int u, int v)
l
- m
- u
- v
- public double precomputed_getWeightI(int l, int m, int u, int v)
l
- m
- u
- v
- public void precomputed_interpolateD(double[] D, int u, int v)
D
- output, X and Y derivatives of the imageu
- x- point coordinatev
- y- point coordinatepublic void precomputed_interpolateD2(double[] D2, int u, int v)
D2
- output, XY, XX and YY derivatives of the imageu
- x- point coordinatev
- y- point coordinatepublic double precomputed_interpolateI(int u, int v)
u
- x- point coordinatev
- y- point coordinatepublic void precomputed_prepareForInterpolation(int Ydim, int Xdim, int intervals)
Ydim
- y- image dimensionXdim
- x- image dimensionintervals
- intervals in the deformationpublic void run()
public void setCoefficients(double[] c, int Ydim, int Xdim, int offset)
c
- Set of B-spline coefficientsYdim
- Y-dimension of the set of coefficientsXdim
- X-dimension of the set of coefficientsoffset
- Offset of the beginning of the array with respect to the origin of cpublic void setPyramidDepth(int pyramidDepth)
pyramidDepth
- pyramid depth to be setpublic double[] reduceCoeffsBy2(double[] c, int width, int height)
c
- width
- height
- public void setSubsamplingFactor(int maxImageSubsamplingFactor)
maxImageSubsamplingFactor
- public int getSubsamplingFactor()
Copyright © 2015–2021 Fiji. All rights reserved.