| Bsoft 1.9 Bernard's software package

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions | Variables
img_radial.cpp File Reference

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

## Detailed Description

Library routines for radial transformations and calculations.

Author
  Bernard Heymann

Date
  Created: 19990904
  Modified: 20150508

Definition in file img_radial.cpp.

## 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

  *p | 3D image.
  angle | direction angle.
  minrad | minimum radius in angstrom.
  maxrad | maximum radius in angstrom.
  rad_step | step 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

  *p | 2D image.
  rmin | minimum radius in angstrom.
  rmax | maximum radius in angstrom.
  ellipticity | step size in angstrom.
  ellipse_angle | wrapping 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

  *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.

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

  *p | 3D image.
  minrad | minimum radius in angstrom.
  maxrad | maximum radius in angstrom.
  rad_step | step size in angstrom.
  wrap | wrapping 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

  *p | radial profile as a 1D image.
  *pref | reference 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.

double img_radial_R | ( | Bsimplex * | simp | ) |

Definition at line 694 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

  *prad | 1D radial image.
  size | size of image to expand to.
  origin | origin 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.

## Variable Documentation

int verbose