#include <processor.h>
Inheritance diagram for EMAN::NormalizeLREdgeMeanProcessor:
Public Member Functions | |
string | get_name () const |
Get the processor's name. | |
string | get_desc () const |
Get the descrition of this specific processor. | |
Static Public Member Functions | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "normalize.lredge" |
Protected Member Functions | |
float | calc_mean (EMData *image) const |
Definition at line 4366 of file processor.h.
|
Implements EMAN::NormalizeProcessor. Definition at line 3793 of file processor.cpp. References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), LOGWARN, nx, and ny. 03794 { 03795 if (!image) { 03796 LOGWARN("NULL Image"); 03797 return 0; 03798 } 03799 double sum = 0; 03800 int nx = image->get_xsize(); 03801 int ny = image->get_ysize(); 03802 int nz = image->get_zsize(); 03803 float *d = image->get_data(); 03804 size_t nyz = ny * nz; 03805 03806 for (size_t i = 0; i < nyz; i++) { 03807 size_t l = i * nx; 03808 size_t r = l + nx - 2; 03809 sum += d[l] + d[l + 1] + d[r] + d[r + 1]; 03810 } 03811 float mean = (float) sum / (4 * nyz); 03812 return mean; 03813 }
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 4379 of file processor.h. 04380 { 04381 return "normalizes an image, uses 2 pixels on left and right edge"; 04382 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 4369 of file processor.h. 04370 {
04371 return NAME;
04372 }
|
|
Definition at line 4374 of file processor.h. 04375 { 04376 return new NormalizeLREdgeMeanProcessor(); 04377 }
|
|
Definition at line 151 of file processor.cpp. |