|
Bsoft
1.9
Bernard's software package
|
Library routines for radial transformations and calculations. More...
#include "img_radial.h"#include "Matrix.h"#include "trigonometry.h"#include "simplex.h"#include "utilities.h"Go to the source code of this file.
Functions | |
| double | img_radial_R (Bsimplex *simp) |
| Bimage * | img_radial (Bimage *p, double minrad, double maxrad, double rad_step, int wrap, double ellipticity, double angle, double threshold, Bimage *pmask) |
| Calculates the elliptical radial average or volume of an image. More... | |
| Bimage * | img_radial_average (Bimage *p, int minrad, int maxrad, int wrap) |
| Bimage * | img_radial_average (Bimage *p, double minrad, double maxrad, double rad_step, int wrap) |
| Calculates the radial average of an image. More... | |
| Bimage * | img_radial_average (Bimage *p, double minrad, double maxrad, double rad_step, int wrap, Bimage *pmask) |
| Bimage * | img_elliptical_average (Bimage *p, int rmin, int rmax, double ellipticity, double ellipse_angle) |
| Calculates the elliptical average of an image. More... | |
| Bimage * | img_directional_average (Bimage *p, double angle, double minrad, double maxrad, double rad_step) |
| Calculates the radial average of an image. More... | |
| Bimage * | img_directional_average (Bimage *p, double angle, double minrad, double maxrad, double rad_step, Bimage *pmask) |
| Bimage * | img_radial_to_full (Bimage *prad, Vector3< int > size, Vector3< float > origin) |
| Generates a full 2D or 3D image from a radial profile in a 1D image. More... | |
| float * | img_radial_fit (Bimage *p, Bimage *pref) |
| Fits a radial profile to a reference radial profile. More... | |
Variables | |
| int | verbose |
Library routines for radial transformations and calculations.
Definition in file img_radial.cpp.
| Bimage* img_directional_average | ( | Bimage * | p, |
| double | angle, | ||
| double | minrad, | ||
| double | maxrad, | ||
| double | rad_step | ||
| ) |
Calculates the radial average of an image.
| *p | 3D image. |
| angle | direction angle. |
| minrad | minimum radius in angstrom. |
| maxrad | maximum radius in angstrom. |
| rad_step | step size in angstrom. |
Radial averages parallel and perpendicular to a given direction defined by an angle in the xy plane is calculated between a minimum and maximum radius. An interpolative method is used where the value of a voxel is distributed between the two nearest radial annuli. The final sum in an annulus is normalized by the number of voxels contributing to the annulus sum. The origins within the sub-image structures are used.
Definition at line 411 of file img_radial.cpp.
| Bimage* img_directional_average | ( | Bimage * | p, |
| double | angle, | ||
| double | minrad, | ||
| double | maxrad, | ||
| double | rad_step, | ||
| Bimage * | pmask | ||
| ) |
Definition at line 417 of file img_radial.cpp.
| Bimage* img_elliptical_average | ( | Bimage * | p, |
| int | rmin, | ||
| int | rmax, | ||
| double | ellipticity, | ||
| double | ellipse_angle | ||
| ) |
Calculates the elliptical average of an image.
| *p | 2D image. |
| rmin | minimum radius in angstrom. |
| rmax | maximum radius in angstrom. |
| ellipticity | step size in angstrom. |
| ellipse_angle | wrapping around image boundaries. |
An elliptical average of a 2D image is calculated between a minimum
and maximum radius. An interpolative method is used where the value of
a voxel is distributed between the two nearest radial annuli.
The eeffective radius is:
r = sqrt(x*x+y*y) * sqrt(ellmax*cos(a)*cos(a) + ellmin*sin(a)*sin(a))
a = atan2(y,x) - ellipse_angle
ellmin = 1 - ellipticity
ellmax = 1 + ellipticity
The final sum in an annulus is normalized by the number of voxels
contributing to the annulus sum.
The origins within the sub-image structures are used. Definition at line 320 of file img_radial.cpp.
| Bimage* img_radial | ( | Bimage * | p, |
| double | minrad, | ||
| double | maxrad, | ||
| double | rad_step, | ||
| int | wrap, | ||
| double | ellipticity, | ||
| double | angle, | ||
| double | threshold, | ||
| Bimage * | pmask | ||
| ) |
Calculates the elliptical radial average or volume of an image.
| *p | image. |
| minrad | minimum radius in angstrom. |
| maxrad | maximum radius in angstrom. |
| rad_step | step size in angstrom. |
| wrap | wrapping around image boundaries. |
| ellipticity | ratio of major and minor axes. |
| angle | angle of major axis. |
| threshold | threshold above which the volume is included. |
| *pmask | mask defining the region to be used. |
An elliptical radial average or volume of a 2D or 3D image is calculated between a minimum and maximum radius. An interpolative method is used where the value of a voxel is distributed between the two nearest radial annuli. When a threshold larger than the minimum in the image is specified, the volume above the threshold is counted. The final sum in an annulus is normalized by the number of voxels contributing to the annulus sum. The origins within the sub-image structures are used with or without wrapping.
Definition at line 45 of file img_radial.cpp.
Definition at line 155 of file img_radial.cpp.
Calculates the radial average of an image.
| *p | 3D image. |
| minrad | minimum radius in angstrom. |
| maxrad | maximum radius in angstrom. |
| rad_step | step size in angstrom. |
| wrap | wrapping around image boundaries. |
A radial average of a 2D or 3D image is calculated between a minimum and maximum radius. An interpolative method is used where the value of a voxel is distributed between the two nearest radial annuli. The final sum in an annulus is normalized by the number of voxels contributing to the annulus sum. The origins within the sub-image structures are used.
Definition at line 177 of file img_radial.cpp.
| Bimage* img_radial_average | ( | Bimage * | p, |
| double | minrad, | ||
| double | maxrad, | ||
| double | rad_step, | ||
| int | wrap, | ||
| Bimage * | pmask | ||
| ) |
Definition at line 183 of file img_radial.cpp.
Fits a radial profile to a reference radial profile.
| *p | radial profile as a 1D image. |
| *pref | reference radial profile as a 1D image. |
A radial profile is fitted to a reference profile using an iterative
simplex down-hill method. The equations solved are:
x(new) = x(old)*m
y(new) = y(old)*a + b
where m is the dimension scaling (or magnification).
a is the amplitude scaling.
b is the amplitude shift. Definition at line 598 of file img_radial.cpp.
| double img_radial_R | ( | Bsimplex * | simp | ) |
Definition at line 694 of file img_radial.cpp.
Generates a full 2D or 3D image from a radial profile in a 1D image.
| *prad | 1D radial image. |
| size | size of image to expand to. |
| origin | origin for radial profile. |
It assumes the resultant image is square or cubic.
Definition at line 525 of file img_radial.cpp.
| int verbose |