| Bsoft 2.0.5 Bernard's software package

Functions | Variables
mg_particles.cpp File Reference

Calculates centers of single particle images. More...

`#include "mg_processing.h"`
`#include "mg_particles.h"`
`#include "mg_img_proc.h"`
`#include "rwimg.h"`
`#include "matrix_linear.h"`
`#include "utilities.h"`
`#include "timer.h"`
`#include <sys/stat.h>`

Go to the source code of this file.

## Functions
int | project_align_particles (Bproject *project, int part_select, double nuavg, double nustd)
| Aligns single particle images based on orientation parameters. More...
int | project_center_particles (Bproject *project, int part_select, double nuavg, double nustd)
| Centers single particle images based on the parametric center. More...
int | project_set_particle_centers (Bproject *project, Bimage *pref, int part_select, double hires, double lores)
| Calculates centers of single particle images by cross-correlation with a reference. More...
long | project_find_part_centers_in_mgs (Bproject *project, double hires, double lores, int filter_flag)
| Finds the centers of picked particles within a micrograph. More...
long | mg_find_part_centers (Bmicrograph *mg, double hires, double lores, int filter_flag)
| Finds the centers of picked particles within a micrograph. More...
Bimage * | project_find_particle_centers (Bproject *project, int max_iter, int part_select, double hires, double lores)
| Calculates centers of single particle images. More...
long | particles_mask (Bmicrograph *mg, Bimage *pmask, Bstring &partpath)
long | project_mask_particles (Bproject *project, Bimage *pmask, Bstring &partpath)
| Calculates centers of single particle images. More...
long | project_compare_particles (Bproject *project, Bproject *projcomp)
| Compares the coordinates of particles between two files. More...
double | project_tilt_from_particle_defocus (Bproject *project)
| Finds the tilt axis from refined particle defocus values. More...
long | project_set_particle_defocus_from_tilt (Bproject *project, double axis, double tilt)
| Finds the tilt axis from refined particle defocus values. More...

## Variables
int | verbose

## Detailed Description

Calculates centers of single particle images.

Author
  Bernard Heymann

Date
  Created: 20080424
  Modified: 20180102

Definition in file mg_particles.cpp.

## Function Documentation

## ◆ mg_find_part_centers()

long mg_find_part_centers | ( | Bmicrograph * | mg,
|  | double | hires,
|  | double | lores,
|  | int | filter_flag
| ) |  |

Finds the centers of picked particles within a micrograph.

Parameters

  *mg | micrograph parameter structure.
  hires | high resolution limit.
  lores | low resolution limit.
  filter_flag | flag to filter extremes in particles.

Returns
  long number of particles.

      An image processing parameter structure loaded with micrograph
      information is used to extract particle images from the micrograph
      image using the particle coordinates in the parameter structure.
      The extracted particle images are each rotated by PI and the shift
      found by cross-correlation between the unrotated and rotated images.
      The particle coordinates in the parameter structure are updated with
      the shift.

Definition at line 354 of file mg_particles.cpp.

## ◆ particles_mask()

long particles_mask | ( | Bmicrograph * | mg,
|  | Bimage * | pmask,
|  | Bstring & | partpath
| ) |  |

Definition at line 512 of file mg_particles.cpp.

## ◆ project_align_particles()

int project_align_particles | ( | Bproject * | project,
|  | int | part_select,
|  | double | nuavg,
|  | double | nustd
| ) |  |

Aligns single particle images based on orientation parameters.

Parameters

  *project | image processing parameter structure.
  part_select | selection number from the selection column.
  nuavg | rescale to new average.
  nustd | rescale to new standard deviation.

Returns
  int 0.

      Each selected particle image is rotated and shifted.

Definition at line 33 of file mg_particles.cpp.

## ◆ project_center_particles()

int project_center_particles | ( | Bproject * | project,
|  | int | part_select,
|  | double | nuavg,
|  | double | nustd
| ) |  |

Centers single particle images based on the parametric center.

Parameters

  *project | image processing parameter structure.
  part_select | selection number from the selection column.
  nuavg | rescale to new average.
  nustd | rescale to new standard deviation.

