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