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

A thresholding processor for Fourier images based on the amplitude component. More...

#include <processor.h>

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

Public Member Functions

virtual string get_name () const
 Get the processor's name. More...
 
virtual void process_inplace (EMData *image)
 
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 = "threshold.binary.fourier"
 

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

A thresholding processor for Fourier images based on the amplitude component.

All maps set below value are set to zero Useful in tomography when you want to toss complex components with low amplitides

Author
John Flanagan
Date
Oct 25th 2010
Parameters
valueThe Fourier amplitude threshold cutoff

Definition at line 3236 of file processor.h.

Member Function Documentation

◆ get_desc()

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

3262 {
3263 return "f(k) = 0 + 0i if ||f(k)|| < value; f(k) = a + bi if ||f(k)|| >= value.";
3264 }

◆ get_name()

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

3240 {
3241 return NAME;
3242 }
static const string NAME
Definition: processor.h:3266

References NAME.

◆ get_param_types()

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

3255 {
3256 TypeDict d;
3257 d.put("value", EMObject::FLOAT, "The Fourier amplitude threshold cutoff" );
3258 return d;
3259 }
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, and EMAN::TypeDict::put().

◆ NEW()

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

Definition at line 3243 of file processor.h.

3244 {
3245 return new BinarizeFourierProcessor();
3246 }
A thresholding processor for Fourier images based on the amplitude component.
Definition: processor.h:3237

◆ process_inplace()

void BinarizeFourierProcessor::process_inplace ( EMData image)
virtual
Exceptions
ImageFormatExceptionif the input image is not complex Note result is always in real-imaginary format

Implements EMAN::Processor.

Definition at line 5314 of file processor.cpp.

5314 {
5315 ENTERFUNC;
5316 if (!image->is_complex()) throw ImageFormatException("Fourier binary thresholding processor only works for complex images");
5317
5318 float threshold = params.set_default("value",0.0f);
5319 image->ri2ap(); // works for cuda
5320
5321 float* d = image->get_data();
5322 for( size_t i = 0; i < image->get_size()/2; ++i, d+=2) {
5323 if ( *d < threshold ) {
5324 *d = 0;
5325 *(d+1) = 0;
5326 }
5327 }
5328 image->ap2ri();
5329 image->set_ri(true); // So it can be used for fourier multiplaction, for example
5330 image->update();
5331 EXITFUNC;
5332}
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
#define ImageFormatException(desc)
Definition: exception.h:147
#define ENTERFUNC
Definition: log.h:48
#define EXITFUNC
Definition: log.h:49

References ENTERFUNC, EXITFUNC, ImageFormatException, EMAN::Processor::params, and EMAN::Dict::set_default().

Member Data Documentation

◆ NAME

const string BinarizeFourierProcessor::NAME = "threshold.binary.fourier"
static

Definition at line 3266 of file processor.h.

Referenced by get_name().


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