EMAN::ZGradientProcessor Class Reference

#include <processor.h>

Inheritance diagram for EMAN::ZGradientProcessor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ZGradientProcessor ()
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

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "math.edge.zgradient"

Detailed Description

Definition at line 592 of file processor.h.


Constructor & Destructor Documentation

EMAN::ZGradientProcessor::ZGradientProcessor (  )  [inline]

Definition at line 595 of file processor.h.

Referenced by NEW().

00595 {}


Member Function Documentation

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

00610                         {
00611                                 return "Determines the image gradient in the z direction";
00612                         }

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

References NAME.

00598                         {
00599                                 return NAME;
00600                         }

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

00615                         {
00616                                 TypeDict d;
00617                                 return d;
00618                         }

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

Definition at line 604 of file processor.h.

References ZGradientProcessor().

00605                         {
00606                                 return new ZGradientProcessor();
00607                         }

void ZGradientProcessor::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 9567 of file processor.cpp.

References EMAN::EMData::clip_inplace(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), ImageDimensionException, ImageFormatException, EMAN::EMData::is_complex(), EMAN::EMData::process_inplace(), EMAN::EMData::set_size(), and EMAN::EMData::set_value_at().

09568 {
09569         if (image->is_complex()) throw ImageFormatException("Cannot edge detect a complex image");
09570 
09571         EMData* e = new EMData();
09572         int nx = image->get_xsize();
09573         int ny = image->get_ysize();
09574         int nz = image->get_zsize();
09575 
09576         if ( nx < 3 || ny < 3 || nz < 3) throw ImageDimensionException("Error - cannot edge detect in the z direction with any dimension being less than three pixels");
09577 
09578         e->set_size(3,3,3);
09579         e->set_value_at(0,0,0,-1);
09580         e->set_value_at(1,0,0,-1);
09581         e->set_value_at(2,0,0,-1);
09582         e->set_value_at(0,1,0,-1);
09583         e->set_value_at(1,1,0,-8);
09584         e->set_value_at(2,1,0,-1);
09585         e->set_value_at(0,2,0,-1);
09586         e->set_value_at(1,2,0,-1);
09587         e->set_value_at(2,2,0,-1);
09588 
09589         e->set_value_at(0,0,2,1);
09590         e->set_value_at(1,0,2,1);
09591         e->set_value_at(2,0,2,1);
09592         e->set_value_at(0,1,2,1);
09593         e->set_value_at(1,1,2,8);
09594         e->set_value_at(2,1,2,1);
09595         e->set_value_at(0,2,2,1);
09596         e->set_value_at(1,2,2,1);
09597         e->set_value_at(2,2,2,1);
09598 
09599         Region r = Region(-nx/2+1,-ny/2+1,-nz/2+1,nx,ny,nz);
09600         e->clip_inplace(r);
09601 
09602         Dict conv_parms;
09603         conv_parms["with"] = e;
09604         image->process_inplace("math.convolution", conv_parms);
09605 
09606         delete e;
09607 }


Member Data Documentation

const string ZGradientProcessor::NAME = "math.edge.zgradient" [static]

Definition at line 620 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files:
Generated on Thu Nov 17 12:45:51 2011 for EMAN2 by  doxygen 1.4.7