#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 3729 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 3743 of file processor.h. 03744 {
03745 return "Fill zeroes at edges with nearest horizontal/vertical value.";
03746 }
|
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 3734 of file processor.h. Referenced by process_inplace(). 03735 {
03736 return NAME;
03737 }
|
|
|
Definition at line 3738 of file processor.h. 03739 {
03740 return new SigmaZeroEdgeProcessor();
03741 }
|
|
|
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 2976 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. 02977 {
02978 if (!image) {
02979 LOGWARN("NULL Image");
02980 return;
02981 }
02982
02983 if (image->get_zsize() > 1) {
02984 LOGERR("%s Processor doesn't support 3D model", get_name().c_str());
02985 throw ImageDimensionException("3D model not supported");
02986 }
02987 float *d = image->get_data();
02988 int i = 0;
02989 int j = 0;
02990
02991 int nx = image->get_xsize();
02992 int ny = image->get_ysize();
02993
02994 for (j = 0; j < ny; j++) {
02995 for (i = 0; i < nx - 1; i++) {
02996 if (d[i + j * nx] != 0) {
02997 break;
02998 }
02999 }
03000
03001 float v = d[i + j * nx];
03002 while (i >= 0) {
03003 d[i + j * nx] = v;
03004 i--;
03005 }
03006
03007 for (i = nx - 1; i > 0; i--) {
03008 if (d[i + j * nx] != 0)
03009 break;
03010 }
03011 v = d[i + j * nx];
03012 while (i < nx) {
03013 d[i + j * nx] = v;
03014 i++;
03015 }
03016 }
03017
03018 for (i = 0; i < nx; i++) {
03019 for (j = 0; j < ny; j++) {
03020 if (d[i + j * nx] != 0)
03021 break;
03022 }
03023
03024 float v = d[i + j * nx];
03025 while (j >= 0) {
03026 d[i + j * nx] = v;
03027 j--;
03028 }
03029
03030 for (j = ny - 1; j > 0; j--) {
03031 if (d[i + j * nx] != 0)
03032 break;
03033 }
03034 v = d[i + j * nx];
03035 while (j < ny) {
03036 d[i + j * nx] = v;
03037 j++;
03038 }
03039 }
03040
03041
03042 image->update();
03043 }
|
|
|
Definition at line 134 of file processor.cpp. |
1.3.9.1