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

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

#include <processor.h>

Inheritance diagram for EMAN::AutoMaskAsymUnit:
Inheritance graph
[legend]
Collaboration diagram for EMAN::AutoMaskAsymUnit:
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 TypeDict get_param_types () const
 Get processor parameter information in a dictionary. More...
 
virtual 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...
 

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 = "mask.asymunit"
 

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

Tries to mask out only interesting density.

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

Definition at line 6830 of file processor.h.

Member Function Documentation

◆ get_desc()

virtual string EMAN::AutoMaskAsymUnit::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 6854 of file processor.h.

6855 {
6856 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.";
6857 }

◆ get_name()

virtual string EMAN::AutoMaskAsymUnit::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 6835 of file processor.h.

6836 {
6837 return NAME;
6838 }
static const string NAME
Definition: processor.h:6859

References NAME.

◆ get_param_types()

virtual TypeDict EMAN::AutoMaskAsymUnit::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 6845 of file processor.h.

6846 {
6847 TypeDict d;
6848 d.put("symavg", EMObject::INT, "Cn symmetry only. If set, the mask for a single subunit will follow a linear falloff to the neighboring subunit. After applying, symmetrizing the map should produce a smooth symmetrized average of the masked subunit (and partially its two neighbors).");
6849 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.");
6850 d.put("sym", EMObject::STRING, "The symmetry, for example, d7");
6851 return d;
6852 }
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, EMAN::TypeDict::put(), and EMAN::EMObject::STRING.

◆ NEW()

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

Definition at line 6840 of file processor.h.

6841 {
6842 return new AutoMaskAsymUnit();
6843 }
Tries to mask out only interesting density.
Definition: processor.h:6831

◆ process_inplace()

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.

Parameters
imageThe image to be processed.

Implements EMAN::Processor.

Definition at line 6702 of file processor.cpp.

6702 {
6703 if (!image) {
6704 LOGWARN("NULL Image");
6705 return;
6706 }
6707
6708 int nx = image->get_xsize();
6709 int ny = image->get_ysize();
6710 int nz = image->get_zsize();
6711
6712 int ox = nx/2;
6713 int oy = ny/2;
6714 int oz = nz/2;
6715
6716 Symmetry3D* sym = Factory<Symmetry3D>::get((string)params["sym"]);
6717 int au = params.set_default("au",0);
6718 int symavg = params.set_default("symavg",0);
6719
6720 if ((toupper(((string)params["sym"])[0])!='C' || au<0)&& symavg) throw InvalidParameterException("ERROR: symavg only works with Cn symmetry, and one au must be specified.");
6721
6722 if (symavg) {
6723 for(int k = 0; k < nz; ++k ) {
6724 for(int j = 0; j < ny; ++j ) {
6725 for (int i = 0; i< nx; ++i) {
6726 float az=atan2(float(j-ny/2),float(i-nx/2));
6727
6728 }
6729 }
6730 }
6731
6732 delete sym;
6733 }
6734
6735 float *d = image->get_data();
6736 for(int k = 0; k < nz; ++k ) {
6737 for(int j = 0; j < ny; ++j ) {
6738 for (int i = 0; i< nx; ++i, ++d) {
6739 //cout << i << " " << j << " " << k << endl;
6740 Vec3f v(i-ox,j-oy,k-oz);
6741// v.normalize();
6742 int a = sym->point_in_which_asym_unit(v);
6743 if (au == -1) {
6744 *d = (float)a;
6745 } else {
6746 if ( a == au ) *d = 1;
6747 else *d = 0;
6748 }
6749 }
6750 }
6751 }
6752
6753 delete sym;
6754
6755}
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
static T * get(const string &instance_name)
Definition: emobject.h:781
Symmetry3D - A base class for 3D Symmetry objects.
Definition: symmetry.h:57
virtual int point_in_which_asym_unit(const Vec3f &v) const
A function that will determine in which asymmetric unit a given vector resides The asymmetric unit 'n...
Definition: symmetry.cpp:1072
#define InvalidParameterException(desc)
Definition: exception.h:361
#define LOGWARN
Definition: log.h:53

References EMAN::Factory< T >::get(), InvalidParameterException, LOGWARN, EMAN::Processor::params, EMAN::Symmetry3D::point_in_which_asym_unit(), and EMAN::Dict::set_default().

Member Data Documentation

◆ NAME

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

Definition at line 6859 of file processor.h.

Referenced by get_name().


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