Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EMAN::TestImageNoiseUniformRand Class Reference

Replace a source image as a uniform random noise, random number generated from gsl_rng_mt19937, the pixel value is from 0 to 1, [0, 1). More...

#include <processor.h>

Inheritance diagram for EMAN::TestImageNoiseUniformRand:

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

Collaboration graph
[legend]
List of all members.

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

ProcessorNEW ()

Static Public Attributes

const string NAME = "testimage.noise.uniform.rand"

Detailed Description

Replace a source image as a uniform random noise, random number generated from gsl_rng_mt19937, the pixel value is from 0 to 1, [0, 1).

Parameters:
seed seed for random number generator

Definition at line 6568 of file processor.h.


Member Function Documentation

virtual string EMAN::TestImageNoiseUniformRand::get_desc  )  const [inline, virtual]
 

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 6578 of file processor.h.

06579                 {
06580                         return "Replace a source image as a uniform random noise, random number generated from gsl_rng_mt19937, the pixel value is [0, 1)";
06581                 }

virtual string EMAN::TestImageNoiseUniformRand::get_name  )  const [inline, virtual]
 

Get the processor's name.

Each processor is identified by a unique name.

Returns:
The processor's name.

Implements EMAN::Processor.

Definition at line 6573 of file processor.h.

06574                 {
06575                         return NAME;
06576                 }

virtual TypeDict EMAN::TestImageNoiseUniformRand::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.

Returns:
A dictionary containing the parameter info.

Reimplemented from EMAN::Processor.

Definition at line 6588 of file processor.h.

References EMAN::TypeDict::put().

06589                 {
06590                         TypeDict d;
06591                         d.put("seed", EMObject::INT, "seed for random number generator");
06592                         return d;
06593                 }

Processor* EMAN::TestImageNoiseUniformRand::NEW  )  [inline, static]
 

Definition at line 6583 of file processor.h.

06584                 {
06585                         return new TestImageNoiseUniformRand();
06586                 }

void TestImageNoiseUniformRand::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:
image The image to be processed.

Implements EMAN::Processor.

Definition at line 8001 of file processor.cpp.

References EMAN::EMData::get_data(), EMAN::Randnum::get_frand(), EMAN::Dict::has_key(), EMAN::Randnum::Instance(), nx, ny, EMAN::TestImageProcessor::preprocess(), EMAN::Randnum::set_seed(), and EMAN::EMData::update().

08002 {
08003         preprocess(image);
08004 
08005         Randnum * r = Randnum::Instance();
08006         if(params.has_key("seed")) {
08007                 r->set_seed((int)params["seed"]);
08008         }
08009 
08010         float *dat = image->get_data();
08011         size_t size = (size_t)nx*ny*nz;
08012         for (size_t i=0; i<size; ++i) {
08013                 dat[i] = r->get_frand();
08014         }
08015 
08016         image->update();
08017 }


Member Data Documentation

const string TestImageNoiseUniformRand::NAME = "testimage.noise.uniform.rand" [static]
 

Definition at line 208 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jun 11 13:49:13 2013 for EMAN2 by  doxygen 1.3.9.1