EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions
EMAN::FourierInserter3DMode7 Class Reference

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

List of all members.

Public Member Functions

 FourierInserter3DMode7 ()
virtual ~FourierInserter3DMode7 ()
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.
virtual string get_name () const
 Get the unique name of this class (especially for factory based instantiation access)
virtual string get_desc () const
 Get a clear, concise description of this class.

Static Public Member Functions

static FourierPixelInserter3DNEW ()

Static Public Attributes

static const string NAME = "hypergeom_5"

Private Member Functions

 FourierInserter3DMode7 (const FourierInserter3DMode7 &)
FourierInserter3DMode7operator= (const FourierInserter3DMode7 &)

Detailed Description

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

Definition at line 341 of file reconstructor_tools.h.


Constructor & Destructor Documentation

EMAN::FourierInserter3DMode7::FourierInserter3DMode7 ( ) [inline]

Definition at line 344 of file reconstructor_tools.h.

Referenced by NEW().

{}
virtual EMAN::FourierInserter3DMode7::~FourierInserter3DMode7 ( ) [inline, virtual]

Definition at line 345 of file reconstructor_tools.h.

{}
EMAN::FourierInserter3DMode7::FourierInserter3DMode7 ( const FourierInserter3DMode7 ) [private]

Member Function Documentation

virtual string EMAN::FourierInserter3DMode7::get_desc ( ) const [inline, virtual]

Get a clear, concise description of this class.

Returns:
a clear, concise description of this class

Implements EMAN::FactoryBase.

Definition at line 359 of file reconstructor_tools.h.

                        {
                                return "Hypergeometric kernel 5x5x5";
                        }
virtual string EMAN::FourierInserter3DMode7::get_name ( ) const [inline, virtual]

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

References NAME.

                        {
                                return NAME;
                        }
bool FourierInserter3DMode7::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 315 of file reconstructor_tools.cpp.

References EMAN::EMData::add_complex_at(), EMAN::FourierPixelInserter3D::data, EMAN::FourierPixelInserter3D::fullnx, EMAN::FourierPixelInserter3D::fullny, EMAN::FourierPixelInserter3D::fullnz, EMAN::Interp::hyperg(), EMAN::Util::hypot3sq(), EMAN::FourierPixelInserter3D::norm, EMAN::FourierPixelInserter3D::nx, EMAN::FourierPixelInserter3D::nxyz, EMAN::FourierPixelInserter3D::ny, EMAN::FourierPixelInserter3D::nz, sqrt(), EMAN::FourierPixelInserter3D::subx0, EMAN::FourierPixelInserter3D::suby0, EMAN::FourierPixelInserter3D::subz0, and weight.

{
        int x0 = 2 * (int) floor(xx + 0.5f);
        int y0 = (int) floor(yy + 0.5f);
        int z0 = (int) floor(zz + 0.5f);

        if (x0 >= nx - 4 || y0 > ny - 3 || z0 > nz - 3 || y0 < 2 || z0 < 2)
                return false;

        int l = x0 - 4;
        if (x0 <= 2)
                l = 0;

        //size_t ii;
        float r, gg;
        for (int k = z0 - 2; k <= z0 + 2; k++) {
                for (int j = y0 - 2; j <= y0 + 2; j++) {
                        for (int i = l; i <= x0 + 4; i += 2) {
                                r =     sqrt(Util::hypot3sq((float) i / 2 - xx, (float) j - yy, (float) k - zz));
                                gg = Interp::hyperg(r)*weight;

                                size_t off;
                                if (subx0<0) off=data->add_complex_at(i,j,k,dt*gg);
                                else off=data->add_complex_at(i,j,k,subx0,suby0,subz0,fullnx,fullny,fullnz,dt*gg);
                                if (static_cast<int>(off)!=nxyz) norm[off/2]+=gg;

                        }
                }
        }

        if (x0 <= 2) {
                float xx_b = -xx;
                float yy_b = -(yy - ny / 2) + ny / 2;
                float zz_b = -(zz - nz / 2) + nz / 2;
                x0 = 2 * (int) floor(xx_b + 0.5f);
                y0 = (int) floor(yy_b + 0.5f);
                z0 = (int) floor(zz_b + 0.5f);

                if (y0 > ny - 3 || z0 > nz - 3 || y0 < 2 || z0 < 2)
                        return false;

                //size_t ii;
                float r, gg;
                for (int k = z0 - 2; k <= z0 + 2; k++) {
                        for (int j = y0 - 2; j <= y0 + 2; j++) {
                                for (int i = 0; i <= x0 + 4; i += 2) {
                                        r = sqrt(Util::hypot3sq((float) i / 2 - xx_b, (float) j - yy_b,
                                                                   (float) k - zz_b));
                                        gg = Interp::hyperg(r)*weight;

                                        size_t off;
                                        if (subx0<0) off=data->add_complex_at(i,j,k,dt*gg);
                                        else off=data->add_complex_at(i,j,k,subx0,suby0,subz0,fullnx,fullny,fullnz,dt*gg);
                                        if (static_cast<int>(off)!=nxyz) norm[off/2]+=gg;

                                }
                        }
                }
        }

        return true;
}
static FourierPixelInserter3D* EMAN::FourierInserter3DMode7::NEW ( ) [inline, static]

Definition at line 349 of file reconstructor_tools.h.

References FourierInserter3DMode7().

                        {
                                return new FourierInserter3DMode7();
                        }
FourierInserter3DMode7& EMAN::FourierInserter3DMode7::operator= ( const FourierInserter3DMode7 ) [private]

Member Data Documentation

const string FourierInserter3DMode7::NAME = "hypergeom_5" [static]

Definition at line 364 of file reconstructor_tools.h.

Referenced by get_name().


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