#include <processor.h>
Inheritance diagram for EMAN::ConvolutionProcessor:
Public Member Functions | |
ConvolutionProcessor () | |
string | get_name () const |
Get the processor's name. | |
void | process_inplace (EMData *image) |
To process an image in-place. | |
string | get_desc () const |
Get the descrition of this specific processor. | |
TypeDict | get_param_types () const |
Get processor parameter information in a dictionary. | |
Static Public Member Functions | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "math.convolution" |
with | The image that will convolute the other image |
Definition at line 516 of file processor.h.
|
Definition at line 519 of file processor.h. 00519 {}
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 533 of file processor.h. 00534 { 00535 return "Performs Fourier space convolution. Maintains the space that the image is in - i.e. if image is real, the result is real and vice versa."; 00536 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 521 of file processor.h. 00522 {
00523 return NAME;
00524 }
|
|
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 538 of file processor.h. References EMAN::TypeDict::put(). 00539 { 00540 TypeDict d; 00541 d.put("with", EMObject::EMDATA, "The image that will convolute the other image"); 00542 return d; 00543 }
|
|
Definition at line 528 of file processor.h. 00529 { 00530 return new ConvolutionProcessor(); 00531 }
|
|
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.
Implements EMAN::Processor. Definition at line 9445 of file processor.cpp. References EMAN::CIRCULANT, EMAN::CONVOLUTION, EMAN::fourierproduct(), EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), InvalidParameterException, nx, ny, EMAN::Dict::set_default(), and EMAN::EMData::update(). 09446 { 09447 //bool complexflag = false; 09448 EMData* null = 0; 09449 EMData* with = params.set_default("with", null); 09450 if ( with == NULL ) throw InvalidParameterException("Error - the image required for the convolution is null"); 09451 09452 EMData* newimage = fourierproduct(image, with, CIRCULANT, CONVOLUTION, false); 09453 09454 float* orig = image->get_data(); 09455 float* work = newimage->get_data(); 09456 int nx = image->get_xsize(); 09457 int ny = image->get_ysize(); 09458 int nz = image->get_zsize(); 09459 memcpy(orig,work,nx*ny*nz*sizeof(float)); 09460 image->update(); 09461 09462 delete newimage; 09463 }
|
|
Definition at line 62 of file processor.cpp. |