#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 1651 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 1676 of file processor.h. 01677 { 01678 return "f(k) = 0 + 0i if ||f(k)|| < value; f(k) = a + bi if ||f(k)|| >= value."; 01679 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 1654 of file processor.h. 01655 {
01656 return NAME;
01657 }
|
|
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 1669 of file processor.h. References EMAN::TypeDict::put(). 01670 { 01671 TypeDict d; 01672 d.put("value", EMObject::FLOAT, "The Fourier amplitude threshold cutoff" ); 01673 return d; 01674 }
|
|
Definition at line 1658 of file processor.h. 01659 { 01660 return new BinarizeFourierProcessor(); 01661 }
|
|
Implements EMAN::Processor. Definition at line 3757 of file processor.cpp. References EMAN::EMData::ap2ri(), binarize_fourier_amp_processor(), 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(). 03757 { 03758 ENTERFUNC; 03759 if (!image->is_complex()) throw ImageFormatException("Fourier binary thresholding processor only works for complex images"); 03760 03761 float threshold = params.set_default("value",0.0f); 03762 image->ri2ap(); // works for cuda 03763 03764 // This is rubbish!!! Needs fixing as does not do the same thing as below.... 03765 #ifdef EMAN2_USING_CUDA 03766 if (image->gpu_operation_preferred()) { 03767 EMDataForCuda tmp = image->get_data_struct_for_cuda(); 03768 binarize_fourier_amp_processor(&tmp,threshold); 03769 image->set_ri(true); // So it can be used for fourier multiplaction, for example 03770 image->gpu_update(); 03771 EXITFUNC; 03772 return; 03773 } 03774 #endif 03775 //compete rubbish!! doesn't work I need to fix this.... 03776 float* d = image->get_data(); 03777 for( size_t i = 0; i < image->get_size()/2; ++i, d+=2) { 03778 //float v = *d; 03779 if ( *d < threshold ) { 03780 *d = 0; 03781 *(d+1) = 0; 03782 } 03783 } 03784 03785 image->ap2ri(); 03786 image->set_ri(true); // So it can be used for fourier multiplaction, for example 03787 image->update(); 03788 EXITFUNC; 03789 }
|
|
Definition at line 91 of file processor.cpp. |