public class Transformation extends Object
doBidirectionalRegistration
(bidirectional) and doUnidirectionalRegistration
(unidirectional).outputLevel
.Constructor and Description |
---|
Transformation(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
BSplineModel target,
PointHandler sourcePh,
PointHandler targetPh,
Mask sourceMsk,
Mask targetMsk,
double[][] sourceAffineMatrix,
double[][] targetAffineMatrix,
int min_scale_deformation,
int max_scale_deformation,
int min_scale_image,
double divWeight,
double curlWeight,
double landmarkWeight,
double imageWeight,
double consistencyWeight,
double stopThreshold,
int outputLevel,
boolean showMarquardtOptim,
int accurate_mode,
String fn_tnf_1,
String fn_tnf_2,
ij.ImagePlus output_ip_1,
ij.ImagePlus output_ip_2,
MainDialog dialog)
Create an instance of Transformation.
|
Transformation(ij.ImagePlus sourceImp,
ij.ImagePlus targetImp,
BSplineModel source,
BSplineModel target,
PointHandler sourcePh,
PointHandler targetPh,
Mask sourceMsk,
Mask targetMsk,
double[][] sourceAffineMatrix,
double[][] targetAffineMatrix,
int min_scale_deformation,
int max_scale_deformation,
int min_scale_image,
double divWeight,
double curlWeight,
double landmarkWeight,
double imageWeight,
double consistencyWeight,
double stopThreshold,
int outputLevel,
boolean showMarquardtOptim,
int accurate_mode,
String fn_tnf_1,
String fn_tnf_2,
ij.ImagePlus output_ip_1,
ij.ImagePlus output_ip_2,
MainDialog dialog,
ij.process.ImageProcessor originalSourceIP,
ij.process.ImageProcessor originalTargetIP)
Create an instance of Transformation.
|
Modifier and Type | Method and Description |
---|---|
void |
doBidirectionalRegistration()
Registration method.
|
void |
doUnidirectionalRegistration()
Unidirectional registration method.
|
double |
evaluateImageSimilarity(boolean bIsReverse)
Evaluate the similarity between the images.
|
void |
getDeformation(double[][] transformation_x,
double[][] transformation_y,
boolean bIsReverse)
Get the deformation from the corresponding coefficients.
|
double[][] |
getDirectDeformationCoefficientsX()
Get the direct deformation X coefficients.
|
double[][] |
getDirectDeformationCoefficientsY()
Get the direct deformation Y coefficients.
|
ij.ImagePlus |
getDirectResults()
Get direct results window
|
int |
getIntervals()
Get the current number of intervals between B-spline coefficients.
|
double[][] |
getInverseDeformationCoefficientsX()
Get the inverse deformation X coefficients.
|
double[][] |
getInverseDeformationCoefficientsY()
Get the inverse deformation Y coefficients.
|
ij.ImagePlus |
getInverseResults()
Get inverse results window
|
void |
loadDirectTransformation(String fileName)
Load target to source transformation from a file.
|
void |
loadInverseTransformation(String fileName)
Load source to target transformation from a file.
|
static AffineTransform |
makeAffineMatrix(double scalex,
double scaley,
double shearx,
double sheary,
double rotang,
double transx,
double transy)
Makes an affine transformation matrix from the given scale, shear,
rotation and translation values
if you want a uniquely retrievable matrix, give sheary=0
|
void |
regularizeMatrix(AffineTransform a,
double centerX,
double centerY)
Regularize matrix to remove sharing, scaling, etc.
|
void |
saveDirectTransformation()
Save source transformation.
|
void |
saveDirectTransformation(String fileName)
Save target to source transformation into a file.
|
void |
saveInverseTransformation()
Save target transformation.
|
void |
saveInverseTransformation(String fileName)
Save source to target transformation into a file.
|
void |
setAnisotropyCorrection(double isoCorrection)
Correct anisotropy on initial affine transform
|
void |
setScaleCorrection(double scaleCorrection)
Correct scale on initial affine transform
|
void |
setShearCorrection(double shearCorrection)
Correct shear on initial affine transform
|
void |
showDirectResults()
Show the direct transformation results(multi-thread version).
|
void |
showInverseResults()
Show the inverse transformation results (multi-thread version).
|
void |
transform(double u,
double v,
double[] xyF,
boolean bIsReverse)
Apply the current transformation to a given point.
|
public Transformation(ij.ImagePlus sourceImp, ij.ImagePlus targetImp, BSplineModel source, BSplineModel target, PointHandler sourcePh, PointHandler targetPh, Mask sourceMsk, Mask targetMsk, double[][] sourceAffineMatrix, double[][] targetAffineMatrix, int min_scale_deformation, int max_scale_deformation, int min_scale_image, double divWeight, double curlWeight, double landmarkWeight, double imageWeight, double consistencyWeight, double stopThreshold, int outputLevel, boolean showMarquardtOptim, int accurate_mode, String fn_tnf_1, String fn_tnf_2, ij.ImagePlus output_ip_1, ij.ImagePlus output_ip_2, MainDialog dialog)
sourceImp
- image representation for the sourcetargetImp
- image representation for the targetsource
- source image modeltarget
- target image modelsourcePh
- point handler for the landmarks in the source imagetargetPh
- point handler for the landmarks in the target imagesourceMsk
- source image masktargetMsk
- target image masksourceAffineMatrix
- source initial affine matrixtargetAffineMatrix
- source initial affine matrixmin_scale_deformation
- minimum scale deformationmax_scale_deformation
- maximum scale deformationmin_scale_image
- minimum image scaledivWeight
- divergence weightcurlWeight
- curl weightlandmarkWeight
- landmark weightimageWeight
- weight for image similarityconsistencyWeight
- weight for the deformations consistencystopThreshold
- stopping thresholdoutputLevel
- flag to specify the level of resolution in the outputshowMarquardtOptim
- flag to show the optimizeraccurate_mode
- level of accuracyfn_tnf_1
- direct transformation file namefn_tnf_2
- inverse transformation file nameoutput_ip_1
- pointer to the first output imageoutput_ip_2
- pointer to the second output imagedialog
- pointer to the dialog of the bUnwarpJ interfacepublic Transformation(ij.ImagePlus sourceImp, ij.ImagePlus targetImp, BSplineModel source, BSplineModel target, PointHandler sourcePh, PointHandler targetPh, Mask sourceMsk, Mask targetMsk, double[][] sourceAffineMatrix, double[][] targetAffineMatrix, int min_scale_deformation, int max_scale_deformation, int min_scale_image, double divWeight, double curlWeight, double landmarkWeight, double imageWeight, double consistencyWeight, double stopThreshold, int outputLevel, boolean showMarquardtOptim, int accurate_mode, String fn_tnf_1, String fn_tnf_2, ij.ImagePlus output_ip_1, ij.ImagePlus output_ip_2, MainDialog dialog, ij.process.ImageProcessor originalSourceIP, ij.process.ImageProcessor originalTargetIP)
sourceImp
- image representation for the sourcetargetImp
- image representation for the targetsource
- source image modeltarget
- target image modelsourcePh
- point handler for the landmarks in the source imagetargetPh
- point handler for the landmarks in the target imagesourceMsk
- source image masktargetMsk
- target image masksourceAffineMatrix
- source initial affine matrixtargetAffineMatrix
- source initial affine matrixmin_scale_deformation
- minimum scale deformationmax_scale_deformation
- maximum scale deformationmin_scale_image
- minimum image scaledivWeight
- divergence weightcurlWeight
- curl weightlandmarkWeight
- landmark weightimageWeight
- weight for image similarityconsistencyWeight
- weight for the deformations consistencystopThreshold
- stopping thresholdoutputLevel
- flag to specify the level of resolution in the outputshowMarquardtOptim
- flag to show the optimizeraccurate_mode
- level of accuracyfn_tnf_1
- direct transformation file namefn_tnf_2
- inverse transformation file nameoutput_ip_1
- pointer to the first output imageoutput_ip_2
- pointer to the second output imagedialog
- pointer to the dialog of the bUnwarpJ interfacepublic void doBidirectionalRegistration()
public void doUnidirectionalRegistration()
public double evaluateImageSimilarity(boolean bIsReverse)
bIsReverse
- determines the transformation direction (source-target=TRUE or target-source=FALSE)public void getDeformation(double[][] transformation_x, double[][] transformation_y, boolean bIsReverse)
transformation_x
- matrix to store the x- transformationtransformation_y
- matrix to store the y- transformationbIsReverse
- flag to choose the deformation coefficients
(source-target=TRUE or target-source=FALSE)public double[][] getDirectDeformationCoefficientsX()
public double[][] getDirectDeformationCoefficientsY()
public double[][] getInverseDeformationCoefficientsX()
public double[][] getInverseDeformationCoefficientsY()
public int getIntervals()
public void transform(double u, double v, double[] xyF, boolean bIsReverse)
u
- input, x- point coordinatev
- input, y- point coordinatexyF
- output, transformed pointbIsReverse
- flag to decide the transformation direction (direct-inverse)
(source-target=TRUE or target-source=FALSE)public void regularizeMatrix(AffineTransform a, double centerX, double centerY)
a
- affine transformcenterX
- image center x- coordinatecenterX
- image center y- coordinatepublic static AffineTransform makeAffineMatrix(double scalex, double scaley, double shearx, double sheary, double rotang, double transx, double transy)
scalex
- scaling in xscaley
- scaling in yshearx
- shearing in xsheary
- shearing in yrotang
- angle of rotation (in radians)transx
- translation in xtransy
- translation in ypublic void saveDirectTransformation()
public void saveDirectTransformation(String fileName)
public void saveInverseTransformation()
public void saveInverseTransformation(String fileName)
public void loadDirectTransformation(String fileName)
public void loadInverseTransformation(String fileName)
public void showDirectResults()
public void showInverseResults()
public ij.ImagePlus getDirectResults()
public ij.ImagePlus getInverseResults()
public void setShearCorrection(double shearCorrection)
shearCorrection
- percentage of shear correction (0.0 - 1.0)public void setScaleCorrection(double scaleCorrection)
scaleCorrection
- percentage of scale correction (0.0 - 1.0)public void setAnisotropyCorrection(double isoCorrection)
isoCorrection
- percentage of anisotropy correction (0.0 - 1.0)Copyright © 2015–2021 Fiji. All rights reserved.