|
Bsoft
2.1.0
Bernard's software package
|
Functions for picking single particle images from a micrograph. More...
#include "mg_pick.h"#include "mg_processing.h"#include "mg_select.h"#include "linked_list.h"#include "utilities.h"Go to the source code of this file.
Functions | |
| Bimage * | img_prepare_for_picking (Bimage *p, int flags, long sigma, long bin) |
| Bparticle * | particles_from_peaks (Bimage *pcc, long bin, double excl_dist, double part_ori, double &fommin, double fommax, long maxnum, double pix_min, double pix_max) |
| Finds the peaks in a cross-correlation map corresponding to particles. More... | |
| Bparticle * | particles_pick_cc (Bimage *p, Bimage *ptemp, Bimage *pmask, double hires, double lores, double fommin, double fommax, double excl_dist, long bin) |
| Picks particles using cross-correlation. More... | |
| double | gauss_find_intersection (long ngauss, vector< double > &gauss) |
| Bparticle * | particles_pick_var (Bimage *p, long avg_kernel, long var_kernel, double nsig, double part_ori, double excl_dist, long bin) |
| Picks particles in variance map. More... | |
| Bparticle * | particles_pick_var (Bimage *p, long avg_kernel, long var_kernel, double cutmin, double cutmax, double part_ori, double excl_dist, long bin) |
| Bparticle * | particles_pick_cc (Bstring &filename, long img_num, Bimage *ptemp, Bimage *pmask, double hires, double lores, double fommin, double fommax, double excl_dist, long bin) |
| Picks particles using cross-correlation. More... | |
| Bparticle * | particles_pick_var (Bstring &filename, long img_num, long avg_kernel, long var_kernel, double nsig, double part_ori, double excl_dist, long bin) |
| Picks particles in variance map. More... | |
| double | img_marker_set_difference_at_voxel (Bimage *p, long i, Bmarker *markin, Bmarker *markout) |
| Bimage * | img_marker_set_difference (Bimage *p, Bmarker *markin, Bmarker *markout, int contrast) |
| Calculates the average difference between voxels tagged by two marker sets. More... | |
| double | mg_pick_particles (Bmicrograph *mg, Bimage *p, Bmarker *markin, Bmarker *markout, int avg_kernel, int contrast) |
| Locates particles using a fore/background difference measure. More... | |
| double | project_pick_particles (Bproject *project, Bimage *ptemp, Bimage *pmask, double hires, double lores, double fommin, double fommax, double excl_dist, long bin) |
| Picks particles using cross-correlation. More... | |
| double | project_pick_particles (Bproject *project, long avg_kernel, long var_kernel, double nsig, double part_ori, double excl_dist, long bin) |
| Picks particles in variance map. More... | |
| long | project_pick_particles (Bproject *project, double din, double dout, int avg_kernel, double ainc, int flags, int contrast) |
| Locates particles using a fore/background difference measure. More... | |
| int | part_mask_particles (Bparticle *part, Bimage *pmask, long box_size) |
| int | img_mask_above_threshold (Bimage *pvar, Bimage *p, double threshold) |
| double | mg_pick_background (Bmicrograph *mg, Bimage *p, long number, long avg_kernel, long var_kernel, double excl_dist) |
| double | rec_pick_background (Breconstruction *rec, Bimage *p, long number, long avg_kernel, long var_kernel, double excl_dist) |
| long | project_pick_background (Bproject *project, long number, long avg_kernel, long var_kernel, double excl_dist) |
| Picks background areas not overlapping existing particles. More... | |
| Bparticle * | part_pick_sym_axis (Bparticle *part, Bsymmetry *sym, View &refview, Vector3< double > refori, double axis_dist) |
| long | project_pick_sym_axis (Bproject *project, Bsymmetry *sym, int sym_axis, double axis_dist) |
| Picks subregions in 3D particles on the given symmetry axis. More... | |
| Bimage * | img_prepare_projections (Bstring &tempfile, Bsymmetry *sym, double hires, long bin) |
| Bimage * | img_prepare_orientations (Bstring &tempfile, Bsymmetry *sym, double hires, long bin) |
| double | part_align (Bparticle *part, Bimage *p, Bimage *ptemp, double hires, double lores, double shift_limit, long bin, fft_plan planf, fft_plan planb) |
| long | mg_extract_orient_particles (Bmicrograph *mg, Bimage *ptemp, double hires, double lores, long bin, fft_plan planf, fft_plan planb) |
| Finds the centers of picked particles within a micrograph. More... | |
| long | rec_extract_orient_particles (Breconstruction *rec, Bimage *ptemp, double hires, double lores, long bin, fft_plan planf, fft_plan planb) |
| double | project_extract_orient_particles (Bproject *project, Bstring &tempfile, Bsymmetry *sym, double hires, double lores, long bin) |
| Picks particles using cross-correlation. More... | |
Variables | |
| int | verbose |
Functions for picking single particle images from a micrograph.
Definition in file mg_pick.cpp.
| double gauss_find_intersection | ( | long | ngauss, |
| vector< double > & | gauss | ||
| ) |
Definition at line 180 of file mg_pick.cpp.
Calculates the average difference between voxels tagged by two marker sets.
| *p | image. |
| *markin | inner marker set (relates to particle). |
| *markout | outer marker set (relates to background). |
| contrast | contrast direction (foreground: white=1, black=0). |
The values in the image corresponding to the coordinates of the inner marker set is subtracted from those of the outer marker set.
Definition at line 429 of file mg_pick.cpp.
| double img_marker_set_difference_at_voxel | ( | Bimage * | p, |
| long | i, | ||
| Bmarker * | markin, | ||
| Bmarker * | markout | ||
| ) |
Definition at line 385 of file mg_pick.cpp.
Definition at line 742 of file mg_pick.cpp.
Definition at line 19 of file mg_pick.cpp.
Definition at line 1059 of file mg_pick.cpp.
Definition at line 1002 of file mg_pick.cpp.
| long mg_extract_orient_particles | ( | Bmicrograph * | mg, |
| Bimage * | ptemp, | ||
| double | hires, | ||
| double | lores, | ||
| long | bin, | ||
| fft_plan | planf, | ||
| fft_plan | planb | ||
| ) |
Finds the centers of picked particles within a micrograph.
| *mg | micrograph parameter structure. |
| *ptemp | template image. |
| hires | high resolution limit. |
| lores | low resolution limit. |
| bin | level of image binning. |
| planf | FFT forward plan. |
| planb | FFT backward plan. |
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 1206 of file mg_pick.cpp.
| double mg_pick_background | ( | Bmicrograph * | mg, |
| Bimage * | p, | ||
| long | number, | ||
| long | avg_kernel, | ||
| long | var_kernel, | ||
| double | excl_dist | ||
| ) |
Definition at line 754 of file mg_pick.cpp.
| double mg_pick_particles | ( | Bmicrograph * | mg, |
| Bimage * | p, | ||
| Bmarker * | markin, | ||
| Bmarker * | markout, | ||
| int | avg_kernel, | ||
| int | contrast | ||
| ) |
Locates particles using a fore/background difference measure.
| *mg | micrograph parameter structure. |
| *p | micrograph image, if NULL, read from mg. |
| *markin | foreground marker set. |
| *markout | background marker set. |
| avg_kernel | averaging kernle to smooth difference map. |
| contrast | contrast direction (foreground: white=1, black=0). |
The two marker sets are used to calculate a difference between the foreground and background as an estimate of the presence of a particle. The resultant image is smoothed by an averaging kernel and rescaled to [0,1]. This image is then scanned to identify particles.
Definition at line 473 of file mg_pick.cpp.
| double part_align | ( | Bparticle * | part, |
| Bimage * | p, | ||
| Bimage * | ptemp, | ||
| double | hires, | ||
| double | lores, | ||
| double | shift_limit, | ||
| long | bin, | ||
| fft_plan | planf, | ||
| fft_plan | planb | ||
| ) |
Definition at line 1120 of file mg_pick.cpp.
Definition at line 729 of file mg_pick.cpp.
| Bparticle* part_pick_sym_axis | ( | Bparticle * | part, |
| Bsymmetry * | sym, | ||
| View & | refview, | ||
| Vector3< double > | refori, | ||
| double | axis_dist | ||
| ) |
Definition at line 899 of file mg_pick.cpp.
| Bparticle* particles_from_peaks | ( | Bimage * | pcc, |
| long | bin, | ||
| double | excl_dist, | ||
| double | part_ori, | ||
| double & | fommin, | ||
| double | fommax, | ||
| long | maxnum, | ||
| double | pix_min, | ||
| double | pix_max | ||
| ) |
Finds the peaks in a cross-correlation map corresponding to particles.
| *pcc | peak map (after binning). |
| bin | binning to speed up calculations. |
| excl_dist | distance between peaks. |
| part_ori | particle origin. |
| fommin | minimum threshold to accept peaks. |
| fommax | maximum threshold to accept peaks. |
| maxnum | maximum number of peaks to pick. |
| pix_min | minimum peak width. |
| pix_max | maximum peak width. |
The map is searched in increments of the particle radius to identify peaks above the threshold and within a box the size of the particle radius. The identified peaks are further examined to eliminate ones that are too close to a higher scoring peak. The acceptable distance between peaks is set to 1.8 times the particle radius.
Definition at line 75 of file mg_pick.cpp.
| Bparticle* particles_pick_cc | ( | Bimage * | p, |
| Bimage * | ptemp, | ||
| Bimage * | pmask, | ||
| double | hires, | ||
| double | lores, | ||
| double | fommin, | ||
| double | fommax, | ||
| double | excl_dist, | ||
| long | bin | ||
| ) |
Picks particles using cross-correlation.
| *p | image to pick from. |
| *ptemp | template image. |
| *pmask | frequency space mask. |
| hires | high resolution limit. |
| lores | low resolution limit. |
| fommin | minimum FOM cutoff. |
| fommax | maximum FOM cutoff. |
| excl_dist | minimum distance between particles. |
| bin | level of image binning. |
A template is cross-correlated with the input image including bandpass filtering to target the size of the particle.
Definition at line 141 of file mg_pick.cpp.
| Bparticle* particles_pick_cc | ( | Bstring & | filename, |
| long | img_num, | ||
| Bimage * | ptemp, | ||
| Bimage * | pmask, | ||
| double | hires, | ||
| double | lores, | ||
| double | fommin, | ||
| double | fommax, | ||
| double | excl_dist, | ||
| long | bin | ||
| ) |
Picks particles using cross-correlation.
| &filename | image to pick from. |
| img_num | sub-image number. |
| *ptemp | template image. |
| *pmask | frequency space mask. |
| hires | high resolution limit. |
| lores | low resolution limit. |
| fommin | minimum FOM cutoff. |
| fommax | maximum FOM cutoff. |
| excl_dist | minimum distance between particles. |
| bin | level of image binning. |
A template is cross-correlated with the input image including bandpass filtering to target the size of the particle. The template must have the correct pixel size.
Definition at line 336 of file mg_pick.cpp.
| Bparticle* particles_pick_var | ( | Bimage * | p, |
| long | avg_kernel, | ||
| long | var_kernel, | ||
| double | cutmin, | ||
| double | cutmax, | ||
| double | part_ori, | ||
| double | excl_dist, | ||
| long | bin | ||
| ) |
Definition at line 286 of file mg_pick.cpp.
| Bparticle* particles_pick_var | ( | Bimage * | p, |
| long | avg_kernel, | ||
| long | var_kernel, | ||
| double | nsig, | ||
| double | part_ori, | ||
| double | excl_dist, | ||
| long | bin | ||
| ) |
Picks particles in variance map.
| *p | image to pick from. |
| avg_kernel | averaging kernel size. |
| var_kernel | variance kernel size. |
| nsig | multiple of sigma above variance average to accept peaks. |
| part_ori | particle origin. |
| excl_dist | minimum distance between particles. |
| bin | level of image binning. |
A copy of the micrograph is filtered with an averaging kernel and a variance map calculated. The variance map is then used to find high variance peaks as candidate locations for particles.
Definition at line 220 of file mg_pick.cpp.
| Bparticle* particles_pick_var | ( | Bstring & | filename, |
| long | img_num, | ||
| long | avg_kernel, | ||
| long | var_kernel, | ||
| double | nsig, | ||
| double | part_ori, | ||
| double | excl_dist, | ||
| long | bin | ||
| ) |
Picks particles in variance map.
| &filename | image to pick from. |
| img_num | sub-image number. |
| avg_kernel | averaging kernel size. |
| var_kernel | variance kernel size. |
| nsig | multiple of sigma above variance average to accept peaks. |
| part_ori | particle origin. |
| excl_dist | minimum distance between particles. |
| bin | level of image binning. |
A copy of the micrograph is filtered with an averaging kernel and a variance map calculated. The variance map is then used to find high variance peaks as candidate locations for particles.
Definition at line 370 of file mg_pick.cpp.
| double project_extract_orient_particles | ( | Bproject * | project, |
| Bstring & | tempfile, | ||
| Bsymmetry * | sym, | ||
| double | hires, | ||
| double | lores, | ||
| long | bin | ||
| ) |
Picks particles using cross-correlation.
| *project | project parameter structure. |
| &tempfile | template image. |
| sym | point group symmetry. |
| hires | high resolution limit. |
| lores | low resolution limit. |
| bin | level of image binning. |
Each micrograph is cross-correlated with the template image including bandpass filtering and frequency space masking.
Definition at line 1301 of file mg_pick.cpp.
| long project_pick_background | ( | Bproject * | project, |
| long | number, | ||
| long | avg_kernel, | ||
| long | var_kernel, | ||
| double | excl_dist | ||
| ) |
Picks background areas not overlapping existing particles.
| *project | project parameter structure. |
| number | maximum number of background images to pick. |
| avg_kernel | averaging kernel to smooth the image. |
| var_kernel | kernel to calculate a local variance image. |
| excl_dist | exclusion distance between areas. |
Definition at line 848 of file mg_pick.cpp.
| double project_pick_particles | ( | Bproject * | project, |
| Bimage * | ptemp, | ||
| Bimage * | pmask, | ||
| double | hires, | ||
| double | lores, | ||
| double | fommin, | ||
| double | fommax, | ||
| double | excl_dist, | ||
| long | bin | ||
| ) |
Picks particles using cross-correlation.
| *project | project parameter structure. |
| *ptemp | template image. |
| *pmask | frequency space mask. |
| hires | high resolution limit. |
| lores | low resolution limit. |
| fommin | minimum FOM cutoff. |
| fommax | maximum FOM cutoff. |
| excl_dist | minimum distance between particles. |
| bin | level of image binning. |
Each micrograph is cross-correlated with the template image including bandpass filtering and frequency space masking.
Definition at line 533 of file mg_pick.cpp.
| long project_pick_particles | ( | Bproject * | project, |
| double | din, | ||
| double | dout, | ||
| int | avg_kernel, | ||
| double | ainc, | ||
| int | flags, | ||
| int | contrast | ||
| ) |
Locates particles using a fore/background difference measure.
| *project | project parameter structure. |
| din | inner diameter corresponding to particle edge. |
| dout | outer diameter corresponding to background. |
| avg_kernel | averaging kernle to smooth difference map. |
| ainc | angular increment. |
| flags | flags: bit 1 = filter extremes. |
| contrast | contrast direction (foreground: white=1, black=0). |
Two marker sets are generated at the indicated diameters. At each pixel, the marker sets are used to calculate a difference between the foreground and background as an estimate of the presence of a particle.
Definition at line 676 of file mg_pick.cpp.
| double project_pick_particles | ( | Bproject * | project, |
| long | avg_kernel, | ||
| long | var_kernel, | ||
| double | nsig, | ||
| double | part_ori, | ||
| double | excl_dist, | ||
| long | bin | ||
| ) |
Picks particles in variance map.
| *project | project parameter structure. |
| avg_kernel | averaging kernel size. |
| var_kernel | variance kernel size. |
| nsig | multiple of sigma above variance average to accept peaks. |
| part_ori | particle origin. |
| excl_dist | minimum distance between particles. |
| bin | level of image binning. |
A copy of the micrograph is filtered with an averaging kernel and a variance map calculated. The variance map is then used to find high variance peaks as candidate locations for particles.
Definition at line 605 of file mg_pick.cpp.
Picks subregions in 3D particles on the given symmetry axis.
| *project | parameter structure with all parameters. |
| sym | point group symmetry. |
| sym_axis | symmetry axis to pick subregions. |
| axis_dist | distance along symmetry axis. |
The existing particles are replaced by the new particles.
Definition at line 944 of file mg_pick.cpp.
| long rec_extract_orient_particles | ( | Breconstruction * | rec, |
| Bimage * | ptemp, | ||
| double | hires, | ||
| double | lores, | ||
| long | bin, | ||
| fft_plan | planf, | ||
| fft_plan | planb | ||
| ) |
Definition at line 1246 of file mg_pick.cpp.
| double rec_pick_background | ( | Breconstruction * | rec, |
| Bimage * | p, | ||
| long | number, | ||
| long | avg_kernel, | ||
| long | var_kernel, | ||
| double | excl_dist | ||
| ) |
Definition at line 797 of file mg_pick.cpp.
|
extern |