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

Makes the radial power distribution spherically symmetric with a profile defined by "strucfac". More...

#include <processor.h>

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

Public Member Functions

void process_inplace (EMData *image)
 To process an image in-place. More...
 
virtual string get_name () const
 Get the processor's name. More...
 
virtual 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 = "filter.setisotropicpow"
 

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

Makes the radial power distribution spherically symmetric with a profile defined by "strucfac".

Parameters
strucfacXYData object with the curve to be imposed as intensity as a function of s
apixA/pix value. Overrides and replaces apix_x/y/z in image

Definition at line 7950 of file processor.h.

Member Function Documentation

◆ get_desc()

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

7962 {
7963 return "Forces a map/image to have an isotropic radial power distribution. Unlike filter.setstrucfac, which produces a filtered, but anisotropic map, this forces the radial power to be the same in all directions. Phases are unchanged.";
7964 }

◆ get_name()

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

7957 {
7958 return NAME;
7959 }
static const string NAME
Definition: processor.h:7979

References NAME.

◆ get_param_types()

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

7972 {
7973 TypeDict d;
7974 d.put("strucfac", EMObject::XYDATA, "An XYData object contaning the intensity (not amplitude) to be imposed as a function of S");
7975 d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
7976 return d;
7977 }
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::TypeDict::put(), and EMAN::EMObject::XYDATA.

◆ NEW()

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

Definition at line 7966 of file processor.h.

7967 {
7968 return new SetIsoPowProcessor();
7969 }
Makes the radial power distribution spherically symmetric with a profile defined by "strucfac".
Definition: processor.h:7951

◆ process_inplace()

void SetIsoPowProcessor::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 8311 of file processor.cpp.

8311 {
8312
8313 EMData *tmp = 0;
8314 if (!image->is_complex()) { tmp=image; image=tmp->do_fft(); }
8315
8316 XYData *tmpsf = params["strucfac"];
8317 XYData *sf = new XYData();
8318 sf->set_state(tmpsf->get_state());
8319 for (int i=0; i<sf->get_size(); i++) sf->set_y(i,sqrt(sf->get_y(i)));
8320
8321 if(params.has_key("apix")) {
8322 image->set_attr("apix_x", (float)params["apix"]);
8323 image->set_attr("apix_y", (float)params["apix"]);
8324 image->set_attr("apix_z", (float)params["apix"]);
8325 if (image->has_attr("ctf")) {
8326 Ctf *ctf=image->get_attr("ctf");
8327 ctf->apix=(float)params["apix"];
8328 image->set_attr("ctf",ctf);
8329 delete(ctf);
8330 }
8331 }
8332
8333 float apix=image->get_attr("apix_x");
8334 int nx=image->get_xsize();
8335 int ny=image->get_ysize();
8336 int nz=image->get_zsize();
8337
8338 if (nz==1) {
8339 for (int j=-ny/2; j<ny/2; j++) {
8340 for (int i=0; i<nx/2; i++) {
8341 float r=Util::hypot2(i/(float)(nx-2),j/(float)ny)/apix; // radius in terms of Nyquist=0.5
8342 float a=sf->get_yatx(r);
8343 std::complex<float> v=image->get_complex_at(i,j);
8344 if (v!=0.0f) v*=a/abs(v);
8345 else v=std::complex<float>(a,0);
8346 image->set_complex_at(i,j,v);
8347 }
8348 }
8349 }
8350 else {
8351 for (int k=-nz/2; k<nz/2; k++) {
8352 for (int j=-ny/2; j<ny/2; j++) {
8353 for (int i=0; i<nx/2; i++) {
8354 float r=Util::hypot3(i/(float)(nx-2),j/(float)ny,k/(float)nz)/apix; // radius in terms of Nyquist=0.5
8355 float a=sf->get_yatx(r);
8356 std::complex<float> v=image->get_complex_at(i,j,k);
8357 if (v!=0.0f) v*=a/abs(v);
8358 else v=std::complex<float>(a,0);
8359 image->set_complex_at(i,j,k,v);
8360 }
8361 }
8362 }
8363 }
8364
8365 if (tmp!=0) {
8366 EMData *tmp2=image->do_ift();
8367 memcpy(tmp->get_data(),tmp2->get_data(),tmp2->get_size()*sizeof(float));
8368 delete tmp2;
8369 delete image;
8370 }
8371 delete sf;
8372
8373}
Ctf is the base class for all CTF model.
Definition: ctf.h:60
float apix
Definition: ctf.h:88
bool has_key(const string &key) const
Ask the Dictionary if it as a particular key.
Definition: emobject.h:511
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
static float hypot3(int x, int y, int z)
Euclidean distance function in 3D: f(x,y,z) = sqrt(x*x + y*y + z*z);.
Definition: util.h:827
static float hypot2(float x, float y)
Euclidean distance function in 2D: f(x,y) = sqrt(x*x + y*y);.
Definition: util.h:774
XYData defines a 1D (x,y) data set.
Definition: xydata.h:47
size_t get_size() const
Definition: xydata.h:127
float get_y(size_t i) const
Definition: xydata.h:95
float get_yatx(float x, bool outzero=true)
Definition: xydata.cpp:172
void set_y(size_t i, float y)
Definition: xydata.h:101
vector< float > get_state() const
Definition: xydata.cpp:285
void set_state(vector< float >)
Definition: xydata.cpp:297
EMData * sqrt() const
return square root of current image

References EMAN::Ctf::apix, EMAN::XYData::get_size(), EMAN::XYData::get_state(), EMAN::XYData::get_y(), EMAN::XYData::get_yatx(), EMAN::Dict::has_key(), EMAN::Util::hypot2(), EMAN::Util::hypot3(), EMAN::Processor::params, EMAN::XYData::set_state(), EMAN::XYData::set_y(), and sqrt().

Member Data Documentation

◆ NAME

const string SetIsoPowProcessor::NAME = "filter.setisotropicpow"
static

Definition at line 7979 of file processor.h.

Referenced by get_name().


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