EMAN2
Public Member Functions | Private Member Functions
EMAN::Reconstructor Class Reference

Reconstructor class defines a way to do 3D recontruction. More...

#include <reconstructor.h>

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

List of all members.

Public Member Functions

 Reconstructor ()
virtual ~Reconstructor ()
virtual void setup ()=0
 Initialize the reconstructor.
virtual void setup_seed (EMData *seed, float seed_weight)
 Initialize the reconstructor with a seed volume.
virtual EMDatapreprocess_slice (const EMData *const slice, const Transform &t=Transform())
 While you can just insert unprocessed slices, if you call preprocess_slice yourself, and insert the returned slice instead, repeatedly, it can save a fair bit of computation.
virtual int insert_slice (const EMData *const slice, const Transform &euler, const float weight)
 Insert an image slice to the reconstructor.
int insert_slice (const EMData *const slice, const Transform &euler)
virtual int determine_slice_agreement (EMData *slice, const Transform &euler, const float weight=1.0, bool sub=true)
 Compares a slice to the current reconstruction volume and computes a normalization factor and quality.
virtual EMDatafinish (bool doift=true)
 Finish reconstruction and return the complete model.
virtual void clear ()
 set the volume and tmp_volume data to zero, for use in Monte Carlo reconstructors
void print_params () const
 Print the current parameters to std::out.
EMObjectoperator[] (const string &key)

Private Member Functions

 Reconstructor (const Reconstructor &that)
Reconstructoroperator= (const Reconstructor &)

Detailed Description

Reconstructor class defines a way to do 3D recontruction.

A reconstruction is done by 3 steps:

Reconstructor class is the base class for all reconstructors. Each specific Reconstructor class has a unique ID name. This name is used to create a Reconstructor instance or do a reconstruction.

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

Typical usages of Reconstructors are as follows:

Definition at line 110 of file reconstructor.h.


Constructor & Destructor Documentation

EMAN::Reconstructor::Reconstructor ( ) [inline]

Definition at line 113 of file reconstructor.h.

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

Definition at line 114 of file reconstructor.h.

{}
EMAN::Reconstructor::Reconstructor ( const Reconstructor that) [private]

Member Function Documentation

virtual void EMAN::Reconstructor::clear ( ) [inline, virtual]

set the volume and tmp_volume data to zero, for use in Monte Carlo reconstructors

Reimplemented in EMAN::FourierReconstructor, and EMAN::FourierPlaneReconstructor.

Definition at line 172 of file reconstructor.h.

{throw; }
virtual int EMAN::Reconstructor::determine_slice_agreement ( EMData slice,
const Transform euler,
const float  weight = 1.0,
bool  sub = true 
) [inline, virtual]

Compares a slice to the current reconstruction volume and computes a normalization factor and quality.

Normalization and quality are returned via attributes set in the passed slice. You may freely mix calls to determine_slice_agreement with calls to insert_slice, but note that determine_slice_agreement can only use information from slices that have already been inserted. reconstruct_norm contains the relative normalization factor which should be applied before inserting the slice reconstruct_qual contains a quality factor (larger better) for this slice as compared to the existing reconstruction

Parameters:
input_sliceThe EMData slice to be compared
eulerThe orientation of the slice as a Transform object
weightA weighting factor for this slice, generally the number of particles in a class-average. May be ignored by some reconstructors
subFlag indicating whether to subtract the slice from the volume before comparing. May be ignored by some reconstructors
Returns:
0 if OK. 1 if error.
Exceptions:

Reimplemented in EMAN::FourierReconstructor, EMAN::WienerFourierReconstructor, EMAN::FourierPlaneReconstructor, and EMAN::BackProjectionReconstructor.

Definition at line 162 of file reconstructor.h.

{ throw; }
virtual EMData* EMAN::Reconstructor::finish ( bool  doift = true) [inline, virtual]

Finish reconstruction and return the complete model.

Parameters:
doiftA flag indicating whether the returned object should be guaranteed to be in real-space (true) or should be left in whatever space the reconstructor generated
Returns:
The result 3D model.

Reimplemented in EMAN::XYZReconstructor, EMAN::FourierReconstructorSimple2D, EMAN::FourierReconstructor, EMAN::WienerFourierReconstructor, EMAN::FourierPlaneReconstructor, EMAN::BackProjectionReconstructor, EMAN::nn4Reconstructor, EMAN::nn4_rectReconstructor, EMAN::nnSSNR_Reconstructor, EMAN::nn4_ctfReconstructor, EMAN::nn4_ctfwReconstructor, EMAN::nn4_ctf_rectReconstructor, and EMAN::nnSSNR_ctfReconstructor.

