#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 | |
static Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "math.edge.zgradient" |
Definition at line 617 of file processor.h.
EMAN::ZGradientProcessor::ZGradientProcessor | ( | ) | [inline] |
string EMAN::ZGradientProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 634 of file processor.h.
string EMAN::ZGradientProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 622 of file processor.h.
References NAME.
00623 { 00624 return NAME; 00625 }
TypeDict EMAN::ZGradientProcessor::get_param_types | ( | ) | const [inline, virtual] |
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 639 of file processor.h.
00640 { 00641 TypeDict d; 00642 return d; 00643 }
static Processor* EMAN::ZGradientProcessor::NEW | ( | ) | [inline, static] |
Definition at line 629 of file processor.h.
References ZGradientProcessor().
00630 { 00631 return new ZGradientProcessor(); 00632 }
void ZGradientProcessor::process_inplace | ( | EMData * | image | ) | [virtual] |
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.
image | The image to be processed. |
Implements EMAN::Processor.
Definition at line 9654 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(), EMAN::EMData::process_inplace(), EMAN::EMData::set_size(), and EMAN::EMData::set_value_at().
09655 { 09656 if (image->is_complex()) throw ImageFormatException("Cannot edge detect a complex image"); 09657 09658 EMData* e = new EMData(); 09659 int nx = image->get_xsize(); 09660 int ny = image->get_ysize(); 09661 int nz = image->get_zsize(); 09662 09663 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"); 09664 09665 e->set_size(3,3,3); 09666 e->set_value_at(0,0,0,-1); 09667 e->set_value_at(1,0,0,-1); 09668 e->set_value_at(2,0,0,-1); 09669 e->set_value_at(0,1,0,-1); 09670 e->set_value_at(1,1,0,-8); 09671 e->set_value_at(2,1,0,-1); 09672 e->set_value_at(0,2,0,-1); 09673 e->set_value_at(1,2,0,-1); 09674 e->set_value_at(2,2,0,-1); 09675 09676 e->set_value_at(0,0,2,1); 09677 e->set_value_at(1,0,2,1); 09678 e->set_value_at(2,0,2,1); 09679 e->set_value_at(0,1,2,1); 09680 e->set_value_at(1,1,2,8); 09681 e->set_value_at(2,1,2,1); 09682 e->set_value_at(0,2,2,1); 09683 e->set_value_at(1,2,2,1); 09684 e->set_value_at(2,2,2,1); 09685 09686 Region r = Region(-nx/2+1,-ny/2+1,-nz/2+1,nx,ny,nz); 09687 e->clip_inplace(r); 09688 09689 Dict conv_parms; 09690 conv_parms["with"] = e; 09691 image->process_inplace("math.convolution", conv_parms); 09692 09693 delete e; 09694 }
const string ZGradientProcessor::NAME = "math.edge.zgradient" [static] |