#include <processor.h>


Public Member Functions | |
| void | process_inplace (EMData *image) |
| To process an image in-place. | |
| string | get_name () const |
| Get the processor's name. | |
| string | get_desc () const |
| Get the descrition of this specific processor. | |
Static Public Member Functions | |
| static Processor * | NEW () |
Definition at line 3599 of file processor.h.
| void AverageXProcessor::process_inplace | ( | EMData * | image | ) | [virtual] |
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.
| image | The image to be processed. |
Implements EMAN::Processor.
Definition at line 2819 of file processor.cpp.
References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), LOGWARN, EMAN::EMData::update(), and x.
02820 { 02821 if (!image) { 02822 LOGWARN("NULL Image"); 02823 return; 02824 } 02825 02826 float *data = image->get_data(); 02827 int nx = image->get_xsize(); 02828 int ny = image->get_ysize(); 02829 int nz = image->get_zsize(); 02830 size_t nxy = (size_t)nx * ny; 02831 02832 size_t idx; 02833 for (int z = 0; z < nz; z++) { 02834 for (int x = 0; x < nx; x++) { 02835 double sum = 0; 02836 for (int y = 0; y < ny; y++) { 02837 idx = x + y * nx + z * nxy; 02838 sum += data[idx]; 02839 } 02840 float mean = (float) sum / ny; 02841 02842 for (int y = 0; y < ny; y++) { 02843 idx = x + y * nx + z * nxy; 02844 data[idx] = mean; 02845 } 02846 } 02847 } 02848 02849 image->update(); 02850 }
| string EMAN::AverageXProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 3604 of file processor.h.
| static Processor* EMAN::AverageXProcessor::NEW | ( | ) | [inline, static] |
| string EMAN::AverageXProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 3614 of file processor.h.
1.5.6