EMAN::Wiener2DAutoAreaProcessor Class Reference

Automatically determines the background for the image then uses this to perform Wiener filters on overlapping subregions of the image, which are then combined using linear interpolation. More...

#include <processor.h>

Inheritance diagram for EMAN::Wiener2DAutoAreaProcessor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

string get_name () const
 Get the processor's name.
virtual EMDataprocess (const EMData *const image)
 To proccess an image out-of-place.
void process_inplace (EMData *image)
 To process an image in-place.
void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary.
TypeDict get_param_types () const
 Get processor parameter information in a dictionary.
string get_desc () const
 Get the descrition of this specific processor.

Static Public Member Functions

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "filter.wiener2dauto"

Protected Attributes

int bgsize

Detailed Description

Automatically determines the background for the image then uses this to perform Wiener filters on overlapping subregions of the image, which are then combined using linear interpolation.

Parameters:
size[in] size in pixels of the boxes to chop the image into during processing
Author:
Steve Ludtke
Date:
2007/11/06

Definition at line 631 of file processor.h.


Member Function Documentation

string EMAN::Wiener2DAutoAreaProcessor::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 662 of file processor.h.

00663                 {
00664                         return "Automatically detrmines the background for the image then uses this to perform Wiener filters on overlapping subregions of the image, which are then combined using linear interpolation";
00665                 }

string EMAN::Wiener2DAutoAreaProcessor::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 634 of file processor.h.

References NAME.

00635                 {
00636                         return NAME;
00637                 }

TypeDict EMAN::Wiener2DAutoAreaProcessor::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 650 of file processor.h.

References EMAN::EMObject::INT, and EMAN::TypeDict::put().

00651                 {
00652                         TypeDict d;
00653                         d.put("size", EMObject::INT, "Size in pixels of the boxes to chop the image into");
00654                         return d;
00655                 }

static Processor* EMAN::Wiener2DAutoAreaProcessor::NEW (  )  [inline, static]

Definition at line 657 of file processor.h.

00658                 {
00659                         return new Wiener2DAutoAreaProcessor();
00660                 }

EMData * Wiener2DAutoAreaProcessor::process ( const EMData *const   image  )  [virtual]

To proccess an image out-of-place.

For those processors which can only be processed out-of-place, override this function to give the right behavior.

Parameters:
image The image will be copied, actual process happen on copy of image.
Returns:
the image processing result, may or may not be the same size of the input image

Reimplemented from EMAN::Processor.

Definition at line 960 of file processor.cpp.

References EMAN::EMData::do_fft(), EMAN::EMData::get_data(), EMAN::EMData::is_complex(), LOGWARN, and NullPointerException.

Referenced by process_inplace().

00961 {
00962 // TODO NOT IMPLEMENTED YET !!!
00963         EMData *ret = 0;
00964         const EMData *fft;
00965         float *fftd;
00966         int f=0;
00967 
00968         if (!image) {
00969                 LOGWARN("NULL Image");
00970                 return ret;
00971         }
00972         throw NullPointerException("Processor not yet implemented");
00973 
00974         if (!image->is_complex()) {
00975                 fft = image->do_fft();
00976                 fftd = fft->get_data();
00977                 f=1;
00978         }
00979         else {
00980                 fft=image;
00981                 fftd=image->get_data();
00982         }
00983 
00984         return ret;
00985 }

void Wiener2DAutoAreaProcessor::process_inplace ( EMData image  )  [virtual]

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.

Parameters:
image The image to be processed.

Implements EMAN::Processor.

Definition at line 987 of file processor.cpp.

References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), process(), and EMAN::EMData::update().

00987                                                              {
00988         EMData *tmp=process(image);
00989         memcpy(image->get_data(),tmp->get_data(),image->get_xsize()*image->get_ysize()*image->get_zsize()*sizeof(float));
00990         delete tmp;
00991         image->update();
00992         return;
00993 }

void EMAN::Wiener2DAutoAreaProcessor::set_params ( const Dict new_params  )  [inline, virtual]

Set the processor parameters using a key/value dictionary.

Parameters:
new_params A dictionary containing the new parameters.

Reimplemented from EMAN::Processor.

Definition at line 643 of file processor.h.

References bgsize, and EMAN::Processor::params.

00644                 {
00645                         params = new_params;
00646                         bgsize = params["size"];
00647 //                      printf("%s %f\n",params.keys()[0].c_str(),lowpass);
00648                 }


Member Data Documentation

int EMAN::Wiener2DAutoAreaProcessor::bgsize [protected]

Definition at line 670 of file processor.h.

Referenced by set_params().

const string Wiener2DAutoAreaProcessor::NAME = "filter.wiener2dauto" [static]

Definition at line 667 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files:
Generated on Tue May 25 17:16:22 2010 for EMAN2 by  doxygen 1.4.7