#include <processor.h>
Inheritance diagram for EMAN::FileFourierProcessor:
Public Member Functions | |
virtual void | process_inplace (EMData *image) |
To process an image in-place. | |
virtual string | get_name () const |
Get the processor's name. | |
virtual string | get_desc () const |
Get the descrition of this specific processor. | |
virtual TypeDict | get_param_types () const |
Get processor parameter information in a dictionary. | |
Static Public Member Functions | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "eman1.filter.byfile" |
filename | file name for a 2 column text file which specified a radial function data array |
Definition at line 5152 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 5162 of file processor.h. 05163 { 05164 return "A fourier processor specified in a 2 column text file."; 05165 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5157 of file processor.h. 05158 {
05159 return NAME;
05160 }
|
|
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 5172 of file processor.h. References EMAN::TypeDict::put(). 05173 { 05174 TypeDict d; 05175 d.put("filename", EMObject::STRING, "file name for a 2 column text file which specified a radial function data array."); 05176 return d; 05177 }
|
|
Definition at line 5167 of file processor.h. 05168 { 05169 return new FileFourierProcessor(); 05170 }
|
|
To process an image in-place. For those processors which can only be processed out-of-place, override this function to just print out some error message to remind user call the out-of-place version.
Implements EMAN::Processor. Definition at line 5753 of file processor.cpp. References EMAN::EMData::apply_radial_func(), EMAN::EMData::do_fft(), EMAN::EMData::do_ift(), EMAN::EMData::get_xsize(), in, LOGERR, and LOGWARN. 05754 { 05755 if (!image) { 05756 LOGWARN("NULL Image"); 05757 return; 05758 } 05759 const char *filename = params["filename"]; 05760 float apix = params["apix"]; 05761 05762 FILE *in = fopen(filename, "rb"); 05763 if (!in) { 05764 LOGERR("FileFourierProcessor: cannot open file '%s'", filename); 05765 return; 05766 } 05767 05768 float f = 0; 05769 int n = 0; 05770 while (fscanf(in, " %f %f", &f, &f) == 2) { 05771 n++; 05772 } 05773 rewind(in); 05774 05775 vector < float >xd(n); 05776 vector < float >yd(n); 05777 05778 float sf = apix * image->get_xsize(); 05779 05780 for (int i = 0; fscanf(in, " %f %f", &xd[i], &yd[i]) == 2; i++) { 05781 xd[i] *= sf; 05782 } 05783 05784 if (xd[2] - xd[1] != xd[1] - xd[0]) { 05785 LOGWARN("Warning, x spacing appears nonuniform %g!=%g\n", 05786 xd[2] - xd[1], xd[1] - xd[0]); 05787 } 05788 05789 EMData *d2 = image->do_fft(); 05790 if( image ) 05791 { 05792 delete image; 05793 image = 0; 05794 } 05795 05796 d2->apply_radial_func(xd[0], xd[1] - xd[0], yd, 1); 05797 image = d2->do_ift(); 05798 }
|
|
Definition at line 174 of file processor.cpp. |