EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
EMAN::TestImagePureGaussian Class Reference

Replace a source image as a strict Gaussian. More...

#include <processor.h>

Inheritance diagram for EMAN::TestImagePureGaussian:
Inheritance graph
[legend]
Collaboration diagram for EMAN::TestImagePureGaussian:
Collaboration graph
[legend]

Public Member Functions

virtual void process_inplace (EMData *image)
 To process an image in-place. More...
 
virtual string get_name () const
 Get the processor's name. More...
 
virtual string get_desc () const
 Get the descrition of this specific processor. More...
 
virtual TypeDict get_param_types () const
 Get processor parameter information in a dictionary. More...
 
- Public Member Functions inherited from EMAN::Processor
virtual ~Processor ()
 
virtual EMDataprocess (const EMData *const image)
 To proccess an image out-of-place. More...
 
virtual void process_list_inplace (vector< EMData * > &images)
 To process multiple images using the same algorithm. More...
 
virtual Dict get_params () const
 Get the processor parameters in a key/value dictionary. More...
 
virtual void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary. More...
 

Static Public Member Functions

static ProcessorNEW ()
 
- Static Public Member Functions inherited from EMAN::TestImageProcessor
static string get_group_desc ()
 
- Static Public Member Functions inherited from EMAN::Processor
static string get_group_desc ()
 Get the description of this group of processors. More...
 
static void EMFourierFilterInPlace (EMData *fimage, Dict params)
 Compute a Fourier-filter processed image in place. More...
 
static EMDataEMFourierFilter (EMData *fimage, Dict params)
 Compute a Fourier-processor processed image without altering the original image. More...
 

Static Public Attributes

static const string NAME = "testimage.puregaussian"
 

Additional Inherited Members

- Public Types inherited from EMAN::Processor
enum  fourier_filter_types {
  TOP_HAT_LOW_PASS , TOP_HAT_HIGH_PASS , TOP_HAT_BAND_PASS , TOP_HOMOMORPHIC ,
  GAUSS_LOW_PASS , GAUSS_HIGH_PASS , GAUSS_BAND_PASS , GAUSS_INVERSE ,
  GAUSS_HOMOMORPHIC , BUTTERWORTH_LOW_PASS , BUTTERWORTH_HIGH_PASS , BUTTERWORTH_HOMOMORPHIC ,
  KAISER_I0 , KAISER_SINH , KAISER_I0_INVERSE , KAISER_SINH_INVERSE ,
  SHIFT , TANH_LOW_PASS , TANH_HIGH_PASS , TANH_HOMOMORPHIC ,
  TANH_BAND_PASS , RADIAL_TABLE , CTF_
}
 Fourier filter Processor type enum. More...
 
- Protected Member Functions inherited from EMAN::TestImageProcessor
void preprocess (EMData *image)
 
- Protected Attributes inherited from EMAN::TestImageProcessor
int nx
 
int ny
 
int nz
 
- Protected Attributes inherited from EMAN::Processor
Dict params
 

Detailed Description

Replace a source image as a strict Gaussian.

Parameters
x_sigmasigma value for this Gaussian blob on x direction
y_sigmasigma value for this Gaussian blob on y direction
z_sigmasigma value for this Gaussian blob on z direction
x_centercenter for this Gaussian blob on x direction
y_centercenter for this Gaussian blob on y direction
z_centercenter for this Gaussian blob on z direction

Definition at line 8074 of file processor.h.

Member Function Documentation

◆ get_desc()

virtual string EMAN::TestImagePureGaussian::get_desc ( ) const
inlinevirtual

Get the descrition of this specific processor.

This function must be overwritten by a subclass.

Returns
The description of this processor.

Implements EMAN::Processor.

Definition at line 8084 of file processor.h.

8085 {
8086 return "Replace a source image as a strict Gaussian ";
8087 }

◆ get_name()

virtual string EMAN::TestImagePureGaussian::get_name ( ) const
inlinevirtual

Get the processor's name.

Each processor is identified by a unique name.

Returns
The processor's name.

Implements EMAN::Processor.

Definition at line 8079 of file processor.h.

