#include <reconstructor_tools.h>
Inheritance diagram for EMAN::FourierInserter3DMode5:
Public Member Functions | |
FourierInserter3DMode5 () | |
virtual | ~FourierInserter3DMode5 () |
virtual bool | insert_pixel (const float &xx, const float &yy, const float &zz, const std::complex< float > dt, const float &weight=1.0) |
Insert a complex pixel [dt[0]+dt[1]i] at (float) coordinate [xx,yy,zz] with weighting into a discrete 3D volume. | |
virtual string | get_name () const |
Get the unique name of this class (especially for factory based instantiation access). | |
virtual string | get_desc () const |
Get a clear, concise description of this class. | |
Static Public Member Functions | |
static FourierPixelInserter3D * | NEW () |
Static Public Attributes | |
static const string | NAME = "gauss_5" |
Private Member Functions | |
FourierInserter3DMode5 (const FourierInserter3DMode5 &) | |
FourierInserter3DMode5 & | operator= (const FourierInserter3DMode5 &) |
Definition at line 259 of file reconstructor_tools.h.
EMAN::FourierInserter3DMode5::FourierInserter3DMode5 | ( | ) | [inline] |
virtual EMAN::FourierInserter3DMode5::~FourierInserter3DMode5 | ( | ) | [inline, virtual] |
Definition at line 267 of file reconstructor_tools.h.
00268 { 00269 // Don't delete gimx it causes a seg fault 00270 // if ( gimx != 0 ) 00271 // { 00272 // delete gimx; 00273 // gimx = 0; 00274 // } 00275 }
EMAN::FourierInserter3DMode5::FourierInserter3DMode5 | ( | const FourierInserter3DMode5 & | ) | [private] |
virtual string EMAN::FourierInserter3DMode5::get_desc | ( | ) | const [inline, virtual] |
Get a clear, concise description of this class.
Implements EMAN::FactoryBase.
Definition at line 289 of file reconstructor_tools.h.
virtual string EMAN::FourierInserter3DMode5::get_name | ( | ) | const [inline, virtual] |
Get the unique name of this class (especially for factory based instantiation access).
Implements EMAN::FactoryBase.
Definition at line 284 of file reconstructor_tools.h.
References NAME.
00285 { 00286 return NAME; 00287 }
bool FourierInserter3DMode5::insert_pixel | ( | const float & | xx, | |
const float & | yy, | |||
const float & | zz, | |||
const std::complex< float > | dt, | |||
const float & | weight = 1.0 | |||
) | [virtual] |
Insert a complex pixel [dt[0]+dt[1]i] at (float) coordinate [xx,yy,zz] with weighting into a discrete 3D volume.
xx | the floating point x coordinate | |
yy | the floating point y coordinate | |
zz | the floating point z coordinate | |
dt | the complex pixel value (dt[0] is real, dt[1] is imaginary) | |
weight | the weight to given to this complex pixel |
Implements EMAN::FourierPixelInserter3D.
Definition at line 235 of file reconstructor_tools.cpp.
References EMAN::EMData::add_complex_at_fast(), EMAN::FourierPixelInserter3D::data, EMAN::Util::fast_exp(), EMAN::Util::hypot3(), EMAN::Util::hypot3sq(), EMAN::EMConsts::I3G, EMAN::FourierPixelInserter3D::norm, EMAN::FourierPixelInserter3D::nx2, EMAN::FourierPixelInserter3D::ny2, EMAN::FourierPixelInserter3D::nz2, and EMAN::FourierPixelInserter3D::subx0.
00236 { 00237 int x0 = (int) floor(xx-1.5); 00238 int y0 = (int) floor(yy-1.5); 00239 int z0 = (int) floor(zz-1.5); 00240 00241 if (subx0<0) { // normal full reconstruction 00242 if (x0<-nx2-4 || y0<-ny2-4 || z0<-nz2-4 || x0>nx2+3 || y0>ny2+3 || z0>nz2+3 ) return false; 00243 00244 // no error checking on add_complex_fast, so we need to be careful here 00245 int x1=x0+4; 00246 int y1=y0+4; 00247 int z1=z0+4; 00248 if (x0<-nx2) x0=-nx2; 00249 if (x1>nx2) x1=nx2; 00250 if (y0<-ny2) y0=-ny2; 00251 if (y1>ny2) y1=ny2; 00252 if (z0<-nz2) z0=-nz2; 00253 if (z1>nz2) z1=nz2; 00254 00255 // float h=2.0/((1.0+pow(Util::hypot3sq(xx,yy,zz),.5))*EMConsts::I2G); 00256 // float h=2.0/EMConsts::I3G; 00257 float h=32.0f/((8.0f+Util::hypot3(xx,yy,zz))*EMConsts::I3G); 00258 float w=weight/(1.0f+6.0f*Util::fast_exp(-h)+12*Util::fast_exp(-h*2.0f)+8*Util::fast_exp(-h*3.0f)+ 00259 6.0f*Util::fast_exp(-h*4.0f)+24.0f*Util::fast_exp(-h*5.0f)+24.0f*Util::fast_exp(-h*6.0f)+12.0f*Util::fast_exp(-h*8.0f)+ 00260 24.0f*Util::fast_exp(-h*9.0f)+8.0f*Util::fast_exp(-h*12.0f)); // approx normalization so higer radii aren't upweighted relative to lower due to wider Gaussian 00261 //size_t idx; 00262 float r, gg; 00263 // int pc=0; 00264 for (int k = z0 ; k <= z1; k++) { 00265 for (int j = y0 ; j <= y1; j++) { 00266 for (int i = x0; i <= x1; i ++) { 00267 r = Util::hypot3sq((float) i - xx, j - yy, k - zz); 00268 // gg=weight; 00269 gg = Util::fast_exp(-r *h)*w; 00270 // gg = Util::fast_exp(-r / EMConsts::I2G)*weight; 00271 // gg = sqrt(Util::fast_exp(-r / EMConsts::I2G))*weight; 00272 00273 size_t off; 00274 off=data->add_complex_at_fast(i,j,k,dt*gg); 00275 norm[off/2]+=gg; 00276 } 00277 } 00278 } 00279 return true; 00280 } 00281 printf("region writing not supported in mode 3\n"); 00282 return false; 00283 }
static FourierPixelInserter3D* EMAN::FourierInserter3DMode5::NEW | ( | ) | [inline, static] |
Definition at line 279 of file reconstructor_tools.h.
References FourierInserter3DMode5().
00280 { 00281 return new FourierInserter3DMode5(); 00282 }
FourierInserter3DMode5& EMAN::FourierInserter3DMode5::operator= | ( | const FourierInserter3DMode5 & | ) | [private] |
const string FourierInserter3DMode5::NAME = "gauss_5" [static] |