EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
EMAN::FourierInserter3DMode7 Class Reference

FourierPixelInserter3DMode7 - encapsulates "method 7" for inserting a 2D Fourier slice into a 3D volume See comments in FourierPixelInserter3D for explanations. More...

#include <reconstructor_tools.h>

Inheritance diagram for EMAN::FourierInserter3DMode7:
Inheritance graph
[legend]
Collaboration diagram for EMAN::FourierInserter3DMode7:
Collaboration graph
[legend]

Public Member Functions

 FourierInserter3DMode7 ()
 
virtual ~FourierInserter3DMode7 ()
 
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. More...
 
virtual string get_name () const
 Get the unique name of this class (especially for factory based instantiation access) More...
 
virtual string get_desc () const
 Get a clear, concise description of this class. More...
 
- Public Member Functions inherited from EMAN::FourierPixelInserter3D
 FourierPixelInserter3D ()
 Construct a FourierPixelInserter3D. More...
 
virtual ~FourierPixelInserter3D ()
 Desctruct a FourierPixelInserter3D. More...
 
TypeDict get_param_types () const
 
virtual void init ()
 
- Public Member Functions inherited from EMAN::FactoryBase
 FactoryBase ()
 
virtual ~FactoryBase ()
 
Dict get_params () const
 get a copy of the parameters of this class More...
 
void set_params (const Dict &new_params)
 Set new parameters. More...
 
void set_param (const string key, const EMObject val)
 
void insert_params (const Dict &new_params)
 Insert parameters. More...
 
Dict copy_relevant_params (const FactoryBase *const that) const
 

Static Public Member Functions

static FourierPixelInserter3DNEW ()
 

Static Public Attributes

static const float kernel [9][9][9]
 
static const string NAME = "gridding_5"
 

Private Member Functions

 FourierInserter3DMode7 (const FourierInserter3DMode7 &)
 
FourierInserter3DMode7operator= (const FourierInserter3DMode7 &)
 

Additional Inherited Members

- Protected Attributes inherited from EMAN::FourierPixelInserter3D
float * norm
 A pointer to the constructor argument normalize_values. More...
 
EMDatadata
 A pointer to the constructor argument real_data. More...
 
int nx
 Image volume data sizes a convenience variable used here and there. More...
 
int ny
 
int nz
 
int nxyz
 
int nx2
 
int ny2
 
int nz2
 
int subx0
 
int suby0
 
int subz0
 
int fullnx
 
int fullny
 
int fullnz
 
- Protected Attributes inherited from EMAN::FactoryBase
Dict params
 This is the dictionary the stores the parameters of the object. More...
 

Detailed Description

FourierPixelInserter3DMode7 - encapsulates "method 7" for inserting a 2D Fourier slice into a 3D volume See comments in FourierPixelInserter3D for explanations.

Definition at line 376 of file reconstructor_tools.h.

Constructor & Destructor Documentation

◆ FourierInserter3DMode7() [1/2]

EMAN::FourierInserter3DMode7::FourierInserter3DMode7 ( )
inline

Definition at line 382 of file reconstructor_tools.h.

382{}

Referenced by NEW().

◆ ~FourierInserter3DMode7()

virtual EMAN::FourierInserter3DMode7::~FourierInserter3DMode7 ( )
inlinevirtual

Definition at line 383 of file reconstructor_tools.h.

383{}

◆ FourierInserter3DMode7() [2/2]

EMAN::FourierInserter3DMode7::FourierInserter3DMode7 ( const FourierInserter3DMode7 )
private

Member Function Documentation

◆ get_desc()

virtual string EMAN::FourierInserter3DMode7::get_desc ( ) const
inlinevirtual

Get a clear, concise description of this class.

Returns
a clear, concise description of this class

Implements EMAN::FactoryBase.

Definition at line 397 of file reconstructor_tools.h.

398 {
399 return "5x5x5 gridding kernel with numerically computed kernel";
400 }

◆ get_name()

virtual string EMAN::FourierInserter3DMode7::get_name ( ) const
inlinevirtual

Get the unique name of this class (especially for factory based instantiation access)

Returns
the unique name of this class

Implements EMAN::FactoryBase.

