#include <processor.h>
Inheritance diagram for EMAN::CircularMaskProcessor:
Public Member Functions | |
CircularMaskProcessor () | |
void | set_params (const Dict &new_params) |
Set the processor parameters using a key/value dictionary. | |
string | get_desc () const |
Get the descrition of this specific processor. | |
TypeDict | get_param_types () const |
Get processor parameter information in a dictionary. | |
Protected Member Functions | |
void | calc_locals (EMData *image) |
bool | is_valid () const |
void | process_pixel (float *pixel, int xi, int yi, int zi) const |
virtual void | process_dist_pixel (float *pixel, float dist) const =0 |
Protected Attributes | |
int | inner_radius |
int | outer_radius |
int | inner_radius_square |
int | outer_radius_square |
float | dx |
float | dy |
float | dz |
float | xc |
float | yc |
float | zc |
inner_radius | inner mask radius. optional, default=-1 | |
outer_radius | outer mask radius | |
dx | Modify mask center by dx relative to the default center nx/2 | |
dy | Modify mask center by dy relative to the default center ny/2 | |
dz | Modify mask center by dz relative to the default center nz/2 |
Definition at line 2298 of file processor.h.
|
Definition at line 2301 of file processor.h. 02301 :inner_radius(0), outer_radius(0), inner_radius_square(0), 02302 outer_radius_square(0), dx(0), dy(0), dz(0), xc(0), yc(0), zc(0) 02303 { 02304 }
|
|
Reimplemented from EMAN::CoordinateProcessor. Reimplemented in EMAN::MaskEdgeMeanProcessor, and EMAN::MaskGaussInvProcessor. Definition at line 1451 of file processor.cpp. References dx, dy, dz, inner_radius, inner_radius_square, EMAN::CoordinateProcessor::nx, EMAN::CoordinateProcessor::ny, EMAN::CoordinateProcessor::nz, outer_radius, outer_radius_square, xc, yc, and zc. 01452 { 01453 xc = nx / 2.0f + dx; 01454 yc = ny / 2.0f + dy; 01455 zc = nz / 2.0f + dz; 01456 01457 01458 if (outer_radius <= 0) { 01459 outer_radius = nx / 2; 01460 outer_radius_square = outer_radius * outer_radius; 01461 } 01462 01463 if (inner_radius <= 0) { 01464 inner_radius_square = 0; 01465 } 01466 }
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Reimplemented in EMAN::MaskSharpProcessor, EMAN::MaskEdgeMeanProcessor, EMAN::MaskNoiseProcessor, EMAN::MaskGaussProcessor, EMAN::MaskGaussInvProcessor, EMAN::MakeRadiusSquaredProcessor, and EMAN::MakeRadiusProcessor. Definition at line 2336 of file processor.h. 02337 { 02338 return "CircularMaskProcessor applies a circular mask to the data.This is the base class for specific circular mask processors.Its subclass must implement process_dist_pixel()."; 02339 }
|
|
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::Processor. Reimplemented in EMAN::MaskSharpProcessor, EMAN::MaskEdgeMeanProcessor, EMAN::MaskGaussProcessor, and EMAN::MaskGaussInvProcessor. Definition at line 2341 of file processor.h. References EMAN::EMObject::FLOAT, EMAN::EMObject::INT, and EMAN::TypeDict::put(). Referenced by EMAN::MaskGaussInvProcessor::get_param_types(), EMAN::MaskGaussProcessor::get_param_types(), EMAN::MaskEdgeMeanProcessor::get_param_types(), and EMAN::MaskSharpProcessor::get_param_types(). 02342 { 02343 TypeDict d; 02344 02345 d.put("inner_radius", EMObject::INT, "inner mask radius. optional, default=-1"); 02346 d.put("outer_radius", EMObject::INT, "outer mask radius"); 02347 02348 d.put("dx", EMObject::FLOAT, 02349 "Modify mask center by dx relative to the default center nx/2"); 02350 d.put("dy", EMObject::FLOAT, 02351 "Modify mask center by dy relative to the default center ny/2"); 02352 d.put("dz", EMObject::FLOAT, 02353 "Modify mask center by dz relative to the default center nz/2"); 02354 02355 return d; 02356 }
|
|
Reimplemented from EMAN::CoordinateProcessor. Definition at line 2360 of file processor.h. References EMAN::CoordinateProcessor::is_complex. 02361 { 02362 return (!is_complex); 02363 }
|
|
|
Implements EMAN::CoordinateProcessor. Definition at line 2365 of file processor.h. References dist(), process_dist_pixel(), xc, yc, and zc. 02366 { 02367 float dist = (xi - xc) * (xi - xc) + (yi - yc) * (yi - yc) + (zi - zc) * (zi - zc); 02368 process_dist_pixel(pixel, dist); 02369 }
|
|
Set the processor parameters using a key/value dictionary.
Reimplemented from EMAN::Processor. Reimplemented in EMAN::MaskSharpProcessor, EMAN::MaskEdgeMeanProcessor, and EMAN::MaskGaussProcessor. Definition at line 2306 of file processor.h. References dx, dy, dz, EMAN::Dict::has_key(), inner_radius, inner_radius_square, outer_radius, outer_radius_square, EMAN::Processor::params, xc, yc, and zc. Referenced by EMAN::MaskGaussProcessor::set_params(), EMAN::MaskEdgeMeanProcessor::set_params(), and EMAN::MaskSharpProcessor::set_params(). 02307 { 02308 params = new_params; 02309 02310 if (params.has_key("inner_radius")) { 02311 inner_radius = params["inner_radius"]; 02312 inner_radius_square = inner_radius * inner_radius; 02313 } 02314 else { 02315 inner_radius = -1; 02316 inner_radius_square = -1; 02317 } 02318 02319 if (params.has_key("outer_radius")) { 02320 outer_radius = params["outer_radius"]; 02321 outer_radius_square = outer_radius * outer_radius; 02322 } 02323 else { 02324 outer_radius = INT_MAX; 02325 outer_radius_square = INT_MAX; 02326 } 02327 02328 if (params.has_key("xc")) xc = params["xc"]; 02329 if (params.has_key("yc")) yc = params["yc"]; 02330 if (params.has_key("zc")) zc = params["zc"]; 02331 if (params.has_key("dx")) dx = params["dx"]; 02332 if (params.has_key("dy")) dy = params["dy"]; 02333 if (params.has_key("dz")) dz = params["dz"]; 02334 }
|
|
Definition at line 2377 of file processor.h. Referenced by calc_locals(), and set_params(). |
|
Definition at line 2377 of file processor.h. Referenced by calc_locals(), and set_params(). |
|
Definition at line 2377 of file processor.h. Referenced by calc_locals(), and set_params(). |
|
Definition at line 2373 of file processor.h. Referenced by calc_locals(), EMAN::MaskGaussProcessor::process_dist_pixel(), and set_params(). |
|
Definition at line 2375 of file processor.h. Referenced by calc_locals(), EMAN::MaskGaussProcessor::process_dist_pixel(), EMAN::MaskNoiseProcessor::process_dist_pixel(), EMAN::MaskEdgeMeanProcessor::process_dist_pixel(), EMAN::MaskSharpProcessor::process_dist_pixel(), and set_params(). |
|
Definition at line 2374 of file processor.h. Referenced by EMAN::MaskEdgeMeanProcessor::calc_locals(), calc_locals(), and set_params(). |
|
Definition at line 2376 of file processor.h. Referenced by calc_locals(), EMAN::MaskGaussProcessor::process_dist_pixel(), EMAN::MaskNoiseProcessor::process_dist_pixel(), EMAN::MaskEdgeMeanProcessor::process_dist_pixel(), EMAN::MaskSharpProcessor::process_dist_pixel(), and set_params(). |
|
Definition at line 2378 of file processor.h. Referenced by EMAN::MaskEdgeMeanProcessor::calc_locals(), calc_locals(), process_pixel(), and set_params(). |
|
Definition at line 2378 of file processor.h. Referenced by EMAN::MaskEdgeMeanProcessor::calc_locals(), calc_locals(), process_pixel(), and set_params(). |
|
Definition at line 2378 of file processor.h. Referenced by EMAN::MaskEdgeMeanProcessor::calc_locals(), calc_locals(), process_pixel(), and set_params(). |