#include <reconstructor.h>
Inheritance diagram for EMAN::Reconstructor:
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 EMData * | preprocess_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=1.0) |
Insert an image slice to the reconstructor. | |
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 EMData * | finish (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. | |
EMObject & | operator[] (const string &key) |
Private Member Functions | |
Reconstructor (const Reconstructor &that) | |
Reconstructor & | operator= (const Reconstructor &) |
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:
vector<string> all_reconstructors = Factory<Reconstructor>::get_list();
Reconstructor* r = Factory<Reconstructor>::get("fourier"); r->setup(); r->determine_slice_agreement(slice,euler,weight,true); ... r->insert_slice(slice, euler, weight); ... EMData* result = r->finish();
void setup(); int insert_slice(const EMData* const slice, const Transform & t); EMData * finish(); string get_name() const { return "xyz"; } static Reconstructor *NEW() { return new XYZReconstructor(); } TypeDict get_param_types() const;
Definition at line 110 of file reconstructor.h.
EMAN::Reconstructor::Reconstructor | ( | ) | [inline] |
virtual EMAN::Reconstructor::~Reconstructor | ( | ) | [inline, virtual] |
EMAN::Reconstructor::Reconstructor | ( | const Reconstructor & | that | ) | [private] |
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 171 of file reconstructor.h.
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
input_slice | The EMData slice to be compared | |
euler | The orientation of the slice as a Transform object | |
weight | A weighting factor for this slice, generally the number of particles in a class-average. May be ignored by some reconstructors | |
sub | Flag indicating whether to subtract the slice from the volume before comparing. May be ignored by some reconstructors |
Reimplemented in EMAN::FourierReconstructor, EMAN::WienerFourierReconstructor, and EMAN::FourierPlaneReconstructor.
Definition at line 161 of file reconstructor.h.
virtual EMData* EMAN::Reconstructor::finish | ( | bool | doift = true |
) | [inline, virtual] |
Finish reconstruction and return the complete model.
doift | A 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 |
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_ctf_rectReconstructor, and EMAN::nnSSNR_ctfReconstructor.
Definition at line 167 of file reconstructor.h.
Referenced by ali3d_d(), and recons3d_4nn().
virtual int EMAN::Reconstructor::insert_slice | ( | const EMData *const | slice, | |
const Transform & | euler, | |||
const float | weight = 1.0 | |||
) | [inline, virtual] |
Insert an image slice to the reconstructor.
To insert multiple image slices, call this function multiple times.
slice | Image slice. | |
euler | Euler angle of this image slice. | |
weight | A weighting factor for this slice, generally the number of particles in a class-average. May be ignored by some reconstructors |
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_ctf_rectReconstructor, and EMAN::nnSSNR_ctfReconstructor.
Definition at line 146 of file reconstructor.h.
Referenced by ali3d_d(), and recons3d_4nn().
Reconstructor& EMAN::Reconstructor::operator= | ( | const Reconstructor & | ) | [private] |
EMObject& EMAN::Reconstructor::operator[] | ( | const string & | key | ) | [inline] |
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.
slice | the slice to be prepocessed | |
t | transform |
InvalidValueException | when 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().
void EMAN::Reconstructor::print_params | ( | ) | const [inline] |
Print the current parameters to std::out.
Definition at line 175 of file reconstructor.h.
References EMAN::Dict::begin(), EMAN::Dict::end(), EMAN::FactoryBase::params, and EMAN::Gatan::to_str().
Referenced by EMAN::nn4_rectReconstructor::nn4_rectReconstructor(), and EMAN::nn4Reconstructor::nn4Reconstructor().
00176 { 00177 std::cout << "Printing reconstructor params" << std::endl; 00178 for ( Dict::const_iterator it = params.begin(); it != params.end(); ++it ) 00179 { 00180 std::cout << (it->first) << " " << (it->second).to_str() << std::endl; 00181 } 00182 std::cout << "Done printing reconstructor params" << std::endl; 00183 }
virtual void EMAN::Reconstructor::setup | ( | ) | [pure virtual] |
Initialize the reconstructor.
Implemented in EMAN::XYZReconstructor, EMAN::FourierReconstructorSimple2D, EMAN::FourierReconstructor, EMAN::FourierPlaneReconstructor, EMAN::BackProjectionReconstructor, EMAN::nn4Reconstructor, EMAN::nn4_rectReconstructor, EMAN::nnSSNR_Reconstructor, EMAN::nn4_ctfReconstructor, EMAN::nn4_ctf_rectReconstructor, and EMAN::nnSSNR_ctfReconstructor.
Referenced by ali3d_d(), and recons3d_4nn().
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.