Definition at line 392 of file reconstructor_tools.h.

393 {
394 return NAME;
395 }

References NAME.

◆ insert_pixel()

bool FourierInserter3DMode7::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.

Parameters
xxthe floating point x coordinate
yythe floating point y coordinate
zzthe floating point z coordinate
dtthe complex pixel value (dt[0] is real, dt[1] is imaginary)
weightthe weight to given to this complex pixel
Returns
A boolean that indicates the pixel has been inserted (or not)

Implements EMAN::FourierPixelInserter3D.

Definition at line 539 of file reconstructor_tools.cpp.

540{
541 int x0 = Util::fast_floor(xx-1.5);
542 int y0 = Util::fast_floor(yy-1.5);
543 int z0 = Util::fast_floor(zz-1.5);
544
545 if (subx0<0) { // normal full reconstruction
546 if (x0<-nx2-4 || y0<-ny2-4 || z0<-nz2-4 || x0>nx2+3 || y0>ny2+3 || z0>nz2+3 ) return false;
547
548 // no error checking on add_complex_fast, so we need to be careful here
549 int x1=x0+4;
550 int y1=y0+4;
551 int z1=z0+4;
552 if (x0<-nx2) x0=-nx2;
553 if (x1>nx2) x1=nx2;
554 if (y0<-ny2) y0=-ny2;
555 if (y1>ny2) y1=ny2;
556 if (z0<-nz2) z0=-nz2;
557 if (z1>nz2) z1=nz2;
558
559 float w=weight;
560
561 float r, gg;
562 for (int k = z0 ; k <= z1; k++) {
563 for (int j = y0 ; j <= y1; j++) {
564 for (int i = x0; i <= x1; i ++) {
565 gg=FourierInserter3DMode7::kernel[abs(Util::fast_floor((i-xx)*3.0f+0.5))][abs(Util::fast_floor((j-yy)*3.0f+0.5))][abs(Util::fast_floor((k-zz)*3.0f+0.5))];
566
567 size_t off;
568 off=data->add_complex_at_fast(i,j,k,dt*gg*w);
569 norm[off/2]+=w;
570// if (i==67&&j==19&&k==1) printf("%1.1f %1.1f %1.1f\t%d %d %d\t%d %d %d\t%f\t%f\t%f\t%f\t%f\t%f\n",xx,yy,zz,i,j,k,abs(Util::fast_floor((i-xx)*3.0f+0.5)),abs(Util::fast_floor((j-yy)*3.0f+0.5)),abs(Util::fast_floor((k-zz)*3.0f+0.5)),gg,w,dt.real(),dt.imag(),norm[off/2],data->get_value_at(off));
571
572 }
573 }
574 }
575 return true;
576 }
577 printf("region writing not supported in mode \n");
578 return false;
579}
static const float kernel[9][9][9]
EMData * data
A pointer to the constructor argument real_data.
float * norm
A pointer to the constructor argument normalize_values.
static int fast_floor(float x)
A fast way to calculate a floor, which is largest integral value not greater than argument.
Definition: util.h:874

References EMAN::FourierPixelInserter3D::data, EMAN::Util::fast_floor(), kernel, EMAN::FourierPixelInserter3D::norm, EMAN::FourierPixelInserter3D::nx2, EMAN::FourierPixelInserter3D::ny2, EMAN::FourierPixelInserter3D::nz2, and EMAN::FourierPixelInserter3D::subx0.

◆ NEW()

static FourierPixelInserter3D * EMAN::FourierInserter3DMode7::NEW ( )
inlinestatic

Definition at line 387 of file reconstructor_tools.h.

388 {
389 return new FourierInserter3DMode7();
390 }

References FourierInserter3DMode7().

◆ operator=()

FourierInserter3DMode7 & EMAN::FourierInserter3DMode7::operator= ( const FourierInserter3DMode7 )
private

Member Data Documentation

◆ kernel

const float FourierInserter3DMode7::kernel
static

◆ NAME

const string FourierInserter3DMode7::NAME = "gridding_5"
static

Definition at line 402 of file reconstructor_tools.h.

Referenced by get_name().


The documentation for this class was generated from the following files: