#include <processor.h>
Inheritance diagram for EMAN::SigmaZeroEdgeProcessor:
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 () |
Static Public Attributes | |
static const string | NAME = "mask.zeroedgefill" |
Definition at line 3764 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 3778 of file processor.h.
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 3769 of file processor.h. References NAME. Referenced by process_inplace(). 03770 { 03771 return NAME; 03772 }
|
|
Definition at line 3773 of file processor.h. 03774 { 03775 return new SigmaZeroEdgeProcessor(); 03776 }
|
|
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 2929 of file processor.cpp. References EMAN::EMData::get_data(), get_name(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), ImageDimensionException, LOGERR, LOGWARN, EMAN::EMData::update(), and v. 02930 { 02931 if (!image) { 02932 LOGWARN("NULL Image"); 02933 return; 02934 } 02935 02936 if (image->get_zsize() > 1) { 02937 LOGERR("%s Processor doesn't support 3D model", get_name().c_str()); 02938 throw ImageDimensionException("3D model not supported"); 02939 } 02940 float *d = image->get_data(); 02941 int i = 0; 02942 int j = 0; 02943 02944 int nx = image->get_xsize(); 02945 int ny = image->get_ysize(); 02946 02947 for (j = 0; j < ny; j++) { 02948 for (i = 0; i < nx - 1; i++) { 02949 if (d[i + j * nx] != 0) { 02950 break; 02951 } 02952 } 02953 02954 float v = d[i + j * nx]; 02955 while (i >= 0) { 02956 d[i + j * nx] = v; 02957 i--; 02958 } 02959 02960 for (i = nx - 1; i > 0; i--) { 02961 if (d[i + j * nx] != 0) 02962 break; 02963 } 02964 v = d[i + j * nx]; 02965 while (i < nx) { 02966 d[i + j * nx] = v; 02967 i++; 02968 } 02969 } 02970 02971 for (i = 0; i < nx; i++) { 02972 for (j = 0; j < ny; j++) { 02973 if (d[i + j * nx] != 0) 02974 break; 02975 } 02976 02977 float v = d[i + j * nx]; 02978 while (j >= 0) { 02979 d[i + j * nx] = v; 02980 j--; 02981 } 02982 02983 for (j = ny - 1; j > 0; j--) { 02984 if (d[i + j * nx] != 0) 02985 break; 02986 } 02987 v = d[i + j * nx]; 02988 while (j < ny) { 02989 d[i + j * nx] = v; 02990 j++; 02991 } 02992 } 02993 02994 02995 image->update(); 02996 }
|
|
Definition at line 3783 of file processor.h. Referenced by get_name(). |