#include <processor.h>
Inheritance diagram for EMAN::TestImageScurve:
Public Member Functions | |
virtual void | process_inplace (EMData *image) |
To process an image in-place. | |
virtual string | get_name () const |
Get the processor's name. | |
virtual string | get_desc () const |
Get the descrition of this specific processor. | |
virtual TypeDict | get_param_types () const |
Get processor parameter information in a dictionary. | |
Static Public Member Functions | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "testimage.scurve" |
Definition at line 6242 of file processor.h.
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 6252 of file processor.h. 06253 { 06254 return "Replace a source image with a lumpy S-curve used for alignment testing"; 06255 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 6247 of file processor.h. 06248 {
06249 return NAME;
06250 }
|
|
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 6262 of file processor.h. 06263 { 06264 TypeDict d; 06265 return d; 06266 }
|
|
Definition at line 6257 of file processor.h. 06258 { 06259 return new TestImageScurve(); 06260 }
|
|
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 7440 of file processor.cpp. References EMAN::EMData::get_ndim(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), ImageDimensionException, nx, ny, EMAN::TestImageProcessor::preprocess(), EMAN::EMData::to_zero(), EMAN::EMData::update(), x, and y. 07441 { 07442 preprocess(image); 07443 07444 int dim_size = image->get_ndim(); 07445 if( 2 != dim_size ) { 07446 throw ImageDimensionException("works for 2D images only"); 07447 } 07448 07449 int nx = image->get_xsize(); 07450 int ny = image->get_ysize(); 07451 image->to_zero(); 07452 07453 for (int i=0; i<100; i++) { 07454 int x=static_cast<int>( nx/2+nx/6.0*sin(i*2.0*3.14159/100.0) ); 07455 int y=ny/4+i*ny/200; 07456 for (int xx=x-nx/10; xx<x+nx/10; xx++) { 07457 for (int yy=y-ny/10; yy<y+ny/10; yy++) { 07458 #ifdef _WIN32 07459 (*image)(xx,yy)+=exp(-pow(static_cast<float>(_hypot(xx-x,yy-y))*30.0f/nx,2.0f))*(sin(static_cast<float>((xx-x)*(yy-y)))+.5f); 07460 #else 07461 (*image)(xx,yy)+=exp(-pow(static_cast<float>(hypot(xx-x,yy-y))*30.0f/nx,2.0f))*(sin(static_cast<float>((xx-x)*(yy-y)))+.5f); 07462 #endif 07463 } 07464 } 07465 } 07466 07467 image->update(); 07468 }
|
|
Definition at line 200 of file processor.cpp. |