#include <processor.h>
Inheritance diagram for EMAN::TestImageLineWave:
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.linewave" |
period | the period of the sine wave |
Definition at line 5967 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 5977 of file processor.h. 05978 { 05979 return "Insert an oscillating sine wave into the pixel data"; 05980 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5972 of file processor.h. 05973 {
05974 return NAME;
05975 }
|
|
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 5987 of file processor.h. References EMAN::TypeDict::put(). 05988 { 05989 TypeDict d; 05990 d.put("period", EMObject::FLOAT, "The period of the oscillating sine wave. Default 10."); 05991 return d; 05992 }
|
|
Definition at line 5982 of file processor.h. 05983 { 05984 return new TestImageLineWave(); 05985 }
|
|
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 7093 of file processor.cpp. References EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), EMAN::TestImageProcessor::preprocess(), EMAN::Dict::set_default(), EMAN::EMData::set_value_at_fast(), and x. 07094 { 07095 preprocess(image); 07096 07097 float period = params.set_default("period",10.0f); 07098 size_t n = (size_t)image->get_xsize()*image->get_ysize()*image->get_zsize(); 07099 07100 for(size_t i = 0; i < n; ++i) { 07101 float x = fmod((float)i,period); 07102 x /= period; 07103 x = (float)sin(x*EMConsts::pi*2.0); 07104 image->set_value_at_fast(i,x); 07105 } 07106 }
|
|
Definition at line 194 of file processor.cpp. |