public class Align2D
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FILL_AVG
Description of the Field
|
static int |
FILL_NOISE
Description of the Field
|
static int |
FILL_NONE
Description of the Field
|
protected Roi |
selection
Description of the Field
|
protected boolean |
show
Description of the Field
|
protected int |
sizex
Description of the Field
|
protected int |
sizey
Description of the Field
|
protected int |
sizez
Description of the Field
|
Constructor and Description |
---|
Align2D(ImageStack stack)
Constructor for the Align2D object
|
Modifier and Type | Method and Description |
---|---|
void |
addRotation(int img,
double angleDeg)
Adds a feature to the Rotation attribute of the Align2D object
|
void |
addTranslation(int img,
int tx,
int ty)
Adds a feature to the Translation attribute of the Align2D object
|
void |
align2D(ImageProcessor img1,
int index2,
double rangeangle,
double incrementangle)
Description of the Method
|
ImageProcessor |
average(boolean[] using)
average images using a selection
|
double |
average(int nbimg)
Description of the Method
|
ArrayUtil[] |
basicTranslation(ArrayUtil[] points)
Description of the Method
|
ArrayUtil[] |
centerFeatures(ArrayUtil[] points)
Description of the Method
|
void |
changeImage(int img,
ImageProcessor ip)
Description of the Method
|
void |
changeStack(ImageStack pile)
changes the ImageStack on which alignment is performed
|
void |
computeRotation(boolean polar,
double range,
double angleprecision)
compute the rotation for the images.
|
void |
computeRotation(double range,
double angleprecision)
compute the rotation for the images.
|
static double |
computeRotation2Images(ImageProcessor img1,
ImageProcessor img2,
double range,
double angleprecision)
compute the rotation between 2 images in space domain
the second image is rotated in the allowed range and the rotation obtaining the best correlation coefficient is returned |
static double |
computeRotation2ImagesFHT(ImageProcessor image1,
ImageProcessor image2,
double range,
double angleprecision)
compute the rotation between 2 images using the Fourier Transform.
use the power spectrum to be free of translation then convert to polar coordinate to compute rotation with cross-correlation |
void |
computeRotationOld(double range,
double angleprecision)
Description of the Method
|
static double |
correlation(ImageProcessor img1,
ImageProcessor img2,
double rayonmaxx,
double rayonmaxy)
compute the correlation between 2 images
|
static Voxel3D |
crossCorrelation(ImageProcessor img1,
ImageProcessor img2)
computes the crosscorrelation between 2 images using FFT
|
static Voxel3D |
crossCorrelation(ImageProcessor img1,
ImageProcessor img2,
int maxX,
int maxY)
compute the crosscorrelation between 2 images with a maximum translation of
(maxX,maxY)
|
void |
deleteImage(int image)
Description of the Method
|
ImageProcessor |
doRFA(double rangeangle,
double incrementangle)
align all images using RFA procedure (Penczek 1992)
|
ImageProcessor |
getImage(int img)
Gets the image attribute of the Align2D object
|
ImageProcessor |
getImage(int img,
boolean applytransform)
Gets the image attribute of the Align2D object
|
ImageProcessor |
getImage(int img,
boolean applytransform,
int fill)
Gets the image attribute of the Align2D object
|
ImageStack |
getInStack(ImageStack stack,
boolean applytransform,
int fill)
gets the images on which the alignment is performed in the given stack
the images could be with or without alignement beware there is always a duplication of the images (even if not applying alignment) |
Align2D |
getPart(int indexstart,
int increment,
int nbimages)
Gets the part attribute of the Align2D object
|
float |
getPixelValue(int img,
int x,
int y)
Gets the pixelValue attribute of the Align2D object
|
Roi |
getRoi()
Gets the roi attribute of the Align2D object
|
double |
getRotation(int img)
Gets the rotation attribute of the Align2D object
|
ImageStack |
getStack(boolean applytransform,
int fill)
gets the images on which the alignment is performed
the images could be with or without alignement beware there is always a duplication of the images (even if not applying alignment) |
int |
getTx(int img)
Gets the translation on X Axis for an image
|
int |
getTy(int img)
Gets the translation on Y Axis for an image
|
ImageProcessor |
insert2(ImageProcessor G,
int rayon,
boolean up)
Description of the Method
|
ArrayUtil[] |
meanSquare(ArrayUtil[] points)
Description of the Method
|
void |
reset()
Description of the Method
|
void |
setRoi(Roi sel)
Sets the roi attribute of the Align2D object
|
void |
setRotation(int img,
double angleDeg)
Sets the rotation attribute of the Align2D object
|
void |
setStack(ImageStack pile)
Sets the images to work with
|
void |
setTranslation(int img,
int tx,
int ty)
Sets the translation attribute of the Align2D object
|
void |
setTx(int img,
int value)
Gets the translation on X Axis for an image
|
void |
setTy(int img,
int value)
Gets the translation on Y Axis for an image
|
void |
showInIJ(boolean value)
shows progress of computing in the status bar of ImageJ
|
double |
sigma(int img,
double avg)
Description of the Method
|
static ImageProcessor |
toPolar(ImageProcessor img,
double range,
double angleprecision)
convert image to the polar coordinate system
all angles are not taken, only those between +/- range |
void |
XCorr()
crosscorrelation of all images
|
ArrayUtil[] |
XCorr(ArrayUtil[] points)
Description of the Method
|
protected boolean show
protected int sizex
protected int sizey
protected int sizez
protected Roi selection
public static int FILL_NONE
public static int FILL_AVG
public static int FILL_NOISE
public Align2D(ImageStack stack)
stack
- the stack to registerpublic void showInIJ(boolean value)
value
- true for showing (by default in constructor) false otherwisepublic void setStack(ImageStack pile)
pile
- The new ImageStack on which perform alignmentpublic void changeStack(ImageStack pile)
pile
- the new ImageStack on which the alignment is computed beware
the previous alignment is not deletedpublic ImageStack getStack(boolean applytransform, int fill)
applytransform
- true for registered versionfill
- Description of the Parameterpublic ImageStack getInStack(ImageStack stack, boolean applytransform, int fill)
stack
- stack in which inserting the aligned imagesapplytransform
- true for registered versionfill
- Description of the Parameterpublic ImageProcessor getImage(int img, boolean applytransform)
img
- Description of the Parameterapplytransform
- Description of the Parameterpublic ImageProcessor getImage(int img, boolean applytransform, int fill)
img
- Description of the Parameterapplytransform
- Description of the Parameterfill
- Description of the Parameterpublic ImageProcessor getImage(int img)
img
- Description of the Parameterpublic void changeImage(int img, ImageProcessor ip)
img
- Description of the Parameterip
- Description of the Parameterpublic float getPixelValue(int img, int x, int y)
img
- Description of the Parameterx
- Description of the Parametery
- Description of the Parameterpublic Align2D getPart(int indexstart, int increment, int nbimages)
indexstart
- Description of the Parameternbimages
- Description of the Parameterincrement
- Description of the Parameterpublic void setRoi(Roi sel)
sel
- The new roi valuepublic Roi getRoi()
public void reset()
public void deleteImage(int image)
image
- Description of the Parameterpublic int getTx(int img)
img
- image number in the serie ... be careful start at 0 not 1public int getTy(int img)
img
- image number in the serie ... be careful start at 0 not 1public double getRotation(int img)
img
- Description of the Parameterpublic void setTx(int img, int value)
img
- image number in the serie ... be careful start at 0 not 1value
- The new tx valuepublic void setTy(int img, int value)
img
- image number in the serie ... be careful start at 0 not 1value
- The new ty valuepublic void setTranslation(int img, int tx, int ty)
img
- The new translation valuetx
- The new translation valuety
- The new translation valuepublic void addTranslation(int img, int tx, int ty)
img
- The feature to be added to the Translation attributetx
- The feature to be added to the Translation attributety
- The feature to be added to the Translation attributepublic void setRotation(int img, double angleDeg)
img
- The new rotation valueangleDeg
- The new rotation valuepublic void addRotation(int img, double angleDeg)
img
- The feature to be added to the Rotation attributeangleDeg
- The feature to be added to the Rotation attributepublic ArrayUtil[] XCorr(ArrayUtil[] points)
points
- Description of the Parameterpublic void XCorr()
public ImageProcessor insert2(ImageProcessor G, int rayon, boolean up)
G
- Description of the Parameterrayon
- Description of the Parameterup
- Description of the Parameterpublic ArrayUtil[] meanSquare(ArrayUtil[] points)
points
- Description of the Parameterpublic ArrayUtil[] basicTranslation(ArrayUtil[] points)
points
- Description of the Parameterpublic ArrayUtil[] centerFeatures(ArrayUtil[] points)
points
- Description of the Parameterpublic double average(int nbimg)
nbimg
- Description of the Parameterpublic double sigma(int img, double avg)
avg
- Description of the Parameterimg
- Description of the Parameterpublic static Voxel3D crossCorrelation(ImageProcessor img1, ImageProcessor img2)
img1
- first image (reference)img2
- second imagepublic static Voxel3D crossCorrelation(ImageProcessor img1, ImageProcessor img2, int maxX, int maxY)
img1
- reference imageimg2
- image to translatemaxX
- maximum translation on X axismaxY
- maximum translation on Y axispublic static double computeRotation2ImagesFHT(ImageProcessor image1, ImageProcessor image2, double range, double angleprecision)
image1
- reference imageimage2
- image to rotaterange
- the rotation computed will be between [-range,+range[angleprecision
- the precision wanted (1 for degrees precision, 0.1
for decidegrees precision)public static ImageProcessor toPolar(ImageProcessor img, double range, double angleprecision)
img
- image to convert (not modified)range
- the rotation taken for new image will be between
[-range,+range[angleprecision
- the precision wanted (1 for degrees precision, 0.1
for decidegrees precision)public static double computeRotation2Images(ImageProcessor img1, ImageProcessor img2, double range, double angleprecision)
img1
- Description of the Parameterimg2
- Description of the Parameterrange
- the rotation computed will be between [-range,+range[angleprecision
- the precision wanted (1 for degrees precision, 0.1
for decidegrees precision)public void computeRotation(double range, double angleprecision)
range
- the rotations computed will be between
[-range,+range[angleprecision
- the precision wanted (1 for degrees precision, 0.1
for decidegrees precision)public void computeRotation(boolean polar, double range, double angleprecision)
polar
- true if computation in fourier space false for
computation in real spacerange
- the rotations computed will be between
[-range,+range[angleprecision
- the precision wanted (1 for degrees precision, 0.1
for decidegrees precision)public void computeRotationOld(double range, double angleprecision)
range
- Description of the Parameterangleprecision
- Description of the Parameterpublic static double correlation(ImageProcessor img1, ImageProcessor img2, double rayonmaxx, double rayonmaxy)
img1
- first imageimg2
- second imagerayonmaxx
- maximum radius on X axis to take pixels into accountrayonmaxy
- maximum radius on Y axis to take pixels into accountpublic ImageProcessor average(boolean[] using)
using
- array containing true for all images that are added to the
averagepublic ImageProcessor doRFA(double rangeangle, double incrementangle)
rangeangle
- Description of the Parameterincrementangle
- Description of the Parameterpublic void align2D(ImageProcessor img1, int index2, double rangeangle, double incrementangle)
img1
- Description of the Parameterindex2
- Description of the Parameterrangeangle
- Description of the Parameterincrementangle
- Description of the Parameter