#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 |
class | ctf_store_new |
Defines | |
#define | rdata(i, j, k) rdata[(i-1)+((j-1)+(k-1)*ny)*(size_t)nx] |
#define | square(x) ((x)*(x)) |
#define | proj(ix, iy, iz) proj[ix-1+(iy-1+(iz-1)*ny)*(size_t)nx] |
#define | pnewimg(ix, iy, iz) pnewimg[ix-1+(iy-1+(iz-1)*ny)*(size_t)nx] |
#define | in(i, j, k) in[i+(j+(k*ny))*(size_t)nx] |
#define | in(i, j, k) in[i+(j+(k*ny))*(size_t)nx] |
#define | QUADPI 3.141592653589793238462643383279502884197 |
#define | DGR_TO_RAD QUADPI/180 |
#define | rdata(i, j, k) rdata[(i-1)+((j-1)+(k-1)*ny)*(size_t)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)*(size_t)lsd] |
#define | fout(i, j, k) fout[(i-1) + ((j-1) + (k-1)*nyn)*(size_t)lsdn] |
#define | fint(jx, jy, jz) fint[jx + (jy + jz*ny)*(size_t)nox] |
#define | fint(jx, jy, jz) fint[jx + (jy + jz*ny)*(size_t)nx] |
#define | fout(jx, jy, jz) fout[jx + (jy + jz*ny)*(size_t)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 5974 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 6268 of file emdata_sparx.cpp.
#define DGR_TO_RAD QUADPI/180 |
Definition at line 6268 of file emdata_sparx.cpp.
Referenced by EMAN::Util::CANG(), EMAN::EMData::fouriergridrot2d(), EMAN::EMData::fouriergridrot_shift2d(), EMAN::EMData::helicise(), and EMAN::EMData::helicise_grid().
Definition at line 7363 of file emdata_sparx.cpp.
#define fint | ( | jx, | |||
jy, | |||||
jz | ) | fint[jx + (jy + jz*ny)*(size_t)nox] |
Definition at line 7363 of file emdata_sparx.cpp.
#define fint | ( | i, | |||
j, | |||||
k | ) | fint[(i-1) + ((j-1) + (k-1)*ny)*(size_t)lsd] |
Definition at line 7363 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 7364 of file emdata_sparx.cpp.
#define fout | ( | i, | |||
j, | |||||
k | ) | fout[(i-1) + ((j-1) + (k-1)*nyn)*(size_t)lsdn] |
Definition at line 7364 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 2779 of file emdata_sparx.cpp.
Definition at line 2779 of file emdata_sparx.cpp.
Referenced by EMAN::Log::begin(), EMAN::Util::cl1(), EMAN::EMData::conjg(), frm_2d_Align(), EMAN::newfile_store::get_image(), EMAN::EMUtil::get_image_type(), EMAN::EMData::get_pow(), EMAN::ImagicIO2::init_test(), EMAN::EMData::oneDfftPolar(), 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 1004 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 6267 of file emdata_sparx.cpp.
#define QUADPI 3.141592653589793238462643383279502884197 |
Definition at line 6267 of file emdata_sparx.cpp.
#define R (0.61803399f) |
Definition at line 5973 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::find_3d_threshold(), EMAN::Transform::orthogonalize(), and EMAN::NewLowpassGaussProcessor::process_inplace().
Definition at line 5836 of file emdata_sparx.cpp.
Definition at line 5836 of file emdata_sparx.cpp.
#define square | ( | x | ) | ((x)*(x)) |
Definition at line 721 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::calc_sigma_diff(), EMAN::OptVarianceCmp::cmp(), EMAN::EMData::cog(), EMAN::EMData::little_big_dot(), main(), and EMAN::BilateralProcessor::process_inplace().
#define X | ( | i | ) | X[i-1] |
Definition at line 5837 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 5838 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 6612 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.
Referenced by EMAN::EMData::norm_pad().
06613 { 06614 int nx = emdata->get_xsize(); 06615 int ny = emdata->get_ysize(); 06616 int nz = emdata->get_zsize(); 06617 06618 float* data = emdata->get_data(); 06619 if( ny==1 && nz==1 ) { 06620 // 1d case 06621 float sumf=0.0; 06622 int sumn=0; 06623 for( int i=0; i < npixel; ++i ) { 06624 sumf += data[i]; 06625 sumf += data[nx-1-i]; 06626 sumn += 2; 06627 } 06628 return sumf/sumn; 06629 } 06630 06631 if( nz==1 ) { 06632 float sumf=0.0; 06633 int sumn=0; 06634 int id=0; 06635 for( int iy=0; iy < ny; ++iy ) { 06636 for( int ix=0; ix < nx; ++ix ) { 06637 if( iy<npixel || iy>ny-1-npixel || ix<npixel || ix>nx-1-npixel ) { 06638 sumf += data[id]; 06639 sumn += 1; 06640 } 06641 id++; 06642 } 06643 } 06644 06645 Assert( id==nx*ny ); 06646 Assert( sumn == nx*ny - (nx-2*npixel)*(ny-2*npixel) ); 06647 return sumf/sumn; 06648 } 06649 06650 // 3d cases; 06651 06652 float sumf = 0.0; 06653 size_t sumn = 0; 06654 size_t id = 0; 06655 for( int iz=0; iz < nz; ++iz) { 06656 for( int iy=0; iy < ny; ++iy) { 06657 for( int ix=0; ix < nx; ++ix ) { 06658 if( iz<npixel||iz>nz-1-npixel||iy<npixel||iy>ny-1-npixel||ix<npixel||ix>nx-1-npixel) { 06659 sumf += data[id]; 06660 sumn += 1; 06661 } 06662 id++; 06663 } 06664 } 06665 } 06666 06667 06668 Assert( id==(size_t)nx*ny*nz); 06669 Assert( sumn==(size_t)nx*ny*nz-(size_t)(nx-2*npixel)*(ny-2*npixel)*(nz-2*npixel) ); 06670 return sumf/sumn; 06671 }
float dist | ( | int | lnlen, | |
const float * | line_1, | |||
const float * | line_2 | |||
) |
Definition at line 474 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().
00475 { 00476 float dis2=0.0; 00477 for( int i=0; i < lnlen; ++i) { 00478 float tmp = line_1[i] - line_2[i]; 00479 dis2 += tmp*tmp; 00480 } 00481 //return static_cast<float>(std::sqrt(dis2)); 00482 return dis2; 00483 }
float dist_r | ( | int | lnlen, | |
const float * | line_1, | |||
const float * | line_2 | |||
) |
Definition at line 485 of file emdata_sparx.cpp.
References sqrt().
00486 { 00487 double dis2 = 0.0; 00488 for( int i=0; i < lnlen; ++i ) { 00489 float tmp = line_1[lnlen-1-i] - line_2[i]; 00490 dis2 += tmp*tmp; 00491 } 00492 return static_cast<float>(std::sqrt(dis2)); 00493 }
ostream& operator<< | ( | ostream & | os, | |
const Pixel & | peak | |||
) |
Definition at line 4998 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 4034 of file emdata_sparx.cpp.
Referenced by EMAN::EMData::fft_shuffle().
04034 { 04035 memcpy(temp, a, nbytes); 04036 memcpy(a, b, nbytes); 04037 memcpy(b, temp, nbytes); 04038 }