Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
img_reconstruct.cpp File Reference

2D and 3D reconstruction from single particle images More...

#include "mg_processing.h"
#include "img_reconstruct.h"
#include "img_ctf.h"
#include "Matrix3.h"
#include "Complex.h"
#include "linked_list.h"
#include "rwimg.h"
#include "utilities.h"

Go to the source code of this file.

Functions

int img_reconstruction_interpolation (Complex< float > cv, Bimage *pmap, Vector3< double > m, float *weight, float *weight2, double part_weight, int interp_type, Vector3< double > vscale)
 
int img_pack_2D_in_recip_space (Bimage *p, Bimage *pmap, float *weight, float *weight2, Bsymmetry *sym, double hi_res, double scale, int ft_size, fft_plan plan, double part_weight, int interp_type, CTFparam *em_ctf, int ctf_action)
 Packs a 2D Fourier transform into a 3D reciprocal space volume. More...
 
int part_ft_size (int xsize, double scale, int pad_factor)
 Sets the Fourier transform size for 2D particle images for reconstruction. More...
 
size_t img_reconstruction_weigh (Bimage *prec)
 Weighs a reconstruction. More...
 
Bimage * img_reconstruction_sum_weigh (Bimage **pacc, int imap, int nmaps, int nthreads, double hi_res)
 Combines and weighs a map from several partial maps and weight sets. More...
 
int img_reconstruction_stats (Bimage *p, double resolution)
 Calculates Fourier shell statistics. More...
 
Bimage * img_backprojection_accumulate (Bimage **pacc, int imap, int nmaps, int nthreads)
 Accumulates multiple backprojections. More...
 

Variables

int verbose
 

Detailed Description

2D and 3D reconstruction from single particle images

Author
Bernard Heymann
Date
Created: 20010403
Modified: 20151101

Definition in file img_reconstruct.cpp.

Function Documentation

Bimage* img_backprojection_accumulate ( Bimage **  pacc,
int  imap,
int  nmaps,
int  nthreads 
)

Accumulates multiple backprojections.

Parameters
**paccarray of partial maps with linked weight maps.
imapwhich output map to weigh.
nmapsnumber of output maps (1,2,3).
nthreadsnumber of threads per map (= number of partial maps).
Returns
int 0.

Definition at line 629 of file img_reconstruct.cpp.

int img_pack_2D_in_recip_space ( Bimage *  p,
Bimage *  pmap,
float *  weight,
float *  weight2,
Bsymmetry *  sym,
double  hi_res,
double  scale,
int  ft_size,
fft_plan  plan,
double  part_weight,
int  interp_type,
CTFparam *  em_ctf,
int  ctf_action 
)

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

Parameters
*pparticle image.
*pmap3D reciprocal space volume.
*weightweight array.
*weight2weight squared array.
*sympoint group symmetry.
hi_reshigh resolution limit.
scalescale of reconstruction and particle magnification.
ft_sizeFourier transform size.
planFourier transform plan.
part_weightweight of particle (usually 1).
interp_typeinterpolation type (0=nearest neighbor, 1=weighted nearest neigbor, 2=trilinear).
*em_ctfCTF parameter structure.
ctf_actionCTF correction to make (0=none).
Returns
int 0, <0 on error.
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.

Definition at line 108 of file img_reconstruct.cpp.

int img_reconstruction_interpolation ( Complex< float >  cv,
Bimage *  pmap,
Vector3< double >  m,
float *  weight,
float *  weight2,
double  part_weight,
int  interp_type,
Vector3< double >  vscale 
)

Definition at line 21 of file img_reconstruct.cpp.

int img_reconstruction_stats ( Bimage *  p,
double  resolution 
)

Calculates Fourier shell statistics.

Parameters
*pimage with reciprocal space FOM calculated.
resolutionhigh resolution limit.
Returns
int 0.
The average FOM and number of FOM values in each resolution shell is determined.

Definition at line 439 of file img_reconstruct.cpp.

Bimage* img_reconstruction_sum_weigh ( Bimage **  pacc,
int  imap,
int  nmaps,
int  nthreads,
double  hi_res 
)

Combines and weighs a map from several partial maps and weight sets.

Parameters
**paccarray of partial maps with linked weight maps.
imapwhich output map to weigh.
nmapsnumber of output maps (1,2,3).
nthreadsnumber of threads per map (= number of partial maps).
hi_reshigh resolution limit.
Returns
Bimage* weighed reconstruction with FOM block.
The input is a set of partially integrated complex maps with associated 
weigths as follows:
    voxel power sums            FOM block of map.
    voxel weight sums           linked image.
    voxel weight squared sums   linked image FOM block.
The partial sums are completed into corresponding blocks in three possible
ways based on the value of imap and nmap:
    nmap    imap    result
    1       0       one map from all input maps
    2       0,1     one map from half of the input maps
    3       0       one map from all input maps
    3       1,2     one map from half of the input maps
The output map has a FOM block with an SNR value for each voxel.

Definition at line 315 of file img_reconstruct.cpp.

size_t img_reconstruction_weigh ( Bimage *  prec)

Weighs a reconstruction.

Parameters
*precreconstruction with a pointer to a weight image.
Returns
size_t coverage.
The FOM block contains the sum of powers, the next image conatins the
weight sum, and the next image FOM block contains the sum of the
weight squared.

Definition at line 256 of file img_reconstruct.cpp.

int part_ft_size ( int  xsize,
double  scale,
int  pad_factor 
)

Sets the Fourier transform size for 2D particle images for reconstruction.

Parameters
xsizesize of x dimension.
scalescale of reconstruction.
pad_factorfactor that determines image padding.
Returns
int transform size.
The reconstruction size must be set.

Definition at line 221 of file img_reconstruct.cpp.

Variable Documentation

int verbose