#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 2439 of file processor.h.
|
|
Reimplemented from EMAN::CircularMaskProcessor. Definition at line 1544 of file processor.cpp. References data, EMAN::EMData::get_data(), NullPointerException, ring_avg, sqrt(), x, and y. 01545 {
01546 if (!image) {
01547 throw NullPointerException("NULL image");
01548 }
01549 int nitems = 0;
01550 float sum = 0;
01551 float *data = image->get_data();
01552 size_t i = 0;
01553
01554 for (int z = 0; z < nz; ++z) {
01555 for (int y = 0; y < ny; ++y) {
01556 for (int x = 0; x < nx; ++x) {
01557 float x1 = sqrt((x - xc) * (x - xc) + (y - yc) * (y - yc) + (z - zc) * (z - zc));
01558 if (x1 <= outer_radius + ring_width && x1 >= outer_radius - ring_width) {
01559 sum += data[i];
01560 ++nitems;
01561 }
01562 ++i;
01563 }
01564 }
01565 }
01566
01567 ring_avg = sum / nitems;
01568 }
|
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Reimplemented from EMAN::CircularMaskProcessor. Definition at line 2467 of file processor.h. 02468 {
02469 return "A step cutoff to the the mean value in a ring centered on the outer radius";
02470 }
|
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 2442 of file processor.h. 02443 {
02444 return NAME;
02445 }
|
|
|
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 2460 of file processor.h. References EMAN::TypeDict::put(). 02461 {
02462 TypeDict d = CircularMaskProcessor::get_param_types();
02463 d.put("ring_width", EMObject::INT, "The width of the mask ring.");
02464 return d;
02465 }
|
|
|
Definition at line 2446 of file processor.h. 02447 {
02448 return new MaskEdgeMeanProcessor();
02449 }
|
|
||||||||||||
|
Implements EMAN::CircularMaskProcessor. Definition at line 2478 of file processor.h. References dist(). 02479 {
02480 if (dist >= outer_radius_square || dist < inner_radius_square){
02481 *pixel = ring_avg;
02482 }
02483 }
|
|
|
Set the processor parameters using a key/value dictionary.
Reimplemented from EMAN::CircularMaskProcessor. Definition at line 2451 of file processor.h. 02452 {
02453 CircularMaskProcessor::set_params(new_params);
02454 ring_width = params["ring_width"];
02455 if (ring_width == 0) {
02456 ring_width = 1;
02457 }
02458 }
|
|
|
Definition at line 111 of file processor.cpp. |
|
|
Definition at line 2487 of file processor.h. Referenced by calc_locals(). |
|
|
Definition at line 2486 of file processor.h. |
1.3.9.1