EMAN2
Public Member Functions | Private Member Functions | List of all members
EMAN::Reconstructor Class Referenceabstract

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]

Public Member Functions

 Reconstructor ()
 
virtual ~Reconstructor ()
 
virtual void setup ()=0
 Initialize the reconstructor. More...
 
virtual void setup_seed (EMData *seed, float seed_weight)
 Initialize the reconstructor with a seed volume. More...
 
virtual void setup_seedandweights (EMData *seed, EMData *weight)
 Initialize the reconstructor with a seed volume, as above. More...
 
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. More...
 
virtual int insert_slice (const EMData *const slice, const Transform &euler, const float weight)
 Insert an image slice to the reconstructor. More...
 
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. More...
 
virtual EMDataprojection (const Transform &euler, int ret_fourier=1)
 This will create a projection from the current reconstruction. More...
 
virtual EMDatafinish (bool doift=true)
 Finish reconstruction and return the complete model. More...
 
virtual void clear ()
 set the volume and tmp_volume data to zero, for use in Monte Carlo reconstructors More...
 
void print_params () const
 Print the current parameters to std::out. More...
 
EMObjectoperator[] (const string &key)
 
- 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)
 
virtual TypeDict get_param_types () const =0
 
void insert_params (const Dict &new_params)
 Insert parameters. More...
 
Dict copy_relevant_params (const FactoryBase *const that) const
 

Private Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from EMAN::FactoryBase
Dict params
 This is the dictionary the stores the parameters of the object. More...
 

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:
  - a unique name to idenfity itself in the factory.
  - a static method to register itself in the factory.

Typical usages of Reconstructors are as follows:

Definition at line 108 of file reconstructor.h.

Constructor & Destructor Documentation

◆ Reconstructor() [1/2]

EMAN::Reconstructor::Reconstructor ( )
inline

Definition at line 111 of file reconstructor.h.

111{}

◆ ~Reconstructor()

virtual EMAN::Reconstructor::~Reconstructor ( )
inlinevirtual

Definition at line 112 of file reconstructor.h.

112{}

◆ Reconstructor() [2/2]

EMAN::Reconstructor::Reconstructor ( const Reconstructor that)
private

Member Function Documentation

◆ clear()

virtual void EMAN::Reconstructor::clear ( )
inlinevirtual

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

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

Definition at line 184 of file reconstructor.h.

184{throw; }

◆ determine_slice_agreement()

virtual int EMAN::Reconstructor::determine_slice_agreement ( EMData slice,
const Transform euler,
const float  weight = 1.0,
bool  sub = true 
)
inlinevirtual

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::FourierIterReconstructor, EMAN::BackProjectionReconstructor, and EMAN::RealMedianReconstructor.

Definition at line 163 of file reconstructor.h.

163{ throw; }

◆ finish()

virtual EMData * EMAN::Reconstructor::finish ( bool  doift = true)
inlinevirtual

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::nn4_ctfwReconstructor, EMAN::nn4_ctfwsReconstructor, EMAN::XYZReconstructor, EMAN::FourierReconstructorSimple2D, EMAN::FourierReconstructor, EMAN::WienerFourierReconstructor, EMAN::FourierIterReconstructor, EMAN::BackProjectionReconstructor, EMAN::RealMedianReconstructor, EMAN::nn4Reconstructor, EMAN::nn4_rectReconstructor, EMAN::nnSSNR_Reconstructor, EMAN::nn4_ctfReconstructor, EMAN::nn4_ctf_rectReconstructor, and EMAN::nnSSNR_ctfReconstructor.

Definition at line 180 of file reconstructor.h.

180{ throw; }

◆ insert_slice() [1/2]

int EMAN::Reconstructor::insert_slice ( const EMData *const  slice,
const Transform euler 
)
inline

Definition at line 148 of file reconstructor.h.

148{ return this->insert_slice(slice, euler, 1.0f); }

References insert_slice().

Referenced by insert_slice().

◆ insert_slice() [2/2]

virtual int EMAN::Reconstructor::insert_slice ( const EMData *const  slice,
const Transform euler,
const float  weight 
)
inlinevirtual

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::FourierIterReconstructor, EMAN::BackProjectionReconstructor, EMAN::RealMedianReconstructor, EMAN::nn4Reconstructor, EMAN::nn4_rectReconstructor, EMAN::nnSSNR_Reconstructor, EMAN::nn4_ctfReconstructor, EMAN::nn4_ctfwReconstructor, EMAN::nn4_ctfwsReconstructor, EMAN::nn4_ctf_rectReconstructor, and EMAN::nnSSNR_ctfReconstructor.

Definition at line 147 of file reconstructor.h.

147{throw;}

◆ operator=()

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

◆ operator[]()

EMObject & EMAN::Reconstructor::operator[] ( const string &  key)
inline

Definition at line 199 of file reconstructor.h.

199{ return params[key]; }
Dict params
This is the dictionary the stores the parameters of the object.
Definition: emobject.h:953

References EMAN::FactoryBase::params.

◆ preprocess_slice()

virtual EMData * EMAN::Reconstructor::preprocess_slice ( const EMData *const  slice,
const Transform t = Transform() 
)
inlinevirtual

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::BackProjectionReconstructor, EMAN::FourierReconstructor, EMAN::FourierIterReconstructor, and EMAN::RealMedianReconstructor.

Definition at line 137 of file reconstructor.h.

137{ EMData *ret=slice->copy(); ret->set_attr("reconstruct_preproc",(int)1); return ret; }

◆ print_params()

void EMAN::Reconstructor::print_params ( ) const
inline

Print the current parameters to std::out.

Definition at line 188 of file reconstructor.h.

189 {
190 std::cout << "Printing reconstructor params" << std::endl;
191 for ( Dict::const_iterator it = params.begin(); it != params.end(); ++it )
192 {
193 std::cout << (it->first) << " " << (it->second).to_str() << std::endl;
194 }
195 std::cout << "Done printing reconstructor params" << std::endl;
196 }
iterator end()
Definition: emobject.cpp:1061
iterator begin()
Definition: emobject.cpp:1045

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

Referenced by EMAN::nn4_rectReconstructor::nn4_rectReconstructor().

◆ projection()

virtual EMData * EMAN::Reconstructor::projection ( const Transform euler,
int  ret_fourier = 1 
)
inlinevirtual

This will create a projection from the current reconstruction.

Only valid before finish() is called. may not be implemented for all Reconstructors. If the reconstructor implements padding, the projection will also be padded. The euler parameter will ignore translation and mirroring

Parameters
eulerThe orientation of the slice as a Transform object
ret_fourierIf set returns the Fourier transform of the projection. For many reconstructors this may be less expensive.
Returns
0 if OK. 1 if error.
Exceptions

Reimplemented in EMAN::FourierReconstructor.

Definition at line 173 of file reconstructor.h.

173{ throw; }

◆ setup()

virtual void EMAN::Reconstructor::setup ( )
pure virtual

◆ setup_seed()

virtual void EMAN::Reconstructor::setup_seed ( EMData seed,
float  seed_weight 
)
inlinevirtual

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. The seed is copied on input. 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::FourierIterReconstructor.

Definition at line 122 of file reconstructor.h.

122{throw;}

◆ setup_seedandweights()

virtual void EMAN::Reconstructor::setup_seedandweights ( EMData seed,
EMData weight 
)
inlinevirtual

Initialize the reconstructor with a seed volume, as above.

In this case the initial weight map is also provided explicitly, rather than a single weight value.

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

Definition at line 126 of file reconstructor.h.

126{throw;}

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