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

FourierPixelInserter3DMode2l - trilinear 2x2x2 inserter See comments in FourierPixelInserter3D for explanations. More...

#include <reconstructor_tools.h>

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

Public Member Functions

 FourierInserter3DMode2l ()
 
virtual ~FourierInserter3DMode2l ()
 
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...
 
 FourierInserter3DMode2l (const FourierInserter3DMode2l &)
 
FourierInserter3DMode2loperator= (const FourierInserter3DMode2l &)
 
- 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 = "trilinear"
 

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

FourierPixelInserter3DMode2l - trilinear 2x2x2 inserter See comments in FourierPixelInserter3D for explanations.

Definition at line 226 of file reconstructor_tools.h.

Constructor & Destructor Documentation

◆ FourierInserter3DMode2l() [1/2]

EMAN::FourierInserter3DMode2l::FourierInserter3DMode2l ( )
inline

Definition at line 229 of file reconstructor_tools.h.

229{}

Referenced by NEW().

◆ ~FourierInserter3DMode2l()

virtual EMAN::FourierInserter3DMode2l::~FourierInserter3DMode2l ( )
inlinevirtual

Definition at line 230 of file reconstructor_tools.h.

230{}

◆ FourierInserter3DMode2l() [2/2]

EMAN::FourierInserter3DMode2l::FourierInserter3DMode2l ( const FourierInserter3DMode2l )

Member Function Documentation

◆ get_desc()

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

245 {
246 return "Fourier pixel insertion 2x2x2 with trilinear interpolation";
247 }

◆ get_name()

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

240 {
241 return NAME;
242 }

References NAME.

◆ insert_pixel()

bool FourierInserter3DMode2l::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 191 of file reconstructor_tools.cpp.

192{
193 int x0 = (int) floor(xx);
194 int y0 = (int) floor(yy);
195 int z0 = (int) floor(zz);
196
197 // note that subnx differs in the inserters. In the reconstructors it subx0 is 0 for the full volume. Here it is -1
198 if (subx0<0) { // normal full reconstruction
199 if (x0<-nx2-1 || y0<-ny2-1 || z0<-nz2-1 || x0>nx2 || y0>ny2 || z0>nz2 ) return false;
200
201 int x1=x0+1;
202 int y1=y0+1;
203 int z1=z0+1;
204// if (x0<-nx2) x0=-nx2;
205// if (x1>nx2) x1=nx2;
206// if (y0<-ny2) y0=-ny2;
207// if (y1>ny2) y1=ny2;
208// if (z0<-nz2) z0=-nz2;
209// if (z1>nz2) z1=nz2;
210
211// float h=2.0/((1.0+pow(Util::hypot3sq(xx,yy,zz),.5))*EMConsts::I2G);
212 float h=1.0f/EMConsts::I2G;
213 //size_t idx;
214 float r, gg;
215// int pc=0;
216 for (int k = z0 ; k <= z1; k++) {
217 for (int j = y0 ; j <= y1; j++) {
218 for (int i = x0; i <= x1; i ++) {
219// r = Util::hypot3sq((float) i - xx, j - yy, k - zz);
220// gg = Util::fast_exp(-r *h)*weight;
221 gg=(1.0-fabs(i-xx))*(1.0-fabs(j-yy))*(1.0-fabs(k-zz))*weight;
222
223 size_t off;
224 off=data->add_complex_at_fast(i,j,k,dt*gg);
225 if (off!=nxyz) norm[off/2]+=gg;
226// if (off!=nxyz) norm[off/2]+=weight; // experiment 6/1/20, use true Gaussian kernel, not just weight
227#ifdef DEBUG_POINT
228 if (k==23 && j==0 && i==113) {
229 std::complex<float> pv = data->get_complex_at(113,0,23);
230 float pnv = norm[off/2];
231 printf("insert: %1.4g\t%1.4g\t%1.4g\t%1.4g\t%1.4g\t%1.4g\n",pv.real()/pnv,pv.imag()/pnv,pnv,dt.real(),dt.imag(),gg);
232 }
233#endif
234
235 }
236 }
237 }
238 return true;
239 }
240 else { // for subvolumes, not optimized yet
241 //size_t idx;
242 float r, gg;
243 int pc=0;
244 for (int k = z0 ; k <= z0 + 1; k++) {
245 for (int j = y0 ; j <= y0 + 1; j++) {
246 for (int i = x0; i <= x0 + 1; i ++) {
247// r = Util::hypot3sq((float) i - xx, j - yy, k - zz);
248// gg = Util::fast_exp(-r / EMConsts::I2G)*weight;
249 gg=(1.0-fabs(i-xx))*(1.0-fabs(j-yy))*(1.0-fabs(k-zz))*weight;
250
251 size_t off;
252 if (subx0<0) off=data->add_complex_at(i,j,k,dt*gg);
253 else off=data->add_complex_at(i,j,k,subx0,suby0,subz0,fullnx,fullny,fullnz,dt*gg);
254 if (static_cast<int>(off)!=nxyz) { norm[off/2]+=gg; pc+=1; }
255 }
256 }
257 }
258
259 if (pc>0) return true;
260 return false;
261 }
262}
static const float I2G
Definition: emobject.h:72
EMData * data
A pointer to the constructor argument real_data.
float * norm
A pointer to the constructor argument normalize_values.

References EMAN::FourierPixelInserter3D::data, EMAN::FourierPixelInserter3D::fullnx, EMAN::FourierPixelInserter3D::fullny, EMAN::FourierPixelInserter3D::fullnz, EMAN::EMConsts::I2G, EMAN::FourierPixelInserter3D::norm, EMAN::FourierPixelInserter3D::nx2, EMAN::FourierPixelInserter3D::nxyz, EMAN::FourierPixelInserter3D::ny2, EMAN::FourierPixelInserter3D::nz2, EMAN::FourierPixelInserter3D::subx0, EMAN::FourierPixelInserter3D::suby0, and EMAN::FourierPixelInserter3D::subz0.

◆ NEW()

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

Definition at line 234 of file reconstructor_tools.h.

235 {
236 return new FourierInserter3DMode2l();
237 }

References FourierInserter3DMode2l().

◆ operator=()

FourierInserter3DMode2l & EMAN::FourierInserter3DMode2l::operator= ( const FourierInserter3DMode2l )

Member Data Documentation

◆ NAME

const string FourierInserter3DMode2l::NAME = "trilinear"
static

Definition at line 249 of file reconstructor_tools.h.

Referenced by get_name().


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