#include <processor.h>
Inheritance diagram for EMAN::BoxMedianProcessor:
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 = "eman1.filter.median" |
Protected Member Functions | |
void | process_pixel (float *pixel, const float *array, int n) const |
pixel = median of values surrounding pixel.
Definition at line 2963 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 2975 of file processor.h. 02976 { 02977 return "A processor for noise reduction. pixel = median of values surrounding pixel."; 02978 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 2966 of file processor.h. 02967 {
02968 return NAME;
02969 }
|
|
Definition at line 2970 of file processor.h. 02971 { 02972 return new BoxMedianProcessor(); 02973 }
|
|
Implements EMAN::BoxStatProcessor. Definition at line 2983 of file processor.h. 02984 { 02985 float *data = new float[n]; 02986 memcpy(data, array, sizeof(float) * n); 02987 02988 for (int i = 0; i <= n / 2; i++) 02989 { 02990 for (int j = i + 1; j < n; j++) 02991 { 02992 if (data[i] < data[j]) { 02993 float t = data[i]; 02994 data[i] = data[j]; 02995 data[j] = t; 02996 } 02997 } 02998 } 02999 03000 if (n % 2 != 0) 03001 { 03002 *pixel = data[n / 2]; 03003 } 03004 else { 03005 *pixel = (data[n / 2] + data[n / 2 - 1]) / 2; 03006 } 03007 if( data ) 03008 { 03009 delete[]data; 03010 data = 0; 03011 } 03012 }
|
|
Definition at line 116 of file processor.cpp. |