8080 {
8081 return NAME;
8082 }
static const string NAME
Definition: processor.h:8106

References NAME.

◆ get_param_types()

virtual TypeDict EMAN::TestImagePureGaussian::get_param_types ( ) const
inlinevirtual

Get processor parameter information in a dictionary.

Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.

Returns
A dictionary containing the parameter info.

Reimplemented from EMAN::Processor.

Definition at line 8094 of file processor.h.

8095 {
8096 TypeDict d;
8097 d.put("x_sigma", EMObject::FLOAT, "sigma value for this Gaussian blob on x direction");
8098 d.put("y_sigma", EMObject::FLOAT, "sigma value for this Gaussian blob on y direction");
8099 d.put("z_sigma", EMObject::FLOAT, "sigma value for this Gaussian blob on z direction");
8100 d.put("x_center", EMObject::FLOAT, "center for this Gaussian blob on x direction" );
8101 d.put("y_center", EMObject::FLOAT, "center for this Gaussian blob on y direction" );
8102 d.put("z_center", EMObject::FLOAT, "center for this Gaussian blob on z direction" );
8103 return d;
8104 }
TypeDict is a dictionary to store <string, EMObject::ObjectType> pair.
Definition: emobject.h:305
void put(const string &key, EMObject::ObjectType o, const string &desc="")
Definition: emobject.h:330

References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().

◆ NEW()

static Processor * EMAN::TestImagePureGaussian::NEW ( )
inlinestatic

Definition at line 8089 of file processor.h.

8090 {
8091 return new TestImagePureGaussian();
8092 }
Replace a source image as a strict Gaussian.
Definition: processor.h:8075

◆ process_inplace()

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.

Parameters
imageThe image to be processed.

Implements EMAN::Processor.

Definition at line 9509 of file processor.cpp.

9510{
9511 preprocess(image);
9512
9513 float x_sigma = params["x_sigma"];
9514 float y_sigma = params["y_sigma"];
9515 float z_sigma = params["z_sigma"];
9516
9517 float x_center = params["x_center"];
9518 float y_center = params["y_center"];
9519 float z_center = params["z_center"];
9520
9521 int nx = image->get_xsize();
9522 int ny = image->get_ysize();
9523 int nz = image->get_zsize();
9524
9525 float x_twosig2 = 2*x_sigma*x_sigma;
9526 float y_twosig2 = 2*y_sigma*y_sigma;
9527 float z_twosig2 = 2*z_sigma*z_sigma;
9528
9529 float sr2pi = sqrt( 2.0f*(float)pi );
9530 float norm = 1.0f/ ( x_sigma*sr2pi );
9531 if (ny > 1) {
9532 norm *= 1.0f/ ( y_sigma*sr2pi );
9533 if (nz > 1) norm *= 1.0f/ ( z_sigma*sr2pi );
9534 }
9535
9536 float z, y, x, sum, val;
9537 for (int iz=0; iz < nz; ++iz) {
9538 z = static_cast<float>(iz) - z_center;
9539 for (int iy=0; iy < ny; ++iy) {
9540 y = static_cast<float>(iy) - y_center;
9541 for (int ix=0; ix < nx; ++ix) {
9542 x = static_cast<float>(ix) - x_center;
9543 sum = x*x/x_twosig2 + y*y/y_twosig2 + z*z/z_twosig2;
9544 val = norm*exp(-sum);
9545 (*image)(ix,iy,iz) = val;
9546 }
9547 }
9548 }
9549 image->update();
9550}
void preprocess(EMData *image)
Definition: processor.cpp:8923
EMData * sqrt() const
return square root of current image
#define y(i, j)
Definition: projector.cpp:1516
#define x(i)
Definition: projector.cpp:1517

References EMAN::TestImageProcessor::nx, EMAN::TestImageProcessor::ny, EMAN::TestImageProcessor::nz, EMAN::Processor::params, EMAN::TestImageProcessor::preprocess(), sqrt(), x, and y.

Member Data Documentation

◆ NAME

const string TestImagePureGaussian::NAME = "testimage.puregaussian"
static

Definition at line 8106 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files: