#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 620 of file processor.h. 00620 {}
|
|
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. 00635 { 00636 return "Determines the image gradient in the z direction"; 00637 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 622 of file processor.h. 00623 {
00624 return NAME;
00625 }
|
|
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 }
|
|
Definition at line 629 of file processor.h. 00630 { 00631 return new ZGradientProcessor(); 00632 }
|
|
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 9717 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(). 09718 { 09719 if (image->is_complex()) throw ImageFormatException("Cannot edge detect a complex image"); 09720 09721 EMData* e = new EMData(); 09722 int nx = image->get_xsize(); 09723 int ny = image->get_ysize(); 09724 int nz = image->get_zsize(); 09725 09726 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"); 09727 09728 e->set_size(3,3,3); 09729 e->set_value_at(0,0,0,-1); 09730 e->set_value_at(1,0,0,-1); 09731 e->set_value_at(2,0,0,-1); 09732 e->set_value_at(0,1,0,-1); 09733 e->set_value_at(1,1,0,-8); 09734 e->set_value_at(2,1,0,-1); 09735 e->set_value_at(0,2,0,-1); 09736 e->set_value_at(1,2,0,-1); 09737 e->set_value_at(2,2,0,-1); 09738 09739 e->set_value_at(0,0,2,1); 09740 e->set_value_at(1,0,2,1); 09741 e->set_value_at(2,0,2,1); 09742 e->set_value_at(0,1,2,1); 09743 e->set_value_at(1,1,2,8); 09744 e->set_value_at(2,1,2,1); 09745 e->set_value_at(0,2,2,1); 09746 e->set_value_at(1,2,2,1); 09747 e->set_value_at(2,2,2,1); 09748 09749 Region r = Region(-nx/2+1,-ny/2+1,-nz/2+1,nx,ny,nz); 09750 e->clip_inplace(r); 09751 09752 Dict conv_parms; 09753 conv_parms["with"] = e; 09754 image->process_inplace("math.convolution", conv_parms); 09755 09756 delete e; 09757 }
|
|
Definition at line 65 of file processor.cpp. |