EMAN2
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
EMAN::FourierPixelInserter3D Class Referenceabstract

FourierPixelInserter3D class defines a way a continuous pixel in 3D is inserted into the discrete 3D volume - there are various schemes for doing this including simply finding the nearest neighbor to more elaborate schemes that involve interpolation using the nearest 8 voxels and so on. More...

#include <reconstructor_tools.h>

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

Public Member Functions

 FourierPixelInserter3D ()
 Construct a FourierPixelInserter3D. More...
 
virtual ~FourierPixelInserter3D ()
 Desctruct a FourierPixelInserter3D. More...
 
TypeDict get_param_types () const
 
virtual bool insert_pixel (const float &xx, const float &yy, const float &zz, const std::complex< float > dt, const float &weight=1.0)=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 void init ()
 
- Public Member Functions inherited from EMAN::FactoryBase
 FactoryBase ()
 
virtual ~FactoryBase ()
 
virtual string get_name () const =0
 Get the unique name of this class (especially for factory based instantiation access) More...
 
virtual string get_desc () const =0
 Get a clear, concise description of this class. More...
 
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
 

Protected Attributes

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...
 

Private Member Functions

 FourierPixelInserter3D (const FourierPixelInserter3D &)
 
FourierPixelInserter3Doperator= (const FourierPixelInserter3D &)
 
void free_memory ()
 

Detailed Description

FourierPixelInserter3D class defines a way a continuous pixel in 3D is inserted into the discrete 3D volume - there are various schemes for doing this including simply finding the nearest neighbor to more elaborate schemes that involve interpolation using the nearest 8 voxels and so on.

FourierPixelInserter3D class is the base class for all pixel inserters. Each specific pixel inserter class has a unique ID name. This name is used to create a FourierPixelInserter3D instance or do a pixel insertion. Currently these IDs are (strings) 1,2,3,4,5,6,7 - where mode 2 is currently the most popularly used pixel insertion mode as it generally performs well, and was the default mode in EMAN1 - it interpolates to the nearest 8 voxels using a gaussian weighting based on Euclidian distance

All FourierPixelInserter3D classes in EMAN2 are managed by a Factory pattern. So each FourierPixelInserter3D class must define:

Typical usages of FourierPixelInserter3D are as follows:

Definition at line 94 of file reconstructor_tools.h.

Constructor & Destructor Documentation

◆ FourierPixelInserter3D() [1/2]

EMAN::FourierPixelInserter3D::FourierPixelInserter3D ( )
inline

Construct a FourierPixelInserter3D.

Definition at line 99 of file reconstructor_tools.h.

99 : norm(0), data(0), nx(0), ny(0), nz(0), nxyz(0)
100 {}
EMData * data
A pointer to the constructor argument real_data.
int nx
Image volume data sizes a convenience variable used here and there.
float * norm
A pointer to the constructor argument normalize_values.

◆ ~FourierPixelInserter3D()

virtual EMAN::FourierPixelInserter3D::~FourierPixelInserter3D ( )
inlinevirtual

Desctruct a FourierPixelInserter3D.

Definition at line 104 of file reconstructor_tools.h.

105 {
106 free_memory();
107 }

References free_memory().

◆ FourierPixelInserter3D() [2/2]

EMAN::FourierPixelInserter3D::FourierPixelInserter3D ( const FourierPixelInserter3D )
private

Member Function Documentation

◆ free_memory()

void EMAN::FourierPixelInserter3D::free_memory ( )
inlineprivate

Definition at line 151 of file reconstructor_tools.h.

152 {
153 }

Referenced by ~FourierPixelInserter3D().

◆ get_param_types()

TypeDict EMAN::FourierPixelInserter3D::get_param_types ( ) const
inlinevirtual
Returns
a TypeDict defining and describing the feasible parameters of this class

Implements EMAN::FactoryBase.

Definition at line 109 of file reconstructor_tools.h.

110 {
111 TypeDict d;
112 d.put("data", EMObject::EMDATA);
113 d.put("norm", EMObject::FLOAT_POINTER);
114 return d;
115 }

References EMAN::EMObject::EMDATA, EMAN::EMObject::FLOAT_POINTER, and EMAN::TypeDict::put().

◆ init()

void FourierPixelInserter3D::init ( )
virtual

Reimplemented in EMAN::FourierInserter3DMode8.

Definition at line 74 of file reconstructor_tools.cpp.

