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

Average along Y and replace with average. More...

#include <processor.h>

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

Public Member Functions

void process_inplace (EMData *image)
 To process an image in-place. More...
 
string get_name () const
 Get the processor's name. More...
 
string get_desc () const
 Get the descrition of this specific processor. 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...
 
virtual TypeDict get_param_types () const
 Get processor parameter information in a dictionary. More...
 

Static Public Member Functions

static ProcessorNEW ()
 
- 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 = "math.averageovery"
 

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 Attributes inherited from EMAN::Processor
Dict params
 

Detailed Description

Average along Y and replace with average.

Definition at line 5649 of file processor.h.

Member Function Documentation

◆ get_desc()

string EMAN::AverageXProcessor::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 5664 of file processor.h.

5665 {
5666 return "Average along Y and replace with average";
5667 }

◆ get_name()

string EMAN::AverageXProcessor::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 5654 of file processor.h.

5655 {
5656 return NAME;
5657 }
static const string NAME
Definition: processor.h:5669

References NAME.

◆ NEW()

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

Definition at line 5659 of file processor.h.

5660 {
5661 return new AverageXProcessor();
5662 }
Average along Y and replace with average.
Definition: processor.h:5650

◆ process_inplace()

void AverageXProcessor::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 4452 of file processor.cpp.

4453{
4454 if (!image) {
4455 LOGWARN("NULL Image");
4456 return;
4457 }
4458
4459 float *data = image->get_data();
4460 int nx = image->get_xsize();
4461 int ny = image->get_ysize();
4462 int nz = image->get_zsize();
4463 size_t nxy = (size_t)nx * ny;
4464
4465 size_t idx;
4466 for (int z = 0; z < nz; z++) {
4467 for (int x = 0; x < nx; x++) {
4468 double sum = 0;
4469 for (int y = 0; y < ny; y++) {
4470 idx = x + y * nx + z * nxy;
4471 sum += data[idx];
4472 }
4473 float mean = (float) sum / ny;
4474
4475 for (int y = 0; y < ny; y++) {
4476 idx = x + y * nx + z * nxy;
4477 data[idx] = mean;
4478 }
4479 }
4480 }
4481
4482 image->update();
4483}
#define LOGWARN
Definition: log.h:53
#define y(i, j)
Definition: projector.cpp:1516
#define x(i)
Definition: projector.cpp:1517

References LOGWARN, x, and y.

Member Data Documentation

◆ NAME

const string AverageXProcessor::NAME = "math.averageovery"
static

Definition at line 5669 of file processor.h.

Referenced by get_name().


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