#include <stack>
#include "ctf.h"
#include "emdata.h"
#include <iostream>
#include <cmath>
#include <cstring>
#include <gsl/gsl_sf_bessel.h>
#include <gsl/gsl_errno.h>
#include <vector>
#include <boost/shared_ptr.hpp>
Include dependency graph for emdata_sparx.cpp:
Go to the source code of this file.
Classes | |
class | ctf_store |
Defines | |
#define | rdata(i, j, k) rdata[(i-1)+((j-1)+(k-1)*ny)*nx] |
#define | square(x) ((x)*(x)) |
#define | proj(ix, iy, iz) proj[ix-1+(iy-1+(iz-1)*ny)*nx] |
#define | pnewimg(ix, iy, iz) pnewimg[ix-1+(iy-1+(iz-1)*ny)*nx] |
#define | in(i, j, k) in[i+(j+(k*ny))*nx] |
#define | in(i, j, k) in[i+(j+(k*ny))*nx] |
#define | QUADPI 3.141592653589793238462643383279502884197 |
#define | DGR_TO_RAD QUADPI/180 |
#define | rdata(i, j, k) rdata[(i-1)+((j-1)+(k-1)*ny)*nx] |
#define | X(i) X[i-1] |
#define | Y(j) Y[j-1] |
#define | Z(k) Z[k-1] |
#define | avagadro (6.023*(double)pow(10.0,23.0)) |
#define | density_protein (1.36) |
#define | R (0.61803399f) |
#define | C (1.f-R) |
#define | QUADPI 3.141592653589793238462643383279502884197 |
#define | DGR_TO_RAD QUADPI/180 |
#define | fint(i, j, k) fint[(i-1) + ((j-1) + (k-1)*ny)*lsd] |
#define | fout(i, j, k) fout[(i-1) + ((j-1) + (k-1)*nyn)*lsdn] |
#define | fint(jx, jy, jz) fint[jx + (jy + jz*ny)*nox] |
#define | fint(jx, jy, jz) fint[jx + (jy + jz*ny)*nx] |
#define | fout(jx, jy, jz) fout[jx + (jy + jz*ny)*nx] |
Functions | |
float | dist (int lnlen, const float *line_1, const float *line_2) |
float | dist_r (int lnlen, const float *line_1, const float *line_2) |
void | swapx (float *a, float *b, float *temp, size_t nbytes) |
Helper function for EMData::fft_shuffle, below. | |
ostream & | operator<< (ostream &os, const Pixel &peak) |
float | circumference (EMData *emdata, int npixel) |
#define avagadro (6.023*(double)pow(10.0,23.0)) |
#define C (1.f-R) |
Definition at line 4642 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::find_3d_threshold(), EMAN::EMData::phase_cog(), and EMAN::Util::TwoDTestFunc().
#define density_protein (1.36) |
#define DGR_TO_RAD QUADPI/180 |
Definition at line 4936 of file emdata_sparx.cpp.
#define DGR_TO_RAD QUADPI/180 |
Definition at line 4936 of file emdata_sparx.cpp.
Referenced by EMAN::Util::CANG(), EMAN::EMData::fouriergridrot2d(), EMAN::EMData::fouriergridrot_shift2d(), and EMAN::EMData::helicise().
Definition at line 5898 of file emdata_sparx.cpp.
#define fint | ( | jx, | |||
jy, | |||||
jz | ) | fint[jx + (jy + jz*ny)*nox] |
Definition at line 5898 of file emdata_sparx.cpp.
#define fint | ( | i, | |||
j, | |||||
k | ) | fint[(i-1) + ((j-1) + (k-1)*ny)*lsd] |
Definition at line 5898 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::filter_by_image(), EMAN::EMData::Four_ds(), EMAN::EMData::Four_shuf_ds_cen_us(), EMAN::EMData::FourInterpol(), EMAN::EMData::FourTruncate(), and EMAN::EMData::replace_amplitudes().
Definition at line 5899 of file emdata_sparx.cpp.
#define fout | ( | i, | |||
j, | |||||
k | ) | fout[(i-1) + ((j-1) + (k-1)*nyn)*lsdn] |
Definition at line 5899 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::Four_ds(), EMAN::EMData::Four_shuf_ds_cen_us(), EMAN::EMData::FourInterpol(), EMAN::EMData::FourTruncate(), and EMAN::EMData::replace_amplitudes().
Definition at line 2123 of file emdata_sparx.cpp.
Definition at line 2123 of file emdata_sparx.cpp.
Referenced by EMAN::Log::begin(), EMAN::Util::cl1(), EMAN::EMData::conjg(), EMAN::newfile_store::get_image(), EMAN::EMUtil::get_image_type(), EMAN::EMData::get_pow(), EMAN::Wiener2DFourierProcessor::process(), EMAN::ApplyPolynomialProfileToHelix::process_inplace(), EMAN::ModelEMCylinderProcessor::process_inplace(), EMAN::FileFourierProcessor::process_inplace(), EMAN::newfile_store::read(), EMAN::XYData::read_file(), EMAN::file_store::restart(), EMAN::newfile_store::restart(), EMAN::EMData::rot_scale_trans(), and EMAN::EMData::rot_scale_trans_background().
Definition at line 964 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::average_circ_sub(), EMAN::FourierGriddingProjector::project3d(), EMAN::StandardProjector::project3d(), EMAN::PointArray::projection_by_summation(), recons3d_4nn(), EMAN::PointArray::replace_by_summation(), and EMAN::Util::twoD_to_3D_ali().
#define QUADPI 3.141592653589793238462643383279502884197 |
Definition at line 4935 of file emdata_sparx.cpp.
#define QUADPI 3.141592653589793238462643383279502884197 |
Definition at line 4935 of file emdata_sparx.cpp.
#define R (0.61803399f) |
Definition at line 4641 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::find_3d_threshold(), and EMAN::Transform::orthogonalize().
Definition at line 4504 of file emdata_sparx.cpp.
Definition at line 4504 of file emdata_sparx.cpp.
#define square | ( | x | ) | ((x)*(x)) |
Definition at line 671 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::calc_sigma_diff(), EMAN::OptVarianceCmp::cmp(), EMAN::EMData::cog(), EMAN::WienerFourierReconstructor::insert_slice(), EMAN::EMData::little_big_dot(), main(), and EMAN::BilateralProcessor::process_inplace().
#define X | ( | i | ) | X[i-1] |
Definition at line 4505 of file emdata_sparx.cpp.
Referenced by EMAN::SVDAnalyzer::analyze(), EMAN::EMData::phase_cog(), and EMAN::Util::svdcmp().
#define Y | ( | j | ) | Y[j-1] |
Definition at line 4506 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::phase_cog(), and EMAN::Util::WTF().
#define Z | ( | k | ) | Z[k-1] |
float circumference | ( | EMData * | emdata, | |
int | npixel | |||
) |
Definition at line 5133 of file emdata_sparx.cpp.
References Assert, data, EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), nx, and ny.
05134 { 05135 int nx = emdata->get_xsize(); 05136 int ny = emdata->get_ysize(); 05137 int nz = emdata->get_zsize(); 05138 05139 float* data = emdata->get_data(); 05140 if( ny==1 && nz==1 ) 05141 { 05142 // 1d case 05143 float sumf=0.0; 05144 int sumn=0; 05145 for( int i=0; i < npixel; ++i ) 05146 { 05147 sumf += data[i]; 05148 sumf += data[nx-1-i]; 05149 sumn += 2; 05150 } 05151 return sumf/sumn; 05152 } 05153 05154 if( nz==1 ) 05155 { 05156 float sumf=0.0; 05157 int sumn=0; 05158 int id=0; 05159 for( int iy=0; iy < ny; ++iy ) 05160 { 05161 for( int ix=0; ix < nx; ++ix ) 05162 { 05163 if( iy<npixel || iy>ny-1-npixel || ix<npixel || ix>nx-1-npixel ) 05164 { 05165 sumf += data[id]; 05166 sumn += 1; 05167 } 05168 id++; 05169 } 05170 } 05171 05172 Assert( id==nx*ny ); 05173 Assert( sumn == nx*ny - (nx-2*npixel)*(ny-2*npixel) ); 05174 return sumf/sumn; 05175 } 05176 05177 // 3d cases; 05178 05179 float sumf = 0.0; 05180 int sumn = 0; 05181 int id = 0; 05182 for( int iz=0; iz < nz; ++iz) 05183 { 05184 for( int iy=0; iy < ny; ++iy) 05185 { 05186 for( int ix=0; ix < nx; ++ix ) 05187 { 05188 if( iz<npixel||iz>nz-1-npixel||iy<npixel||iy>ny-1-npixel||ix<npixel||ix>nx-1-npixel) 05189 { 05190 sumf += data[id]; 05191 sumn += 1; 05192 } 05193 id++; 05194 } 05195 } 05196 } 05197 05198 05199 Assert( id==nx*ny*nz); 05200 Assert( sumn==nx*ny*nz-(nx-2*npixel)*(ny-2*npixel)*(nz-2*npixel) ); 05201 return sumf/sumn; 05202 }
float dist | ( | int | lnlen, | |
const float * | line_1, | |||
const float * | line_2 | |||
) |
Definition at line 452 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::cm_euc(), EMAN::Quaternion::normalize(), EMAN::RotationalSubstractProcessor::process_inplace(), EMAN::RotationalAverageProcessor::process_inplace(), EMAN::MaskGaussNonuniformProcessor::process_pixel(), EMAN::CircularMaskProcessor::process_pixel(), and EMAN::PointArray::set_from_density_map().
00453 { 00454 float dis2=0.0; 00455 for( int i=0; i < lnlen; ++i) { 00456 float tmp = line_1[i] - line_2[i]; 00457 dis2 += tmp*tmp; 00458 } 00459 //return static_cast<float>(std::sqrt(dis2)); 00460 return dis2; 00461 }
float dist_r | ( | int | lnlen, | |
const float * | line_1, | |||
const float * | line_2 | |||
) |
Definition at line 463 of file emdata_sparx.cpp.
References sqrt().
00464 { 00465 double dis2 = 0.0; 00466 for( int i=0; i < lnlen; ++i ) { 00467 float tmp = line_1[lnlen-1-i] - line_2[i]; 00468 dis2 += tmp*tmp; 00469 } 00470 return static_cast<float>(std::sqrt(dis2)); 00471 }
ostream& operator<< | ( | ostream & | os, | |
const Pixel & | peak | |||
) |
Definition at line 3666 of file emdata_sparx.cpp.
References EMAN::Pixel::value, EMAN::Pixel::x, EMAN::Pixel::y, and EMAN::Pixel::z.
void swapx | ( | float * | a, | |
float * | b, | |||
float * | temp, | |||
size_t | nbytes | |||
) | [inline] |
Helper function for EMData::fft_shuffle, below.
Definition at line 3226 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::fft_shuffle().
03226 { 03227 memcpy(temp, a, nbytes); 03228 memcpy(a, b, nbytes); 03229 memcpy(b, temp, nbytes); 03230 }