#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.
|
Definition at line 113 of file reconstructor.h. 00113 {}
|
|
Definition at line 114 of file reconstructor.h. 00114 {}
|
|
|
|
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. 00171 {throw; }
|
|
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
Reimplemented in EMAN::FourierReconstructor, EMAN::WienerFourierReconstructor, and EMAN::FourierPlaneReconstructor. Definition at line 161 of file reconstructor.h. 00161 { throw; }
|
|
Finish reconstruction and return the complete 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_ctf_rectReconstructor, and EMAN::nnSSNR_ctfReconstructor. Definition at line 167 of file reconstructor.h. Referenced by ali3d_d(), and recons3d_4nn(). 00167 { throw; }
|
|
Insert an image slice to the reconstructor. To insert multiple image slices, call this function multiple times.
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(). 00146 {throw;}
|
|
|
|
Definition at line 186 of file reconstructor.h. 00186 { return params[key]; }
|
|
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.
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(). 00136 { EMData *ret=slice->copy(); ret->set_attr("reconstruct_preproc",(int)1); return ret; }
|
|
Print the current parameters to std::out.
Definition at line 175 of file reconstructor.h. 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 }
|
|
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(). |
|
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. 00126 {throw;}
|