#include <processor.h>
Inheritance diagram for EMAN::MaskEdgeMeanProcessor:
Public Member Functions | |
string | get_name () const |
Get the processor's name. | |
void | set_params (const Dict &new_params) |
Set the processor parameters using a key/value dictionary. | |
TypeDict | get_param_types () const |
Get processor parameter information in a dictionary. | |
string | get_desc () const |
Get the descrition of this specific processor. | |
Static Public Member Functions | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "mask.ringmean" |
Protected Member Functions | |
void | calc_locals (EMData *image) |
void | process_dist_pixel (float *pixel, float dist) const |
Private Attributes | |
int | ring_width |
float | ring_avg |
ring_width | The width of the mask ring. |
Definition at line 2345 of file processor.h.
|
Reimplemented from EMAN::CircularMaskProcessor. Definition at line 1485 of file processor.cpp. References data, EMAN::EMData::get_data(), NullPointerException, ring_avg, sqrt(), x, and y. 01486 { 01487 if (!image) { 01488 throw NullPointerException("NULL image"); 01489 } 01490 int nitems = 0; 01491 float sum = 0; 01492 float *data = image->get_data(); 01493 size_t i = 0; 01494 01495 for (int z = 0; z < nz; ++z) { 01496 for (int y = 0; y < ny; ++y) { 01497 for (int x = 0; x < nx; ++x) { 01498 float x1 = sqrt((x - xc) * (x - xc) + (y - yc) * (y - yc) + (z - zc) * (z - zc)); 01499 if (x1 <= outer_radius + ring_width && x1 >= outer_radius - ring_width) { 01500 sum += data[i]; 01501 ++nitems; 01502 } 01503 ++i; 01504 } 01505 } 01506 } 01507 01508 ring_avg = sum / nitems; 01509 }
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Reimplemented from EMAN::CircularMaskProcessor. Definition at line 2373 of file processor.h. 02374 { 02375 return "A step cutoff to the the mean value in a ring centered on the outer radius"; 02376 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 2348 of file processor.h. 02349 {
02350 return NAME;
02351 }
|
|
Get processor parameter information in a dictionary. Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
Reimplemented from EMAN::CircularMaskProcessor. Definition at line 2366 of file processor.h. References EMAN::TypeDict::put(). 02367 { 02368 TypeDict d = CircularMaskProcessor::get_param_types(); 02369 d.put("ring_width", EMObject::INT, "The width of the mask ring."); 02370 return d; 02371 }
|
|
Definition at line 2352 of file processor.h. 02353 { 02354 return new MaskEdgeMeanProcessor(); 02355 }
|
|
Implements EMAN::CircularMaskProcessor. Definition at line 2384 of file processor.h. References dist(). 02385 { 02386 if (dist >= outer_radius_square || dist < inner_radius_square){ 02387 *pixel = ring_avg; 02388 } 02389 }
|
|
Set the processor parameters using a key/value dictionary.
Reimplemented from EMAN::CircularMaskProcessor. Definition at line 2357 of file processor.h. 02358 { 02359 CircularMaskProcessor::set_params(new_params); 02360 ring_width = params["ring_width"]; 02361 if (ring_width == 0) { 02362 ring_width = 1; 02363 } 02364 }
|
|
Definition at line 103 of file processor.cpp. |
|
Definition at line 2393 of file processor.h. Referenced by calc_locals(). |
|
Definition at line 2392 of file processor.h. |