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

Zeroes the values on the X=0 and y=0 Fourier axes (except x=y=0) More...

#include <processor.h>

Inheritance diagram for EMAN::Axis0FourierProcessor:
Inheritance graph
Collaboration diagram for EMAN::Axis0FourierProcessor:
Collaboration graph

Public Member Functions

string get_name () const
 Get the processor's name. More...
void process_inplace (EMData *image)
 To process an image in-place. More...
void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary. More...
TypeDict get_param_types () const
 Get processor parameter information in a dictionary. 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...

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 = "filter.xyaxes0"

Additional Inherited Members

- Public Types inherited from EMAN::Processor
enum  fourier_filter_types {
 Fourier filter Processor type enum. More...
- Protected Attributes inherited from EMAN::Processor
Dict params

Detailed Description

Zeroes the values on the X=0 and y=0 Fourier axes (except x=y=0)

Definition at line 500 of file processor.h.

Member Function Documentation

◆ get_desc()

string EMAN::Axis0FourierProcessor::get_desc ( ) const

Get the descrition of this specific processor.

This function must be overwritten by a subclass.

The description of this processor.

Implements EMAN::Processor.

Definition at line 530 of file processor.h.

531 {
532 return "Sets values along X/Y Fourier axes to 0, except origin";
533 }

◆ get_name()

string EMAN::Axis0FourierProcessor::get_name ( ) const

Get the processor's name.

Each processor is identified by a unique name.

The processor's name.

Implements EMAN::Processor.

Definition at line 503 of file processor.h.

504 {
505 return NAME;
506 }
static const string NAME
Definition: processor.h:535

References NAME.

◆ get_param_types()

TypeDict EMAN::Axis0FourierProcessor::get_param_types ( ) const

Get processor parameter information in a dictionary.

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

A dictionary containing the parameter info.

Reimplemented from EMAN::Processor.

Definition at line 515 of file processor.h.

516 {
517 TypeDict d;
518 d.put("x", EMObject::INT, "If set, zeroes along X axis. Default True.");
519 d.put("y", EMObject::INT, "If set, zeroes along Y axis. Default True.");
520 d.put("neighbor", EMObject::INT, "If set, interpolates neighbor values rather than zeroing");
521 d.put("neighbornorm", EMObject::INT, "In neighbor mode it sums the neighboring 2 (complex) pixels, then divides by this factor. default = sqrt(2), which is good for very noisy images");
522 return d;
523 }
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::INT, and EMAN::TypeDict::put().

◆ NEW()

static Processor * EMAN::Axis0FourierProcessor::NEW ( )

Definition at line 525 of file processor.h.

526 {
527 return new Axis0FourierProcessor();
528 }
Zeroes the values on the X=0 and y=0 Fourier axes (except x=y=0)
Definition: processor.h:501

◆ process_inplace()

void Axis0FourierProcessor::process_inplace ( EMData image)

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.

imageThe image to be processed.

Implements EMAN::Processor.

Definition at line 1250 of file processor.cpp.

1252 EMData *fft;
1253 float *fftd;
1254 int f=0;
1255// static float sum1=0,sum1a=0;
1256// static double sum2=0,sum2a=0;
1258 if (!image) {
1259 LOGWARN("NULL Image");
1260 return;
1261 }
1263 if (!image->is_complex()) fft = image->do_fft();
1264 else fft = image;
1266 int neighbor=params.set_default("neighbor",0);
1267 float neighbornorm=params.set_default("neighbornorm",sqrt(2.0f));
1269 int nx=fft->get_xsize()/2;
1270 int ny=fft->get_ysize();
1271 if (params.set_default("x",1)) {
1272 if (neighbor) {
1273 for (int x=1; x<nx; x++) fft->set_complex_at(x,0,(fft->get_complex_at(x,1)+fft->get_complex_at(x,-1))/neighbornorm); // sqrt is because the pixels are normally pretty noisy
1274 }
1275 else {
1276 for (int x=1; x<nx; x++) fft->set_complex_at(x,0,0.0f);
1277 }
1278 }
1279 if (params.set_default("y",1)) {
1280 if (neighbor) {
1281 for (int y=1; y<ny; y++) fft->set_complex_at(0,y,(fft->get_complex_at(-1,y)+fft->get_complex_at(1,y))/neighbornorm); // sqrt is because the pixels are normally pretty noisy
1282 }
1283 else {
1284 for (int y=1; y<ny; y++) fft->set_complex_at(0,y,0.0f);
1285 }
1286 }
1288 if (fft!=image) {
1289// fft->update();
1290 EMData *ift=fft->do_ift();
1291 memcpy(image->get_data(),ift->get_data(),(nx*2-2)*ny*sizeof(float));
1292 delete fft;
1293 delete ift;
1294 }
1296// image->update();
type set_default(const string &key, type val)
Default setting behavior This can be achieved using a template - d.woolford Jan 2008 (before there wa...
Definition: emobject.h:569
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
EMData * sqrt() const
return square root of current image
#define LOGWARN
Definition: log.h:53
#define y(i, j)
Definition: projector.cpp:1516
#define x(i)
Definition: projector.cpp:1517

References LOGWARN, EMAN::Processor::params, EMAN::Dict::set_default(), sqrt(), x, and y.

◆ set_params()

void EMAN::Axis0FourierProcessor::set_params ( const Dict new_params)

Set the processor parameters using a key/value dictionary.

new_paramsA dictionary containing the new parameters.

Reimplemented from EMAN::Processor.

Definition at line 510 of file processor.h.

511 {
512 params = new_params;
513 }

References EMAN::Processor::params.

Member Data Documentation


const string Axis0FourierProcessor::NAME = "filter.xyaxes0"

Definition at line 535 of file processor.h.

Referenced by get_name().

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