#include <processor.h>
Inheritance diagram for EMAN::ZGradientProcessor:


Public Member Functions | |
| ZGradientProcessor () | |
| string | get_name () const |
| Get the processor's name. | |
| void | process_inplace (EMData *image) |
| To process an image in-place. | |
| string | get_desc () const |
| Get the descrition of this specific processor. | |
| TypeDict | get_param_types () const |
| Get processor parameter information in a dictionary. | |
Static Public Member Functions | |
| Processor * | NEW () |
Static Public Attributes | |
| const string | NAME = "math.edge.zgradient" |
|
|
Definition at line 595 of file processor.h. 00595 {}
|
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 609 of file processor.h. 00610 {
00611 return "Determines the image gradient in the z direction";
00612 }
|
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 597 of file processor.h. 00598 {
00599 return NAME;
00600 }
|
|
|
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. Definition at line 614 of file processor.h. 00615 {
00616 TypeDict d;
00617 return d;
00618 }
|
|
|
Definition at line 604 of file processor.h. 00605 {
00606 return new ZGradientProcessor();
00607 }
|
|
|
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 9449 of file processor.cpp. References EMAN::EMData::clip_inplace(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), ImageDimensionException, ImageFormatException, EMAN::EMData::is_complex(), nx, ny, EMAN::EMData::process_inplace(), EMAN::EMData::set_size(), and EMAN::EMData::set_value_at(). 09450 {
09451 if (image->is_complex()) throw ImageFormatException("Cannot edge detect a complex image");
09452
09453 EMData* e = new EMData();
09454 int nx = image->get_xsize();
09455 int ny = image->get_ysize();
09456 int nz = image->get_zsize();
09457
09458 if ( nx < 3 || ny < 3 || nz < 3) throw ImageDimensionException("Error - cannot edge detect in the z direction with any dimension being less than three pixels");
09459
09460 e->set_size(3,3,3);
09461 e->set_value_at(0,0,0,-1);
09462 e->set_value_at(1,0,0,-1);
09463 e->set_value_at(2,0,0,-1);
09464 e->set_value_at(0,1,0,-1);
09465 e->set_value_at(1,1,0,-8);
09466 e->set_value_at(2,1,0,-1);
09467 e->set_value_at(0,2,0,-1);
09468 e->set_value_at(1,2,0,-1);
09469 e->set_value_at(2,2,0,-1);
09470
09471 e->set_value_at(0,0,2,1);
09472 e->set_value_at(1,0,2,1);
09473 e->set_value_at(2,0,2,1);
09474 e->set_value_at(0,1,2,1);
09475 e->set_value_at(1,1,2,8);
09476 e->set_value_at(2,1,2,1);
09477 e->set_value_at(0,2,2,1);
09478 e->set_value_at(1,2,2,1);
09479 e->set_value_at(2,2,2,1);
09480
09481 Region r = Region(-nx/2+1,-ny/2+1,-nz/2+1,nx,ny,nz);
09482 e->clip_inplace(r);
09483
09484 Dict conv_parms;
09485 conv_parms["with"] = e;
09486 image->process_inplace("math.convolution", conv_parms);
09487
09488 delete e;
09489 }
|
|
|
Definition at line 67 of file processor.cpp. |
1.3.9.1