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

FourierPixelInserter3DMode10 - encapsulates "method 10" 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::FourierInserter3DMode10:
Inheritance graph
[legend]
Collaboration diagram for EMAN::FourierInserter3DMode10:
Collaboration graph
[legend]

Public Member Functions

 FourierInserter3DMode10 ()
 
virtual ~FourierInserter3DMode10 ()
 
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 string NAME = "kaiser_bessel_derived"
 

Private Member Functions

 FourierInserter3DMode10 (const FourierInserter3DMode10 &)
 
FourierInserter3DMode10operator= (const FourierInserter3DMode10 &)
 

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

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

Definition at line 495 of file reconstructor_tools.h.

Constructor & Destructor Documentation

◆ FourierInserter3DMode10() [1/2]

EMAN::FourierInserter3DMode10::FourierInserter3DMode10 ( )
inline

Definition at line 498 of file reconstructor_tools.h.

498{}

Referenced by NEW().

◆ ~FourierInserter3DMode10()

virtual EMAN::FourierInserter3DMode10::~FourierInserter3DMode10 ( )
inlinevirtual

Definition at line 499 of file reconstructor_tools.h.

499{}

◆ FourierInserter3DMode10() [2/2]

EMAN::FourierInserter3DMode10::FourierInserter3DMode10 ( const FourierInserter3DMode10 )
private

Member Function Documentation

◆ get_desc()

virtual string EMAN::FourierInserter3DMode10::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 513 of file reconstructor_tools.h.

514 {
515 return "(imprecise) Kaiser-bessel derived (KBD) kernel 8x8x8";
516 }

◆ get_name()

virtual string EMAN::FourierInserter3DMode10::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 508 of file reconstructor_tools.h.

509 {
510 return NAME;
511 }

References NAME.

◆ insert_pixel()

bool FourierInserter3DMode10::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 760 of file reconstructor_tools.cpp.

761{
762 const int N = 8; // kernel width
763
764 int x0 = (int) floor(xx-N/2);
765 int y0 = (int) floor(yy-N/2);
766 int z0 = (int) floor(zz-N/2);
767
768 if (subx0<0) { // normal full reconstruction
769 if (x0<-nx2-7 || y0<-ny2-7 || z0<-nz2-7 || x0>nx2+6 || y0>ny2+6 || z0>nz2+6 ) return false;
770
771 // no error checking on add_complex_fast, so we need to be careful here
772 int x1=x0+N;
773 int y1=y0+N;
774 int z1=z0+N;
775
776 if (x0<-nx2) x0=-nx2;
777 if (x1>nx2) x1=nx2;
778 if (y0<-ny2) y0=-ny2;
779 if (y1>ny2) y1=ny2;
780 if (z0<-nz2) z0=-nz2;
781 if (z1>nz2) z1=nz2;
782
783 float w=weight;
784 float ws [ N/2 + 1 ];
785 float alpha = 32.0;
786 float wm = 0.0;
787
788 // compute 1D weights... not exactly correct, but somewhat close.
789 for ( int p = 0; p <= N/2; p++) {
790 double tmp = gsl_sf_bessel_i0_scaled(M_PI * alpha * sqrt(1.0f - Util::square((((N/2)+p)/(N-1))-1))) / gsl_sf_bessel_i0_scaled(M_PI * alpha);
791 ws[p] = (float) tmp;
792 wm += (float) tmp;
793 }
794
795 float r, kb, dn;
796 for (int k = z0 ; k <= z1; k++) {
797 for (int j = y0 ; j <= y1; j++) {
798 for (int i = x0; i <= x1; i ++) {
799 r = Util::hypot3sq((float) i - xx, j - yy, k - zz);
800 kb = 0.0;
801 //quasi radial...true cumulative radial weights are much more time consuming to code.
802 for (int p = 0; p <= Util::get_min(r,(float) N/2); p++) {
803 kb += ws[p];
804 }
805 dn = sqrt(kb/wm);
806 size_t off = data->add_complex_at_fast(i,j,k,dt*dn*w);
807 norm[off/2]+=w;
808 }
809 }
810 }
811 return true;
812 }
813 printf("region writing not supported in mode 10\n");
814 return false;
815}
EMData * data
A pointer to the constructor argument real_data.
float * norm
A pointer to the constructor argument normalize_values.
static int hypot3sq(int x, int y, int z)
Euclidean distance function squared in 3D: f(x,y,z) = (x*x + y*y + z*z);.
Definition: util.h:805
static int square(int n)
Calculate a number's square.
Definition: util.h:736
static int get_min(int f1, int f2)
Get the minimum of 2 numbers.
Definition: util.h:922
EMData * sqrt() const
return square root of current image

References EMAN::FourierPixelInserter3D::data, EMAN::Util::get_min(), EMAN::Util::hypot3sq(), EMAN::FourierPixelInserter3D::norm, EMAN::FourierPixelInserter3D::nx2, EMAN::FourierPixelInserter3D::ny2, EMAN::FourierPixelInserter3D::nz2, sqrt(), EMAN::Util::square(), and EMAN::FourierPixelInserter3D::subx0.

◆ NEW()

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

Definition at line 503 of file reconstructor_tools.h.

504 {
505 return new FourierInserter3DMode10();
506 }

References FourierInserter3DMode10().

◆ operator=()

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

Member Data Documentation

◆ NAME

const string FourierInserter3DMode10::NAME = "kaiser_bessel_derived"
static

Definition at line 518 of file reconstructor_tools.h.

Referenced by get_name().


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