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

Functions to assess the resoltion of a tomographic tilt series. More...

#include "mg_tomo_resol.h"
#include "mg_tomo_rec.h"
#include "mg_reconstruct.h"
#include "rwimg.h"
#include "mg_ctf.h"
#include "Complex.h"
#include "linked_list.h"
#include "utilities.h"

Functions

Bplotimg_calculate_FRC_curve (vector< Bimage * > parr, double hi_res, double sampling_ratio)
 Calculates the FRC/FSC for a micrograph or particle image in a series.
More...
 
double plot_calculate_resolution (Bplot *plot, double cutoff)
 Calculates the resolution estimate from a FRC/FSC curve.
More...
 
int plot_resolution (Bplot *plot, double hi_res, Bstring &psfile, Bstring &title)
 Plots the resolution curve in a plot structure.
More...
 
int img_pack_2D_into_central_section_old (Bimage *p, Bimage *prec, Bimage *prec2, long ft_size, int zsize, double scale, double hi_res, Matrix3 matr, Matrix3 mat, int inplane)
 
vector< Bimage * > mg_tomo_res_reconstruct (Bproject *project, int micrograph_id, double hi_res, double sampling_ratio, double scale, Vector3< long > size, double fast_angle, int action, double wiener)
 Estimating the resolution of one micrograph in an aligned tilt series. More...
 
Bimagemg_tomo_resolution (Bproject *project, int micrograph_id, double hi_res, double sampling_ratio, double scale, Vector3< long > size, double fast_angle, int action, double wiener, double cutoff, Bstring &psfile)
 Estimating the resolution of one micrograph in an aligned tilt series.
More...
 
int plot_nloo3d (Bplot *plot)
 
vector< Bplot * > project_tomo_resolution (Bproject *project, double hi_res, double sampling_ratio, double scale, Vector3< long > size, double fast_angle, int action, double wiener, double cutoff)
 Estimating the resolution of the tomogram from an aligned tilt series. More...
 
Bplotproject_tomo_particle_resolution (Bproject *project, double hi_res, double sampling_ratio, double fast_angle, double cutoff)
 Estimates the resolution for each particle image in each micrograph. More...
 
long img_pack_2D_into_central_section (Bimage *p, Bimage *prec, Bimage *prec2, long ft_size, double scale, double hi_res, Matrix3 matr, Matrix3 mat, int inplane)
 Packs a 2D Fourier transform into a 3D reciprocal space volume.
More...
 
Bplotplot_tilt_resolution (Bproject *project)
 Plots the estimated resolution against the tilt angle. More...
 

Variables

int verbose
 

Detailed Description

Functions to assess the resoltion of a tomographic tilt series.

Author
Bernard Heymann
Date
Created: 20031205
Modified: 20190221

Function Documentation

◆ img_calculate_FRC_curve()

Bplot * img_calculate_FRC_curve ( vector< Bimage * >  parr,
double  hi_res,
double  sampling_ratio 
)

Calculates the FRC/FSC for a micrograph or particle image in a series.

Parameters
parrimage array with 2D Fourier transform, 3D central section, 3D LOO central section
hi_reshigh resolution limit.
sampling_ratioratio for averaging window.
Returns
Bplot* plot structure with FRC/FSC curve.

◆ img_pack_2D_into_central_section()

long img_pack_2D_into_central_section ( Bimage p,
Bimage prec,
Bimage prec2,
long  ft_size,
double  scale,
double  hi_res,
Matrix3  matr,
Matrix3  mat,
int  inplane 
)

Packs a 2D Fourier transform into a 3D reciprocal space volume.

Parameters
*p2D Fourier transform.
*prec3D central section.
*prec23D central section with in-plane micrograph omitted.
ft_sizeFourier transform size.
scalereconstruction scale.
hi_reshigh resolution limit.
matrin plane or reference matrix.
matmatrix of image being packed.
inplaneflag to indicate an in plane image.
Returns
long number voxels packed.
The rotation matrix is used to determine the plane in reciprocal space
to which the 2D transform data is added. The map is assumed to be cubic
and the 2D transform square. The orientation parameters must be written
into the image structure. The real space 2D image must be supplied.
This is then padded to more than twice its original size, fourier
transformed, and packed into the 3D reciprocal space block.

◆ img_pack_2D_into_central_section_old()

int img_pack_2D_into_central_section_old ( Bimage p,
Bimage prec,
Bimage prec2,
long  ft_size,
int  zsize,
double  scale,
double  hi_res,
Matrix3  matr,
Matrix3  mat,
int  inplane 
)

◆ mg_tomo_res_reconstruct()

vector< Bimage * > mg_tomo_res_reconstruct ( Bproject project,
int  micrograph_id,
double  hi_res,
double  sampling_ratio,
double  scale,
Vector3< long >  size,
double  fast_angle,
int  action,
double  wiener 
)

Estimating the resolution of one micrograph in an aligned tilt series.

Parameters
*projectimage processing parameter structure.
micrograph_idmicrograph number to use for resolution test.
hi_reshigh resolution limit.
sampling_ratioratio for averaging window.
scalereconstruction scale.
sizereconstruction size.
fast_angleangle to select micrographs for reconstruction.
actionflag to apply CTF to projections.
wienerWiener factor.
Returns
vector<Bimage*> array of three images, length of zero on error.
The orientation parameters, view vector, angle of rotation and origin,
must all be set. Each image is padded to at least two times its size
and its Fourier transform packed into 3D reciprocal space.
The figure-of-merit calculated for each reciprocal space voxel is:
           sum(w*re)^2 + sum(w*im)^2
    FOM = ---------------------------
          sum(w)*sum(w*(re^2 + im^2))
where
    re  real part
    im  imaginary part
    w   weight (inverse distance of image pixel to closest grid point)
For voxels with only one data pixel contributing to it, FOM(0).
An image is used in the reconstruction if its selection flag has been set.
If the selection number is less than zero, all particles with selection flags
greater than zero are used. If the selection number is zero or above, all
particles with the selection flag set to the same number are used.
Three images are returned: micrograph, full reconstruction, leave-one-out reconstruction.

◆ mg_tomo_resolution()

Bimage * mg_tomo_resolution ( Bproject project,
int  micrograph_id,
double  hi_res,
double  sampling_ratio,
double  scale,
Vector3< long >  size,
double  fast_angle,
int  action,
double  wiener,
double  cutoff,
Bstring psfile 
)

Estimating the resolution of one micrograph in an aligned tilt series.

Parameters
*projectimage processing parameter structure.
micrograph_idmicrograph number to use for resolution test.
hi_reshigh resolution limit.
sampling_ratioratio for averaging window.
scalereconstruction scale.
sizereconstruction size.
fast_angleangle to select micrographs for reconstruction.
actionflag to apply CTF to projections.
wienerWiener factor.
cutoffFRC cutoff.
&psfilepostscript output file name.
Returns
Bimage* micrograph reconstruction, NULL on error.
The orientation parameters, view vector, angle of rotation and origin,
must all be set. Each image is padded to at least two times its size 
and its Fourier transform packed into 3D reciprocal space.
The figure-of-merit calculated for each reciprocal space voxel is:
           sum(w*re)^2 + sum(w*im)^2
    FOM = ---------------------------
          sum(w)*sum(w*(re^2 + im^2))
where
    re  real part
    im  imaginary part
    w   weight (inverse distance of image pixel to closest grid point)
For voxels with only one data pixel contributing to it, FOM(0).
An image is used in the reconstruction if its selection flag has been set.
If the selection number is less than zero, all particles with selection flags
greater than zero are used. If the selection number is zero or above, all
particles with the selection flag set to the same number are used.

◆ plot_calculate_resolution()

double plot_calculate_resolution ( Bplot plot,
double  cutoff 
)

Calculates the resolution estimate from a FRC/FSC curve.

Parameters
*plotplot structure.
cutoffFRC/FSC cutoff to use.
Returns
double estimated resolution.

◆ plot_nloo3d()

int plot_nloo3d ( Bplot plot)

◆ plot_resolution()

int plot_resolution ( Bplot plot,
double  hi_res,
Bstring psfile,
Bstring title 
)

Plots the resolution curve in a plot structure.

Parameters
*plotplot structure.
hi_reshigh resolution limit.
&psfilepostscript output file name.
&titleplot title.
Returns
int 0.

◆ plot_tilt_resolution()

Bplot * plot_tilt_resolution ( Bproject project)

Plots the estimated resolution against the tilt angle.

Parameters
*projectproject structure.
Returns
*plot new plot.
The resolution estimates must be encoded in the micrograph FOM's.

◆ project_tomo_particle_resolution()

Bplot * project_tomo_particle_resolution ( Bproject project,
double  hi_res,
double  sampling_ratio,
double  fast_angle,
double  cutoff 
)

Estimates the resolution for each particle image in each micrograph.

Parameters
*projectmicrograph project.
hi_reshigh resolution limit for resolution estimation.
sampling_ratioratio for averaging window.
fast_angleangle to select micrographs for reconstruction.
cutoffFRC cutoff to use.
Returns
Bplot* plot with average particle resolutions.
Requires the particles to be defined in all micrographs.
The NLOO algorithm is used for each particle.

◆ project_tomo_resolution()

vector< Bplot * > project_tomo_resolution ( Bproject project,
double  hi_res,
double  sampling_ratio,
double  scale,
Vector3< long >  size,
double  fast_angle,
int  action,
double  wiener,
double  cutoff 
)

Estimating the resolution of the tomogram from an aligned tilt series.

Parameters
*projectimage processing parameter structure.
hi_reshigh resolution limit.
sampling_ratioratio for averaging window.
scalereconstruction scale.
sizereconstruction size.
fast_angleangle to select micrographs for reconstruction.
actionflag to apply CTF to projections.
wienerWiener factor.
cutoffFRC cutoff.
Returns
vector<Bplot*> Two plots: Tilt-resolution and NLOO-3D.
The orientation parameters, view vector, angle of rotation and origin,
must all be set. Each image is padded to at least two times its size
and its Fourier transform packed into 3D reciprocal space.
The figure-of-merit calculated for each reciprocal space voxel is:
           sum(w*re)^2 + sum(w*im)^2
    FOM = ---------------------------
          sum(w)*sum(w*(re^2 + im^2))
where
    re  real part
    im  imaginary part
    w   weight (inverse distance of image pixel to closest grid point)
For voxels with only one data pixel contributing to it, FOM(0).
An image is used in the reconstruction if its selection flag has been set.
If the selection number is less than zero, all particles with selection flags
greater than zero are used. If the selection number is zero or above, all
particles with the selection flag set to the same number are used.

Variable Documentation

◆ verbose

int verbose
extern