Returns
  int 0.

      Each particle image is shifted to center the origin.

Definition at line 135 of file mg_particles.cpp.

## ◆ project_compare_particles()

long project_compare_particles | ( | Bproject * | project,
|  | Bproject * | projcomp
| ) |  |

Compares the coordinates of particles between two files.

Parameters

  *project | project parameter structure.
  *projcomp | comparable project parameter structure.

Returns
  long number of common particles.

      The coordinates of particles in one parameter file is compared to
      that of a reference parameter file.
      The two parameter files must have the same field and micrograph ID's.

Definition at line 650 of file mg_particles.cpp.

## ◆ project_find_part_centers_in_mgs()

long project_find_part_centers_in_mgs | ( | Bproject * | project,
|  | double | hires,
|  | double | lores,
|  | int | filter_flag
| ) |  |

Finds the centers of picked particles within a micrograph.

Parameters

  *project | project parameter structure.
  hires | high resolution limit.
  lores | low resolution limit.
  filter_flag | flag to filter extremes in particles.

Returns
  int 0.

      An image processing parameter structure loaded with micrograph
      information is used to extract particle images from the micrograph
      image using the particle coordinates in the parameter structure.
      The extracted particle images are each rotated by PI and the shift
      found by cross-correlation between the unrotated and rotated images.
      The particle coordinates in the parameter structure are updated with
      the shift.

Definition at line 319 of file mg_particles.cpp.

## ◆ project_find_particle_centers()

Bimage* project_find_particle_centers | ( | Bproject * | project,
|  | int | max_iter,
|  | int | part_select,
|  | double | hires,
|  | double | lores
| ) |  |

Calculates centers of single particle images.

Parameters

  *project | image processing parameter structure.
  max_iter | maximum number of iterations.
  part_select | selection number from the selection column.
  hires | high resolution limit.
  lores | low resolution limit.

Returns
  Bimage* final image composite reference.

      A composite image is generated from the selected particles and radially
      symmetrized. Each image shift is then determined by cross correlation.
      This is repeated until the chnage in image shifts decreases below
      a threshold.

Definition at line 408 of file mg_particles.cpp.

## ◆ project_mask_particles()

long project_mask_particles | ( | Bproject * | project,
|  | Bimage * | pmask,
|  | Bstring & | partpath
| ) |  |

Calculates centers of single particle images.

Parameters

  *project | image processing parameter structure.
  *pmask | 3D volume mask to be projected.
  &partpath | new path to particle files.

Returns
  long number of particles masked.

      A 3D mask is projected into each particle view and the particle image masked.

Definition at line 579 of file mg_particles.cpp.

## ◆ project_set_particle_centers()

int project_set_particle_centers | ( | Bproject * | project,
|  | Bimage * | pref,
|  | int | part_select,
|  | double | hires,
|  | double | lores
| ) |  |

Calculates centers of single particle images by cross-correlation with a reference.

Parameters

  *project | image processing parameter structure.
  *pref | reference image.
  part_select | selection number from the selection column.
  hires | high resolution limit.
  lores | low resolution limit.

Returns
  int 0.

      Each particle image shift is determined by cross correlation with
      the reference image.
      The reference must be the same size as the particle images.

Definition at line 260 of file mg_particles.cpp.

## ◆ project_set_particle_defocus_from_tilt()

long project_set_particle_defocus_from_tilt | ( | Bproject * | project,
|  | double | axis,
|  | double | tilt
| ) |  |

Finds the tilt axis from refined particle defocus values.

Parameters

  *project | project parameter structure.
  axis | tilt axis angle (radians).
  tilt | tilt angle (radians).

Returns
  long number of selected particles.

Definition at line 802 of file mg_particles.cpp.

## ◆ project_tilt_from_particle_defocus()

double project_tilt_from_particle_defocus | ( | Bproject * | project | ) |

Finds the tilt axis from refined particle defocus values.

Parameters

  *project | project parameter structure.

Returns
  double average tilt axis.

Definition at line 709 of file mg_particles.cpp.

## Variable Documentation

## ◆ verbose

int verbose