| Bsoft 2.0.5 Bernard's software package

Functions | Variables
mg_particle_select.cpp File Reference

Select particles. More...

`#include "mg_processing.h"`
`#include "mg_tomography.h"`
`#include "mg_particle_select.h"`
`#include "mg_tags.h"`
`#include "symmetry.h"`
`#include "matrix_linear.h"`
`#include "Matrix.h"`
`#include "random_numbers.h"`
`#include "linked_list.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Functions
int_float * | project_fom_order (Bproject *project, long &npart, int fom_index, int defocus_fit)
int_float * | part_fom_order (Bparticle *partlist, long &npart, int fom_index)
long | part_reset_selection (Bproject *project)
| Resets selection to all particles. More...
long | part_unset_selection (Bproject *project)
| Unsets selection to no particles. More...
long | part_invert_selection (Bproject *project)
| Inverts the selection. More...
long | part_select_micrograph (Bproject *project, Bstring &mgselect)
| Sets selection to the micrographs indicated. More...
long | part_consolidate_selection (Bproject *project, int number)
| Consolidates selected particles under one selection number. More...
long | part_set_selection (Bproject *project, int number)
| Selects one selection number and sets all others to zero. More...
long | part_set_FOM (Bproject *project, int fom_index, double fom)
| Sets the FOM for all particles. More...
long | part_deselect_from_list (Bproject *project, Bstring list)
| Deselects particles with selection numbers from a list. More...
long | part_deselect (Bproject *project, int fom_index, double fommin, double fommax)
| Deselects particles below a given FOM cutoff. More...
int | QsortLargeToSmallParticle (const void *x, const void *y)
long | part_deselect_redundant (Bparticle *partlist, double excl_dist, int part_select, int fom_index)
| Deselects particles overlapping with better ones. More...
long | part_deselect_redundant (Bproject *project, double excl_dist, int part_select, int fom_index)
| Deselects particles overlapping with better ones. More...
long | part_set_multi_maps (Bproject *project, int part_select, int nmaps)
| Sets selection for generating multiple maps. More...
long | part_set_filament_maps (Bproject *project)
| Generates a selection number from the group number for each filament. More...
int | part_reselect (Bparticle *part, Bstring &tag, double reselect_min, double reselect_max)
long | part_reselect (Bproject *project, Bstring &tag, double reselect_min, double reselect_max)
| Reselects particles identified by an input STAR tag and between a minimum and maximum. More...
double | part_series_comparison (Bproject *project, Bsymmetry *sym, double angle_cutoff)
| A function to select particles based on comparison of the orientations within a series. More...
long | part_convert_selection (Bproject *project, int *sel)
long | part_select_FOM_groups (Bproject *project, int ngroups, int fom_index, int defocus_fit)
| Selects groups of particles based on the FOM. More...
long | part_select_percentage (Bproject *project, double percentage, int fom_index, int defocus_fit)
| Selects a percentage of particles based on the FOM. More...
long | part_select_best (Bproject *project, long number, int fom_index, int defocus_fit)
| Selects the best particles based on the FOM. More...
long | part_select_FOM_avg_std (Bproject *project, double factor, int fom_index)
| Selects particles based on FOM average and standard deviation. More...
long | part_select_random (Bproject *project, long number)
| Selects a specific number of particles randomly. More...
long | part_select_random_fraction (Bproject *project, double fraction)
| Selects particles randomly based on a fraction of the total. More...
long | part_select_random_group (Bproject *project, long number)
| Selects groups randomly to give at least a number of particles. More...
long | part_select_bootstrap (Bproject *project, int number)
| Selects a given number of particles randomly with replacement. More...
long | part_select_random_within_view (Bproject *project, Bsymmetry *sym, double theta_step, double phi_step, int number)
| Selects a given number of particles within each view. More...
long | part_select_maxsmooth (Bproject *project, Bsymmetry *sym, double theta_step, double phi_step, double threshfrac, double sigma, int fom_index)
| Selects particles based on a smoothed maximum surface. More...
long | part_select_best_within_view (Bproject *project, Bsymmetry *sym, double theta_step, double phi_step, int number, int fom_index)
| Selects the best number of particles within each view. More...
long | part_select_to_group (Bproject *project)
| Transfer selection numbers to the group identifiers. More...
long | part_select_group (Bproject *project, int group)
| Selects particles with a given group identifier. More...
long | part_select_sets (Bproject *project, int size, int flag)
| Selects sets of particles, each set with the same size. More...
long | part_select_frames (Bproject *project, int frame_start, int frame_end)
| Select particles from frames in a series. More...
long | part_fil_dir_stats (Bparticle *partlist)
long | part_fil_dir_stats (Bparticle *partlist, double minpct)
long | part_filament_direction (Bproject *project, double minpct)
| Checks the direction of particles associated with filaments. More...
long | part_view_select (Bproject *project, View view, double angle)
| Selects particles based on a distance from a reference view. More...
long | part_side_view_select (Bproject *project, double angle)
| Selects particles based on a distance from a side view. More...
long | part_euler_angle_select (Bproject *project, double *euler6)
| Selects particles based on Euler angle limits. More...
long | part_origin_select (Bproject *project, Vector3< double > origin, double distance)
| Selects particles based on the distance from the nominal origin. More...
long | part_set_first_view_in_series (Bproject *project)
| Sets all orientation parameters for a particle to the first in the set. More...
long | part_set_best_view_in_series (Bproject *project, int fom_index)
| Sets all orientation parameters for a particle to the best in the set. More...
long | part_select_series (Bproject *project, int size, int flag)
| Select series where all are already selected. More...
long | part_series_from_seed (Bproject *project, int flags)
| Calculates the locations of particles in a series from a seed. More...
double | part_fom_defocus_fit (Bproject *project, int fom_index, double &intercept, double &slope)
| Fits the particle FOMs as a function of the defocus. More...
double | part_fom_defocus_fit_deselect (Bproject *project, int fom_index, double cutoff)
| Deselects particles below a given FOM cutoff, adjusted for the defocus. More...
long | part_select_closest_to_focus (Bproject *project)
| Deselects all particles except those from micrographs closest to focus. More...
long | part_select_furthest_from_focus (Bproject *project)
| Deselects all particles except those from micrographs furthest from focus. More...
long | part_delete_deselected (Bproject *project)
| Deletes deselected particles and renumber the remaining. More...
long | part_fix_defocus (Bproject *project, double max_dev)
| Resets defocus values for particles thata are too far off. More...

## Variables
int | verbose

## Detailed Description

Select particles.

Author
  Bernard Heymann

Date
  Created: 20000426
  Modified: 20180430

Definition in file mg_particle_select.cpp.

## Function Documentation

## ◆ part_consolidate_selection()

long part_consolidate_selection | ( | Bproject * | project,
|  | int | number
| ) |  |

Consolidates selected particles under one selection number.

Parameters

  *project | project parameter structure with all parameters.
  number | new selection number (1 if < 1).

Returns
  long number of particles.

Definition at line 284 of file mg_particle_select.cpp.

## ◆ part_convert_selection()

long part_convert_selection | ( | Bproject * | project,
|  | int * | sel
| ) |  |

Definition at line 873 of file mg_particle_select.cpp.

## ◆ part_delete_deselected()

long part_delete_deselected | ( | Bproject * | project | ) |

Deletes deselected particles and renumber the remaining.

Parameters

  *project | parameter structure with all parameters.

Returns
  long number of particles remaining.

Definition at line 2703 of file mg_particle_select.cpp.

## ◆ part_deselect()

long part_deselect | ( | Bproject * | project,
|  | int | fom_index,
|  | double | fommin,
|  | double | fommax
| ) |  |

Deselects particles below a given FOM cutoff.

Parameters

  *project | parameter structure with all parameters.
  fom_index | index of FOM value to test for.
  fommin | minimum threshold for deselection.
  fommax | maximum threshold for deselection.

Returns
  long number of particles selected.

Definition at line 442 of file mg_particle_select.cpp.

## ◆ part_deselect_from_list()

long part_deselect_from_list | ( | Bproject * | project,
|  | Bstring | list
| ) |  |

Deselects particles with selection numbers from a list.

Parameters

  *project | parameter structure with all parameters.
  list | comma-separated list of selection numbers.

Returns
  long number of particles selected.

Definition at line 387 of file mg_particle_select.cpp.

## ◆ part_deselect_redundant() [1/2]

long part_deselect_redundant | ( | Bparticle * | partlist,
|  | double | excl_dist,
|  | int | part_select,
|  | int | fom_index
| ) |  |

Deselects particles overlapping with better ones.

Parameters

  *partlist | particle linked list.
  excl_dist | minimum distance between particles.
  part_select | initial selection number (-1 means all >0).
  fom_index | index of FOM value to test for.

Returns
  long number of particles selected.

Definition at line 494 of file mg_particle_select.cpp.

## ◆ part_deselect_redundant() [2/2]

long part_deselect_redundant | ( | Bproject * | project,
|  | double | excl_dist,
|  | int | part_select,
|  | int | fom_index
| ) |  |

Deselects particles overlapping with better ones.

Parameters

  *project | parameter structure with all parameters.
  excl_dist | minimum distance between particles.
  part_select | initial selection number (-1 means all >0).
  fom_index | index of FOM value to test for.

Returns
  long number of particles selected.

Definition at line 526 of file mg_particle_select.cpp.

## ◆ part_euler_angle_select()

long part_euler_angle_select | ( | Bproject * | project,
|  | double * | euler6
| ) |  |

Selects particles based on Euler angle limits.

Parameters

  *project | project structure with all parameters.
  *euler6 | 6-value vector of Euler angle limits.

Returns
  long number of particles selected.

      Only particles already selected are subject to the test.

Definition at line 2203 of file mg_particle_select.cpp.

## ◆ part_fil_dir_stats() [1/2]

long part_fil_dir_stats | ( | Bparticle * | partlist | ) |

Definition at line 1924 of file mg_particle_select.cpp.

## ◆ part_fil_dir_stats() [2/2]

long part_fil_dir_stats | ( | Bparticle * | partlist,
|  | double | minpct
| ) |  |

Definition at line 1980 of file mg_particle_select.cpp.

## ◆ part_filament_direction()

long part_filament_direction | ( | Bproject * | project,
|  | double | minpct
| ) |  |

Checks the direction of particles associated with filaments.

Parameters

  *project | project structure with all parameters.
  minpct | minimum percentage.

Returns
  long number of particles with clear direction.

      The selected particles associated with a filament is checked for their
      in-plane direction. If the percentage of particles exceed the
      minimum desired, the particles with the corresponding direction
      are selected, and the rest deselected.

Definition at line 2055 of file mg_particle_select.cpp.

## ◆ part_fix_defocus()

long part_fix_defocus | ( | Bproject * | project,
|  | double | max_dev
| ) |  |

Resets defocus values for particles thata are too far off.

Parameters

  *project | parameter structure with all parameters.
  max_dev | maximum defocus difference allowed.

Returns
  long number of defocus values reset.

Definition at line 2751 of file mg_particle_select.cpp.

## ◆ part_fom_defocus_fit()

double part_fom_defocus_fit | ( | Bproject * | project,
|  | int | fom_index,
|  | double & | intercept,
|  | double & | slope
| ) |  |

Fits the particle FOMs as a function of the defocus.

Parameters

  *project | parameter structure with all parameters.
  fom_index | index of FOM value to test for.
  &intercept | fit intercept.
  &slope | fit slope.

Returns
  double correlation index of fit.

      The FOM is fit as a linear function of the defocus average.

Definition at line 2558 of file mg_particle_select.cpp.

## ◆ part_fom_defocus_fit_deselect()

double part_fom_defocus_fit_deselect | ( | Bproject * | project,
|  | int | fom_index,
|  | double | cutoff
| ) |  |

Deselects particles below a given FOM cutoff, adjusted for the defocus.

Parameters

  *project | parameter structure with all parameters.
  fom_index | index of FOM value to test for.
  cutoff | threshold for deselection.

Returns
  double correlation index of fit.

      The FOM is fit as a linear function of the defocus average.
      Particles are deselected based on the adjusted FOM cutoff:
          adj_cut = slope * defocus + cut

Definition at line 2618 of file mg_particle_select.cpp.

## ◆ part_fom_order()

int_float* part_fom_order | ( | Bparticle * | partlist,
|  | long & | npart,
|  | int | fom_index
| ) |  |

Definition at line 89 of file mg_particle_select.cpp.

## ◆ part_invert_selection()

long part_invert_selection | ( | Bproject * | project | ) |

Inverts the selection.

Parameters

  *project | project parameter structure with all parameters.

Returns
  long number of particles.

Definition at line 202 of file mg_particle_select.cpp.

## ◆ part_origin_select()

long part_origin_select | ( | Bproject * | project,
|  | Vector3< double > | origin,
|  | double | distance
| ) |  |

Selects particles based on the distance from the nominal origin.

Parameters

  *project | project structure with all parameters.
  origin | nominal origin.
  distance | maximum distance to accept.

Returns
  long number of particles selected.

      Only particles already selected are subject to the test.

Definition at line 2265 of file mg_particle_select.cpp.

## ◆ part_reselect() [1/2]

int part_reselect | ( | Bparticle * | part,
|  | Bstring & | tag,
|  | double | reselect_min,
|  | double | reselect_max
| ) |  |

Definition at line 664 of file mg_particle_select.cpp.

## ◆ part_reselect() [2/2]

long part_reselect | ( | Bproject * | project,
|  | Bstring & | tag,
|  | double | reselect_min,
|  | double | reselect_max
| ) |  |

Reselects particles identified by an input STAR tag and between a minimum and maximum.

Parameters

  *project | parameter structure with all parameters.
  &tag | tag indicating which data to select on.
  reselect_min | minimum value.
  reselect_max | maximum value.

Returns
  long number of particles selected.

      Only particles already selected are subject to reselection.

Definition at line 723 of file mg_particle_select.cpp.

## ◆ part_reset_selection()

long part_reset_selection | ( | Bproject * | project | ) |

Resets selection to all particles.

Parameters

  *project | project parameter structure with all parameters.

Returns
  long number of particles.

Definition at line 131 of file mg_particle_select.cpp.

## ◆ part_select_best()

long part_select_best | ( | Bproject * | project,
|  | long | number,
|  | int | fom_index,
|  | int | defocus_fit
| ) |  |

Selects the best particles based on the FOM.

Parameters

  *project | parameter structure with all parameters.
  number | number of particles.
  fom_index | which FOM value to select on.
  defocus_fit | flag to compensate for defocus.

Returns
  long number of particles selected.

      Particles are ranked according to the figure-of-merit and the
      desired percentage selected.

Definition at line 1026 of file mg_particle_select.cpp.

## ◆ part_select_best_within_view()

long part_select_best_within_view | ( | Bproject * | project,
|  | Bsymmetry * | sym,
|  | double | theta_step,
|  | double | phi_step,
|  | int | number,
|  | int | fom_index
| ) |  |

Selects the best number of particles within each view.

Parameters

  *project | parameter structure with all parameters.
  *sym | symmetry structure.
  theta_step | angular step size from primary symmetry axis (radians).
  phi_step | angular step size around primary symmetry axis (radians).
  number | number within view to select.
  fom_index | which FOM value to select on.

Returns
  long number of particles selected.

      The best particles within each view is selected.

Definition at line 1633 of file mg_particle_select.cpp.

## ◆ part_select_bootstrap()

long part_select_bootstrap | ( | Bproject * | project,
|  | int | number
| ) |  |

Selects a given number of particles randomly with replacement.

Parameters

  *project | parameter structure with all parameters.
  number | number to select.

Returns
  long number of particles selected.

      A random number between 1 and the number of selected particles is
      generated the given number of times. The selection value for the
      selected particle is incremented each time. A particle may therefore
      be selected more than once.

Definition at line 1357 of file mg_particle_select.cpp.

## ◆ part_select_closest_to_focus()

long part_select_closest_to_focus | ( | Bproject * | project | ) |

Deselects all particles except those from micrographs closest to focus.

Parameters

  *project | parameter structure with all parameters.

Returns
  long number of particles selected.

Definition at line 2643 of file mg_particle_select.cpp.

## ◆ part_select_FOM_avg_std()

long part_select_FOM_avg_std | ( | Bproject * | project,
|  | double | factor,
|  | int | fom_index
| ) |  |

Selects particles based on FOM average and standard deviation.

Parameters

  *project | parameter structure with all parameters.
  factor | factor to multiply standard deviation with.
  fom_index | which FOM value to select on.

Returns
  long number of particles selected.

      Particles are selected using the average and standard deviation,
      with the level set as a function of difference from the average:
          selected > average + factor*std_dev
      Note the multiplying factor can be negative.
      Only particles already selected are subject to the test.

Definition at line 1082 of file mg_particle_select.cpp.

## ◆ part_select_FOM_groups()

long part_select_FOM_groups | ( | Bproject * | project,
|  | int | ngroups,
|  | int | fom_index,
|  | int | defocus_fit
| ) |  |

Selects groups of particles based on the FOM.

Parameters

  *project | parameter structure with all parameters.
  ngroups | number of groups of particles.
  fom_index | index of FOM value to select on.
  defocus_fit | flag to compensate for defocus.

Returns
  long number of particles selected in the first group.

      Particles are ranked according to the figure-of-merit and equal
      numbers are distributed to the requested number of particle groups.
      The particle group selections are then written into a selection
      array in the STAR data base, with the group with the best FOM's first.
      Only particles already selected are subject to the test.

Definition at line 919 of file mg_particle_select.cpp.

## ◆ part_select_frames()

long part_select_frames | ( | Bproject * | project,
|  | int | frame_start,
|  | int | frame_end
| ) |  |

Select particles from frames in a series.

Parameters

  *project | parameter structure with all parameters.
  frame_start | first frame (starts at 1).
  frame_end | last frame.

Returns
  long number of particles selected.

      Particles in frames from a series in the same field-of-view are
      selected. Only particles that are already selected are considered.

Definition at line 1898 of file mg_particle_select.cpp.

## ◆ part_select_furthest_from_focus()

long part_select_furthest_from_focus | ( | Bproject * | project | ) |

Deselects all particles except those from micrographs furthest from focus.

Parameters

  *project | parameter structure with all parameters.

Returns
  long number of particles selected.

Definition at line 2673 of file mg_particle_select.cpp.

## ◆ part_select_group()

long part_select_group | ( | Bproject * | project,
|  | int | group
| ) |  |

Selects particles with a given group identifier.

Parameters

  *project | parameter structure with all parameters.
  group | group identifier.

Returns
  long number of particles selected.

Definition at line 1766 of file mg_particle_select.cpp.

## ◆ part_select_maxsmooth()

long part_select_maxsmooth | ( | Bproject * | project,
|  | Bsymmetry * | sym,
|  | double | theta_step,
|  | double | phi_step,
|  | double | threshfrac,
|  | double | sigma,
|  | int | fom_index
| ) |  |

Selects particles based on a smoothed maximum surface.

Parameters

  *project | parameter structure with all parameters.
  *sym | symmetry structure.
  theta_step | angular step size from primary symmetry axis (radians).
  phi_step | angular step size around primary symmetry axis (radians).
  threshfrac | fraction of maximum threshold.
  sigma | smoothing parameter: gaussian sigma.
  fom_index | which FOM value to select on.

Returns
  long number of particles selected.

      The best particles within each view is selected.

Definition at line 1520 of file mg_particle_select.cpp.

## ◆ part_select_micrograph()

long part_select_micrograph | ( | Bproject * | project,
|  | Bstring & | mgselect
| ) |  |

Sets selection to the micrographs indicated.

Parameters

  *project | project parameter structure with all parameters.
  &mgselect | string with selection.

Returns
  long number of particles.

      Only the micrograph selection fields are modified.

Definition at line 245 of file mg_particle_select.cpp.

## ◆ part_select_percentage()

long part_select_percentage | ( | Bproject * | project,
|  | double | percentage,
|  | int | fom_index,
|  | int | defocus_fit
| ) |  |

Selects a percentage of particles based on the FOM.

Author
  David Belnap & Bernard Heymann

Parameters

  *project | parameter structure with all parameters.
  percentage | percentage of particles (0 - 100).
  fom_index | which FOM value to select on.
  defocus_fit | flag to compensate for defocus.

Returns
  long number of particles selected.

      Particles are ranked according to the figure-of-merit and the
      desired percentage selected.

Definition at line 969 of file mg_particle_select.cpp.

## ◆ part_select_random()

long part_select_random | ( | Bproject * | project,
|  | long | number
| ) |  |

Selects a specific number of particles randomly.

Parameters

  *project | parameter structure with all parameters.
  number | number to select.

Returns
  long number of particles selected.

      An array is set up for all selected particles. The given number of random
      elements is selected in the array and transfered as particle selections.

Definition at line 1137 of file mg_particle_select.cpp.

## ◆ part_select_random_fraction()

long part_select_random_fraction | ( | Bproject * | project,
|  | double | fraction
| ) |  |

Selects particles randomly based on a fraction of the total.

Parameters

  *project | parameter structure with all parameters.
  fraction | fraction of total to select.

Returns
  long number of particles selected.

      A random number between 0 and 1 is generated for each particle and if
      it is smaller than the given fraction, the particle is selected.

Definition at line 1217 of file mg_particle_select.cpp.

## ◆ part_select_random_group()

long part_select_random_group | ( | Bproject * | project,
|  | long | number
| ) |  |

Selects groups randomly to give at least a number of particles.

Parameters

  *project | parameter structure with all parameters.
  number | number to select.

Returns
  long number of particles selected.

      A random number between 0 and 1 is generated for each particle and if
      it is smaller than the given fraction, the particle is selected.

Definition at line 1266 of file mg_particle_select.cpp.

## ◆ part_select_random_within_view()

long part_select_random_within_view | ( | Bproject * | project,
|  | Bsymmetry * | sym,
|  | double | theta_step,
|  | double | phi_step,
|  | int | number
| ) |  |

Selects a given number of particles within each view.

Parameters

  *project | parameter structure with all parameters.
  *sym | symmetry structure.
  theta_step | angular step size from primary symmetry axis (radians).
  phi_step | angular step size around primary symmetry axis (radians).
  number | number within view to select.

Returns
  long number of particles selected.

      A random number between 1 and the number of selected particles is
      generated the given number of times. The selection value for the
      selected particle is incremented each time. A particle may therefore
      be selected more than once.
      This selection is meant to be used with the bootstrap reconstruction.

Definition at line 1416 of file mg_particle_select.cpp.

## ◆ part_select_series()

long part_select_series | ( | Bproject * | project,
|  | int | size,
|  | int | flag
| ) |  |

Select series where all are already selected.

Parameters

  *project | parameter structure with all parameters.
  size | number of particles in each set.
  flag | flag to not count across mg or rec boundaries.

Returns
  long number of particles selected.

      This function selects those series where all the particles
      are already selected, and deselects the rest. Sets are selected
      with each series part of the same set.

Definition at line 2395 of file mg_particle_select.cpp.

## ◆ part_select_sets()

long part_select_sets | ( | Bproject * | project,
|  | int | size,
|  | int | flag
| ) |  |

Selects sets of particles, each set with the same size.

Parameters

  *project | parameter structure with all parameters.
  size | number of particles in each set.
  flag | flag to not count across mg or rec boundaries.

Returns
  long number of particles selected.

      Sets up sets of particles, each set identified as a number in the
      selection array.

Definition at line 1815 of file mg_particle_select.cpp.

## ◆ part_select_to_group()

long part_select_to_group | ( | Bproject * | project | ) |

Transfer selection numbers to the group identifiers.

Parameters

  *project | parameter structure with all parameters.

Returns
  long number of particles selected.

Definition at line 1722 of file mg_particle_select.cpp.

## ◆ part_series_comparison()

double part_series_comparison | ( | Bproject * | project,
|  | Bsymmetry * | sym,
|  | double | angle_cutoff
| ) |  |

A function to select particles based on comparison of the orientations within a series.

Parameters

  *project | parameter structure with all parameters.
  *sym | symmetry.
  angle_cutoff | angle cutoff value (radians).

Returns
  double average angular deviation.

      Only particles already selected are subject to the test.

Definition at line 802 of file mg_particle_select.cpp.

## ◆ part_series_from_seed()

long part_series_from_seed | ( | Bproject * | project,
|  | int | flags
| ) |  |

Calculates the locations of particles in a series from a seed.

Parameters

  *project | micrograph project.
  flags | bit 1=invert z, bit 2=use original particle view.

Returns
  long number of particles created.

      The seed particle locations is either in the zero-degree tilt 2D micrograph,
      or a 3D reconstruction. The latter also gives the z-coordinate, resulting
      in a better definition of the particle location.
      The project selection flag indicates micrograph or reconstruction.

Definition at line 2454 of file mg_particle_select.cpp.

## ◆ part_set_best_view_in_series()

long part_set_best_view_in_series | ( | Bproject * | project,
|  | int | fom_index
| ) |  |

Sets all orientation parameters for a particle to the best in the set.

Parameters

  *project | parameter structure with all parameters.
  fom_index | index of FOM value to select on.

Returns
  int 0.

      This function uses the FOM to select the best orientation parameters
      for a particle in a set (typically a focal series) and sets all
      orientation parameters to the same values.

Definition at line 2351 of file mg_particle_select.cpp.

## ◆ part_set_filament_maps()

long part_set_filament_maps | ( | Bproject * | project | ) |

Generates a selection number from the group number for each filament.

Parameters

  *project | parameter structure with all parameters.

Returns
  long number of maps selected.

Definition at line 619 of file mg_particle_select.cpp.

## ◆ part_set_first_view_in_series()

long part_set_first_view_in_series | ( | Bproject * | project | ) |

Sets all orientation parameters for a particle to the first in the set.

Parameters

  *project | parameter structure with all parameters.

Returns
  int 0.

      This function sets the views of all the particles in the field-of-view to
      the views for the first micrograph.

Definition at line 2317 of file mg_particle_select.cpp.

## ◆ part_set_FOM()

long part_set_FOM | ( | Bproject * | project,
|  | int | fom_index,
|  | double | fom
| ) |  |

Sets the FOM for all particles.

Parameters

  *project | project parameter structure with all parameters.
  fom_index | index of FOM value to set.
  fom | new FOM.

Returns
  long number of particles.

Definition at line 357 of file mg_particle_select.cpp.

## ◆ part_set_multi_maps()

long part_set_multi_maps | ( | Bproject * | project,
|  | int | part_select,
|  | int | nmaps
| ) |  |

Sets selection for generating multiple maps.

Parameters

  *project | parameter structure with all parameters.
  part_select | initial selection number (-1 means all >0).
  nmaps | desired number of maps.

Returns
  long number of particles selected.

      Selected particles are sequentially assigned increasing integers
      up to desired number of maps (nmaps).

Definition at line 564 of file mg_particle_select.cpp.

## ◆ part_set_selection()

long part_set_selection | ( | Bproject * | project,
|  | int | number
| ) |  |

Selects one selection number and sets all others to zero.

Parameters

  *project | project parameter structure with all parameters.
  number | selection number to keep.

Returns
  long number of particles selected.

Definition at line 318 of file mg_particle_select.cpp.

## ◆ part_side_view_select()

long part_side_view_select | ( | Bproject * | project,
|  | double | angle
| ) |  |

Selects particles based on a distance from a side view.

Parameters

  *project | project structure with all parameters.
  angle | angular distance from the side view.

Returns
  long number of particles selected.

      Only particles already selected are subject to the test.

Definition at line 2155 of file mg_particle_select.cpp.

## ◆ part_unset_selection()

long part_unset_selection | ( | Bproject * | project | ) |

Unsets selection to no particles.

Parameters

  *project | project parameter structure with all parameters.

Returns
  long number of particles.

Definition at line 166 of file mg_particle_select.cpp.

## ◆ part_view_select()

long part_view_select | ( | Bproject * | project,
|  | View | view,
|  | double | angle
| ) |  |

Selects particles based on a distance from a reference view.

Parameters

  *project | project structure with all parameters.
  view | central view to search for.
  angle | angular distance from the view.

Returns
  long number of particles selected.

      Only particles already selected are subject to the test.

Definition at line 2104 of file mg_particle_select.cpp.

## ◆ project_fom_order()

int_float* project_fom_order | ( | Bproject * | project,
|  | long & | npart,
|  | int | fom_index,
|  | int | defocus_fit
| ) |  |

Definition at line 23 of file mg_particle_select.cpp.

## ◆ QsortLargeToSmallParticle()

int QsortLargeToSmallParticle | ( | const void * | x,
|  | const void * | y
| ) |  |

Definition at line 478 of file mg_particle_select.cpp.

## Variable Documentation

## ◆ verbose

int verbose