#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 | |
static Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "testimage.linewave" |
period | the period of the sine wave |
Definition at line 6053 of file processor.h.
virtual string EMAN::TestImageLineWave::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 6063 of file processor.h.
virtual string EMAN::TestImageLineWave::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 6058 of file processor.h.
References NAME.
06059 { 06060 return NAME; 06061 }
virtual TypeDict EMAN::TestImageLineWave::get_param_types | ( | ) | const [inline, virtual] |
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 6073 of file processor.h.
References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().
06074 { 06075 TypeDict d; 06076 d.put("period", EMObject::FLOAT, "The period of the oscillating sine wave. Default 10."); 06077 return d; 06078 }
static Processor* EMAN::TestImageLineWave::NEW | ( | ) | [inline, static] |
void TestImageLineWave::process_inplace | ( | EMData * | image | ) | [virtual] |
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.
image | The image to be processed. |
Implements EMAN::Processor.
Definition at line 7245 of file processor.cpp.
References EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), EMAN::Processor::params, EMAN::EMConsts::pi, EMAN::TestImageProcessor::preprocess(), EMAN::Dict::set_default(), EMAN::EMData::set_value_at_fast(), and x.
07246 { 07247 preprocess(image); 07248 07249 float period = params.set_default("period",10.0f); 07250 size_t n = (size_t)image->get_xsize()*image->get_ysize()*image->get_zsize(); 07251 07252 for(size_t i = 0; i < n; ++i) { 07253 float x = fmod((float)i,period); 07254 x /= period; 07255 x = (float)sin(x*EMConsts::pi*2.0); 07256 image->set_value_at_fast(i,x); 07257 } 07258 }
const string TestImageLineWave::NAME = "testimage.linewave" [static] |