#include <processor.h>
Inheritance diagram for EMAN::BinaryOperateProcessor< Type >:
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 | |||||||
static Processor * | NEW () | ||||||
Static Public Attributes | |||||||
static const string | NAME | ||||||
Private Attributes | |||||||
Type | op |
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
with | the other image that will be used generate the image with the maximum (or minimum, etc) pixel values |
Definition at line 5657 of file processor.h.
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.
Implements EMAN::Processor.
Definition at line 5682 of file processor.h.
References EMAN::BinaryOperateProcessor< Type >::op.
05683 { 05684 return op.get_desc(); 05685 }
virtual string EMAN::BinaryOperateProcessor< Type >::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 5677 of file processor.h.
References EMAN::BinaryOperateProcessor< Type >::op.
05678 { 05679 return op.get_name(); 05680 }
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.
Reimplemented from EMAN::Processor.
Definition at line 5692 of file processor.h.
References EMAN::EMObject::EMDATA, and EMAN::TypeDict::put().
05693 { 05694 TypeDict d; 05695 d.put("with", EMObject::EMDATA,"The second image"); 05696 return d; 05697 }
static Processor* EMAN::BinaryOperateProcessor< Type >::NEW | ( | ) | [inline, static] |
Definition at line 5687 of file processor.h.
05688 { 05689 return new BinaryOperateProcessor<Type>(); 05690 }
virtual void EMAN::BinaryOperateProcessor< Type >::process_inplace | ( | EMData * | image | ) | [inline, virtual] |
InvalidParameterException | if with is not specified | |
ImageDimensionException | if image dimensions do not match |
Implements EMAN::Processor.
Definition at line 5663 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, EMAN::Processor::params, and EMAN::EMData::update().
05663 { 05664 if ( ! params.has_key("with") ) throw InvalidParameterException("You must supply the \"with\" parameter"); 05665 EMData* with = params["with"]; 05666 05667 if ( with->get_xsize() != image->get_xsize() || with->get_ysize() != image->get_ysize() || with->get_zsize() != image->get_zsize() ) 05668 throw ImageDimensionException("The images you are operating on do not have the same dimensions"); 05669 05670 float* image_data = image->get_data(); 05671 float* with_data = with->get_data(); 05672 05673 std::transform(image_data,image_data+image->get_size(),with_data,image_data,Type::binary_operate); 05674 image->update(); 05675 }
const string EMAN::BinaryOperateProcessor< Type >::NAME [static] |
Definition at line 5699 of file processor.h.
Type EMAN::BinaryOperateProcessor< Type >::op [private] |
Definition at line 5701 of file processor.h.
Referenced by EMAN::BinaryOperateProcessor< Type >::get_desc(), and EMAN::BinaryOperateProcessor< Type >::get_name().