Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EMAN::BackProjectionReconstructor Class Reference

Real space 3D reconstruction using back projection. More...

#include <reconstructor.h>

Inheritance diagram for EMAN::BackProjectionReconstructor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BackProjectionReconstructor ()
virtual ~BackProjectionReconstructor ()
virtual void setup ()
 Initialize the reconstructor.
virtual int insert_slice (const EMData *const slice, const Transform &euler, const float weight=1.0)
 Insert an image slice to the reconstructor.
virtual EMDatafinish (bool doift=true)
 Finish reconstruction and return the complete model.
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.
virtual TypeDict get_param_types () const

Static Public Member Functions

ReconstructorNEW ()

Static Public Attributes

const string NAME = "back_projection"

Private Member Functions

 BackProjectionReconstructor (const BackProjectionReconstructor &that)
BackProjectionReconstructoroperator= (const BackProjectionReconstructor &)
void load_default_settings ()
EMDatapreprocess_slice (const EMData *const slice, const Transform &t)
 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.

Detailed Description

Real space 3D reconstruction using back projection.

Back-projection is a method of 3D reconstruction from 2D projections. It is based on superposing 3D functions ("back-projection bodies") obtained by translating the 2D projections along the directions of projection.

Definition at line 659 of file reconstructor.h.


Constructor & Destructor Documentation

EMAN::BackProjectionReconstructor::BackProjectionReconstructor  )  [inline]
 

Definition at line 662 of file reconstructor.h.

00662 { load_default_settings();  }

virtual EMAN::BackProjectionReconstructor::~BackProjectionReconstructor  )  [inline, virtual]
 

Definition at line 664 of file reconstructor.h.

00664 {}

EMAN::BackProjectionReconstructor::BackProjectionReconstructor const BackProjectionReconstructor that  )  [private]
 


Member Function Documentation

EMData * BackProjectionReconstructor::finish bool  doift = true  )  [virtual]
 

Finish reconstruction and return the complete model.

Parameters:
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
Returns:
The result 3D model.

Reimplemented from EMAN::Reconstructor.

Definition at line 1920 of file reconstructor.cpp.

References EMAN::EMData::add(), EMAN::Factory< T >::get(), EMAN::Symmetry3D::get_nsym(), EMAN::Symmetry3D::get_syms(), EMAN::EMData::mult(), and EMAN::EMData::transform().

01921 {
01922 
01923         Symmetry3D* sym = Factory<Symmetry3D>::get((string)params["sym"]);
01924         vector<Transform> syms = sym->get_syms();
01925 
01926         for ( vector<Transform>::const_iterator it = syms.begin(); it != syms.end(); ++it ) {
01927 
01928                 EMData tmpcopy(*image);
01929                 tmpcopy.transform(*it);
01930                 image->add(tmpcopy);
01931         }
01932 
01933         image->mult(1.0f/(float)sym->get_nsym());
01934         delete sym;
01935 
01936         EMData *ret = image;
01937         image = 0 ;
01938         return ret;
01939 }

virtual string EMAN::BackProjectionReconstructor::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 685 of file reconstructor.h.

00686                 {
00687                         return "Simple (unfiltered) back-projection reconstruction. Weighting by contributing particles in the class average is optional and default behaviour";
00688                 }

virtual string EMAN::BackProjectionReconstructor::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 680 of file reconstructor.h.

00681                 {
00682                         return NAME;
00683                 }

virtual TypeDict EMAN::BackProjectionReconstructor::get_param_types  )  const [inline, virtual]
 

Returns:
a TypeDict defining and describing the feasible parameters of this class

Implements EMAN::FactoryBase.

Definition at line 695 of file reconstructor.h.

References EMAN::TypeDict::put().

00696                 {
00697                         TypeDict d;
00698                         d.put("size", EMObject::INT, "Necessary. The x and y dimensions of the input images.");
00699                         d.put("weight", EMObject::FLOAT, "Optional. A temporary value set prior to slice insertion, indicative of the inserted slice's weight. Default sis 1.");
00700                         d.put("sym", EMObject::STRING, "Optional. The symmetry to impose on the final reconstruction. Default is c1");
00701                         d.put("zsample", EMObject::INT, "Optional. The z dimensions of the reconstructed volume.");
00702                         return d;
00703                 }

virtual int EMAN::BackProjectionReconstructor::insert_slice const EMData *const   slice,
const Transform euler,
const float  weight = 1.0
[virtual]
 

Insert an image slice to the reconstructor.

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

Parameters:
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
Returns:
0 if OK. 1 if error.

Reimplemented from EMAN::Reconstructor.

void EMAN::BackProjectionReconstructor::load_default_settings  )  [inline, private]
 

Definition at line 713 of file reconstructor.h.

00714                 {
00715                         params["weight"] = 1.0;
00716                         params["use_weights"] = true;
00717                         params["size"] = 0;
00718                         params["sym"] = "c1";
00719                         params["zsample"] = 0;
00720                 }

Reconstructor* EMAN::BackProjectionReconstructor::NEW  )  [inline, static]
 

Definition at line 690 of file reconstructor.h.

00691                 {
00692                         return new BackProjectionReconstructor();
00693                 }

BackProjectionReconstructor& EMAN::BackProjectionReconstructor::operator= const BackProjectionReconstructor  )  [private]
 

EMData * BackProjectionReconstructor::preprocess_slice const EMData *const   slice,
const Transform t
[private, 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:
slice the slice to be prepocessed
t transform
Exceptions:
InvalidValueException when the specified padding value is less than the size of the images

Reimplemented from EMAN::Reconstructor.

Definition at line 1850 of file reconstructor.cpp.

References EMAN::Transform::get_mirror(), EMAN::Transform::get_scale(), EMAN::Transform::get_trans_2d(), EMAN::EMData::process(), EMAN::EMData::process_inplace(), EMAN::Transform::set_rotation(), t, EMAN::EMData::transform(), and EMAN::Vec2f.

01851 {
01852 
01853         EMData* return_slice = slice->process("normalize.edgemean");
01854         return_slice->process_inplace("filter.linearfourier");
01855 
01856         Transform tmp(t);
01857         tmp.set_rotation(Dict("type","eman")); // resets the rotation to 0 implicitly
01858         Vec2f trans = tmp.get_trans_2d();
01859         float scale = tmp.get_scale();
01860         bool mirror = tmp.get_mirror();
01861         if (trans[0] != 0 || trans[1] != 0 || scale != 1.0 ) {
01862                 return_slice->transform(tmp);
01863         } else if ( mirror == true ) {
01864                 return_slice = slice->process("xform.flip",Dict("axis","x"));
01865         }
01866 
01867         return return_slice;
01868 }

void BackProjectionReconstructor::setup  )  [virtual]
 

Initialize the reconstructor.

Implements EMAN::Reconstructor.

Definition at line 1839 of file reconstructor.cpp.

References EMAN::EMData::set_size().

01840 {
01841         int size = params["size"];
01842         image = new EMData();
01843         nx = size;
01844         ny = size;
01845         if ( (int) params["zsample"] != 0 ) nz = params["zsample"];
01846         else nz = size;
01847         image->set_size(nx, ny, nz);
01848 }


Member Data Documentation

const string BackProjectionReconstructor::NAME = "back_projection" [static]
 

Definition at line 80 of file reconstructor.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jul 12 13:51:41 2011 for EMAN2 by  doxygen 1.3.9.1