Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

reconstructor.cpp File Reference

#include "reconstructor.h"
#include "plugins/reconstructor_template.h"
#include "ctf.h"
#include "emassert.h"
#include "symmetry.h"
#include <cstring>
#include <fstream>
#include <iomanip>
#include <boost/bind.hpp>
#include <boost/format.hpp>
#include <gsl/gsl_statistics_double.h>
#include <gsl/gsl_fit.h>
#include <iostream>
#include <algorithm>
#include <sstream>

Include dependency graph for reconstructor.cpp:

Go to the source code of this file.

Defines

#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 ]
#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 ]

Enumerations

enum  weighting_method { NONE, ESTIMATE, VORONOI }

Functions

template<typename T>
void checked_delete (T *&x)
EMDataEMAN::padfft_slice (const EMData *const slice, const Transform &t, int npad)
 Direct Fourier inversion Reconstructor.
float max2d (int kc, const vector< float > &pow_a)
float max3d (int kc, const vector< float > &pow_a)
void printImage (const EMData *line)
void circumference (EMData *win)
void EMAN::dump_reconstructors ()
map< string, vector< string > > EMAN::dump_reconstructors_list ()


Define Documentation

#define tw i,
j,
 )     tw[ i-1 + (j-1+(k-1)*iy)*ix ]
 

Definition at line 3100 of file reconstructor.cpp.

#define tw i,
j,
 )     tw[ i-1 + (j-1+(k-1)*iy)*ix ]
 

Definition at line 3100 of file reconstructor.cpp.

#define tw i,
j,
 )     tw[ i-1 + (j-1+(k-1)*iy)*ix ]
 

Definition at line 3100 of file reconstructor.cpp.

#define tw i,
j,
 )     tw[ i-1 + (j-1+(k-1)*iy)*ix ]
 

Definition at line 3100 of file reconstructor.cpp.

Referenced by circumference().


Enumeration Type Documentation

enum weighting_method
 

Enumerator:
NONE 
ESTIMATE 
VORONOI 

Definition at line 1895 of file reconstructor.cpp.

01895 { NONE, ESTIMATE, VORONOI };


Function Documentation

template<typename T>
void checked_delete T *&  x  ) 
 

Definition at line 65 of file reconstructor.cpp.

Referenced by EMAN::file_store::add_image(), EMAN::newfile_store::add_image(), EMAN::nnSSNR_ctfReconstructor::insert_slice(), EMAN::nn4_ctfReconstructor::insert_slice(), EMAN::nnSSNR_Reconstructor::insert_slice(), EMAN::nn4Reconstructor::insert_slice(), EMAN::padfft_slice(), EMAN::nn4_ctfReconstructor::~nn4_ctfReconstructor(), EMAN::nn4Reconstructor::~nn4Reconstructor(), EMAN::nnSSNR_ctfReconstructor::~nnSSNR_ctfReconstructor(), and EMAN::nnSSNR_Reconstructor::~nnSSNR_Reconstructor().

00066 {
00067     typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
00068     (void) sizeof(type_must_be_complete);
00069     delete x;
00070     x = NULL;
00071 }

void circumference EMData win  ) 
 

Definition at line 2130 of file reconstructor.cpp.

References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), and tw.

Referenced by EMAN::nn4_ctfReconstructor::finish(), EMAN::nn4Reconstructor::finish(), and EMAN::EMData::norm_pad().

02131 {
02132         float *tw = win->get_data();
02133         //  mask and subtract circumference average
02134         int ix = win->get_xsize();
02135         int iy = win->get_ysize();
02136         int iz = win->get_zsize();
02137         int L2 = (ix/2)*(ix/2);
02138         int L2P = (ix/2-1)*(ix/2-1);
02139 
02140         int IP = ix/2+1;
02141         int JP = iy/2+1;
02142         int KP = iz/2+1;
02143 
02144         float  TNR = 0.0f;
02145         size_t m = 0;
02146         for (int k = 1; k <= iz; ++k) {
02147                 for (int j = 1; j <= iy; ++j) {
02148                         for (int i = 1; i <= ix; ++i) {
02149                                 size_t LR = (k-KP)*(k-KP)+(j-JP)*(j-JP)+(i-IP)*(i-IP);
02150                                 if (LR<=(size_t)L2) {
02151                                         if(LR >= (size_t)L2P && LR <= (size_t)L2) {
02152                                                 TNR += tw(i,j,k);
02153                                                 ++m;
02154                                         }
02155                                 }
02156                         }
02157                 }
02158         }
02159 
02160         TNR /=float(m);
02161         for (int k = 1; k <= iz; ++k) {
02162                 for (int j = 1; j <= iy; ++j) {
02163                         for (int i = 1; i <= ix; ++i) {
02164                                 size_t LR = (k-KP)*(k-KP)+(j-JP)*(j-JP)+(i-IP)*(i-IP);
02165                                 if (LR<=(size_t)L2) tw(i,j,k) -= TNR; else tw(i,j,k) = 0.0f;
02166                         }
02167                 }
02168         }
02169 
02170 }

float max2d int  kc,
const vector< float > &  pow_a
 

Definition at line 1897 of file reconstructor.cpp.

References abs, and max.

Referenced by EMAN::nn4Reconstructor::finish().

01898 {
01899         float max = 0.0;
01900         for( int i=-kc; i <= kc; ++i ) {
01901                 for( int j=-kc; j <= kc; ++j ) {
01902                         if( i==0 && j==0 ) continue;
01903                         {
01904                                 int c = 2*kc+1 - std::abs(i) - std::abs(j);
01905                                 max = max + pow_a[c];
01906                         }
01907                 }
01908         }
01909         return max;
01910 }

float max3d int  kc,
const vector< float > &  pow_a
 

Definition at line 1912 of file reconstructor.cpp.

References abs, and max.

Referenced by EMAN::nnSSNR_ctfReconstructor::finish(), EMAN::nn4_ctfReconstructor::finish(), EMAN::nnSSNR_Reconstructor::finish(), and EMAN::nn4Reconstructor::finish().

01913 {
01914         float max = 0.0;
01915         for( int i=-kc; i <= kc; ++i ) {
01916                 for( int j=-kc; j <= kc; ++j ) {
01917                         for( int k=-kc; k <= kc; ++k ) {
01918                                 if( i==0 && j==0 && k==0 ) continue;
01919                                 // if( i!=0 )
01920                                 {
01921                                         int c = 3*kc+1 - std::abs(i) - std::abs(j) - std::abs(k);
01922                                         max = max + pow_a[c];
01923                                         // max = max + c * c;
01924                                         // max = max + c;
01925                                 }
01926                         }
01927                 }
01928         }
01929         return max;
01930 }

void printImage const EMData line  ) 
 

Definition at line 2041 of file reconstructor.cpp.

References Assert, EMAN::EMData::get_value_at(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), nx, and ny.

02042 {
02043         Assert( line->get_zsize()==1 );
02044 
02045 
02046         int nx = line->get_xsize();
02047         int ny = line->get_ysize();
02048         for( int j=0; j < ny; ++j ) {
02049                 for( int i=0; i < nx; ++i )  printf( "%10.3f ", line->get_value_at(i,j) );
02050                 printf( "\n" );
02051         }
02052 }


Generated on Mon Jul 19 13:05:07 2010 for EMAN2 by  doxygen 1.4.4