Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EMAN::BinarySkeletonizerProcessor Class Reference

#include <processor.h>

Inheritance diagram for EMAN::BinarySkeletonizerProcessor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual EMDataprocess (EMData *image)
virtual void process_inplace (EMData *image)
 To process an image in-place.
virtual string get_name () const
 Get the processor's name.
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 = "gorgon.binary_skel"

Member Function Documentation

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

06763                 {
06764                         return "Creates a skeleton of the 3D image by considering whether density is above or below a threshold value.";
06765                 }

virtual string EMAN::BinarySkeletonizerProcessor::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 6753 of file processor.h.

06754                 {
06755                         return NAME;
06756 //                      return "gorgon.binary_skel";
06757                 }

virtual TypeDict EMAN::BinarySkeletonizerProcessor::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 6766 of file processor.h.

References EMAN::TypeDict::put().

06767                 {
06768                         TypeDict d;
06769                         d.put("threshold", EMObject::FLOAT, "Threshold value.");
06770                         d.put("min_curve_width", EMObject::INT, "Minimum curve width.");
06771                         d.put("min_surface_width", EMObject::INT, "Minimum surface width.");
06772                         d.put("mark_surfaces", EMObject::BOOL, "Mark surfaces with a value of 2.0f, whereas curves are 1.0f.");
06773                         return d;
06774                 }

Processor* EMAN::BinarySkeletonizerProcessor::NEW  )  [inline, static]
 

Definition at line 6758 of file processor.h.

06759                 {
06760                         return new BinarySkeletonizerProcessor();
06761                 }

EMData * BinarySkeletonizerProcessor::process EMData image  )  [virtual]
 

Definition at line 9984 of file processor.cpp.

References wustl_mm::SkeletonMaker::Volume::get_emdata(), wustl_mm::SkeletonMaker::Volume::getVolumeData(), wustl_mm::SkeletonMaker::VolumeData::owns_emdata, EMAN::Dict::set_default(), and EMAN::EMData::update().

Referenced by process_inplace().

09985 {
09986         using namespace wustl_mm::GraySkeletonCPP;
09987         using namespace wustl_mm::SkeletonMaker;
09988 
09989         Volume * vimage = new Volume(image);
09990         float threshold = params["threshold"];
09991         int min_curvew = params.set_default("min_curve_width", 4);
09992         int min_srfcw = params.set_default("min_surface_width", 4);
09993         bool mark_surfaces = params.set_default("mark_surfaces", true);
09994         Volume* vskel = VolumeSkeletonizer::PerformPureJuSkeletonization(vimage, "unused", static_cast<double>(threshold), min_curvew, min_srfcw);
09995         //VolumeSkeletonizer::CleanUpSkeleton(vskel, 4, 0.01f);
09996         if (mark_surfaces) {
09997                 VolumeSkeletonizer::MarkSurfaces(vskel);
09998         }
09999 
10000         vskel->getVolumeData()->owns_emdata = false; //ensure the EMData object will remain when the Volume and its VolumeData object are freed
10001         EMData* skel = vskel->get_emdata();
10002         skel->update();
10003         return skel;
10004 }

void BinarySkeletonizerProcessor::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 10006 of file processor.cpp.

References process(), and EMAN::EMData::update().

10007 {
10008         EMData* em_skel = this->process(image);
10009         //TODO: use memcpy and copy metadata explicitly
10010         *image = *em_skel; //Deep copy performed by EMData::operator=
10011         image->update();
10012         delete em_skel;
10013         em_skel = NULL;
10014         return;
10015 }


Member Data Documentation

const string BinarySkeletonizerProcessor::NAME = "gorgon.binary_skel" [static]
 

Definition at line 214 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Dec 9 13:48:29 2010 for EMAN2 by  doxygen 1.3.9.1