EMAN2
|
Fourier space 3D reconstruction The Fourier reconstructor is designed to work in an iterative fashion, where similarity ("quality") metrics are used to determine if a slice should be inserted into the 3D in each subsequent iteration. More...
#include <reconstructor.h>
Public Member Functions | |
FourierIterReconstructor () | |
Default constructor. More... | |
virtual | ~FourierIterReconstructor () |
Deconstructor calls free_memory() More... | |
virtual void | setup () |
Setup the Fourier 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 EMData * | preprocess_slice (const EMData *const slice, const Transform &t=Transform()) |
Preprocess the slice prior to insertion into the 3D volume this Fourier tranforms the slice and make sure all the pixels are in the right position it always returns a copy of the provided slice, so it should be deleted by someone eventually. More... | |
virtual int | insert_slice (const EMData *const slice, const Transform &euler, const float weight) |
Insert a slice into a 3D volume, in a given orientation. More... | |
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 EMData * | finish (bool doift=true) |
Get the reconstructed volume Normally will return the volume in real-space with the requested size. More... | |
virtual void | clear () |
clear the volume and tmp_data for use in Monte Carlo reconstructions More... | |
virtual string | get_name () const |
Get the unique name of the reconstructor. More... | |
virtual string | get_desc () const |
Get the one line description of the reconstructor. More... | |
virtual TypeDict | get_param_types () const |
Get the parameter types of this object. More... | |
Public Member Functions inherited from EMAN::Reconstructor | |
Reconstructor () | |
virtual | ~Reconstructor () |
int | insert_slice (const EMData *const slice, const Transform &euler) |
virtual EMData * | projection (const Transform &euler, int ret_fourier=1) |
This will create a projection from the current reconstruction. More... | |
void | print_params () const |
Print the current parameters to std::out. More... | |
EMObject & | operator[] (const string &key) |
Public Member Functions inherited from EMAN::FactoryBase | |
FactoryBase () | |
virtual | ~FactoryBase () |
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) |
void | insert_params (const Dict &new_params) |
Insert parameters. More... | |
Dict | copy_relevant_params (const FactoryBase *const that) const |
Public Member Functions inherited from EMAN::ReconstructorVolumeData | |
ReconstructorVolumeData () | |
Only constructor All member variables are zeroed. More... | |
virtual | ~ReconstructorVolumeData () |
Destructor safely frees memory. More... | |
const EMData * | get_emdata () |
Get the main image pointer, probably redundant (not used) More... | |
Static Public Member Functions | |
static Reconstructor * | NEW () |
Factory incorporation uses the pointer of this function. More... | |
Static Public Attributes | |
static const string | NAME = "fourier_iter" |
Protected Member Functions | |
virtual void | free_memory () |
Frees the memory owned by this object (but not parent objects) Deletes the FourierPixelInserter3D pointer. More... | |
Protected Member Functions inherited from EMAN::ReconstructorVolumeData | |
void | free_memory () |
Free allocated memorys The inherited class may have allocated image of tmp_data In either case you can safely call this function to delete either of those pointers, even if they bdb:refine_03::threed_00are NULL. More... | |
virtual void | normalize_threed (const bool sqrt_damp=false, const bool wiener=false) |
Normalize on the assumption that image is a Fourier volume and that tmp_data is a volume of weights corresponding in size to this Fourier volume. More... | |
virtual void | zero_memory () |
Sends the pixels in tmp_data and image to zero Convenience only. More... | |
Protected Attributes | |
EMData * | ref_vol |
Protected Attributes inherited from EMAN::FactoryBase | |
Dict | params |
This is the dictionary the stores the parameters of the object. More... | |
Protected Attributes inherited from EMAN::ReconstructorVolumeData | |
EMData * | image |
Inheriting class allocates this, probably in setup(). More... | |
EMData * | tmp_data |
Inheriting class may allocate this, probably in setup() More... | |
int | nx |
int | nx2 |
int | ny |
int | ny2 |
int | nz |
int | nz2 |
int | subnx |
int | subny |
int | subnz |
int | subx0 |
int | suby0 |
int | subz0 |
Private Member Functions | |
FourierIterReconstructor (const FourierIterReconstructor &that) | |
Disallow copy construction. More... | |
FourierIterReconstructor & | operator= (const FourierIterReconstructor &) |
Disallow assignment. More... | |
Fourier space 3D reconstruction The Fourier reconstructor is designed to work in an iterative fashion, where similarity ("quality") metrics are used to determine if a slice should be inserted into the 3D in each subsequent iteration.
The client creates a Fourier reconstructor to insert real images into a 3D volume. The return image is a real space image
This reconstructor works in Fourier space using a hardcoded 5x5x5 interpolation kernel based on the local environment from a previous iteration. That is, it uses interpolation, not gridding, but rather than using a fixed interpolation kernel, it bases the kernel on a previous estimate of the Fourier volume. It is designed to be used iteratively, being passed the results of the previous round as a starting volume in each pass. The starting volume does not get directly incorporated into the result, but is only used to define the local interpolation kernel.
Definition at line 698 of file reconstructor.h.
|
inline |
|
inlinevirtual |
Deconstructor calls free_memory()
Definition at line 708 of file reconstructor.h.
References free_memory().
|
private |
Disallow copy construction.
|
virtual |
clear the volume and tmp_data for use in Monte Carlo reconstructions
Reimplemented from EMAN::Reconstructor.
Definition at line 501 of file reconstructor.cpp.
References setup().
|
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. Attributes set in the slice are: reconstruct_norm the relative normalization factor which should be applied before inserting the slice reconstruct_qual a scaled quality factor (larger better) for this slice as compared to the existing reconstruction reconstruct_absqual the absolute (not scaled based on weight) quality factor comparing this slice to the existing reconstruction reconstruct_weight the summed weights from all voxels intersecting with the inserted slice, larger -> more overlap with other slices
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 |
NullPointerException | if the input EMData pointer is null |
ImageFormatException | if the image is complex as opposed to real |
Reimplemented from EMAN::Reconstructor.
Definition at line 651 of file reconstructor.cpp.
|
virtual |
Get the reconstructed volume Normally will return the volume in real-space with the requested size.
The calling application is responsible for removing any padding.
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 from EMAN::Reconstructor.
Definition at line 653 of file reconstructor.cpp.
References EMAN::Dict::has_key(), EMAN::ReconstructorVolumeData::image, EMAN::ReconstructorVolumeData::normalize_threed(), EMAN::FactoryBase::params, and EMAN::ReconstructorVolumeData::tmp_data.
|
protectedvirtual |
Frees the memory owned by this object (but not parent objects) Deletes the FourierPixelInserter3D pointer.
Definition at line 677 of file reconstructor.cpp.
References EMAN::ReconstructorVolumeData::image, ref_vol, and EMAN::ReconstructorVolumeData::tmp_data.
Referenced by ~FourierIterReconstructor().
|
inlinevirtual |
Get the one line description of the reconstructor.
Implements EMAN::FactoryBase.
Definition at line 787 of file reconstructor.h.
|
inlinevirtual |
Get the unique name of the reconstructor.
Implements EMAN::FactoryBase.
Definition at line 780 of file reconstructor.h.
References NAME.
|
inlinevirtual |
Get the parameter types of this object.
Implements EMAN::FactoryBase.
Definition at line 803 of file reconstructor.h.
References EMAN::EMObject::BOOL, EMAN::EMObject::INTARRAY, EMAN::TypeDict::put(), and EMAN::EMObject::STRING.
|
virtual |
Insert a slice into a 3D volume, in a given orientation.
slice | the image slice to be inserted into the 3D volume |
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 |
NullPointerException | if the input EMData pointer is null |
ImageFormatException | if the image is complex as opposed to real |
Reimplemented from EMAN::Reconstructor.
Definition at line 522 of file reconstructor.cpp.
References EMAN::Util::fast_exp(), EMAN::Symmetry3D::get_symmetries(), EMAN::Util::hypot3sq(), EMAN::Util::hypot_fast_int(), EMAN::ReconstructorVolumeData::image, EMAN::ReconstructorVolumeData::nx, EMAN::ReconstructorVolumeData::nx2, EMAN::ReconstructorVolumeData::ny, EMAN::ReconstructorVolumeData::ny2, EMAN::ReconstructorVolumeData::nz, EMAN::ReconstructorVolumeData::nz2, EMAN::FactoryBase::params, ref_vol, EMAN::Transform::set_mirror(), EMAN::Transform::set_scale(), EMAN::Transform::set_trans(), EMAN::ReconstructorVolumeData::tmp_data, EMAN::Util::trilinear_interpolate_complex(), x, and y.
|
inlinestatic |
Factory incorporation uses the pointer of this function.
Definition at line 795 of file reconstructor.h.
References FourierIterReconstructor().
|
private |
Disallow assignment.
|
virtual |
Preprocess the slice prior to insertion into the 3D volume this Fourier tranforms the slice and make sure all the pixels are in the right position it always returns a copy of the provided slice, so it should be deleted by someone eventually.
slice | the slice to be prepocessed |
t | transform to be used for insertion |
InvalidValueException | when the specified padding value is less than the size of the images |
Reimplemented from EMAN::Reconstructor.
Definition at line 505 of file reconstructor.cpp.
References EMAN::Transform::is_identity(), EMAN::Transform::set_rotation(), and sqrt().
|
virtual |
Setup the Fourier reconstructor.
InvalidValueException | When one of the input parameters is invalid |
Implements EMAN::Reconstructor.
Definition at line 430 of file reconstructor.cpp.
References EMAN::ReconstructorVolumeData::image, ImageDimensionException, EMAN::ReconstructorVolumeData::nx, EMAN::ReconstructorVolumeData::nx2, EMAN::ReconstructorVolumeData::ny, EMAN::ReconstructorVolumeData::ny2, EMAN::ReconstructorVolumeData::nz, EMAN::ReconstructorVolumeData::nz2, EMAN::FactoryBase::params, ref_vol, EMAN::Dict::set_default(), EMAN::ReconstructorVolumeData::subnx, EMAN::ReconstructorVolumeData::subny, EMAN::ReconstructorVolumeData::subnz, EMAN::ReconstructorVolumeData::subx0, EMAN::ReconstructorVolumeData::suby0, EMAN::ReconstructorVolumeData::subz0, and EMAN::ReconstructorVolumeData::tmp_data.
Referenced by clear(), setup_seed(), and setup_seedandweights().
|
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.
InvalidValueException | When one of the input parameters is invalid |
Reimplemented from EMAN::Reconstructor.
Definition at line 481 of file reconstructor.cpp.
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 from EMAN::Reconstructor.
Definition at line 490 of file reconstructor.cpp.
|
static |
Definition at line 812 of file reconstructor.h.
Referenced by get_name().
|
protected |
Definition at line 821 of file reconstructor.h.
Referenced by free_memory(), insert_slice(), setup(), setup_seed(), and setup_seedandweights().