Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
img_radial.h File Reference

Library routines for radial transformations and calculations. More...

#include "rwimg.h"

Go to the source code of this file.

Functions

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_elliptical_average (Bimage *p, int rmin, int rmax, double ellipticity, double ellipse_angle)
 Calculates the elliptical average of an image. More...
 
Bimage * img_radial_average (Bimage *p, double minrad, double maxrad, double rad_step, int wrap, Bimage *pmask)
 
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...
 

Detailed Description

Library routines for radial transformations and calculations.

Author
Bernard Heymann
Date
Created: 19990904
Modified: 20130904

Definition in file img_radial.h.

Function Documentation

Bimage* img_directional_average ( Bimage *  p,
double  angle,
double  minrad,
double  maxrad,
double  rad_step 
)

Calculates the radial average of an image.

Parameters
*p3D image.
angledirection angle.
minradminimum radius in angstrom.
maxradmaximum radius in angstrom.
rad_stepstep size in angstrom.
Returns
Bimage* radial directional averages in the form of a n x 2 image.
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.

Parameters
*p2D image.
rminminimum radius in angstrom.
rmaxmaximum radius in angstrom.
ellipticitystep size in angstrom.
ellipse_anglewrapping around image boundaries.
Returns
Bimage* elliptical average in the form of a 1D image.
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.

Parameters
*pimage.
minradminimum radius in angstrom.
maxradmaximum radius in angstrom.
rad_stepstep size in angstrom.
wrapwrapping around image boundaries.
ellipticityratio of major and minor axes.
angleangle of major axis.
thresholdthreshold above which the volume is included.
*pmaskmask defining the region to be used.
Returns
Bimage* eliptical average in the form of a 1D image.
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.

Bimage* img_radial_average ( Bimage *  p,
int  minrad,
int  maxrad,
int  wrap 
)

Definition at line 155 of file img_radial.cpp.

Bimage* img_radial_average ( Bimage *  p,
double  minrad,
double  maxrad,
double  rad_step,
int  wrap 
)

Calculates the radial average of an image.

Parameters
*p3D image.
minradminimum radius in angstrom.
maxradmaximum radius in angstrom.
rad_stepstep size in angstrom.
wrapwrapping around image boundaries.
Returns
Bimage* radial average in the form of a 1D image.
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.

float* img_radial_fit ( Bimage *  p,
Bimage *  pref 
)

Fits a radial profile to a reference radial profile.

Parameters
*pradial profile as a 1D image.
*prefreference radial profile as a 1D image.
Returns
float* 3-value result vector: dimension scale, amplitude scale and amplitude shift.
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.

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.

Parameters
*prad1D radial image.
sizesize of image to expand to.
originorigin for radial profile.
Returns
Bimage* new 2D or 3D image.
It assumes the resultant image is square or cubic.

Definition at line 525 of file img_radial.cpp.