Definition at line 168 of file reconstructor.h.

Referenced by ali3d_d(), and recons3d_4nn().

{ throw; }
int EMAN::Reconstructor::insert_slice ( const EMData *const  slice,
const Transform euler 
) [inline]

Definition at line 147 of file reconstructor.h.

References insert_slice().

Referenced by insert_slice().

{ return this->insert_slice(slice, euler, 1.0f); }
virtual int EMAN::Reconstructor::insert_slice ( const EMData *const  slice,
const Transform euler,
const float  weight 
) [inline, virtual]

Insert an image slice to the reconstructor.

To insert multiple image slices, call this function multiple times.

Parameters:
sliceImage slice.
eulerEuler angle of this image slice.
weightA weighting factor for this slice, generally the number of particles in a class-average. May be ignored by some reconstructors
Returns:
0 if OK. 1 if error.

Reimplemented in EMAN::XYZReconstructor, EMAN::FourierReconstructorSimple2D, EMAN::FourierReconstructor, EMAN::WienerFourierReconstructor, EMAN::FourierPlaneReconstructor, EMAN::BackProjectionReconstructor, EMAN::nn4Reconstructor, EMAN::nn4_rectReconstructor, EMAN::nnSSNR_Reconstructor, EMAN::nn4_ctfReconstructor, EMAN::nn4_ctfwReconstructor, EMAN::nn4_ctf_rectReconstructor, and EMAN::nnSSNR_ctfReconstructor.

Definition at line 146 of file reconstructor.h.

Referenced by ali3d_d(), and recons3d_4nn().

{throw;}
Reconstructor& EMAN::Reconstructor::operator= ( const Reconstructor ) [private]
EMObject& EMAN::Reconstructor::operator[] ( const string &  key) [inline]

Definition at line 187 of file reconstructor.h.

References key, and EMAN::FactoryBase::params.

{ return params[key]; }
virtual EMData* EMAN::Reconstructor::preprocess_slice ( const EMData *const  slice,
const Transform t = Transform() 
) [inline, virtual]

While you can just insert unprocessed slices, if you call preprocess_slice yourself, and insert the returned slice instead, repeatedly, it can save a fair bit of computation.

The default operation just returns a copy of the image, as the preprocessing is reconstructor-specific.

Returns:
the processed slice
Parameters:
slicethe slice to be prepocessed
ttransform
Exceptions:
InvalidValueExceptionwhen the specified padding value is less than the size of the images

Reimplemented in EMAN::FourierReconstructor, EMAN::FourierPlaneReconstructor, and EMAN::BackProjectionReconstructor.

Definition at line 136 of file reconstructor.h.

References EMAN::EMData::copy(), and EMAN::EMData::set_attr().

{ EMData *ret=slice->copy(); ret->set_attr("reconstruct_preproc",(int)1); return ret; }
void EMAN::Reconstructor::print_params ( ) const [inline]

Print the current parameters to std::out.

Definition at line 176 of file reconstructor.h.

References EMAN::Dict::begin(), EMAN::Dict::end(), and EMAN::FactoryBase::params.

Referenced by EMAN::nn4_rectReconstructor::nn4_rectReconstructor(), and EMAN::nn4Reconstructor::nn4Reconstructor().

                {
                        std::cout << "Printing reconstructor params" << std::endl;
                        for ( Dict::const_iterator it = params.begin(); it != params.end(); ++it )
                        {
                                std::cout << (it->first) << " " << (it->second).to_str() << std::endl;
                        }
                        std::cout << "Done printing reconstructor params" << std::endl;
                }
virtual void EMAN::Reconstructor::setup ( ) [pure virtual]
virtual void EMAN::Reconstructor::setup_seed ( EMData seed,
float  seed_weight 
) [inline, virtual]

Initialize the reconstructor with a seed volume.

This can be used to provide some 'default' value when there is missing data in Fourier space. The passed 'seed' must be of the appropriate padded size, must be in Fourier space, and the same EMData* object will be returned by finish(), meaning the Reconstructor is implicitly taking ownership of the object. However, in Python, this means the seed may be passed in without copying, as the same EMData will be coming back out at the end. The seed_weight determines how 'strong' the seed volume should be as compared to other inserted slices in Fourier space. Raises an exception if not supported by the Reconstructor, or if there is an error with the size.

Reimplemented in EMAN::FourierReconstructor, and EMAN::FourierPlaneReconstructor.

Definition at line 126 of file reconstructor.h.

{throw;}

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