75{
76 if ( params.has_key("data") )
77 {
78 data = params["data"];
79 if ( data == 0 )
80 throw NotExistingObjectException("data", "error the data pointer was 0 in FourierPixelInserter3D::init");
81 }
82 else throw NotExistingObjectException("data", "the data pointer was not defined in FourierPixelInserter3D::init");
83
84 if ( params.has_key("norm"))
85 {
86 norm = params["norm"];
87 if ( norm == 0 )
88 throw NotExistingObjectException("norm", "error the norm pointer was 0 in FourierPixelInserter3D::init");
89 }
90 else throw NotExistingObjectException("norm", "the norm pointer was not defined in FourierPixelInserter3D::init");
91
92 nx=data->get_xsize();
93 ny=data->get_ysize();
94 nz=data->get_zsize();
95 nxyz=(size_t)nx*ny*nz;
96 nx2=nx/2-1;
97 ny2=ny/2;
98 nz2=nz/2;
99
100 if (data->has_attr("subvolume_x0") && data->has_attr("subvolume_full_nx")) {
101 subx0=data->get_attr("subvolume_x0");
102 suby0=data->get_attr("subvolume_y0");
103 subz0=data->get_attr("subvolume_z0");
104 fullnx=data->get_attr("subvolume_full_nx");
105 fullny=data->get_attr("subvolume_full_ny");
106 fullnz=data->get_attr("subvolume_full_nz");
107 }
108 else {
109 subx0=suby0=subz0=-1;
110 }
111}
bool has_key(const string &key) const
Ask the Dictionary if it as a particular key.
Definition: emobject.h:511
#define NotExistingObjectException(objname, desc)
Definition: exception.h:130

References data, fullnx, fullny, fullnz, EMAN::Dict::has_key(), norm, NotExistingObjectException, nx, nx2, nxyz, ny, ny2, nz, nz2, EMAN::FactoryBase::params, subx0, suby0, and subz0.

Referenced by EMAN::FourierInserter3DMode8::init(), and EMAN::FourierReconstructor::load_inserter().

◆ insert_pixel()

virtual bool EMAN::FourierPixelInserter3D::insert_pixel ( const float &  xx,
const float &  yy,
const float &  zz,
const std::complex< float >  dt,
const float &  weight = 1.0 
)
pure 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)

Implemented in EMAN::FourierInserter3DMode1, EMAN::FourierInserter3DMode2, EMAN::FourierInserter3DMode2l, EMAN::FourierInserter3DMode3, EMAN::FourierInserter3DMode5, EMAN::FourierInserter3DMode6, EMAN::FourierInserter3DMode7, EMAN::FourierInserter3DMode8, EMAN::FourierInserter3DMode9, EMAN::FourierInserter3DMode10, and EMAN::FourierInserter3DMode11.

Referenced by EMAN::WienerFourierReconstructor::do_insert_slice_work(), and EMAN::FourierReconstructor::do_insert_slice_work().

◆ operator=()

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

Member Data Documentation

◆ data

EMData* EMAN::FourierPixelInserter3D::data
protected

◆ fullnx

int EMAN::FourierPixelInserter3D::fullnx
protected

◆ fullny

int EMAN::FourierPixelInserter3D::fullny
protected

◆ fullnz

int EMAN::FourierPixelInserter3D::fullnz
protected

◆ norm

float* EMAN::FourierPixelInserter3D::norm
protected

◆ nx

int EMAN::FourierPixelInserter3D::nx
protected

Image volume data sizes a convenience variable used here and there.

Definition at line 142 of file reconstructor_tools.h.

Referenced by init().

◆ nx2

int EMAN::FourierPixelInserter3D::nx2
protected

◆ nxyz

int EMAN::FourierPixelInserter3D::nxyz
protected

◆ ny

int EMAN::FourierPixelInserter3D::ny
protected

Definition at line 142 of file reconstructor_tools.h.

Referenced by init().

◆ ny2

int EMAN::FourierPixelInserter3D::ny2
protected

◆ nz

int EMAN::FourierPixelInserter3D::nz
protected

Definition at line 142 of file reconstructor_tools.h.

Referenced by init().

◆ nz2

int EMAN::FourierPixelInserter3D::nz2
protected

◆ subx0

int EMAN::FourierPixelInserter3D::subx0
protected

◆ suby0

int EMAN::FourierPixelInserter3D::suby0
protected

◆ subz0

int EMAN::FourierPixelInserter3D::subz0
protected

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