#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 3845 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 3859 of file processor.h. 03860 { 03861 return "Fill zeroes at edges with nearest horizontal/vertical value."; 03862 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 3850 of file processor.h. Referenced by process_inplace(). 03851 {
03852 return NAME;
03853 }
|
|
Definition at line 3854 of file processor.h. 03855 { 03856 return new SigmaZeroEdgeProcessor(); 03857 }
|
|
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 3101 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. 03102 { 03103 if (!image) { 03104 LOGWARN("NULL Image"); 03105 return; 03106 } 03107 03108 if (image->get_zsize() > 1) { 03109 LOGERR("%s Processor doesn't support 3D model", get_name().c_str()); 03110 throw ImageDimensionException("3D model not supported"); 03111 } 03112 float *d = image->get_data(); 03113 int i = 0; 03114 int j = 0; 03115 03116 int nx = image->get_xsize(); 03117 int ny = image->get_ysize(); 03118 03119 for (j = 0; j < ny; j++) { 03120 for (i = 0; i < nx - 1; i++) { 03121 if (d[i + j * nx] != 0) { 03122 break; 03123 } 03124 } 03125 03126 float v = d[i + j * nx]; 03127 while (i >= 0) { 03128 d[i + j * nx] = v; 03129 i--; 03130 } 03131 03132 for (i = nx - 1; i > 0; i--) { 03133 if (d[i + j * nx] != 0) 03134 break; 03135 } 03136 v = d[i + j * nx]; 03137 while (i < nx) { 03138 d[i + j * nx] = v; 03139 i++; 03140 } 03141 } 03142 03143 for (i = 0; i < nx; i++) { 03144 for (j = 0; j < ny; j++) { 03145 if (d[i + j * nx] != 0) 03146 break; 03147 } 03148 03149 float v = d[i + j * nx]; 03150 while (j >= 0) { 03151 d[i + j * nx] = v; 03152 j--; 03153 } 03154 03155 for (j = ny - 1; j > 0; j--) { 03156 if (d[i + j * nx] != 0) 03157 break; 03158 } 03159 v = d[i + j * nx]; 03160 while (j < ny) { 03161 d[i + j * nx] = v; 03162 j++; 03163 } 03164 } 03165 03166 03167 image->update(); 03168 }
|
|
Definition at line 135 of file processor.cpp. |