|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbunwarpj.MiscTools
public class MiscTools
Different tools for the bUnwarpJ interface.
| Nested Class Summary | |
|---|---|
private static class |
MiscTools.ColorApplyTransformTile
Class to apply transformation to color images in a concurrent way |
private static class |
MiscTools.GrayscaleApplyTransformTile
Class to apply transformation to grayscale images in a concurrent way |
| Constructor Summary | |
|---|---|
MiscTools()
|
|
| Method Summary | |
|---|---|
static void |
adaptCoefficients(double xScale,
double yScale,
int intervals,
double[][] cx,
double[][] cy)
Adapt B-spline coefficients to a scale factor |
static void |
applyRawTransformationToSource(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
double[][] transformation_x,
double[][] transformation_y)
Apply a given raw transformation to the source image. |
static ij.process.ImageProcessor |
applyTransformationMT(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
int intervals,
double[][] cx,
double[][] cy)
Apply a given B-spline transformation to the source (gray-scale) image. |
static void |
applyTransformationToSource(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel sourceR,
BSplineModel sourceG,
BSplineModel sourceB,
int intervals,
double[][] cx,
double[][] cy)
Deprecated. |
static void |
applyTransformationToSource(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
int intervals,
double[][] cx,
double[][] cy)
Deprecated. |
static void |
applyTransformationToSourceMT(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
int intervals,
double[][] cx,
double[][] cy)
Apply a given B-spline transformation to the source (gray-scale) image. |
static void |
applyTransformationToSourceMT(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
int intervals,
double[][] cx,
double[][] cy)
Apply a given B-spline transformation to the source (gray-scale) image. |
static void |
composeElasticTransformations(ij.ImagePlus targetImp,
int intervals,
double[][] cx1,
double[][] cy1,
double[][] cx2,
double[][] cy2,
double[][] outputTransformation_x,
double[][] outputTransformation_y)
Compose two elastic deformations into a raw deformation. |
static void |
composeElasticTransformationsAtPixelLevel(ij.ImagePlus targetImp,
int intervals,
double[][] cx1,
double[][] cy1,
double[][] cx2,
double[][] cy2,
double[][] outputTransformation_x,
double[][] outputTransformation_y)
Compose two elastic deformations into a raw deformation at pixel level. |
static void |
composeRawElasticTransformations(ij.ImagePlus targetImp,
int intervals,
double[][] transformation_x_1,
double[][] transformation_y_1,
double[][] cx2,
double[][] cy2,
double[][] outputTransformation_x,
double[][] outputTransformation_y)
Compose a raw deformation and an elastic deformation into a raw deformation. |
static void |
composeRawTransformations(int width,
int height,
double[][] transformation_x_1,
double[][] transformation_y_1,
double[][] transformation_x_2,
double[][] transformation_y_2,
double[][] outputTransformation_x,
double[][] outputTransformation_y)
Compose two raw transformations (Bilinear interpolation) |
static void |
convertElasticTransformationToRaw(ij.ImagePlus targetImp,
int intervals,
double[][] cx,
double[][] cy,
double[][] transformation_x,
double[][] transformation_y)
Calculate the raw transformation mapping from B-spline coefficients. |
static void |
convertRawTransformationToBSpline(ij.ImagePlus targetImp,
int intervals,
double[][] transformation_x,
double[][] transformation_y,
double[][] cx,
double[][] cy)
Convert the raw transformation mapping to B-spline coefficients. |
static ij.process.ImageProcessor |
createDownsampled(ij.process.ImageProcessor source,
float scale,
float sourceSigma,
float targetSigma)
Create a downsampled ImageProcessor. |
static void |
drawArrow(double[][] canvas,
int x1,
int y1,
int x2,
int y2,
double color,
int arrow_size)
Draw an arrow between two points. |
static void |
drawLine(double[][] canvas,
int x1,
int y1,
int x2,
int y2,
double color)
Draw a line between two points. |
static void |
extractImage(ij.process.ImageProcessor ip,
double[] image)
Put the image from an ImageProcessor into a double array. |
static void |
extractImage(ij.process.ImageProcessor ip,
double[][] image)
Put the image from an ImageProcessor into a double[][]. |
static void |
invertRawTransformation(ij.ImagePlus targetImp,
double[][] transformation_x,
double[][] transformation_y,
double[][] inv_x,
double[][] inv_y)
|
static void |
loadAffineMatrix(java.lang.String filename,
double[][] affineMatrix)
Load an affine matrix from a file. |
static void |
loadPointRoiAsLandmarks(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
java.util.Stack<java.awt.Point> sourceStack,
java.util.Stack<java.awt.Point> targetStack)
Load point rois in the source and target images as landmarks. |
static void |
loadPoints(java.lang.String filename,
java.util.Stack<java.awt.Point> sourceStack,
java.util.Stack<java.awt.Point> targetStack)
Load landmarks from file. |
static void |
loadRawTransformation(java.lang.String filename,
double[][] transformation_x,
double[][] transformation_y)
Load a raw transformation from a file. |
static void |
loadRawTransformation(java.lang.String filename,
double[] transformation_x,
double[] transformation_y)
Load a raw transformation from a file. |
static void |
loadTransformation(java.lang.String filename,
double[][] cx,
double[][] cy)
Load a transformation from a file. |
static int |
numberOfIntervalsOfTransformation(java.lang.String filename)
Read the number of intervals of a transformation from a file. |
static void |
Point(double[][] canvas,
int y,
int x,
double color)
Plot a point in a canvas. |
static void |
printMatrix(java.lang.String title,
double[][] array)
Print a matrix in the command line. |
static double |
rawWarpingIndex(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
double[][] transformation_x_1,
double[][] transformation_y_1,
double[][] transformation_x_2,
double[][] transformation_y_2)
Warping index for comparing two raw deformations (both transformations having same direction). |
static double |
rawWarpingIndex(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
int intervals,
double[][] cx_direct,
double[][] cy_direct,
double[][] transformation_x,
double[][] transformation_y)
Warping index for comparing elastic deformations with any kind of deformation (both transformations having same direction). |
static void |
saveElasticTransformation(int intervals,
double[][] cx,
double[][] cy,
java.lang.String filename)
Save the elastic transformation. |
static void |
saveRawTransformation(java.lang.String filename,
int width,
int height,
double[][] transformation_x,
double[][] transformation_y)
Save a raw transformation |
static ij.process.ImageProcessor |
scale(ij.process.ImageProcessor source,
float scale)
Scale an image with good quality in both up and down direction |
static void |
showImage(java.lang.String title,
double[][] array)
Show an image in a new bUnwarpJ window. |
static void |
showImage(java.lang.String title,
double[] array,
int Ydim,
int Xdim)
Show an image in a new bUnwarpJ window. |
static void |
smoothForScale(ij.process.ImageProcessor source,
float scale,
float sourceSigma,
float targetSigma)
Smooth with a Gaussian kernel that represents downsampling at a given scale factor and sourceSigma. |
static double |
warpingIndex(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
int intervals,
double[][] cx_direct,
double[][] cy_direct,
double[][] cx_inverse,
double[][] cy_inverse)
Calculate the warping index between two opposite elastic deformations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MiscTools()
| Method Detail |
|---|
public static void applyTransformationToSource(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
int intervals,
double[][] cx,
double[][] cy)
sourceImp - source image representationtargetImp - target image representationsource - source image modelintervals - intervals in the deformationcx - x- B-spline coefficientscy - y- B-spline coefficients
public static void applyTransformationToSource(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel sourceR,
BSplineModel sourceG,
BSplineModel sourceB,
int intervals,
double[][] cx,
double[][] cy)
sourceImp - source image representationtargetImp - target image representationsourceR - image model of the source red channelsourceG - image model of the source green channelsourceB - image model of the source blue channelintervals - intervals in the deformationcx - x- B-spline coefficientscy - y- B-spline coefficients
public static void applyRawTransformationToSource(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
double[][] transformation_x,
double[][] transformation_y)
sourceImp - source image representationtargetImp - target image representationsource - source imagetransformation_x - x- mapping coordinatestransformation_y - y- mapping coordinates
public static double warpingIndex(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
int intervals,
double[][] cx_direct,
double[][] cy_direct,
double[][] cx_inverse,
double[][] cy_inverse)
sourceImp - source image representationtargetImp - target image representationintervals - intervals in the deformationcx_direct - direct transformation x- B-spline coefficientscy_direct - direct transformation y- B-spline coefficientscx_inverse - inverse transformation x- B-spline coefficientscy_inverse - inverse transformation y- B-spline coefficients
public static void convertElasticTransformationToRaw(ij.ImagePlus targetImp,
int intervals,
double[][] cx,
double[][] cy,
double[][] transformation_x,
double[][] transformation_y)
targetImp - target image representationintervals - intervals in the deformationcx - transformation x- B-spline coefficientscy - transformation y- B-spline coefficientstransformation_x - raw transformation in x- axis (output)transformation_y - raw transformation in y- axis (output)
public static void convertRawTransformationToBSpline(ij.ImagePlus targetImp,
int intervals,
double[][] transformation_x,
double[][] transformation_y,
double[][] cx,
double[][] cy)
targetImp - target image representationintervals - intervals in the deformationtransformation_x - raw transformation in x- axistransformation_y - raw transformation in y- axiscx - transformation in x- by B-spline coefficients (output)cy - transformation in y- by B-spline coefficients (output)
public static void invertRawTransformation(ij.ImagePlus targetImp,
double[][] transformation_x,
double[][] transformation_y,
double[][] inv_x,
double[][] inv_y)
public static double rawWarpingIndex(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
int intervals,
double[][] cx_direct,
double[][] cy_direct,
double[][] transformation_x,
double[][] transformation_y)
sourceImp - source image representationtargetImp - target image representationintervals - intervals in the deformationcx_direct - direct transformation x- B-spline coefficientscy_direct - direct transformation y- B-spline coefficientstransformation_x - raw direct transformation in x- axistransformation_y - raw direct transformation in y- axis
public static double rawWarpingIndex(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
double[][] transformation_x_1,
double[][] transformation_y_1,
double[][] transformation_x_2,
double[][] transformation_y_2)
sourceImp - source image representationtargetImp - target image representationtransformation_x_1 - raw first transformation in x- axistransformation_y_1 - raw first transformation in y- axistransformation_x_2 - raw second transformation in x- axistransformation_y_2 - raw second transformation in y- axis
public static void drawArrow(double[][] canvas,
int x1,
int y1,
int x2,
int y2,
double color,
int arrow_size)
canvas - canvas where we are paintingx1 - x- coordinate for the arrow originy1 - y- coordinate for the arrow originx2 - x- coordinate for the arrow heady2 - y- coordinate for the arrow headcolor - arrow colorarrow_size - arrow size
public static void drawLine(double[][] canvas,
int x1,
int y1,
int x2,
int y2,
double color)
canvas - canvas where we are paintingx1 - x- coordinate for first pointy1 - y- coordinate for first pointx2 - x- coordinate for second pointy2 - y- coordinate for second pointcolor - line color
public static void extractImage(ij.process.ImageProcessor ip,
double[] image)
ip - input, origin of the imageimage - output, the image in a double array
public static void extractImage(ij.process.ImageProcessor ip,
double[][] image)
ip - input, origin of the imageimage - output, the image in a double[][]
public static void loadPoints(java.lang.String filename,
java.util.Stack<java.awt.Point> sourceStack,
java.util.Stack<java.awt.Point> targetStack)
filename - landmarks file namesourceStack - stack of source related points (output)targetStack - stack of target related points (output)
public static void loadPointRoiAsLandmarks(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
java.util.Stack<java.awt.Point> sourceStack,
java.util.Stack<java.awt.Point> targetStack)
sourceImp - source image plustargetImp - target image plussourceStack - stack of source related points (output)targetStack - stack of target related points (output)
public static void loadTransformation(java.lang.String filename,
double[][] cx,
double[][] cy)
filename - transformation file namecx - x- B-spline coefficientscy - y- B-spline coefficients
public static void loadRawTransformation(java.lang.String filename,
double[][] transformation_x,
double[][] transformation_y)
filename - transformation file nametransformation_x - output x- transformation coordinatestransformation_y - output y- transformation coordinates
public static void loadRawTransformation(java.lang.String filename,
double[] transformation_x,
double[] transformation_y)
filename - transformation file nametransformation_x - output x- transformation coordinatestransformation_y - output y- transformation coordinates
public static void loadAffineMatrix(java.lang.String filename,
double[][] affineMatrix)
filename - matrix file nameaffineMatrix - output affine matrix
public static void composeElasticTransformations(ij.ImagePlus targetImp,
int intervals,
double[][] cx1,
double[][] cy1,
double[][] cx2,
double[][] cy2,
double[][] outputTransformation_x,
double[][] outputTransformation_y)
targetImp - target image representationintervals - intervals in the deformationcx1 - first transformation x- B-spline coefficientscy1 - first transformation y- B-spline coefficientscx2 - second transformation x- B-spline coefficientscy2 - second transformation y- B-spline coefficientsoutputTransformation_x - output transformation coordinates in x-axisoutputTransformation_y - output transformation coordinates in y-axis
public static void composeRawElasticTransformations(ij.ImagePlus targetImp,
int intervals,
double[][] transformation_x_1,
double[][] transformation_y_1,
double[][] cx2,
double[][] cy2,
double[][] outputTransformation_x,
double[][] outputTransformation_y)
targetImp - target image representationintervals - intervals in the deformationtransformation_x_1 - first transformation coordinates in x-axistransformation_y_1 - first transformation coordinates in y-axiscx2 - second transformation x- B-spline coefficientscy2 - second transformation y- B-spline coefficientsoutputTransformation_x - output transformation coordinates in x-axisoutputTransformation_y - output transformation coordinates in y-axis
public static void composeElasticTransformationsAtPixelLevel(ij.ImagePlus targetImp,
int intervals,
double[][] cx1,
double[][] cy1,
double[][] cx2,
double[][] cy2,
double[][] outputTransformation_x,
double[][] outputTransformation_y)
targetImp - target image representationintervals - intervals in the deformationcx1 - first transformation x- B-spline coefficientscy1 - first transformation y- B-spline coefficientscx2 - second transformation x- B-spline coefficientscy2 - second transformation y- B-spline coefficientsoutputTransformation_x - output transformation coordinates in y-axisoutputTransformation_y - output transformation coordinates in y-axis
public static void composeRawTransformations(int width,
int height,
double[][] transformation_x_1,
double[][] transformation_y_1,
double[][] transformation_x_2,
double[][] transformation_y_2,
double[][] outputTransformation_x,
double[][] outputTransformation_y)
width - image widthheight - image heighttransformation_x_1 - first transformation coordinates in x-axistransformation_y_1 - first transformation coordinates in y-axistransformation_x_2 - second transformation coordinates in x-axistransformation_y_2 - second transformation coordinates in y-axisoutputTransformation_x - output transformation coordinates in y-axisoutputTransformation_y - output transformation coordinates in y-axis
public static void saveElasticTransformation(int intervals,
double[][] cx,
double[][] cy,
java.lang.String filename)
intervals - number of intervals in the deformationcx - x- deformation coefficientscy - y- deformation coefficientsfilename - transformation file name
public static void saveRawTransformation(java.lang.String filename,
int width,
int height,
double[][] transformation_x,
double[][] transformation_y)
filename - raw transformation file namewidth - image widthheight - image heighttransformation_x - transformation coordinates in x-axistransformation_y - transformation coordinates in y-axispublic static int numberOfIntervalsOfTransformation(java.lang.String filename)
filename - transformation file name
public static void Point(double[][] canvas,
int y,
int x,
double color)
canvas - canvas where we are paintingx - x- coordinate for the pointy - y- coordinate for the pointcolor - point color
public static void printMatrix(java.lang.String title,
double[][] array)
title - matrix titlearray - matrix to be printed
public static void showImage(java.lang.String title,
double[] array,
int Ydim,
int Xdim)
title - image titlearray - image in a double arrayYdim - image heightXdim - image width
public static void showImage(java.lang.String title,
double[][] array)
title - image titlearray - image in a double array
public static void adaptCoefficients(double xScale,
double yScale,
int intervals,
double[][] cx,
double[][] cy)
xScale - yScale - intervals - cx - cy -
public static void applyTransformationToSourceMT(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
int intervals,
double[][] cx,
double[][] cy)
sourceImp - source image representationtargetImp - target image representationintervals - intervals in the deformationcx - x- B-spline coefficientscy - y- B-spline coefficients
public static void applyTransformationToSourceMT(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
int intervals,
double[][] cx,
double[][] cy)
sourceImp - source image representationtargetImp - target image representationsource - source image modelintervals - intervals in the deformationcx - x- B-spline coefficientscy - y- B-spline coefficients
public static ij.process.ImageProcessor applyTransformationMT(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
int intervals,
double[][] cx,
double[][] cy)
sourceImp - source image representationtargetImp - target image representationsource - source image modelintervals - intervals in the deformationcx - x- B-spline coefficientscy - y- B-spline coefficients
public static final void smoothForScale(ij.process.ImageProcessor source,
float scale,
float sourceSigma,
float targetSigma)
public static final ij.process.ImageProcessor createDownsampled(ij.process.ImageProcessor source,
float scale,
float sourceSigma,
float targetSigma)
source - the source imagescale - scaling factorsourceSigma - the Gaussian at which the source was sampled (guess 0.5 if you do not know)targetSigma - the Gaussian at which the target will be sampled
FloatProcessor
public static final ij.process.ImageProcessor scale(ij.process.ImageProcessor source,
float scale)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||