#include <processor.h>
Inheritance diagram for EMAN::YGradientProcessor:
Public Member Functions | |
YGradientProcessor () | |
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.ygradient" |
|
Definition at line 588 of file processor.h. 00588 {}
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 602 of file processor.h. 00603 { 00604 return "Determines the image gradient in the y direction"; 00605 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 590 of file processor.h. 00591 {
00592 return NAME;
00593 }
|
|
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 608 of file processor.h. 00609 { 00610 TypeDict d; 00611 return d; 00612 }
|
|
Definition at line 597 of file processor.h. 00598 { 00599 return new YGradientProcessor(); 00600 }
|
|
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 9581 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(). 09582 { 09583 if (image->is_complex()) throw ImageFormatException("Cannot edge detect a complex image"); 09584 09585 EMData* e = new EMData(); 09586 int nx = image->get_xsize(); 09587 int ny = image->get_ysize(); 09588 int nz = image->get_zsize(); 09589 09590 if ( nz == 1 && ny == 1 ) { 09591 throw ImageDimensionException("Error - cannot detect Y edges for an image that that is 1D!"); 09592 } else if ( nz == 1 ) { 09593 if ( nx < 3 || ny < 3 ) throw ImageDimensionException("Error - cannot edge detect an image with less than three pixels"); 09594 e->set_size(3,3,1); 09595 e->set_value_at(0,0,-1); 09596 e->set_value_at(1,0,-2); 09597 e->set_value_at(2,0,-1); 09598 09599 e->set_value_at(0,2,1); 09600 e->set_value_at(1,2,2); 09601 e->set_value_at(2,2,1); 09602 Region r = Region(-nx/2+1,-ny/2+1,nx,ny); 09603 e->clip_inplace(r); 09604 } else { 09605 if ( nx < 3 || ny < 3 || nz < 3) throw ImageDimensionException("Error - cannot edge detect an image with less than three pixels"); 09606 e->set_size(3,3,3); 09607 e->set_value_at(0,0,0,-1); 09608 e->set_value_at(1,0,0,-1); 09609 e->set_value_at(2,0,0,-1); 09610 e->set_value_at(0,0,1,-1); 09611 e->set_value_at(1,0,1,-8); 09612 e->set_value_at(2,0,1,-1); 09613 e->set_value_at(0,0,2,-1); 09614 e->set_value_at(1,0,2,-1); 09615 e->set_value_at(2,0,2,-1); 09616 09617 e->set_value_at(0,2,0,1); 09618 e->set_value_at(1,2,0,1); 09619 e->set_value_at(2,2,0,1); 09620 e->set_value_at(0,2,1,1); 09621 e->set_value_at(1,2,1,8); 09622 e->set_value_at(2,2,1,1); 09623 e->set_value_at(0,2,2,1); 09624 e->set_value_at(1,2,2,1); 09625 e->set_value_at(2,2,2,1); 09626 09627 Region r = Region(-nx/2+1,-ny/2+1,-nz/2+1,nx,ny,nz); 09628 e->clip_inplace(r); 09629 } 09630 09631 Dict conv_parms; 09632 conv_parms["with"] = e; 09633 image->process_inplace("math.convolution", conv_parms); 09634 09635 delete e; 09636 }
|
|
Definition at line 64 of file processor.cpp. |