Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File 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 >:

[legend]
Collaboration diagram for EMAN::BinaryOperateProcessor< Type >:
[legend]
List of all members.

Public Member Functions

virtual void process_inplace (EMData *image)
virtual string get_name () const
 Get the processor's name.
virtual string get_desc () const
 Get the descrition of this specific processor.
virtual TypeDict get_param_types () const
 Get processor parameter information in a dictionary.

Static Public Member Functions

ProcessorNEW ()

Static Public Attributes

const string NAME

Private Attributes

Type op

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:
with the 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 5533 of file processor.h.


Member Function Documentation

template<class Type>
virtual string EMAN::BinaryOperateProcessor< Type >::get_desc  )  const [inline, virtual]
 

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 5558 of file processor.h.

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

05559                         {
05560                                 return op.get_desc();
05561                         }

template<class Type>
virtual string EMAN::BinaryOperateProcessor< Type >::get_name  )  const [inline, virtual]
 

Get the processor's name.

Each processor is identified by a unique name.

Returns:
The processor's name.

Implements EMAN::Processor.

Definition at line 5553 of file processor.h.

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

05554                         {
05555                                 return op.get_name();
05556                         }

template<class Type>
virtual TypeDict EMAN::BinaryOperateProcessor< Type >::get_param_types  )  const [inline, virtual]
 

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 5568 of file processor.h.

References EMAN::TypeDict::put().

05569                         {
05570                                 TypeDict d;
05571                                 d.put("with", EMObject::EMDATA,"The second image");
05572                                 return d;
05573                         }

template<class Type>
Processor* EMAN::BinaryOperateProcessor< Type >::NEW  )  [inline, static]
 

Definition at line 5563 of file processor.h.

05564                         {
05565                                 return new BinaryOperateProcessor<Type>();
05566                         }

template<class Type>
virtual void EMAN::BinaryOperateProcessor< Type >::process_inplace EMData image  )  [inline, virtual]
 

Exceptions:
InvalidParameterException if with is not specified
ImageDimensionException if image dimensions do not match

Implements EMAN::Processor.

Definition at line 5539 of file processor.h.

References EMAN::EMData::get_data(), EMAN::EMData::get_size(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), EMAN::Dict::has_key(), ImageDimensionException, InvalidParameterException, and EMAN::EMData::update().

05539                                                                      {
05540                                 if ( ! params.has_key("with") ) throw InvalidParameterException("You must supply the \"with\" parameter");
05541                                 EMData* with = params["with"];
05542 
05543                                 if ( with->get_xsize() != image->get_xsize() || with->get_ysize() != image->get_ysize() || with->get_zsize() != image->get_zsize() )
05544                                         throw ImageDimensionException("The images you are operating on do not have the same dimensions");
05545 
05546                                 float* image_data = image->get_data();
05547                                 float* with_data = with->get_data();
05548 
05549                                 std::transform(image_data,image_data+image->get_size(),with_data,image_data,Type::binary_operate);
05550                                 image->update();
05551                         }


Member Data Documentation

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

Definition at line 5575 of file processor.h.

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

Definition at line 5577 of file processor.h.

Referenced by EMAN::BinaryOperateProcessor< Type >::get_desc(), and EMAN::BinaryOperateProcessor< Type >::get_name().


The documentation for this class was generated from the following file:
Generated on Fri Apr 30 15:39:27 2010 for EMAN2 by  doxygen 1.3.9.1