EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes
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

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "gorgon.binary_skel"

Detailed Description

Definition at line 7415 of file processor.h.


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 7430 of file processor.h.

                {
                        return "Creates a skeleton of the 3D image by considering whether density is above or below a threshold value.";
                }
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 7421 of file processor.h.

References NAME.

                {
                        return NAME;
//                      return "gorgon.binary_skel";
                }
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 7434 of file processor.h.

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

                {
                        TypeDict d;
                        d.put("threshold", EMObject::FLOAT, "Threshold value.");
                        d.put("min_curve_width", EMObject::INT, "Minimum curve width.");
                        d.put("min_surface_width", EMObject::INT, "Minimum surface width.");
                        d.put("mark_surfaces", EMObject::BOOL, "Mark surfaces with a value of 2.0f, whereas curves are 1.0f.");
                        return d;
                }
static Processor* EMAN::BinarySkeletonizerProcessor::NEW ( ) [inline, static]

Definition at line 7426 of file processor.h.

                {
                        return new BinarySkeletonizerProcessor();
                }
EMData * BinarySkeletonizerProcessor::process ( EMData image) [virtual]

Definition at line 10602 of file processor.cpp.

References EMAN::Processor::params, EMAN::Dict::set_default(), and EMAN::EMData::update().

{
        using namespace wustl_mm::GraySkeletonCPP;
        using namespace wustl_mm::SkeletonMaker;

        Volume * vimage = new Volume(image);
        float threshold = params["threshold"];
        int min_curvew = params.set_default("min_curve_width", 4);
        int min_srfcw = params.set_default("min_surface_width", 4);
        bool mark_surfaces = params.set_default("mark_surfaces", true);
        Volume* vskel = VolumeSkeletonizer::PerformPureJuSkeletonization(vimage, "unused", static_cast<double>(threshold), min_curvew, min_srfcw);
        //VolumeSkeletonizer::CleanUpSkeleton(vskel, 4, 0.01f);
        if (mark_surfaces) {
                VolumeSkeletonizer::MarkSurfaces(vskel);
        }

        vskel->getVolumeData()->owns_emdata = false; //ensure the EMData object will remain when the Volume and its VolumeData object are freed
        EMData* skel = vskel->get_emdata();
        skel->update();
        return skel;
}
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:
imageThe image to be processed.

Implements EMAN::Processor.

Definition at line 10624 of file processor.cpp.

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

{
        EMData* em_skel = this->process(image);
        //TODO: use memcpy and copy metadata explicitly
        *image = *em_skel; //Deep copy performed by EMData::operator=
        image->update();
        delete em_skel;
        em_skel = NULL;
        return;
}

Member Data Documentation

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

Definition at line 7443 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files: