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 | |
FourierReconstructor () | |
Default constructor calls load_default_settings() More... | |
virtual | ~FourierReconstructor () |
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 EMData * | projection (const Transform &euler, int ret_fourier) |
Generates a projection by extracting a slice in Fourier space. 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) |
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" |
Protected Member Functions | |
virtual void | load_default_settings () |
Load default settings. More... | |
virtual void | free_memory () |
Frees the memory owned by this object (but not parent objects) Deletes the FourierPixelInserter3D pointer. More... | |
virtual void | load_inserter () |
Load the pixel inserter based on the information in params. More... | |
virtual void | do_insert_slice_work (const EMData *const input_slice, const Transform &euler, const float weight, const bool corners=false) |
A function to perform the nuts and bolts of inserting an image slice. More... | |
virtual void | do_compare_slice_work (EMData *input_slice, const Transform &euler, float weight) |
A function to perform the nuts and bolts of comparing an image slice. More... | |
virtual bool | pixel_at (const float &xx, const float &yy, const float &zz, float *dt) |
This is a mode-2 pixel extractor. 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 | |
FourierPixelInserter3D * | inserter |
A pixel inserter pointer which inserts pixels into the 3D volume using one of a variety of insertion methods. More... | |
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 | |
FourierReconstructor (const FourierReconstructor &that) | |
Disallow copy construction. More... | |
FourierReconstructor & | operator= (const FourierReconstructor &) |
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 is based on EMAN1's Fourier reconstructor with a handful of modifications including
2 - Uses half of the memory used by EMAN1's equivalent reconstruction algorithm
Definition at line 388 of file reconstructor.h.
|
inline |
Default constructor calls load_default_settings()
Definition at line 394 of file reconstructor.h.
References load_default_settings().
Referenced by NEW().
|
inlinevirtual |
Deconstructor calls free_memory()
Definition at line 399 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 999 of file reconstructor.cpp.
References EMAN::ReconstructorVolumeData::image, EMAN::ReconstructorVolumeData::tmp_data, and to_zero_cuda().
|
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.
Reimplemented in EMAN::WienerFourierReconstructor.
Definition at line 1212 of file reconstructor.cpp.
References do_compare_slice_work(), do_insert_slice_work(), NullPointerException, preprocess_slice(), EMAN::Transform::set_mirror(), EMAN::Transform::set_scale(), EMAN::Transform::set_trans(), and sub().
|
protectedvirtual |
A function to perform the nuts and bolts of comparing an image slice.
input_slice | the slice to insert into the 3D volume |
euler | a transform storing the slice euler angle |
Reimplemented in EMAN::WienerFourierReconstructor.
Definition at line 1259 of file reconstructor.cpp.
References EMAN::Transform::copy_matrix_into_array(), determine_slice_agreement_cuda(), EMAN::dot(), EMAN::Symmetry3D::get_symmetries(), EMAN::Util::hypot_fast(), EMAN::ReconstructorVolumeData::image, EMAN::ReconstructorVolumeData::nx, EMAN::ReconstructorVolumeData::ny, EMAN::ReconstructorVolumeData::nz, EMAN::FactoryBase::params, pixel_at(), power(), sqrt(), EMAN::ReconstructorVolumeData::tmp_data, x, and y.
Referenced by determine_slice_agreement().
|
protectedvirtual |
A function to perform the nuts and bolts of inserting an image slice.
input_slice | the slice to insert into the 3D volume |
euler | a transform storing the slice euler angle |
weight | weighting factor for this slice (usually number of particles in a class-average) |
Definition at line 1122 of file reconstructor.cpp.
References EMAN::Transform::copy_matrix_into_array(), EMAN::Util::get_max(), EMAN::Symmetry3D::get_symmetries(), EMAN::Util::hypot_fast_int(), EMAN::ReconstructorVolumeData::image, EMAN::FourierPixelInserter3D::insert_pixel(), insert_slice_cuda(), inserter, EMAN::ReconstructorVolumeData::nx, EMAN::ReconstructorVolumeData::ny, EMAN::ReconstructorVolumeData::nz, EMAN::FactoryBase::params, EMAN::ReconstructorVolumeData::tmp_data, x, and y.
Referenced by determine_slice_agreement(), and insert_slice().
|
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.
Reimplemented in EMAN::WienerFourierReconstructor.
Definition at line 1552 of file reconstructor.cpp.
References EMAN::Dict::has_key(), EMAN::ReconstructorVolumeData::image, EMAN::ReconstructorVolumeData::normalize_threed(), EMAN::FactoryBase::params, EMAN::Dict::set_default(), and EMAN::ReconstructorVolumeData::tmp_data.
|
protectedvirtual |
Frees the memory owned by this object (but not parent objects) Deletes the FourierPixelInserter3D pointer.
Definition at line 693 of file reconstructor.cpp.
References EMAN::ReconstructorVolumeData::image, inserter, and EMAN::ReconstructorVolumeData::tmp_data.
Referenced by ~FourierReconstructor().
|
inlinevirtual |
Get the one line description of the reconstructor.
Implements EMAN::FactoryBase.
Reimplemented in EMAN::WienerFourierReconstructor.
Definition at line 485 of file reconstructor.h.
|
inlinevirtual |
Get the unique name of the reconstructor.
Implements EMAN::FactoryBase.
Reimplemented in EMAN::WienerFourierReconstructor.
Definition at line 478 of file reconstructor.h.
References NAME.
|
inlinevirtual |
Get the parameter types of this object.
Implements EMAN::FactoryBase.
Definition at line 501 of file reconstructor.h.
References EMAN::EMObject::BOOL, EMAN::EMObject::EMDATA, 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.
Reimplemented in EMAN::WienerFourierReconstructor.
Definition at line 1064 of file reconstructor.cpp.
References do_insert_slice_work(), NullPointerException, EMAN::FactoryBase::params, preprocess_slice(), EMAN::Dict::set_default(), EMAN::Transform::set_mirror(), EMAN::Transform::set_scale(), and EMAN::Transform::set_trans().
|
protectedvirtual |
Load default settings.
Definition at line 686 of file reconstructor.cpp.
References EMAN::ReconstructorVolumeData::image, inserter, and EMAN::ReconstructorVolumeData::tmp_data.
Referenced by FourierReconstructor().
|
protectedvirtual |
Load the pixel inserter based on the information in params.
Definition at line 706 of file reconstructor.cpp.
References EMAN::Factory< T >::get(), EMAN::ReconstructorVolumeData::image, EMAN::FourierPixelInserter3D::init(), inserter, EMAN::FactoryBase::params, and EMAN::ReconstructorVolumeData::tmp_data.
Referenced by setup(), setup_seed(), and setup_seedandweights().
|
inlinestatic |
Factory incorporation uses the pointer of this function.
Definition at line 493 of file reconstructor.h.
References FourierReconstructor().
|
private |
Disallow assignment.
|
protectedvirtual |
This is a mode-2 pixel extractor.
xx,yy,zz | voxel coordinates (need not be integers) |
dt | float pointer with 3 floats allocated for returned complex value and weight sum |
Reimplemented in EMAN::WienerFourierReconstructor.
Definition at line 1448 of file reconstructor.cpp.
References EMAN::ReconstructorVolumeData::image, EMAN::Util::round(), and EMAN::ReconstructorVolumeData::tmp_data.
Referenced by do_compare_slice_work(), and projection().
|
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 1022 of file reconstructor.cpp.
References EMAN::Transform::is_identity(), EMAN::Transform::set_rotation(), and sqrt().
Referenced by determine_slice_agreement(), EMAN::WienerFourierReconstructor::determine_slice_agreement(), insert_slice(), and EMAN::WienerFourierReconstructor::insert_slice().
Generates a projection by extracting a slice in Fourier space.
euler | The orientation of the slice as a Transform object |
ret_fourier | If true, will return the Fourier transform of the projection |
Reimplemented from EMAN::Reconstructor.
Definition at line 1383 of file reconstructor.cpp.
References EMAN::Transform::get_trans(), EMAN::ReconstructorVolumeData::image, ImageDimensionException, EMAN::ReconstructorVolumeData::nx, EMAN::ReconstructorVolumeData::ny, EMAN::ReconstructorVolumeData::nz, pixel_at(), EMAN::Transform::set_mirror(), EMAN::Transform::set_scale(), EMAN::Transform::set_trans(), EMAN::ReconstructorVolumeData::subnx, EMAN::ReconstructorVolumeData::subny, EMAN::ReconstructorVolumeData::subnz, EMAN::ReconstructorVolumeData::subx0, EMAN::ReconstructorVolumeData::suby0, EMAN::ReconstructorVolumeData::subz0, x, and y.
|
virtual |
Setup the Fourier reconstructor.
InvalidValueException | When one of the input parameters is invalid |
Implements EMAN::Reconstructor.
Definition at line 730 of file reconstructor.cpp.
References EMAN::Dict::has_key(), EMAN::ReconstructorVolumeData::image, ImageDimensionException, inserter, is_fftodd(), load_inserter(), EMAN::ReconstructorVolumeData::nx, EMAN::ReconstructorVolumeData::nx2, EMAN::ReconstructorVolumeData::ny, EMAN::ReconstructorVolumeData::ny2, EMAN::ReconstructorVolumeData::nz, EMAN::ReconstructorVolumeData::nz2, EMAN::FactoryBase::params, EMAN::Dict::set_default(), sub(), EMAN::ReconstructorVolumeData::subnx, EMAN::ReconstructorVolumeData::subny, EMAN::ReconstructorVolumeData::subnz, EMAN::ReconstructorVolumeData::subx0, EMAN::ReconstructorVolumeData::suby0, EMAN::ReconstructorVolumeData::subz0, and EMAN::ReconstructorVolumeData::tmp_data.
|
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 820 of file reconstructor.cpp.
References EMAN::Dict::has_key(), EMAN::ReconstructorVolumeData::image, ImageDimensionException, is_fftodd(), load_inserter(), EMAN::ReconstructorVolumeData::nx, EMAN::ReconstructorVolumeData::nx2, EMAN::ReconstructorVolumeData::ny, EMAN::ReconstructorVolumeData::ny2, EMAN::ReconstructorVolumeData::nz, EMAN::ReconstructorVolumeData::nz2, EMAN::FactoryBase::params, EMAN::Dict::set_default(), sub(), EMAN::ReconstructorVolumeData::subnx, EMAN::ReconstructorVolumeData::subny, EMAN::ReconstructorVolumeData::subnz, EMAN::ReconstructorVolumeData::subx0, EMAN::ReconstructorVolumeData::suby0, EMAN::ReconstructorVolumeData::subz0, and EMAN::ReconstructorVolumeData::tmp_data.
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 926 of file reconstructor.cpp.
References EMAN::Dict::has_key(), EMAN::ReconstructorVolumeData::image, ImageDimensionException, is_fftodd(), load_inserter(), EMAN::ReconstructorVolumeData::nx, EMAN::ReconstructorVolumeData::nx2, EMAN::ReconstructorVolumeData::ny, EMAN::ReconstructorVolumeData::ny2, EMAN::ReconstructorVolumeData::nz, EMAN::ReconstructorVolumeData::nz2, EMAN::FactoryBase::params, EMAN::Dict::set_default(), sub(), EMAN::ReconstructorVolumeData::subnx, EMAN::ReconstructorVolumeData::subny, EMAN::ReconstructorVolumeData::subnz, EMAN::ReconstructorVolumeData::subx0, EMAN::ReconstructorVolumeData::suby0, EMAN::ReconstructorVolumeData::subz0, and EMAN::ReconstructorVolumeData::tmp_data.
|
protected |
A pixel inserter pointer which inserts pixels into the 3D volume using one of a variety of insertion methods.
Definition at line 555 of file reconstructor.h.
Referenced by EMAN::WienerFourierReconstructor::do_insert_slice_work(), do_insert_slice_work(), free_memory(), load_default_settings(), load_inserter(), and setup().
|
static |
Definition at line 519 of file reconstructor.h.
Referenced by get_name().