#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 | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "mask.zeroedgefill" |
Definition at line 3673 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 3687 of file processor.h. 03688 { 03689 return "Fill zeroes at edges with nearest horizontal/vertical value."; 03690 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 3678 of file processor.h. Referenced by process_inplace(). 03679 {
03680 return NAME;
03681 }
|
|
Definition at line 3682 of file processor.h. 03683 { 03684 return new SigmaZeroEdgeProcessor(); 03685 }
|
|
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 2945 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, nx, ny, EMAN::EMData::update(), and v. 02946 { 02947 if (!image) { 02948 LOGWARN("NULL Image"); 02949 return; 02950 } 02951 02952 if (image->get_zsize() > 1) { 02953 LOGERR("%s Processor doesn't support 3D model", get_name().c_str()); 02954 throw ImageDimensionException("3D model not supported"); 02955 } 02956 float *d = image->get_data(); 02957 int i = 0; 02958 int j = 0; 02959 02960 int nx = image->get_xsize(); 02961 int ny = image->get_ysize(); 02962 02963 for (j = 0; j < ny; j++) { 02964 for (i = 0; i < nx - 1; i++) { 02965 if (d[i + j * nx] != 0) { 02966 break; 02967 } 02968 } 02969 02970 float v = d[i + j * nx]; 02971 while (i >= 0) { 02972 d[i + j * nx] = v; 02973 i--; 02974 } 02975 02976 for (i = nx - 1; i > 0; i--) { 02977 if (d[i + j * nx] != 0) 02978 break; 02979 } 02980 v = d[i + j * nx]; 02981 while (i < nx) { 02982 d[i + j * nx] = v; 02983 i++; 02984 } 02985 } 02986 02987 for (i = 0; i < nx; i++) { 02988 for (j = 0; j < ny; j++) { 02989 if (d[i + j * nx] != 0) 02990 break; 02991 } 02992 02993 float v = d[i + j * nx]; 02994 while (j >= 0) { 02995 d[i + j * nx] = v; 02996 j--; 02997 } 02998 02999 for (j = ny - 1; j > 0; j--) { 03000 if (d[i + j * nx] != 0) 03001 break; 03002 } 03003 v = d[i + j * nx]; 03004 while (j < ny) { 03005 d[i + j * nx] = v; 03006 j++; 03007 } 03008 } 03009 03010 03011 image->update(); 03012 }
|
|
Definition at line 132 of file processor.cpp. |