EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
EMAN::BinarySkeletonizerProcessor Class Reference

#include <processor.h>

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

Public Member Functions

virtual EMDataprocess (EMData *image)
 
virtual void process_inplace (EMData *image)
 To process an image in-place. More...
 
virtual string get_name () const
 Get the processor's name. More...
 
string get_desc () const
 Get the descrition of this specific processor. More...
 
virtual TypeDict get_param_types () const
 Get processor parameter information in a dictionary. More...
 
- Public Member Functions inherited from EMAN::Processor
virtual ~Processor ()
 
virtual EMDataprocess (const EMData *const image)
 To proccess an image out-of-place. More...
 
virtual void process_list_inplace (vector< EMData * > &images)
 To process multiple images using the same algorithm. More...
 
virtual Dict get_params () const
 Get the processor parameters in a key/value dictionary. More...
 
virtual void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary. More...
 

Static Public Member Functions

static ProcessorNEW ()
 
- Static Public Member Functions inherited from EMAN::Processor
static string get_group_desc ()
 Get the description of this group of processors. More...
 
static void EMFourierFilterInPlace (EMData *fimage, Dict params)
 Compute a Fourier-filter processed image in place. More...
 
static EMDataEMFourierFilter (EMData *fimage, Dict params)
 Compute a Fourier-processor processed image without altering the original image. More...
 

Static Public Attributes

static const string NAME ="gorgon.binary_skel"
 

Additional Inherited Members

- Public Types inherited from EMAN::Processor
enum  fourier_filter_types {
  TOP_HAT_LOW_PASS , TOP_HAT_HIGH_PASS , TOP_HAT_BAND_PASS , TOP_HOMOMORPHIC ,
  GAUSS_LOW_PASS , GAUSS_HIGH_PASS , GAUSS_BAND_PASS , GAUSS_INVERSE ,
  GAUSS_HOMOMORPHIC , BUTTERWORTH_LOW_PASS , BUTTERWORTH_HIGH_PASS , BUTTERWORTH_HOMOMORPHIC ,
  KAISER_I0 , KAISER_SINH , KAISER_I0_INVERSE , KAISER_SINH_INVERSE ,
  SHIFT , TANH_LOW_PASS , TANH_HIGH_PASS , TANH_HOMOMORPHIC ,
  TANH_BAND_PASS , RADIAL_TABLE , CTF_
}
 Fourier filter Processor type enum. More...
 
- Protected Attributes inherited from EMAN::Processor
Dict params
 

Detailed Description

Definition at line 9308 of file processor.h.

Member Function Documentation

◆ get_desc()

string EMAN::BinarySkeletonizerProcessor::get_desc ( ) const
inlinevirtual

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

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

◆ get_name()

virtual string EMAN::BinarySkeletonizerProcessor::get_name ( ) const
inlinevirtual

Get the processor's name.

Each processor is identified by a unique name.

Returns
The processor's name.

Implements EMAN::Processor.

Definition at line 9314 of file processor.h.

9315 {
9316 return NAME;
9317// return "gorgon.binary_skel";
9318 }

References NAME.

◆ get_param_types()

virtual TypeDict EMAN::BinarySkeletonizerProcessor::get_param_types ( ) const
inlinevirtual

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

9328 {
9329 TypeDict d;
9330 d.put("threshold", EMObject::FLOAT, "Threshold value.");
9331 d.put("min_curve_width", EMObject::INT, "Minimum curve width.");
9332 d.put("min_surface_width", EMObject::INT, "Minimum surface width.");
9333 d.put("mark_surfaces", EMObject::BOOL, "Mark surfaces with a value of 2.0f, whereas curves are 1.0f.");
9334 return d;
9335 }
TypeDict is a dictionary to store <string, EMObject::ObjectType> pair.
Definition: emobject.h:305
void put(const string &key, EMObject::ObjectType o, const string &desc="")
Definition: emobject.h:330

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

◆ NEW()

static Processor * EMAN::BinarySkeletonizerProcessor::NEW ( )
inlinestatic

Definition at line 9319 of file processor.h.

◆ process()

EMData * BinarySkeletonizerProcessor::process ( EMData image)
virtual

Definition at line 13291 of file processor.cpp.

13292{
13293 using namespace wustl_mm::GraySkeletonCPP;
13294 using namespace wustl_mm::SkeletonMaker;
13295
13296 Volume * vimage = new Volume(image);
13297 float threshold = params["threshold"];
13298 int min_curvew = params.set_default("min_curve_width", 4);
13299 int min_srfcw = params.set_default("min_surface_width", 4);
13300 bool mark_surfaces = params.set_default("mark_surfaces", true);
13301 Volume* vskel = VolumeSkeletonizer::PerformPureJuSkeletonization(vimage, "unused", static_cast<double>(threshold), min_curvew, min_srfcw);
13302 //VolumeSkeletonizer::CleanUpSkeleton(vskel, 4, 0.01f);
13303 if (mark_surfaces) {
13304 VolumeSkeletonizer::MarkSurfaces(vskel);
13305 }
13306
13307 vskel->getVolumeData()->owns_emdata = false; //ensure the EMData object will remain when the Volume and its VolumeData object are freed
13308 EMData* skel = vskel->get_emdata();
13309 skel->update();
13310 return skel;
13311}
type set_default(const string &key, type val)
Default setting behavior This can be achieved using a template - d.woolford Jan 2008 (before there wa...
Definition: emobject.h:569
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
VolumeData * getVolumeData()
Definition: volume.cpp:69

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

Referenced by process_inplace().

◆ process_inplace()

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 13313 of file processor.cpp.

13314{
13315 EMData* em_skel = this->process(image);
13316 //TODO: use memcpy and copy metadata explicitly
13317 *image = *em_skel; //Deep copy performed by EMData::operator=
13318 image->update();
13319 delete em_skel;
13320 em_skel = NULL;
13321 return;
13322}
virtual EMData * process(EMData *image)

References process().

Member Data Documentation

◆ NAME

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

Definition at line 9336 of file processor.h.

Referenced by get_name().


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