public class bUnwarpJ_ extends Object implements ij.plugin.PlugIn
This class is a plugin for the ImageJ/Fiji interface. It allows pairwise image registration combining the ideas of elastic registration based on B-spline models and consistent registration.
This work is an extension by Ignacio Arganda-Carreras and Jan Kybic of the previous UnwarpJ project by Carlos Oscar Sanchez Sorzano.
For more information visit the main site http://imagej.net/BUnwarpJ/
| Constructor and Description |
|---|
bUnwarpJ_() |
| Modifier and Type | Method and Description |
|---|---|
static void |
adaptCoefficients(String inputTransfPath,
String strImageFactor,
String outputTransfPath)
Adapt the B-spline coefficients to a new image size.
|
static void |
adaptCoefficientsMacro(String targetImageName,
String sourceImageName,
String inputElasticTransfFileName,
String outputElasticTransfFileName,
String sizeFactor)
Method to adapt an elastic transformation given a new image size.
|
static ij.ImagePlus[] |
alignImagesBatch(ij.ImagePlus targetImp,
ij.ImagePlus sourceImp,
ij.process.ImageProcessor targetMskIP,
ij.process.ImageProcessor sourceMskIP,
int mode,
int img_subsamp_fact,
int min_scale_deformation,
int max_scale_deformation,
double divWeight,
double curlWeight,
double landmarkWeight,
double imageWeight,
double consistencyWeight,
double stopThreshold)
Method for images alignment with no graphical interface.
|
static ij.ImagePlus[] |
alignImagesBatch(ij.ImagePlus targetImp,
ij.ImagePlus sourceImp,
ij.process.ImageProcessor targetMskIP,
ij.process.ImageProcessor sourceMskIP,
int mode,
int img_subsamp_fact,
int min_scale_deformation,
int max_scale_deformation,
double divWeight,
double curlWeight,
double landmarkWeight,
double imageWeight,
double consistencyWeight,
double stopThreshold,
double xScale,
double yScale)
Method for images alignment with no graphical interface.
|
static ij.ImagePlus[] |
alignImagesBatch(ij.ImagePlus targetImp,
ij.ImagePlus sourceImp,
ij.process.ImageProcessor targetMskIP,
ij.process.ImageProcessor sourceMskIP,
Param parameter)
Method for images alignment with no graphical interface.
|
static void |
applyRawTransformToSource(String transfPath,
ij.ImagePlus targetImp,
ij.ImagePlus sourceImp)
Apply a raw transform loaded from file to the source image.
|
static void |
applyTransformToSource(String transfPath,
ij.ImagePlus targetImp,
ij.ImagePlus sourceImp)
Apply transform loaded from file to source image (in place).
|
static void |
compareElasticRawTransformationsMacro(String targetImageName,
String sourceImageName,
String targetTransfFileName,
String sourceTransfFileName)
Method to compare an elastic and a raw transformations by warping index.
|
static void |
compareElasticRawTransforms(String elasticTransfPath,
String rawTransfPath,
String targetTitle,
String sourceTitle)
Compare an elastic and a raw transform loaded from file.
|
static void |
compareElasticTransformationsMacro(String targetImageName,
String sourceImageName,
String targetTransfFileName,
String sourceTransfFileName)
Method to compare two opposite elastic transformations by warping index.
|
static void |
compareOppositeElasticTransforms(String directTransfPath,
String inverseTransfPath,
String targetTitle,
String sourceTitle)
Compare opposite elastic transforms loaded from file.
|
static void |
compareRawTransformationsMacro(String targetImageName,
String sourceImageName,
String targetTransfFileName,
String sourceTransfFileName)
Method to compare two raw transformations by warping index.
|
static void |
compareRawTransforms(String rawTransfPath1,
String rawTransfPath2,
String targetTitle,
String sourceTitle)
Compare two raw transforms loaded from file.
|
static void |
composeElasticTransformationsMacro(String targetImageName,
String sourceImageName,
String inputElasticTransfFileName1,
String inputElasticTransfFileName2,
String outputRawTransfFileName)
Method to compose two elastic transformations.
|
static void |
composeElasticTransforms(String elasticTransfPath1,
String elasticTransfPath2,
String rawTransfPath,
String targetTitle)
Compose two elastic transforms into a raw transform.
|
static void |
composeRawElasticTransformationsMacro(String targetImageName,
String sourceImageName,
String inputRawTransfFileName,
String inputElasticTransfFileName,
String outputRawTransfFileName)
Method to compose a raw transformation with an elastic transformation.
|
static void |
composeRawElasticTransforms(String rawTransfPath,
String elasticTransfPath,
String outputRawTransfPath,
String targetTitle,
String sourceTitle)
Compose two a raw and an elastic transform into a raw transform.
|
static void |
composeRawTransformationsMacro(String targetImageName,
String sourceImageName,
String inputRawTransfFileName1,
String inputRawTransfFileName2,
String outputRawTransfFileName)
Method to compose two raw transformations.
|
static void |
composeRawTransforms(String rawTransfPath1,
String rawTransfPath2,
String outputRawTransfPath,
String targetTitle)
Compose two raw transforms into another raw transform.
|
static Transformation |
computeTransformationBatch(ij.ImagePlus targetImp,
ij.ImagePlus sourceImp,
ij.process.ImageProcessor targetMskIP,
ij.process.ImageProcessor sourceMskIP,
AffineTransform targetAffineTransf,
AffineTransform sourceAffineTransf,
Param parameter)
Method for images alignment with no graphical interface.
|
static Transformation |
computeTransformationBatch(ij.ImagePlus targetImp,
ij.ImagePlus sourceImp,
ij.process.ImageProcessor targetMskIP,
ij.process.ImageProcessor sourceMskIP,
int mode,
int img_subsamp_fact,
int min_scale_deformation,
int max_scale_deformation,
double divWeight,
double curlWeight,
double landmarkWeight,
double imageWeight,
double consistencyWeight,
double stopThreshold)
Method for images alignment with no graphical interface.
|
static Transformation |
computeTransformationBatch(ij.ImagePlus targetImp,
ij.ImagePlus sourceImp,
ij.process.ImageProcessor targetMskIP,
ij.process.ImageProcessor sourceMskIP,
Param parameter)
Method for images alignment with no graphical interface.
|
static Transformation |
computeTransformationBatch(int sourceWidth,
int sourceHeight,
int targetWidth,
int targetHeight,
Stack<Point> sourcePoints,
Stack<Point> targetPoints,
Param parameter)
Method for images alignment with no graphical interface.
|
static void |
convertToElastic(String rawTransfPath,
String elasticTransfPath,
String strIntervals,
String targetTitle)
Convert an elastic transform to raw format and save it to file.
|
static void |
convertToRaw(String elasticTransfPath,
String rawTransfPath,
String targetTitle)
Convert an elastic transform to raw format and save it to file.
|
static void |
convertToRawTransformationMacro(String targetImageName,
String sourceImageName,
String inputElasticTransfFileName,
String outputRawTransfFileName)
Method to convert an elastic deformation into raw format.
|
static void |
elasticTransformImageMacro(String targetImageName,
String sourceImageName,
String transformationFileName,
String outputFileName)
Method to transform the source image given an elastic deformation.
|
static void |
evaluateImageSimilarity(String targetImageName,
String sourceImageName)
Calculate image similarity between two images (target and source)
|
static MainDialog |
getMainDialog()
Get bUnwarpJ main dialog (if exists)
|
static void |
invertRawTransform(String inputTransfPath,
String outputTransfPath,
String targetTitle)
Approximate the inverse of a raw transform and save it to file.
|
static void |
loadElasticTransform(String transfPath,
String targetTitle,
String sourceTitle)
Load an elastic transform (bUnwarpJ format) from file and apply it to
the source image.
|
static void |
loadLandmarks(String landmarksFilePath)
Load landmarks from file into existing source and target images.
|
static void |
loadRawTransform(String transfPath,
String targetTitle,
String sourceTitle)
Load a raw transform from file and apply it to the current source image.
|
static void |
loadSourceAffineMatrix(String affineMatrixPath)
Load an initial affine matrix for the source image.
|
static void |
loadSourceMask(String sourceMaskPath)
Load a source mask from file.
|
static void |
main(String[] args)
Main method for bUnwarpJ (command line).
|
static void |
rawTransformImageMacro(String targetImageName,
String sourceImageName,
String transformationFileName,
String outputFileName)
Method to transform the source image given an raw deformation.
|
void |
run(String commandLine)
Method to lunch the plugin.
|
static void |
saveLandmarks(String landmarksFilePath)
Save landmarks to file.
|
static void |
showLandmarks()
Show landmark points in a results window.
|
public void run(String commandLine)
run in interface ij.plugin.PlugIncommandLine - command to determine the actionpublic static Transformation computeTransformationBatch(ij.ImagePlus targetImp, ij.ImagePlus sourceImp, ij.process.ImageProcessor targetMskIP, ij.process.ImageProcessor sourceMskIP, int mode, int img_subsamp_fact, int min_scale_deformation, int max_scale_deformation, double divWeight, double curlWeight, double landmarkWeight, double imageWeight, double consistencyWeight, double stopThreshold)
targetImp - input target imagesourceImp - input source imagetargetMskIP - target masksourceMskIP - source maskmode - accuracy mode (0 - Fast, 1 - Accurate, 2 - Mono)img_subsamp_fact - image subsampling factor (from 0 to 7, representing 2^0=1 to 2^7 = 128)min_scale_deformation - (0 - Very Coarse, 1 - Coarse, 2 - Fine, 3 - Very Fine)max_scale_deformation - (0 - Very Coarse, 1 - Coarse, 2 - Fine, 3 - Very Fine, 4 - Super Fine)divWeight - divergence weightcurlWeight - curl weightlandmarkWeight - landmark weightimageWeight - image similarity weightconsistencyWeight - consistency weightstopThreshold - stopping thresholdpublic static Transformation computeTransformationBatch(ij.ImagePlus targetImp, ij.ImagePlus sourceImp, ij.process.ImageProcessor targetMskIP, ij.process.ImageProcessor sourceMskIP, Param parameter)
targetImp - input target imagesourceImp - input source imagetargetMskIP - target masksourceMskIP - source maskparameter - registration parameterspublic static Transformation computeTransformationBatch(ij.ImagePlus targetImp, ij.ImagePlus sourceImp, ij.process.ImageProcessor targetMskIP, ij.process.ImageProcessor sourceMskIP, AffineTransform targetAffineTransf, AffineTransform sourceAffineTransf, Param parameter)
targetImp - input target imagesourceImp - input source imagetargetMskIP - target masksourceMskIP - source masktargetAffineTransf - initial target affine transformsourceAffineTransf - initial source affine transformparameter - registration parameterspublic static Transformation computeTransformationBatch(int sourceWidth, int sourceHeight, int targetWidth, int targetHeight, Stack<Point> sourcePoints, Stack<Point> targetPoints, Param parameter)
sourceWidth - sourceHeight - targetWidth - targetHeight - sourcePoints - targetPoints - parameter - registration parameterspublic static ij.ImagePlus[] alignImagesBatch(ij.ImagePlus targetImp,
ij.ImagePlus sourceImp,
ij.process.ImageProcessor targetMskIP,
ij.process.ImageProcessor sourceMskIP,
int mode,
int img_subsamp_fact,
int min_scale_deformation,
int max_scale_deformation,
double divWeight,
double curlWeight,
double landmarkWeight,
double imageWeight,
double consistencyWeight,
double stopThreshold)
targetImp - input target imagesourceImp - input source imagetargetMskIP - target masksourceMskIP - source maskmode - accuracy mode (0 - Fast, 1 - Accurate, 2 - Mono)img_subsamp_fact - image subsampling factor (from 0 to 7, representing 2^0=1 to 2^7 = 128)min_scale_deformation - (0 - Very Coarse, 1 - Coarse, 2 - Fine, 3 - Very Fine)max_scale_deformation - (0 - Very Coarse, 1 - Coarse, 2 - Fine, 3 - Very Fine, 4 - Super Fine)divWeight - divergence weightcurlWeight - curl weightlandmarkWeight - landmark weightimageWeight - image similarity weightconsistencyWeight - consistency weightstopThreshold - stopping thresholdpublic static ij.ImagePlus[] alignImagesBatch(ij.ImagePlus targetImp,
ij.ImagePlus sourceImp,
ij.process.ImageProcessor targetMskIP,
ij.process.ImageProcessor sourceMskIP,
Param parameter)
targetImp - input target imagesourceImp - input source imagetargetMskIP - target masksourceMskIP - source maskparameter - registration parameterspublic static ij.ImagePlus[] alignImagesBatch(ij.ImagePlus targetImp,
ij.ImagePlus sourceImp,
ij.process.ImageProcessor targetMskIP,
ij.process.ImageProcessor sourceMskIP,
int mode,
int img_subsamp_fact,
int min_scale_deformation,
int max_scale_deformation,
double divWeight,
double curlWeight,
double landmarkWeight,
double imageWeight,
double consistencyWeight,
double stopThreshold,
double xScale,
double yScale)
targetImp - input target imagesourceImp - input source imagetargetMskIP - target masksourceMskIP - source maskmode - accuracy mode (0 - Fast, 1 - Accurate, 2 - Mono)img_subsamp_fact - image subsampling factor (from 0 to 7, representing 2^0=1 to 2^7 = 128)min_scale_deformation - (0 - Very Coarse, 1 - Coarse, 2 - Fine, 3 - Very Fine)max_scale_deformation - (0 - Very Coarse, 1 - Coarse, 2 - Fine, 3 - Very Fine, 4 - Super Fine)divWeight - divergence weightcurlWeight - curl weightlandmarkWeight - landmark weightimageWeight - image similarity weightconsistencyWeight - consistency weightstopThreshold - stopping thresholdxScale - scale factor for x axisyScale - scale factor for y axispublic static void main(String[] args)
args - arguments to decide the actionpublic static void applyTransformToSource(String transfPath, ij.ImagePlus targetImp, ij.ImagePlus sourceImp)
transfPath - complete path to transform filetargetImp - target (fixed) imagesourceImp - source (moving) imagepublic static void elasticTransformImageMacro(String targetImageName, String sourceImageName, String transformationFileName, String outputFileName)
It calls the main command line method with the following option:
-elastic_transform : TRANSFORM A SOURCE IMAGE WITH A GIVEN ELASTIC DEFORMATION
target_image : In any image format
source_image : In any image format
transformation_file : As saved by bUnwarpJ in elastic format
Output image : Output result in TIFF
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)transformationFileName - transformation file name (with path)outputFileName - output file name (with path)public static void rawTransformImageMacro(String targetImageName, String sourceImageName, String transformationFileName, String outputFileName)
It calls the main command line method with the following option:
-raw_transform : TRANSFORM A SOURCE IMAGE WITH A GIVEN RAW DEFORMATION
target_image : In any image format
source_image : In any image format
transformation_file : As saved by bUnwarpJ in raw format
Output image : Output result in TIFF
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)transformationFileName - transformation file name (with path)outputFileName - output file name (with path)public static void compareElasticTransformationsMacro(String targetImageName, String sourceImageName, String targetTransfFileName, String sourceTransfFileName)
It calls the main command line method with the following option:
-compare_elastic : COMPARE 2 OPPOSITE ELASTIC DEFORMATIONS (BY WARPING INDEX)
target_image : In any image format
source_image : In any image format
target_transformation_file : As saved by bUnwarpJ
source_transformation_file : As saved by bUnwarpJ
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)targetTransfFileName - target transformation file name (with path)sourceTransfFileName - source transformation file name (with path)public static void compareElasticRawTransformationsMacro(String targetImageName, String sourceImageName, String targetTransfFileName, String sourceTransfFileName)
It calls the main command line method with the following option:
-compare_elastic_raw : COMPARE AN ELASTIC DEFORMATION WITH A RAW DEFORMATION (BY WARPING INDEX)
target_image : In any image format
source_image : In any image format
target_transformation_file : As saved by bUnwarpJ
source_transformation_file : As saved by bUnwarpJ
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)targetTransfFileName - target transformation file name (with path)sourceTransfFileName - source transformation file name (with path)public static void compareRawTransformationsMacro(String targetImageName, String sourceImageName, String targetTransfFileName, String sourceTransfFileName)
It calls the main command line method with the following option:
-compare_raw : COMPARE 2 ELASTIC DEFORMATIONS (BY WARPING INDEX)
target_image : In any image format
source_image : In any image format
Raw Transformation File 1 : As saved by bUnwarpJ in raw format
Raw Transformation File 2 : As saved by bUnwarpJ in raw format
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)targetTransfFileName - target transformation file name (with path)sourceTransfFileName - source transformation file name (with path)public static void convertToRawTransformationMacro(String targetImageName, String sourceImageName, String inputElasticTransfFileName, String outputRawTransfFileName)
It calls the main command line method with the following option:
-convert_to_raw : CONVERT AN ELASTIC DEFORMATION INTO RAW FORMAT
target_image : In any image format
source_image : In any image format
Input Elastic Transformation File : As saved by bUnwarpJ in elastic format
Output Raw Transformation File : As saved by bUnwarpJ in raw format
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)inputElasticTransfFileName - input transformation file name (with path)outputRawTransfFileName - output transformation file name (with path)public static void composeElasticTransformationsMacro(String targetImageName, String sourceImageName, String inputElasticTransfFileName1, String inputElasticTransfFileName2, String outputRawTransfFileName)
It calls the main command line method with the following option:
-compose_elastic : COMPOSE TWO ELASTIC DEFORMATIONS
target_image : In any image format
source_image : In any image format
Elastic Transformation File 1 : As saved by bUnwarpJ in elastic format
Elastic Transformation File 2 : As saved by bUnwarpJ in elastic format
Output Raw Transformation File : As saved by bUnwarpJ in raw format
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)inputElasticTransfFileName1 - first input transformation file name (with path)inputElasticTransfFileName2 - second input transformation file name (with path)outputRawTransfFileName - output transformation file name (with path)public static void composeRawTransformationsMacro(String targetImageName, String sourceImageName, String inputRawTransfFileName1, String inputRawTransfFileName2, String outputRawTransfFileName)
It calls the main command line method with the following option:
-compose_raw : COMPOSE TWO RAW DEFORMATIONS
target_image : In any image format
source_image : In any image format
Raw Transformation File 1 : As saved by bUnwarpJ in raw format
Raw Transformation File 2 : As saved by bUnwarpJ in raw format
Output Raw Transformation File : As saved by bUnwarpJ in raw format
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)inputRawTransfFileName1 - first input transformation file name (with path)inputRawTransfFileName2 - second input transformation file name (with path)outputRawTransfFileName - output transformation file name (with path)public static void composeRawElasticTransformationsMacro(String targetImageName, String sourceImageName, String inputRawTransfFileName, String inputElasticTransfFileName, String outputRawTransfFileName)
It calls the main command line method with the following option:
-compose_raw_elastic : COMPOSE A RAW DEFORMATION WITH AN ELASTIC DEFORMATION
target_image : In any image format
source_image : In any image format
Raw Transformation File : As saved by bUnwarpJ in raw format
Elastic Transformation File : As saved by bUnwarpJ in elastic format
Output Raw Transformation File : As saved by bUnwarpJ in raw format
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)inputRawTransfFileName - input raw transformation file name (with path)inputElasticTransfFileName - input elastic transformation file name (with path)outputRawTransfFileName - output transformation file name (with path)public static void adaptCoefficientsMacro(String targetImageName, String sourceImageName, String inputElasticTransfFileName, String outputElasticTransfFileName, String sizeFactor)
It calls the main command line method with the following option:
-adapt_transform : ADAPT AN ELASTIC DEFORMATION GIVEN A NEW IMAGE SIZE
target_image : In any image format
source_image : In any image format
Input Elastic Transformation File : As saved by bUnwarpJ in elastic format
Output Elastic Transformation File : As saved by bUnwarpJ in elastic format
Image Size Factor : Double (0.25, 0.5, 2, 4, 8...)
targetImageName - target image file name (with path)sourceImageName - source image file name (with path)inputElasticTransfFileName - input elastic transformation file name (with path)outputElasticTransfFileName - output elastic transformation file name (with path)sizeFactor - double size factor (between old and new image)public static void evaluateImageSimilarity(String targetImageName, String sourceImageName)
targetImageName - name of the target imagesourceImageName - name of the source imagepublic static void loadLandmarks(String landmarksFilePath)
landmarksFilePath - complete path to landmarks filepublic static void saveLandmarks(String landmarksFilePath)
landmarksFilePath - complete path to output landmark filepublic static void showLandmarks()
public static void loadElasticTransform(String transfPath, String targetTitle, String sourceTitle)
transfPath - complete path to elastic transform filetargetTitle - title of the target imagesourceTitle - title of the source imagepublic static void loadRawTransform(String transfPath, String targetTitle, String sourceTitle)
transfPath - complete path to raw transform filetargetTitle - title of the target imagesourceTitle - title of the source imagepublic static void applyRawTransformToSource(String transfPath, ij.ImagePlus targetImp, ij.ImagePlus sourceImp)
transfPath - complete path to raw transform filetargetImp - target imagesourceImp - source imagepublic static void compareOppositeElasticTransforms(String directTransfPath, String inverseTransfPath, String targetTitle, String sourceTitle)
directTransfPath - complete path to direct elastic transform fileinverseTransfPath - complete path to inverse elastic transform filetargetTitle - title of the target imagesourceTitle - title of the source imagepublic static void compareElasticRawTransforms(String elasticTransfPath, String rawTransfPath, String targetTitle, String sourceTitle)
elasticTransfPath - complete path to elastic transform filerawTransfPath - complete path to raw transform filetargetTitle - target image titlesourceTitle - source image titlepublic static void compareRawTransforms(String rawTransfPath1, String rawTransfPath2, String targetTitle, String sourceTitle)
rawTransfPath1 - complete path to first raw transform filerawTransfPath2 - complete path to second raw transform filetargetTitle - title of the target imagesourceTitle - title of the source imagepublic static void convertToRaw(String elasticTransfPath, String rawTransfPath, String targetTitle)
elasticTransfPath - complete path to input elastic transform filerawTransfPath - complete path to output raw transform filetargetTitle - title of the target imagepublic static void convertToElastic(String rawTransfPath, String elasticTransfPath, String strIntervals, String targetTitle)
rawTransfPath - complete path to input raw transform fileelasticTransfPath - complete path to output elastic transform filestrIntervals - number of intervals in the B-spline gridtargetTitle - title of the target imagepublic static void composeElasticTransforms(String elasticTransfPath1, String elasticTransfPath2, String rawTransfPath, String targetTitle)
elasticTransfPath1 - complete path to first elastic transform fileelasticTransfPath2 - complete path to second elastic transform filerawTransfPath - complete path to output raw transform filetargetTitle - title of the target imagepublic static void composeRawTransforms(String rawTransfPath1, String rawTransfPath2, String outputRawTransfPath, String targetTitle)
rawTransfPath1 - complete path to first raw transform filerawTransfPath2 - complete path to second raw transform fileoutputRawTransfPath - complete path to output raw transform filetargetTitle - title of the target imagepublic static void composeRawElasticTransforms(String rawTransfPath, String elasticTransfPath, String outputRawTransfPath, String targetTitle, String sourceTitle)
rawTransfPath - complete path to raw transform fileelasticTransfPath - complete path to elastic transform fileoutputRawTransfPath - complete path to output raw transform filetargetTitle - title of the target imagesourceTitle - title of the source imagepublic static void adaptCoefficients(String inputTransfPath, String strImageFactor, String outputTransfPath)
inputTransfPath - complete path to input transform filestrImageFactor - string containing the image factor to applyoutputTransfPath - complete path to output transform filepublic static void loadSourceMask(String sourceMaskPath)
sourceMaskPath - complete path to source mask imagepublic static void loadSourceAffineMatrix(String affineMatrixPath)
affineMatrixPath - complete path to affine matrix file.public static void invertRawTransform(String inputTransfPath, String outputTransfPath, String targetTitle)
inputTransfPath - complete path to input raw transform fileoutputTransfPath - complete path to output raw transform filetargetTitle - target image titlepublic static MainDialog getMainDialog()
Copyright © 2015–2021 Fiji. All rights reserved.