#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 9659 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(). 09660 { 09661 if (image->is_complex()) throw ImageFormatException("Cannot edge detect a complex image"); 09662 09663 EMData* e = new EMData(); 09664 int nx = image->get_xsize(); 09665 int ny = image->get_ysize(); 09666 int nz = image->get_zsize(); 09667 09668 if ( nz == 1 && ny == 1 ) { 09669 throw ImageDimensionException("Error - cannot detect Y edges for an image that that is 1D!"); 09670 } else if ( nz == 1 ) { 09671 if ( nx < 3 || ny < 3 ) throw ImageDimensionException("Error - cannot edge detect an image with less than three pixels"); 09672 e->set_size(3,3,1); 09673 e->set_value_at(0,0,-1); 09674 e->set_value_at(1,0,-2); 09675 e->set_value_at(2,0,-1); 09676 09677 e->set_value_at(0,2,1); 09678 e->set_value_at(1,2,2); 09679 e->set_value_at(2,2,1); 09680 Region r = Region(-nx/2+1,-ny/2+1,nx,ny); 09681 e->clip_inplace(r); 09682 } else { 09683 if ( nx < 3 || ny < 3 || nz < 3) throw ImageDimensionException("Error - cannot edge detect an image with less than three pixels"); 09684 e->set_size(3,3,3); 09685 e->set_value_at(0,0,0,-1); 09686 e->set_value_at(1,0,0,-1); 09687 e->set_value_at(2,0,0,-1); 09688 e->set_value_at(0,0,1,-1); 09689 e->set_value_at(1,0,1,-8); 09690 e->set_value_at(2,0,1,-1); 09691 e->set_value_at(0,0,2,-1); 09692 e->set_value_at(1,0,2,-1); 09693 e->set_value_at(2,0,2,-1); 09694 09695 e->set_value_at(0,2,0,1); 09696 e->set_value_at(1,2,0,1); 09697 e->set_value_at(2,2,0,1); 09698 e->set_value_at(0,2,1,1); 09699 e->set_value_at(1,2,1,8); 09700 e->set_value_at(2,2,1,1); 09701 e->set_value_at(0,2,2,1); 09702 e->set_value_at(1,2,2,1); 09703 e->set_value_at(2,2,2,1); 09704 09705 Region r = Region(-nx/2+1,-ny/2+1,-nz/2+1,nx,ny,nz); 09706 e->clip_inplace(r); 09707 } 09708 09709 Dict conv_parms; 09710 conv_parms["with"] = e; 09711 image->process_inplace("math.convolution", conv_parms); 09712 09713 delete e; 09714 }
|
|
Definition at line 64 of file processor.cpp. |