#include <processor.h>


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 () |
| x_sigma | sigma value for this Gaussian blob on x direction | |
| y_sigma | sigma value for this Gaussian blob on y direction | |
| z_sigma | sigma value for this Gaussian blob on z direction | |
| x_center | center for this Gaussian blob on x direction | |
| y_center | center for this Gaussian blob on y direction | |
| z_center | center for this Gaussian blob on z direction |
Definition at line 5432 of file processor.h.
| void TestImagePureGaussian::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 6720 of file processor.cpp.
References EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), norm(), EMAN::Processor::params, pi, EMAN::TestImageProcessor::preprocess(), sqrt(), EMAN::EMData::update(), and x.
06721 { 06722 preprocess(image); 06723 06724 float x_sigma = params["x_sigma"]; 06725 float y_sigma = params["y_sigma"]; 06726 float z_sigma = params["z_sigma"]; 06727 06728 float x_center = params["x_center"]; 06729 float y_center = params["y_center"]; 06730 float z_center = params["z_center"]; 06731 06732 int nx = image->get_xsize(); 06733 int ny = image->get_ysize(); 06734 int nz = image->get_zsize(); 06735 06736 float x_twosig2 = 2*x_sigma*x_sigma; 06737 float y_twosig2 = 2*y_sigma*y_sigma; 06738 float z_twosig2 = 2*z_sigma*z_sigma; 06739 06740 float sr2pi = sqrt( 2.0f*(float)pi ); 06741 float norm = 1.0f/ ( x_sigma*sr2pi ); 06742 if (ny > 1) { 06743 norm *= 1.0f/ ( y_sigma*sr2pi ); 06744 if (nz > 1) norm *= 1.0f/ ( z_sigma*sr2pi ); 06745 } 06746 06747 float z, y, x, sum, val; 06748 for (int iz=0; iz < nz; ++iz) { 06749 z = static_cast<float>(iz) - z_center; 06750 for (int iy=0; iy < ny; ++iy) { 06751 y = static_cast<float>(iy) - y_center; 06752 for (int ix=0; ix < nx; ++ix) { 06753 x = static_cast<float>(ix) - x_center; 06754 sum = x*x/x_twosig2 + y*y/y_twosig2 + z*z/z_twosig2; 06755 val = norm*exp(-sum); 06756 (*image)(ix,iy,iz) = val; 06757 } 06758 } 06759 } 06760 image->update(); 06761 }
| virtual string EMAN::TestImagePureGaussian::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 5437 of file processor.h.
| virtual string EMAN::TestImagePureGaussian::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 5442 of file processor.h.
| static Processor* EMAN::TestImagePureGaussian::NEW | ( | ) | [inline, static] |
Definition at line 5447 of file processor.h.
05448 { 05449 return new TestImagePureGaussian(); 05450 }
| virtual TypeDict EMAN::TestImagePureGaussian::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 5452 of file processor.h.
References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().
05453 { 05454 TypeDict d; 05455 d.put("x_sigma", EMObject::FLOAT, "sigma value for this Gaussian blob on x direction"); 05456 d.put("y_sigma", EMObject::FLOAT, "sigma value for this Gaussian blob on y direction"); 05457 d.put("z_sigma", EMObject::FLOAT, "sigma value for this Gaussian blob on z direction"); 05458 d.put("x_center", EMObject::FLOAT, "center for this Gaussian blob on x direction" ); 05459 d.put("y_center", EMObject::FLOAT, "center for this Gaussian blob on y direction" ); 05460 d.put("z_center", EMObject::FLOAT, "center for this Gaussian blob on z direction" ); 05461 return d; 05462 }
1.5.6