#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 5266 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 5276 of file processor.h. 05277 { 05278 return "A fourier processor specified in a 2 column text file."; 05279 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5271 of file processor.h. 05272 {
05273 return NAME;
05274 }
|
|
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 5286 of file processor.h. References EMAN::TypeDict::put(). 05287 { 05288 TypeDict d; 05289 d.put("filename", EMObject::STRING, "file name for a 2 column text file which specified a radial function data array."); 05290 return d; 05291 }
|
|
Definition at line 5281 of file processor.h. 05282 { 05283 return new FileFourierProcessor(); 05284 }
|
|
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 5939 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. 05940 { 05941 if (!image) { 05942 LOGWARN("NULL Image"); 05943 return; 05944 } 05945 const char *filename = params["filename"]; 05946 float apix = params["apix"]; 05947 05948 FILE *in = fopen(filename, "rb"); 05949 if (!in) { 05950 LOGERR("FileFourierProcessor: cannot open file '%s'", filename); 05951 return; 05952 } 05953 05954 float f = 0; 05955 int n = 0; 05956 while (fscanf(in, " %f %f", &f, &f) == 2) { 05957 n++; 05958 } 05959 rewind(in); 05960 05961 vector < float >xd(n); 05962 vector < float >yd(n); 05963 05964 float sf = apix * image->get_xsize(); 05965 05966 for (int i = 0; fscanf(in, " %f %f", &xd[i], &yd[i]) == 2; i++) { 05967 xd[i] *= sf; 05968 } 05969 05970 if (xd[2] - xd[1] != xd[1] - xd[0]) { 05971 LOGWARN("Warning, x spacing appears nonuniform %g!=%g\n", 05972 xd[2] - xd[1], xd[1] - xd[0]); 05973 } 05974 05975 EMData *d2 = image->do_fft(); 05976 if( image ) 05977 { 05978 delete image; 05979 image = 0; 05980 } 05981 05982 d2->apply_radial_func(xd[0], xd[1] - xd[0], yd, 1); 05983 image = d2->do_ift(); 05984 }
|
|
Definition at line 175 of file processor.cpp. |