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

FourierPixelInserter3DMode9 - encapsulates "method 9" 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::FourierInserter3DMode9:
Inheritance graph
[legend]
Collaboration diagram for EMAN::FourierInserter3DMode9:
Collaboration graph
[legend]

Public Member Functions

 FourierInserter3DMode9 ()
 
virtual ~FourierInserter3DMode9 ()
 
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"
 

Private Member Functions

 FourierInserter3DMode9 (const FourierInserter3DMode9 &)
 
FourierInserter3DMode9operator= (const FourierInserter3DMode9 &)
 

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

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

Definition at line 461 of file reconstructor_tools.h.

Constructor & Destructor Documentation

◆ FourierInserter3DMode9() [1/2]

EMAN::FourierInserter3DMode9::FourierInserter3DMode9 ( )
inline

Definition at line 464 of file reconstructor_tools.h.

464{}

Referenced by NEW().

◆ ~FourierInserter3DMode9()

virtual EMAN::FourierInserter3DMode9::~FourierInserter3DMode9 ( )
inlinevirtual

Definition at line 465 of file reconstructor_tools.h.

465{}

◆ FourierInserter3DMode9() [2/2]

EMAN::FourierInserter3DMode9::FourierInserter3DMode9 ( const FourierInserter3DMode9 )
private

Member Function Documentation

◆ get_desc()

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

480 {
481 return "Kaiser-bessel (KB) kernel 4x4x4";
482 }

◆ get_name()

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

475 {
476 return NAME;
477 }

References NAME.

◆ insert_pixel()

bool FourierInserter3DMode9::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 714 of file reconstructor_tools.cpp.

715{
716 int N = 4; // kernel width
717
718 int x0 = (int) floor(xx-N/2);
719 int y0 = (int) floor(yy-N/2);
720 int z0 = (int) floor(zz-N/2);
721
722 if (subx0<0) { // normal full reconstruction
723 if (x0<-nx2-7 || y0<-ny2-7 || z0<-nz2-7 || x0>nx2+6 || y0>ny2+6 || z0>nz2+6 ) return false;
724
725 // no error checking on add_complex_fast, so we need to be careful here
726 int x1=x0+N;
727 int y1=y0+N;
728 int z1=z0+N;
729
730 if (x0<-nx2) x0=-nx2;
731 if (x1>nx2) x1=nx2;
732 if (y0<-ny2) y0=-ny2;
733 if (y1>ny2) y1=ny2;
734 if (z0<-nz2) z0=-nz2;
735 if (z1>nz2) z1=nz2;
736
737 float w=weight;
738 float a=15.0;
739 float r, kb;
740
741 for (int k = z0 ; k <= z1; k++) {
742 for (int j = y0 ; j <= y1; j++) {
743 for (int i = x0; i <= x1; i ++) {
744 r = Util::hypot3sq((float) i - xx, j - yy, k - zz);
745 kb = gsl_sf_bessel_i0_scaled(M_PI * a * sqrt(1.0f - Util::square((r/(nx2-1))-1))) /
746 gsl_sf_bessel_i0_scaled(M_PI * a);
747 size_t off;
748 off = data->add_complex_at_fast(i,j,k,dt*kb*w);
749 norm[off/2]+=w;
750 }
751 }
752 }
753 return true;
754 }
755 printf("region writing not supported in mode 9\n");
756 return false;
757}
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
EMData * sqrt() const
return square root of current image

References EMAN::FourierPixelInserter3D::data, 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::FourierInserter3DMode9::NEW ( )
inlinestatic

Definition at line 469 of file reconstructor_tools.h.

470 {
471 return new FourierInserter3DMode9();
472 }

References FourierInserter3DMode9().

◆ operator=()

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

Member Data Documentation

◆ NAME

const string FourierInserter3DMode9::NAME = "kaiser_bessel"
static

Definition at line 484 of file reconstructor_tools.h.

Referenced by get_name().


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