Bsoft  2.1.0
Bernard's software package
mg_helix.h File Reference

Header file for functions to process helical data. More...

#include "mg_processing.h"
#include "rwimg.h"

Go to the source code of this file.

Functions

double * filament_profile (Bfilnode *fnode, Bimage *p, long img_num, int id, double width, long &n)
 Calculates a filament profile and node profile. More...
 
double filaments_center (Bfilament *fillist, Bimage *p, long img_num, int filament_width)
 Centers filament nodes in a micrograph. More...
 
double project_center_filaments (Bproject *project, int filament_width)
 Centers filament nodes in all micrographs in a project. More...
 
int project_filament_powerspectrum (Bproject *project, int pad, int rotated, Bstring &path)
 Calculates and average power spectrum from filaments. More...
 
Bimage * project_filament_density (Bproject *project, int filament_width)
 Extracts filament images from micrographs defined in a project and estimates their density per length. More...
 
int mg_generate_layer_lines (Bmicrograph *mg, int rad_lim)
 Generates layer lines given the unit cell vectors. More...
 
int img_mask_layer_lines (Bimage *p, Blayerline *layer_line, float helix_axis, float width)
 Masks the image using the list of layer lines. More...
 
double * img_extract_layer_line (Bimage *p, Blayerline *line, float helix_axis, int length)
 Extracts one layer line from an image. More...
 
int mg_extract_show_layer_lines (Bmicrograph *mg, int length, int show)
 Extracts and prints layer lines from an image with corresponding Bessel functions. More...
 

Detailed Description

Header file for functions to process helical data.

Author
Bernard Heymann
Date
Created: 20061110
Modified: 20151227

Definition in file mg_helix.h.

Function Documentation

◆ filament_profile()

double* filament_profile ( Bfilnode *  fnode,
Bimage *  p,
long  img_num,
int  id,
double  width,
long &  n 
)

Calculates a filament profile and node profile.

Parameters
*fnodenode list.
*pimage with filament.
img_numsub-image number.
ididentifier of selected node.
widthwidth of box around filament.
&nnumber of elements in the profile.
Returns
double* two profile arrays, each length n.
A filament image is extracted from the micrograph along a spline through
the nodes. The overall profile and the profile around a specified node
are calculated and returned in a single array.
It only works for 2D images.

Definition at line 39 of file mg_helix.cpp.

◆ filaments_center()

double filaments_center ( Bfilament *  fillist,
Bimage *  p,
long  img_num,
int  filament_width 
)

Centers filament nodes in a micrograph.

Parameters
*fillistlist of filaments.
*pimage with filament.
img_numsub-image number.
filament_widthwidth of box around filament.
Returns
double average correlation coefficient.
The profile for each node is calculated and centered by cross-correlation
with the mirrored profile.

Definition at line 190 of file mg_helix.cpp.

◆ img_extract_layer_line()

double* img_extract_layer_line ( Bimage *  p,
Blayerline *  line,
float  helix_axis,
int  length 
)

Extracts one layer line from an image.

Parameters
*ppower spectrum.
*linelayer line.
helix_axishelix axis angle.
lengthlength of line.
Returns
double* array with line values.

Definition at line 551 of file mg_helix.cpp.

◆ img_mask_layer_lines()

int img_mask_layer_lines ( Bimage *  p,
Blayerline *  layer_line,
float  helix_axis,
float  width 
)

Masks the image using the list of layer lines.

Parameters
*pcomplex image.
*layer_linelayer line list.
helix_axishelix axis angle.
widthwidth of mask for a line.
Returns
int number of lines or error code.

Definition at line 499 of file mg_helix.cpp.

◆ mg_extract_show_layer_lines()

int mg_extract_show_layer_lines ( Bmicrograph *  mg,
int  length,
int  show 
)

Extracts and prints layer lines from an image with corresponding Bessel functions.

Parameters
*mgmicrograph.
lengthlength of line.
showshow: 1=extracted layer lines, 2=Bessel functions, 3=both
Returns
int 0.

Definition at line 580 of file mg_helix.cpp.

◆ mg_generate_layer_lines()

int mg_generate_layer_lines ( Bmicrograph *  mg,
int  rad_lim 
)

Generates layer lines given the unit cell vectors.

Parameters
*mgmicrograph.
rad_limlayer line radial limit.
Returns
int number of layer lines generated, <0 on error.
The structure factor location is given by:
    x = uh + vk
where u and v are the unit cell vectors,
and h and k are the associated Miller indices.

Definition at line 456 of file mg_helix.cpp.

◆ project_center_filaments()

double project_center_filaments ( Bproject *  project,
int  filament_width 
)

Centers filament nodes in all micrographs in a project.

Parameters
*projectproject object.
filament_widthwidth of box around filament.
Returns
double average correlation coefficient.
The profile for each node is calculated and centered by cross-correlation
with the mirrored profile.

Definition at line 221 of file mg_helix.cpp.

◆ project_filament_density()

Bimage* project_filament_density ( Bproject *  project,
int  filament_width 
)

Extracts filament images from micrographs defined in a project and estimates their density per length.

Parameters
*projectmicrograph project.
filament_widthextracted filament width.
Returns
Bimage* image with all densities.

Definition at line 375 of file mg_helix.cpp.

◆ project_filament_powerspectrum()

int project_filament_powerspectrum ( Bproject *  project,
int  pad,
int  rotated,
Bstring &  path 
)

Calculates and average power spectrum from filaments.

Parameters
*projectproject parameter structure.
padadditional padding before transformation.
rotatedflag to indicate if particles are already rotated.
&pathpath to write power spectra.
Returns
int 0.
Particles derived from picked filaments are extracted and transformed
to orient the helical axis along the x-axis. These images are then
Fourier transformed and their power spectra averaged.
One average per micrograph is calculated.
Requirements: The filaments must be picked and converted to particle locations.

Definition at line 278 of file mg_helix.cpp.