#include "reconstructor.h"
#include "plugins/reconstructor_template.h"
#include "ctf.h"
#include "emassert.h"
#include "symmetry.h"
#include <cstring>
#include <fstream>
#include <iomanip>
#include <gsl/gsl_statistics_double.h>
#include <gsl/gsl_fit.h>
#include <iostream>
#include <algorithm>
#include <sstream>
Go to the source code of this file.
|
#define | tw(i, j, k) tw[ i-1 + (j-1+(k-1)*iy)*ix ] |
|
#define | tw(i, j, k) tw[ i-1 + (j-1+(k-1)*iy)*ix ] |
|
◆ tw [1/2]
#define tw |
( |
|
i, |
|
|
|
j, |
|
|
|
k |
|
) |
| tw[ i-1 + (j-1+(k-1)*iy)*ix ] |
◆ tw [2/2]
#define tw |
( |
|
i, |
|
|
|
j, |
|
|
|
k |
|
) |
| tw[ i-1 + (j-1+(k-1)*iy)*ix ] |
◆ weighting_method
◆ checked_delete()
template<typename T >
void checked_delete |
( |
T *& |
x | ) |
|
Definition at line 65 of file reconstructor.cpp.
67 typedef char type_must_be_complete[
sizeof(T)? 1: -1 ];
68 (void)
sizeof(type_must_be_complete);
References x.
Referenced by EMAN::newfile_store::add_image(), EMAN::file_store::add_image(), EMAN::nn4Reconstructor::insert_slice(), EMAN::nn4_rectReconstructor::insert_slice(), EMAN::nnSSNR_Reconstructor::insert_slice(), EMAN::nn4_ctfReconstructor::insert_slice(), EMAN::nn4_ctfwReconstructor::insert_slice(), EMAN::nn4_ctfwsReconstructor::insert_slice(), EMAN::nn4_ctf_rectReconstructor::insert_slice(), EMAN::nnSSNR_ctfReconstructor::insert_slice(), and EMAN::padfft_slice().
◆ circumfnn()
void circumfnn |
( |
EMData * |
win, |
|
|
int |
npad |
|
) |
| |
Definition at line 3007 of file reconstructor.cpp.
3009 float *
tw = win->get_data();
3012 int ix = win->get_xsize();
3013 int iy = win->get_ysize();
3014 int iz = win->get_zsize();
3015 int L2 = (ix/2)*(ix/2);
3016 int L2P = (ix/2-1)*(ix/2-1);
3023 float* sincx =
new float[IP+1];
3024 float* sincy =
new float[JP+1];
3025 float* sincz =
new float[KP+1];
3032 if( npad == 1 ) cor = 1.0;
3035 float cdf = M_PI/(cor*ix);
3036 for (
int i = 1; i <= IP; ++i) sincx[i] = sin(i*cdf)/(i*cdf);
3037 cdf = M_PI/(cor*iy);
3038 for (
int i = 1; i <= JP; ++i) sincy[i] = sin(i*cdf)/(i*cdf);
3039 cdf = M_PI/(cor*iz);
3040 for (
int i = 1; i <= KP; ++i) sincz[i] = sin(i*cdf)/(i*cdf);
3041 for (
int k = 1; k <= iz; ++k) {
3042 int kkp = abs(k-KP);
3043 for (
int j = 1; j <= iy; ++j) {
3044 cdf = sincy[abs(j- JP)]*sincz[kkp];
3045 for (
int i = 1; i <= ix; ++i)
tw(i,j,k) /= (sincx[abs(i-IP)]*cdf);
3055 for (
int k = 1; k <= iz; ++k) {
3056 for (
int j = 1; j <= iy; ++j) {
3057 for (
int i = 1; i <= ix; ++i) {
3058 size_t LR = (k-KP)*(k-KP)+(j-JP)*(j-JP)+(i-IP)*(i-IP);
3059 if (LR >= (
size_t)L2P && LR<=(size_t)L2) {
3070 for (
int k = 1; k <= iz; ++k) {
3071 for (
int j = 1; j <= iy; ++j) {
3072 for (
int i = 1; i <= ix; ++i) {
3073 size_t LR = (k-KP)*(k-KP)+(j-JP)*(j-JP)+(i-IP)*(i-IP);
3074 if (LR<=(
size_t)L2)
tw(i,j,k) -= TNR;
3075 else tw(i,j,k) = 0.0f;
References tw.
Referenced by EMAN::nn4Reconstructor::finish(), and EMAN::nn4_ctfReconstructor::finish().
◆ circumfnn_rect()
void circumfnn_rect |
( |
EMData * |
win, |
|
|
int |
npad |
|
) |
| |
Definition at line 3695 of file reconstructor.cpp.
3697 float *
tw = win->get_data();
3700 int ix = win->get_xsize();
3701 int iy = win->get_ysize();
3702 int iz = win->get_zsize();
3709 float* sincx =
new float[IP+1];
3710 float* sincy =
new float[JP+1];
3711 float* sincz =
new float[KP+1];
3717 float cdf = M_PI/float(npad*2*ix);
3718 for (
int i = 1; i <= IP; ++i) sincx[i] = sin(i*cdf)/(i*cdf);
3719 cdf = M_PI/float(npad*2*iy);
3720 for (
int i = 1; i <= JP; ++i) sincy[i] = sin(i*cdf)/(i*cdf);
3721 cdf = M_PI/float(npad*2*iz);
3722 for (
int i = 1; i <= KP; ++i) sincz[i] = sin(i*cdf)/(i*cdf);
3723 for (
int k = 1; k <= iz; ++k) {
3724 int kkp = abs(k-KP);
3725 for (
int j = 1; j <= iy; ++j) {
3726 cdf = sincy[abs(j- JP)]*sincz[kkp];
3727 for (
int i = 1; i <= ix; ++i)
tw(i,j,k) /= (sincx[abs(i-IP)]*cdf);
3737 float dxx = 1.0f/float(0.25*ix*ix);
3738 float dyy = 1.0f/float(0.25*iy*iy);
3742 float LR2=(float(ix)/2-1)*(
float(ix)/2-1)*dxx;
3746 for (
int k = 1; k <= iz; ++k) {
3747 for (
int j = 1; j <= iy; ++j) {
3748 for (
int i = 1; i <= ix; ++i) {
3749 float LR = (j-JP)*(j-JP)*dyy+(i-IP)*(i-IP)*dxx;
3750 if (LR<=1.0f && LR >= LR2) {
3761 for (
int k = 1; k <= iz; ++k) {
3762 for (
int j = 1; j <= iy; ++j) {
3763 for (
int i = 1; i <= ix; ++i) {
3764 float LR = (j-JP)*(j-JP)*dyy+(i-IP)*(i-IP)*dxx;
3765 if (LR<=1.0f)
tw(i,j,k)=
tw(i,j,k)-TNR;
3766 else tw(i,j,k) = 0.0f;
References tw.
Referenced by EMAN::nn4_rectReconstructor::finish(), and EMAN::nn4_ctf_rectReconstructor::finish().
◆ circumftrl()
void circumftrl |
( |
EMData * |
win, |
|
|
int |
npad |
|
) |
| |
Definition at line 3083 of file reconstructor.cpp.
3085 float *
tw = win->get_data();
3088 int ix = win->get_xsize();
3089 int iy = win->get_ysize();
3090 int iz = win->get_zsize();
3091 int L2 = (ix/2)*(ix/2);
3092 int L2P = (ix/2-1)*(ix/2-1);
3099 float* sincx =
new float[IP+1];
3100 float* sincy =
new float[JP+1];
3101 float* sincz =
new float[KP+1];
3108 if( npad == 1 ) cor = 1.0;
3111 float cdf = M_PI/(cor*ix);
3112 for (
int i = 1; i <= IP; ++i) sincx[i] = pow(sin(i*cdf)/(i*cdf),2);
3113 cdf = M_PI/(cor*iy);
3114 for (
int i = 1; i <= JP; ++i) sincy[i] = pow(sin(i*cdf)/(i*cdf),2);
3115 cdf = M_PI/(cor*iz);
3116 for (
int i = 1; i <= KP; ++i) sincz[i] = pow(sin(i*cdf)/(i*cdf),2);
3117 for (
int k = 1; k <= iz; ++k) {
3118 int kkp = abs(k-KP);
3119 for (
int j = 1; j <= iy; ++j) {
3120 cdf = sincy[abs(j- JP)]*sincz[kkp];
3121 for (
int i = 1; i <= ix; ++i)
tw(i,j,k) /= (sincx[abs(i-IP)]*cdf);
3131 for (
int k = 1; k <= iz; ++k) {
3132 for (
int j = 1; j <= iy; ++j) {
3133 for (
int i = 1; i <= ix; ++i) {
3134 size_t LR = (k-KP)*(k-KP)+(j-JP)*(j-JP)+(i-IP)*(i-IP);
3135 if (LR >= (
size_t)L2P && LR<=(size_t)L2) {
3146 for (
int k = 1; k <= iz; ++k) {
3147 for (
int j = 1; j <= iy; ++j) {
3148 for (
int i = 1; i <= ix; ++i) {
3149 size_t LR = (k-KP)*(k-KP)+(j-JP)*(j-JP)+(i-IP)*(i-IP);
3150 if (LR<=(
size_t)L2)
tw(i,j,k) -= TNR;
3151 else tw(i,j,k) = 0.0f;
References tw.
Referenced by EMAN::nn4_ctfwReconstructor::finish(), and EMAN::nn4_ctfwsReconstructor::finish().
◆ max2d()
float max2d |
( |
int |
kc, |
|
|
const vector< float > & |
pow_a |
|
) |
| |
◆ max3d()
float max3d |
( |
int |
kc, |
|
|
const vector< float > & |
pow_a |
|
) |
| |
◆ printImage()
void printImage |
( |
const EMData * |
line | ) |
|
Definition at line 3271 of file reconstructor.cpp.
3273 Assert( line->get_zsize()==1 );
3276 int nx = line->get_xsize();
3277 int ny = line->get_ysize();
3278 for(
int j=0; j < ny; ++j ) {
3279 for(
int i=0; i < nx; ++i ) printf(
"%10.3f ", line->get_value_at(i,j) );
#define Assert(s)
Define Assert() function that is effective only when -DDEBUG is used.
References Assert.