#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 2788 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 2800 of file processor.h. 02801 { 02802 return "A processor for noise reduction. pixel = median of values surrounding pixel."; 02803 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 2791 of file processor.h. 02792 {
02793 return NAME;
02794 }
|
|
Definition at line 2795 of file processor.h. 02796 { 02797 return new BoxMedianProcessor(); 02798 }
|
|
Implements EMAN::BoxStatProcessor. Definition at line 2808 of file processor.h. 02809 { 02810 float *data = new float[n]; 02811 memcpy(data, array, sizeof(float) * n); 02812 02813 for (int i = 0; i <= n / 2; i++) 02814 { 02815 for (int j = i + 1; j < n; j++) 02816 { 02817 if (data[i] < data[j]) { 02818 float t = data[i]; 02819 data[i] = data[j]; 02820 data[j] = t; 02821 } 02822 } 02823 } 02824 02825 if (n % 2 != 0) 02826 { 02827 *pixel = data[n / 2]; 02828 } 02829 else { 02830 *pixel = (data[n / 2] + data[n / 2 - 1]) / 2; 02831 } 02832 if( data ) 02833 { 02834 delete[]data; 02835 data = 0; 02836 } 02837 }
|
|
Definition at line 111 of file processor.cpp. |