#include <processor.h>
Inheritance diagram for EMAN::BinarizeFourierProcessor:


Public Member Functions | |
| virtual string | get_name () const |
| Get the processor's name. | |
| virtual void | process_inplace (EMData *image) |
| virtual TypeDict | get_param_types () const |
| Get processor parameter information in a dictionary. | |
| virtual string | get_desc () const |
| Get the descrition of this specific processor. | |
Static Public Member Functions | |
| Processor * | NEW () |
Static Public Attributes | |
| const string | NAME = "threshold.binary.fourier" |
All maps set below value are set to zero Useful in tomography when you want to toss complex components with low amplitides
| value | The Fourier amplitude threshold cutoff |
Definition at line 1870 of file processor.h.
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 1895 of file processor.h. 01896 {
01897 return "f(k) = 0 + 0i if ||f(k)|| < value; f(k) = a + bi if ||f(k)|| >= value.";
01898 }
|
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 1873 of file processor.h. 01874 {
01875 return NAME;
01876 }
|
|
|
Get processor parameter information in a dictionary. Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
Reimplemented from EMAN::Processor. Definition at line 1888 of file processor.h. References EMAN::TypeDict::put(). 01889 {
01890 TypeDict d;
01891 d.put("value", EMObject::FLOAT, "The Fourier amplitude threshold cutoff" );
01892 return d;
01893 }
|
|
|
Definition at line 1877 of file processor.h. 01878 {
01879 return new BinarizeFourierProcessor();
01880 }
|
|
|
Implements EMAN::Processor. Definition at line 3875 of file processor.cpp. References EMAN::EMData::ap2ri(), EMAN::EMData::get_data(), EMAN::EMData::get_size(), ImageFormatException, EMAN::EMData::is_complex(), EMAN::EMData::ri2ap(), EMAN::Dict::set_default(), EMAN::EMData::set_ri(), and EMAN::EMData::update(). 03875 {
03876 ENTERFUNC;
03877 if (!image->is_complex()) throw ImageFormatException("Fourier binary thresholding processor only works for complex images");
03878
03879 float threshold = params.set_default("value",0.0f);
03880 image->ri2ap(); // works for cuda
03881
03882 float* d = image->get_data();
03883 for( size_t i = 0; i < image->get_size()/2; ++i, d+=2) {
03884 if ( *d < threshold ) {
03885 *d = 0;
03886 *(d+1) = 0;
03887 }
03888 }
03889 image->ap2ri();
03890 image->set_ri(true); // So it can be used for fourier multiplaction, for example
03891 image->update();
03892 EXITFUNC;
03893 }
|
|
|
Definition at line 102 of file processor.cpp. |
1.3.9.1