#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 563 of file processor.h. 00563 {}
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 577 of file processor.h. 00578 { 00579 return "Determines the image gradient in the y direction"; 00580 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 565 of file processor.h. 00566 {
00567 return NAME;
00568 }
|
|
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 583 of file processor.h. 00584 { 00585 TypeDict d; 00586 return d; 00587 }
|
|
Definition at line 572 of file processor.h. 00573 { 00574 return new YGradientProcessor(); 00575 }
|
|
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 9298 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(). 09299 { 09300 if (image->is_complex()) throw ImageFormatException("Cannot edge detect a complex image"); 09301 09302 EMData* e = new EMData(); 09303 int nx = image->get_xsize(); 09304 int ny = image->get_ysize(); 09305 int nz = image->get_zsize(); 09306 09307 if ( nz == 1 && ny == 1 ) { 09308 throw ImageDimensionException("Error - cannot detect Y edges for an image that that is 1D!"); 09309 } else if ( nz == 1 ) { 09310 if ( nx < 3 || ny < 3 ) throw ImageDimensionException("Error - cannot edge detect an image with less than three pixels"); 09311 e->set_size(3,3,1); 09312 e->set_value_at(0,0,-1); 09313 e->set_value_at(1,0,-2); 09314 e->set_value_at(2,0,-1); 09315 09316 e->set_value_at(0,2,1); 09317 e->set_value_at(1,2,2); 09318 e->set_value_at(2,2,1); 09319 Region r = Region(-nx/2+1,-ny/2+1,nx,ny); 09320 e->clip_inplace(r); 09321 } else { 09322 if ( nx < 3 || ny < 3 || nz < 3) throw ImageDimensionException("Error - cannot edge detect an image with less than three pixels"); 09323 e->set_size(3,3,3); 09324 e->set_value_at(0,0,0,-1); 09325 e->set_value_at(1,0,0,-1); 09326 e->set_value_at(2,0,0,-1); 09327 e->set_value_at(0,0,1,-1); 09328 e->set_value_at(1,0,1,-8); 09329 e->set_value_at(2,0,1,-1); 09330 e->set_value_at(0,0,2,-1); 09331 e->set_value_at(1,0,2,-1); 09332 e->set_value_at(2,0,2,-1); 09333 09334 e->set_value_at(0,2,0,1); 09335 e->set_value_at(1,2,0,1); 09336 e->set_value_at(2,2,0,1); 09337 e->set_value_at(0,2,1,1); 09338 e->set_value_at(1,2,1,8); 09339 e->set_value_at(2,2,1,1); 09340 e->set_value_at(0,2,2,1); 09341 e->set_value_at(1,2,2,1); 09342 e->set_value_at(2,2,2,1); 09343 09344 Region r = Region(-nx/2+1,-ny/2+1,-nz/2+1,nx,ny,nz); 09345 e->clip_inplace(r); 09346 } 09347 09348 Dict conv_parms; 09349 conv_parms["with"] = e; 09350 image->process_inplace("math.convolution", conv_parms); 09351 09352 delete e; 09353 }
|
|
Definition at line 65 of file processor.cpp. |