EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
EMAN::BinaryOperateProcessor< Type > Class Template Reference

Operates on two images, returning an image containing the maximum/minimum/multiplied pixel (etc, you choose) at each location The actual operation depends on what template argument you use. More...

#include <processor.h>

Inheritance diagram for EMAN::BinaryOperateProcessor< Type >:
Inheritance graph
[legend]
Collaboration diagram for EMAN::BinaryOperateProcessor< Type >:
Collaboration graph
[legend]

Public Member Functions

virtual void process_inplace (EMData *image)
 
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
 

Private Attributes

Type op
 

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

template<class Type>
class EMAN::BinaryOperateProcessor< Type >

Operates on two images, returning an image containing the maximum/minimum/multiplied pixel (etc, you choose) at each location The actual operation depends on what template argument you use.

Currently the MaxPixelOperator and MinPixelOperator are the only ones utilized - see processor.cpp where the Processor Factory constructor is defined to get an idea of how to add another one Initially added at the request of Dr Matthew Baker NOTE: binary is meant in the sense of the standard algorithms, NOT in the sense of a black and white image

Parameters
withthe other image that will be used generate the image with the maximum (or minimum, etc) pixel values
Author
David Woolford
Date
June 2009

Definition at line 7780 of file processor.h.

Member Function Documentation

◆ get_desc()

template<class Type >
virtual string EMAN::BinaryOperateProcessor< Type >::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 7805 of file processor.h.

7806 {
7807 return op.get_desc();
7808 }

References EMAN::BinaryOperateProcessor< Type >::op.

◆ get_name()

template<class Type >
virtual string EMAN::BinaryOperateProcessor< Type >::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 7800 of file processor.h.

7801 {
7802 return op.get_name();
7803 }

References EMAN::BinaryOperateProcessor< Type >::op.

◆ get_param_types()

template<class Type >
virtual TypeDict EMAN::BinaryOperateProcessor< Type >::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 7815 of file processor.h.

7816 {
7817 TypeDict d;
7818 d.put("with", EMObject::EMDATA,"The second image");
7819 return d;
7820 }
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::EMDATA, and EMAN::TypeDict::put().

◆ NEW()

template<class Type >
static Processor * EMAN::BinaryOperateProcessor< Type >::NEW ( )
inlinestatic

Definition at line 7810 of file processor.h.

7811 {
7812 return new BinaryOperateProcessor<Type>();
7813 }
Operates on two images, returning an image containing the maximum/minimum/multiplied pixel (etc,...
Definition: processor.h:7780

◆ process_inplace()

template<class Type >
virtual void EMAN::BinaryOperateProcessor< Type >::process_inplace ( EMData image)
inlinevirtual
Exceptions
InvalidParameterExceptionif with is not specified
ImageDimensionExceptionif image dimensions do not match

Implements EMAN::Processor.

Definition at line 7786 of file processor.h.

7786 {
7787 if ( ! params.has_key("with") ) throw InvalidParameterException("You must supply the \"with\" parameter");
7788 EMData* with = params["with"];
7789
7790 if ( with->get_xsize() != image->get_xsize() || with->get_ysize() != image->get_ysize() || with->get_zsize() != image->get_zsize() )
7791 throw ImageDimensionException("The images you are operating on do not have the same dimensions");
7792
7793 float* image_data = image->get_data();
7794 float* with_data = with->get_data();
7795
7796 std::transform(image_data,image_data+image->get_size(),with_data,image_data,Type::binary_operate);
7797 image->update();
7798 }
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
#define InvalidParameterException(desc)
Definition: exception.h:361
#define ImageDimensionException(desc)
Definition: exception.h:166

References EMAN::Dict::has_key(), ImageDimensionException, InvalidParameterException, and EMAN::Processor::params.

Member Data Documentation

◆ NAME

template<class Type >
const string EMAN::BinaryOperateProcessor< Type >::NAME
static

Definition at line 7822 of file processor.h.

◆ op

template<class Type >
Type EMAN::BinaryOperateProcessor< Type >::op
private

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