| Bsoft 2.0.5 Bernard's software package

Functions | Variables
mg_helix.cpp File Reference

Functions to process helical data. More...

`#include "Bimage.h"`
`#include "mg_processing.h"`
`#include "mg_img_proc.h"`
`#include "mg_helix.h"`
`#include "mg_extract.h"`
`#include "spline.h"`
`#include "linked_list.h"`
`#include "Complex.h"`
`#include "utilities.h"`
`#include "timer.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 | nodes_center (Bfilnode *fnode, Bimage *p, long img_num, int width)
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...

## Variables
int | verbose

## Detailed Description

Functions to process helical data.

Author
  Bernard Heymann

Date
  Created: 20061110
  Modified: 20170623

Definition in file mg_helix.cpp.

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

  *fnode | node list.
  *p | image with filament.
  img_num | sub-image number.
  id | identifier of selected node.
  width | width of box around filament.
  &n | number 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

  *fillist | list of filaments.
  *p | image with filament.
  img_num | sub-image number.
  filament_width | width 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

  *p | power spectrum.
  *line | layer line.
  helix_axis | helix axis angle.
  length | length 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

  *p | complex image.
  *layer_line | layer line list.
  helix_axis | helix axis angle.
  width | width 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

  *mg | micrograph.
  length | length of line.
  show | show: 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

  *mg | micrograph.
  rad_lim | layer 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.

## ◆ nodes_center()

double nodes_center | ( | Bfilnode * | fnode,
|  | Bimage * | p,
|  | long | img_num,
|  | int | width
| ) |  |

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

  *project | project object.
  filament_width | width 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

  *project | micrograph project.
  filament_width | extracted 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

  *project | project parameter structure.
  pad | additional padding before transformation.
  rotated | flag to indicate if particles are already rotated.
  &path | path 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.

## Variable Documentation

## ◆ verbose

int verbose