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

Dealing with images with helical symmetry. More...

#include "rwimg.h"
#include "ps_plot.h"

Go to the source code of this file.

Functions

Bplot * img_find_helix_parameters (Bimage *p, double angle_start, double angle_end, double angle_step, int bin, double hires, double lores, double radius)
 Finds the best helix parameters for helical map. More...
 
Bplot * img_find_helix_parameters (Bimage *p, double rise_start, double rise_end, double rise_step, double angle_start, double angle_end, double angle_step, int bin, double radius)
 Finds the best helix parameters for helical map. More...
 
Bplot * img_helix_segment_correlation (Bimage *p, int thickness, double angle_start, double angle_end, double angle_step, int bin, double hires, double lores, double radius)
 Calculates the correlation over rotation angles between helical segments. More...
 
int img_distort_elliptically (Bimage *p, double angle, double shift)
 Transforms a tubular cylinder to an elliptical profile. More...
 
Bimage * img_helical_cross_section (Bimage *p, double helix_rise, double helix_angle, double scale, double hires)
 Calculates a helical cross section from line transforms of a filament. More...
 
double img_snvariance (Bimage *p, double snradius)
 Calculates the ratio of variance inside and outside a given radius. More...
 
int img_extrude_cross_section (Bimage *p, int length, double helix_rise, double helix_angle, int fill_type, double fill)
 Extrudes a 2D cross section into a 3D continuous helix. More...
 
Bplot * img_filament_width (Bimage *p, int width, int lim_lo, int lim_hi)
 Estimates the width of a filament. More...
 
Bimage * img_filament_density (Bimage *p, double width)
 Estimates the density per pixel length of a filament. More...
 

Detailed Description

Dealing with images with helical symmetry.

Author
Bernard Heymann
Date
Created: 20021127
Modified: 20150718

Definition in file img_helix.h.

Function Documentation

int img_distort_elliptically ( Bimage *  p,
double  angle,
double  shift 
)

Transforms a tubular cylinder to an elliptical profile.

Parameters
*p3D image.
angleangle of elliptical maximum.
shiftoutward shift at elliptical maximum radius.
Returns
int 0.
The density is shifted towards or away from the origin by a specific
amount and in a direction determined by an elliptical profile.

Definition at line 489 of file img_helix.cpp.

int img_extrude_cross_section ( Bimage *  p,
int  length,
double  helix_rise,
double  helix_angle,
int  fill_type,
double  fill 
)

Extrudes a 2D cross section into a 3D continuous helix.

Parameters
*pimage (converted to floating point).
lengthlength in z.
helix_risehelical subunit rise in angstrom.
helix_anglehelical subunit rotation in radians.
fill_typeFILL_AVERAGE, FILL_BACKGROUND, FILL_USER.
fillvalue of edge voxels.
Returns
int 0.
The helical axis is at the origin and alongthe a axis.

Definition at line 782 of file img_helix.cpp.

Bimage* img_filament_density ( Bimage *  p,
double  width 
)

Estimates the density per pixel length of a filament.

Parameters
*pthe image with the filament along the y axis.
widthfilament width (pixels).
Returns
Bimage* one dimensional image with line integrals.
The filament axis must be along the long axis (x or y).
The filament width must be about half of the image width.
The background is calculated for each line from the regions 
outside the width of the filament and subtracted from all
values in the line.

Definition at line 941 of file img_helix.cpp.

Bplot* img_filament_width ( Bimage *  p,
int  width,
int  lim_lo,
int  lim_hi 
)

Estimates the width of a filament.

Parameters
*pthe image with the filament along the y axis.
widthwindow size.
lim_lominimum filament width.
lim_himaximum filament width.
Returns
Bplot* plot of filament widths.
The filament axis must be along the y axis.

Definition at line 837 of file img_helix.cpp.

Bplot* img_find_helix_parameters ( Bimage *  p,
double  angle_start,
double  angle_end,
double  angle_step,
int  bin,
double  hires,
double  lores,
double  radius 
)

Finds the best helix parameters for helical map.

Parameters
*pimage to be tested.
angle_startstart value for angle.
angle_endend value for angle.
angle_stepstep size for angle.
binbin image for faster searching (limited to 1,2,3).
hireshigh resolution limit in angstroms.
loreslow resolution limit in angstroms.
radiusradius for mask (voxels).
Returns
Bplot* plot with search results.
An incremental search is done for the rotation angle, with the rise
inferred from the cross-correlation shift.

Definition at line 37 of file img_helix.cpp.

Bplot* img_find_helix_parameters ( Bimage *  p,
double  rise_start,
double  rise_end,
double  rise_step,
double  angle_start,
double  angle_end,
double  angle_step,
int  bin,
double  radius 
)

Finds the best helix parameters for helical map.

Parameters
*pimage to be tested.
rise_startstart value for rise.
rise_endend value for rise.
rise_stepstep size for rise.
angle_startstart value for angle.
angle_endend value for angle.
angle_stepstep size for angle.
binbin image for faster searching (limited to 1,2,3).
radiusradius for mask (voxels).
Returns
Bplot* plot with search results.
An incremental search is done for the rise and rotation angle.

Definition at line 189 of file img_helix.cpp.

Bimage* img_helical_cross_section ( Bimage *  p,
double  helix_rise,
double  helix_angle,
double  scale,
double  hires 
)

Calculates a helical cross section from line transforms of a filament.

Parameters
*pimage (converted to floating point).
helix_risehelical subunit rise in angstrom.
helix_anglehelical subunit rotation in radians.
scalescale of cross section.
hireshigh resolution limit.
Returns
Bimage* 2D cross section image.
The filament image must be oriented with the helical axis coinciding with 
the y axis. Each row of pixels is transformed and written into a
2D transform based on an orientation calculated from given helical
parameters.

Definition at line 607 of file img_helix.cpp.

Bplot* img_helix_segment_correlation ( Bimage *  p,
int  thickness,
double  angle_start,
double  angle_end,
double  angle_step,
int  bin,
double  hires,
double  lores,
double  radius 
)

Calculates the correlation over rotation angles between helical segments.

Parameters
*pimage to be tested.
thicknesssegment thickness.
angle_startstart value for angle.
angle_endend value for angle.
angle_stepstep size for angle.
binbin image for faster searching (limited to 1,2,3).
hireshigh resolution limit in angstroms.
loreslow resolution limit in angstroms.
radiusradius for mask (voxels).
Returns
Bplot* plot with coefficients over all rotations results.
The image is split up into segments in the z direction. Every adjacent pair
of segments are cross-correlated over an angular range to find the best
rotation. The cross-correlation can be resolution-limited. The image may
also be masked beyond a radius and binned to speed up execution.

Definition at line 368 of file img_helix.cpp.

double img_snvariance ( Bimage *  p,
double  snradius 
)

Calculates the ratio of variance inside and outside a given radius.

Parameters
*pimage (converted to floating point).
snradiusradius of signal.
Returns
double the SNR.
The region outside the radial limit is considered noise and the region
inside is considered signal plus noise.

Definition at line 717 of file img_helix.cpp.