#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 | ||||
static Processor * | NEW () | |||
Static Public Attributes | ||||
static 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 1913 of file processor.h.
virtual string EMAN::BinarizeFourierProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 1938 of file processor.h.
01939 { 01940 return "f(k) = 0 + 0i if ||f(k)|| < value; f(k) = a + bi if ||f(k)|| >= value."; 01941 }
virtual string EMAN::BinarizeFourierProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 1916 of file processor.h.
References NAME.
01917 { 01918 return NAME; 01919 }
virtual TypeDict EMAN::BinarizeFourierProcessor::get_param_types | ( | ) | const [inline, virtual] |
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 1931 of file processor.h.
References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().
01932 { 01933 TypeDict d; 01934 d.put("value", EMObject::FLOAT, "The Fourier amplitude threshold cutoff" ); 01935 return d; 01936 }
static Processor* EMAN::BinarizeFourierProcessor::NEW | ( | ) | [inline, static] |
Definition at line 1920 of file processor.h.
01921 { 01922 return new BinarizeFourierProcessor(); 01923 }
void BinarizeFourierProcessor::process_inplace | ( | EMData * | image | ) | [virtual] |
ImageFormatException | if the input image is not complex Note result is always in real-imaginary format |
Implements EMAN::Processor.
Definition at line 3968 of file processor.cpp.
References EMAN::EMData::ap2ri(), ENTERFUNC, EXITFUNC, EMAN::EMData::get_data(), EMAN::EMData::get_size(), ImageFormatException, EMAN::EMData::is_complex(), EMAN::Processor::params, EMAN::EMData::ri2ap(), EMAN::Dict::set_default(), EMAN::EMData::set_ri(), and EMAN::EMData::update().
03968 { 03969 ENTERFUNC; 03970 if (!image->is_complex()) throw ImageFormatException("Fourier binary thresholding processor only works for complex images"); 03971 03972 float threshold = params.set_default("value",0.0f); 03973 image->ri2ap(); // works for cuda 03974 03975 float* d = image->get_data(); 03976 for( size_t i = 0; i < image->get_size()/2; ++i, d+=2) { 03977 if ( *d < threshold ) { 03978 *d = 0; 03979 *(d+1) = 0; 03980 } 03981 } 03982 image->ap2ri(); 03983 image->set_ri(true); // So it can be used for fourier multiplaction, for example 03984 image->update(); 03985 EXITFUNC; 03986 }
const string BinarizeFourierProcessor::NAME = "threshold.binary.fourier" [static] |