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

#include <processor.h>

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

Public Member Functions

void process_inplace (EMData *in)
 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...
 
virtual TypeDict get_param_types () const
 Get processor parameter information in a dictionary. 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 = "math.model_em_cylinder"
 

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 Member Functions inherited from EMAN::ModelHelixProcessor
float radprofile (float r, int type)
 
- Protected Attributes inherited from EMAN::Processor
Dict params
 

Detailed Description

Definition at line 9243 of file processor.h.

Member Function Documentation

◆ get_desc()

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

9259 {
9260 return "Adds a cylinder with a radial density profile similar to that of an alpha helix.";
9261 }

◆ get_name()

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

9249 {
9250 return NAME;
9251 }
static const string NAME
Definition: processor.h:9275

References NAME.

◆ get_param_types()

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

9264 {
9265 TypeDict d;
9266 d.put("type", EMObject::INT, "Radial profile of density method, defaults to 2: 0 = pure Gaussian falloff; 1 = Gaussian falloff + dip, so mean is zero; 2 = polynomial fitting of real helix density");
9267 d.put("length", EMObject::FLOAT, "cylinder length in angstroms, defaults to 3 turns (16.2 Angstroms)");
9268 d.put("x0", EMObject::INT, "x coordinate in pixels for the midpoint of the cylinder's axis, defaults to center of map");
9269 d.put("y0", EMObject::INT, "y coordinate in pixels for the midpoint of the cylinder's axis, defaults to center of map");
9270 d.put("z0", EMObject::INT, "z coordinate in pixels for the midpoint of the cylinder's axis, defaults to center of map");
9271 //TODO: Check with Matt Baker about description strings
9272 return d;
9273 }
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::FLOAT, EMAN::EMObject::INT, and EMAN::TypeDict::put().

◆ NEW()

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

Definition at line 9253 of file processor.h.

9254 {
9255 return new ModelEMCylinderProcessor();
9256 }

◆ process_inplace()

void ModelEMCylinderProcessor::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 13171 of file processor.cpp.

13173{
13174 // synthesize model alpha helix, len is Angstrom, default to 2 turns
13175 //The helical axis is parallel to the z axis.
13176 EMData * cyl = in;
13177 int nx = cyl->get_xsize();
13178 int ny = cyl->get_ysize();
13179 int nz = cyl->get_zsize();
13180
13181 int type = params.set_default("type", 2);
13182 float len = params.set_default("length", 16.2f); //in angstroms
13183 int x0 = params.set_default("x0", -1); //in voxels -- default value changed a few lines down
13184 int y0 = params.set_default("y0", -1); //in voxels
13185 int z0 = params.set_default("z0", -1); //in voxels
13186 //TODO: check with Matt about default values
13187
13188 if (x0 < 0 || x0 >= nx)
13189 x0 = nx / 2;
13190 if (y0 < 0 || y0 >= ny)
13191 y0 = ny / 2;
13192 if (z0 < 0 || z0 >= nz)
13193 z0 = nz / 2;
13194
13195 float apix_x = cyl->get_attr("apix_x"); //TODO: Ask Matt if I correctly handled cases where apix_x != apix_y or apix_x != apix_z are not equal
13196 float apix_y = cyl->get_attr("apix_y");
13197 float apix_z = cyl->get_attr("apix_z");
13198
13199 float * dat = cyl->get_data();
13200 int cyl_voxel_len = (int) (len / apix_z);
13201 int cyl_k_min = z0 - cyl_voxel_len / 2;
13202 int cyl_k_max = z0 + cyl_voxel_len / 2;
13203
13204 int x, y;
13205 for (int k = 0; k < nz; ++k) {
13206 for (int j = 0; j < ny; ++j) {
13207 for (int i = 0; i < nx; ++i, ++dat) {
13208 x = i - x0;//coordinate sys centered on cylinder
13209 y = j - y0;//coordinate sys centered on cylinder
13210 float radius = (float)hypot(x * apix_x, y * apix_y);
13211 if ((k > cyl_k_min) && (k < cyl_k_max))
13212 *dat += radprofile(radius, type); //pointer arithmetic for array done in loop
13213 //else
13214 //continue;
13215
13216 }
13217 }
13218 }
13219}
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
float radprofile(float r, int type)
#define y(i, j)
Definition: projector.cpp:1516
#define x(i)
Definition: projector.cpp:1517

References EMAN::Processor::params, EMAN::ModelHelixProcessor::radprofile(), EMAN::Dict::set_default(), x, and y.

Member Data Documentation

◆ NAME

const string ModelEMCylinderProcessor::NAME = "math.model_em_cylinder"
static

Definition at line 9275 of file processor.h.

Referenced by get_name().


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