#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 5190 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 5200 of file processor.h. 05201 {
05202 return "A fourier processor specified in a 2 column text file.";
05203 }
|
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5195 of file processor.h. 05196 {
05197 return NAME;
05198 }
|
|
|
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 5210 of file processor.h. References EMAN::TypeDict::put(). 05211 {
05212 TypeDict d;
05213 d.put("filename", EMObject::STRING, "file name for a 2 column text file which specified a radial function data array.");
05214 return d;
05215 }
|
|
|
Definition at line 5205 of file processor.h. 05206 {
05207 return new FileFourierProcessor();
05208 }
|
|
|
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 5781 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. 05782 {
05783 if (!image) {
05784 LOGWARN("NULL Image");
05785 return;
05786 }
05787 const char *filename = params["filename"];
05788 float apix = params["apix"];
05789
05790 FILE *in = fopen(filename, "rb");
05791 if (!in) {
05792 LOGERR("FileFourierProcessor: cannot open file '%s'", filename);
05793 return;
05794 }
05795
05796 float f = 0;
05797 int n = 0;
05798 while (fscanf(in, " %f %f", &f, &f) == 2) {
05799 n++;
05800 }
05801 rewind(in);
05802
05803 vector < float >xd(n);
05804 vector < float >yd(n);
05805
05806 float sf = apix * image->get_xsize();
05807
05808 for (int i = 0; fscanf(in, " %f %f", &xd[i], &yd[i]) == 2; i++) {
05809 xd[i] *= sf;
05810 }
05811
05812 if (xd[2] - xd[1] != xd[1] - xd[0]) {
05813 LOGWARN("Warning, x spacing appears nonuniform %g!=%g\n",
05814 xd[2] - xd[1], xd[1] - xd[0]);
05815 }
05816
05817 EMData *d2 = image->do_fft();
05818 if( image )
05819 {
05820 delete image;
05821 image = 0;
05822 }
05823
05824 d2->apply_radial_func(xd[0], xd[1] - xd[0], yd, 1);
05825 image = d2->do_ift();
05826 }
|
|
|
Definition at line 180 of file processor.cpp. |
1.3.9.1