Public Member Functions | Static Public Member Functions | Static Public Attributes
EMAN::AutoMaskAsymUnit Class Reference

Tries to mask out only interesting density. More...

#include <processor.h>

Inheritance diagram for EMAN::AutoMaskAsymUnit:
Inheritance graph
Collaboration diagram for EMAN::AutoMaskAsymUnit:
Collaboration graph

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 TypeDict get_param_types () const
 Get processor parameter information in a dictionary.
virtual string get_desc () const
 Get the descrition of this specific processor.

Static Public Member Functions

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "mask.asymunit"

Detailed Description

Tries to mask out only interesting density.

auThe asymmetric unit to mask, if -1 masks all asymmetric units but assigns each a unique value
symThe symmetry type, for example, "tet"
David Woolford
February 2009

Definition at line 5235 of file processor.h.

Member Function Documentation

virtual string EMAN::AutoMaskAsymUnit::get_desc ( ) const [inline, virtual]

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

                                return "Masks out a specific asymmetric unit of the given symmetry. If the au parameter is -1 will mask all asymmetric units, assigning the asymetric unit number to the masked area.";
virtual string EMAN::AutoMaskAsymUnit::get_name ( ) const [inline, virtual]

Get the processor's name.

Each processor is identified by a unique name.

The processor's name.

Implements EMAN::Processor.

Definition at line 5240 of file processor.h.

References NAME.

                                return NAME;
virtual TypeDict EMAN::AutoMaskAsymUnit::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.

A dictionary containing the parameter info.

Reimplemented from EMAN::Processor.

Definition at line 5250 of file processor.h.

References EMAN::EMObject::INT, EMAN::TypeDict::put(), and EMAN::EMObject::STRING.

                                TypeDict d;
                                d.put("au", EMObject::INT, "The asymmetric unit to mask out. If this is -1 will mask all asymmetric units, giving each a unique number.");
                                d.put("sym", EMObject::STRING, "The symmetry, for example, d7");
                                return d;
static Processor* EMAN::AutoMaskAsymUnit::NEW ( ) [inline, static]

Definition at line 5245 of file processor.h.

                                return new AutoMaskAsymUnit();
void AutoMaskAsymUnit::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.

imageThe image to be processed.

Implements EMAN::Processor.

Definition at line 5563 of file processor.cpp.

References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), LOGWARN, nx, ny, EMAN::Processor::params, EMAN::Symmetry3D::point_in_which_asym_unit(), and v.

        if (!image) {
                LOGWARN("NULL Image");

        int nx = image->get_xsize();
        int ny = image->get_ysize();
        int nz = image->get_zsize();

        int ox = nx/2;
        int oy = ny/2;
        int oz = nz/2;

        Symmetry3D* sym = Factory<Symmetry3D>::get((string)params["sym"]);
        int au = params.set_default("au",0);

        float *d = image->get_data();
        for(int k = 0; k < nz; ++k ) {
                for(int j = 0; j < ny; ++j ) {
                        for (int i = 0; i< nx; ++i, ++d) {
                                //cout << i << " " << j << " " << k << endl;
                                Vec3f v(i-ox,j-oy,k-oz);
//                              v.normalize();
                                int a = sym->point_in_which_asym_unit(v);
                                if (au == -1) {
                                        *d = (float)a;
                                } else {
                                        if ( a == au ) *d = 1;
                                        else *d = 0;

        delete sym;


Member Data Documentation

const string AutoMaskAsymUnit::NAME = "mask.asymunit" [static]

Definition at line 5263 of file processor.h.

Referenced by get_name().

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