Bsoft 2.1.4
Bernard's software package
mg_hand.cpp File Reference

Functions for comparing projections of two oppositely handed reconstructions to images of tilted specimens. More...

#include "mg_hand.h"
#include "mg_select.h"
#include "Matrix3.h"
#include "qsort_functions.h"
#include "utilities.h"

Classes

struct  Hand_Stats
 

Functions

int field_get_handedness (Bimage *mapA, Bimage *mapB, Bmicrograph *mg1, Bmicrograph *mg2, Hand_Stats *Global, double rad_min, double rad_max, double res_min, double res_max, double AmB_min, double AB_min, int diff_out, int origins2, Bstring outimg, int fieldnum)
 
int get_handedness_from_tilt_pair (Bimage *mapA, Bimage *mapB, Bmicrograph *mg1, Bmicrograph *mg2, Bparticle *particle1, Bparticle *particle2, Hand_Stats *Pair, double rad_min, double rad_max, double res_min, double res_max, double AmB_min, double AB_min, int diff_out, int origins2, Bstring outimg, int fieldnum)
 
int hand_compute_stats (Hand_Stats *stats, int diff_out)
 
int hand_prepare_image (Bimage *p, double resmin, double resmax)
 
int hand_print_outheader (int which_one, int diff_out)
 
int hand_print_stats (Hand_Stats *stats, int which_one, int diff_out)
 
int hand_write_img (Bimage *img, Bstring imgname, Bstring outimg, int fieldnum, int num)
 Appends micrograph number, image number, and a string tag to a file name. Then it writes out an image file. More...
 
int project_get_handedness (Bimage *mapA, Bproject *project, double *mg_ang, int *mg_index, int *mg_select, double rad_min, double rad_max, double res_min, double res_max, double AmB_min, double AB_min, int diff_out, int origins2, Bstring outimg)
 Determines handedness for all selected particles (sel > 0) in a project. More...
 
int hand_select_consist (Bproject *project, double *mg_ang, int *mg_index, int *mg_select, int sel_consist)
 Sets consistent selection values in all (including unused) micrographs. More...
 

Variables

int verbose
 

Detailed Description

Functions for comparing projections of two oppositely handed reconstructions to images of tilted specimens.

Author
David Belnap
Date
Created: 20011003
Modified: 20151008 (BH)

Function Documentation

◆ field_get_handedness()

int field_get_handedness ( Bimage mapA,
Bimage mapB,
Bmicrograph mg1,
Bmicrograph mg2,
Hand_Stats Global,
double  rad_min,
double  rad_max,
double  res_min,
double  res_max,
double  AmB_min,
double  AB_min,
int  diff_out,
int  origins2,
Bstring  outimg,
int  fieldnum 
)

◆ get_handedness_from_tilt_pair()

int get_handedness_from_tilt_pair ( Bimage mapA,
Bimage mapB,
Bmicrograph mg1,
Bmicrograph mg2,
Bparticle particle1,
Bparticle particle2,
Hand_Stats Pair,
double  rad_min,
double  rad_max,
double  res_min,
double  res_max,
double  AmB_min,
double  AB_min,
int  diff_out,
int  origins2,
Bstring  outimg,
int  fieldnum 
)

◆ hand_compute_stats()

int hand_compute_stats ( Hand_Stats stats,
int  diff_out 
)

◆ hand_prepare_image()

int hand_prepare_image ( Bimage p,
double  resmin,
double  resmax 
)

◆ hand_print_outheader()

int hand_print_outheader ( int  which_one,
int  diff_out 
)

◆ hand_print_stats()

int hand_print_stats ( Hand_Stats stats,
int  which_one,
int  diff_out 
)

◆ hand_select_consist()

int hand_select_consist ( Bproject project,
double *  mg_ang,
int *  mg_index,
int *  mg_select,
int  sel_consist 
)

Sets consistent selection values in all (including unused) micrographs.

Parameters
*projectProject structure
*mg_angangles for micrograph selection, views 1 & 2
*mg_indexindices for micrograph selection, views 1 & 2
*mg_selectmicrograph selection criteria, views 1 & 2
sel_consist1 or 2, set other selection values to those of this view
Returns
int 0.
If a field-of-view contains more than two micrographs, the user can
only use two of them to do the handedness determination.  The unused
micrographs may need their selection values set to the same as those
in the used micrographs (views 1 and 2).  In addition, there may be
differences in the initial selection values for views 1 and 2.  This 
routine loops through the micrographs in a field-of-view and sets all
selection values to those of view 1 or 2.

◆ hand_write_img()

int hand_write_img ( Bimage img,
Bstring  imgname,
Bstring  outimg,
int  fieldnum,
int  num 
)

Appends micrograph number, image number, and a string tag to a file name. Then it writes out an image file.

Parameters
*imgImage to write out
imgnameString tag for image, appended to file name
outimgPrefix and suffix for file name
fieldnumIndex number for current field-of-view
numIndex number for image
Returns
int 0.

◆ project_get_handedness()

int project_get_handedness ( Bimage mapA,
Bproject project,
double *  mg_ang,
int *  mg_index,
int *  mg_select,
double  rad_min,
double  rad_max,
double  res_min,
double  res_max,
double  AmB_min,
double  AB_min,
int  diff_out,
int  origins2,
Bstring  outimg 
)

Determines handedness for all selected particles (sel > 0) in a project.

Parameters
*mapA3D map (hand A)
*projectProject structure
*mg_angangles for micrograph selection, views 1 & 2
*mg_indexindices for micrograph selection, views 1 & 2
*mg_selectmicrograph selection criteria, views 1 & 2
rad_minminimum radius for FOM calculation (pixels)
rad_maxmaximum radius for FOM calculation (pixels)
res_minminimum resolution for FOM calculation (angs.)
res_maxmaximum resolution for FOM calculation (angs.)
AmB_min|FOMA - FOMB| must be this value or greater
AB_minmin. acceptable value for FOM of correct hand
diff_outoutput difference of measured & predicted orientations
origins2flag to determine origins for second view
outimgprefix & suffix for output projection files
Returns
int 0.
Gets tilt-axis direction and rotation angle for a micrograph pair.
Then, loops through the selected particles in pair.  Sends data to
function get_handedness_from_tilt_pair, where handedness is
determined.  Statistics are calculated for each pair and sums for
global statistics are tabulated.

Variable Documentation

◆ verbose

int verbose
extern