#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 | |
static Processor * | NEW () |
Static Public Attributes | |
static 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 5186 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 5196 of file processor.h.
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5191 of file processor.h. References NAME. 05192 { 05193 return NAME; 05194 }
|
|
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 5206 of file processor.h. References EMAN::TypeDict::put(), and EMAN::EMObject::STRING. 05207 { 05208 TypeDict d; 05209 d.put("filename", EMObject::STRING, "file name for a 2 column text file which specified a radial function data array."); 05210 return d; 05211 }
|
|
Definition at line 5201 of file processor.h. 05202 { 05203 return new FileFourierProcessor(); 05204 }
|
|
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 5718 of file processor.cpp. References EMAN::EMData::apply_radial_func(), EMAN::EMData::do_fft(), EMAN::EMData::do_ift(), EMAN::EMData::get_xsize(), in, LOGERR, LOGWARN, and EMAN::Processor::params. 05719 { 05720 if (!image) { 05721 LOGWARN("NULL Image"); 05722 return; 05723 } 05724 const char *filename = params["filename"]; 05725 float apix = params["apix"]; 05726 05727 FILE *in = fopen(filename, "rb"); 05728 if (!in) { 05729 LOGERR("FileFourierProcessor: cannot open file '%s'", filename); 05730 return; 05731 } 05732 05733 float f = 0; 05734 int n = 0; 05735 while (fscanf(in, " %f %f", &f, &f) == 2) { 05736 n++; 05737 } 05738 rewind(in); 05739 05740 vector < float >xd(n); 05741 vector < float >yd(n); 05742 05743 float sf = apix * image->get_xsize(); 05744 05745 for (int i = 0; fscanf(in, " %f %f", &xd[i], &yd[i]) == 2; i++) { 05746 xd[i] *= sf; 05747 } 05748 05749 if (xd[2] - xd[1] != xd[1] - xd[0]) { 05750 LOGWARN("Warning, x spacing appears nonuniform %g!=%g\n", 05751 xd[2] - xd[1], xd[1] - xd[0]); 05752 } 05753 05754 EMData *d2 = image->do_fft(); 05755 if( image ) 05756 { 05757 delete image; 05758 image = 0; 05759 } 05760 05761 d2->apply_radial_func(xd[0], xd[1] - xd[0], yd, 1); 05762 image = d2->do_ift(); 05763 }
|
|
Definition at line 5213 of file processor.h. Referenced by get_name(). |