EMAN2
Public Member Functions | Protected Attributes | Private Member Functions
EMAN::FourierPixelInserter3D Class Reference

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]

List of all members.

Public Member Functions

 FourierPixelInserter3D ()
 Construct a FourierPixelInserter3D.
virtual ~FourierPixelInserter3D ()
 Desctruct a FourierPixelInserter3D.
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.
virtual void init ()

Protected Attributes

float * norm
 A pointer to the constructor argument normalize_values.
EMDatadata
 A pointer to the constructor argument real_data.
int nx
 Image volume data sizes a convenience variable used here and there.
int ny
int nz
int nxyz
int nx2
int ny2
int nz2
int subx0
int suby0
int subz0
int fullnx
int fullny
int fullnz

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 97 of file reconstructor_tools.h.


Constructor & Destructor Documentation

EMAN::FourierPixelInserter3D::FourierPixelInserter3D ( ) [inline]

Construct a FourierPixelInserter3D.

Definition at line 102 of file reconstructor_tools.h.

                                         : norm(0), data(0), nx(0), ny(0), nz(0), nxyz(0)
                {}
virtual EMAN::FourierPixelInserter3D::~FourierPixelInserter3D ( ) [inline, virtual]

Desctruct a FourierPixelInserter3D.

Definition at line 107 of file reconstructor_tools.h.

References free_memory().

                {
                        free_memory();
                }
EMAN::FourierPixelInserter3D::FourierPixelInserter3D ( const FourierPixelInserter3D ) [private]

Member Function Documentation

void EMAN::FourierPixelInserter3D::free_memory ( ) [inline, private]

Definition at line 150 of file reconstructor_tools.h.

Referenced by ~FourierPixelInserter3D().

                        {
                        }
TypeDict EMAN::FourierPixelInserter3D::get_param_types ( ) const [inline, virtual]
Returns:
a TypeDict defining and describing the feasible parameters of this class

Implements EMAN::FactoryBase.

Definition at line 112 of file reconstructor_tools.h.

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

                {
                        TypeDict d;
                        d.put("data", EMObject::EMDATA);
                        d.put("norm", EMObject::FLOAT_POINTER);
                        return d;
                }
void FourierPixelInserter3D::init ( ) [virtual]

Reimplemented in EMAN::FourierInserter3DMode8.

Definition at line 64 of file reconstructor_tools.cpp.

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

Referenced by EMAN::FourierReconstructor::load_inserter().

{
        if ( params.has_key("data") )
        {
                data = params["data"];
                if ( data == 0 )
                        throw NotExistingObjectException("data", "error the data pointer was 0 in FourierPixelInserter3D::init");
        }
        else throw NotExistingObjectException("data", "the data pointer was not defined in FourierPixelInserter3D::init");

        if ( params.has_key("norm"))
        {
                norm = params["norm"];
                if ( norm == 0 )
                        throw NotExistingObjectException("norm", "error the norm pointer was 0 in FourierPixelInserter3D::init");
        }
        else throw NotExistingObjectException("norm", "the norm pointer was not defined in FourierPixelInserter3D::init");

        nx=data->get_xsize();
        ny=data->get_ysize();
        nz=data->get_zsize();
        nxyz=(size_t)nx*ny*nz;
        nx2=nx/2-1;
        ny2=ny/2;
        nz2=nz/2;
        
        if (data->has_attr("subvolume_x0") && data->has_attr("subvolume_full_nx")) {
                subx0=data->get_attr("subvolume_x0");
                suby0=data->get_attr("subvolume_y0");
                subz0=data->get_attr("subvolume_z0");
                fullnx=data->get_attr("subvolume_full_nx");
                fullny=data->get_attr("subvolume_full_ny");
                fullnz=data->get_attr("subvolume_full_nz");
        }
        else {
                subx0=suby0=subz0=-1;
        }
}
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::FourierInserter3DMode3, EMAN::FourierInserter3DMode5, EMAN::FourierInserter3DMode6, EMAN::FourierInserter3DMode7, and EMAN::FourierInserter3DMode8.

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

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

Member Data Documentation

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

Definition at line 141 of file reconstructor_tools.h.

Referenced by EMAN::FourierInserter3DMode8::init(), init(), EMAN::FourierInserter3DMode7::insert_pixel(), and EMAN::FourierInserter3DMode6::insert_pixel().


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