#include <processor.h>
Inheritance diagram for EMAN::BinarySkeletonizerProcessor:
Public Member Functions | |
virtual EMData * | process (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 | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "gorgon.binary_skel" |
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 7058 of file processor.h. 07059 { 07060 return "Creates a skeleton of the 3D image by considering whether density is above or below a threshold value."; 07061 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 7049 of file processor.h. 07050 { 07051 return NAME; 07052 // return "gorgon.binary_skel"; 07053 }
|
|
Get processor parameter information in a dictionary. Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
Reimplemented from EMAN::Processor. Definition at line 7062 of file processor.h. References EMAN::TypeDict::put(). 07063 { 07064 TypeDict d; 07065 d.put("threshold", EMObject::FLOAT, "Threshold value."); 07066 d.put("min_curve_width", EMObject::INT, "Minimum curve width."); 07067 d.put("min_surface_width", EMObject::INT, "Minimum surface width."); 07068 d.put("mark_surfaces", EMObject::BOOL, "Mark surfaces with a value of 2.0f, whereas curves are 1.0f."); 07069 return d; 07070 }
|
|
Definition at line 7054 of file processor.h. 07055 { 07056 return new BinarySkeletonizerProcessor(); 07057 }
|
|
Definition at line 9966 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(). 09967 { 09968 using namespace wustl_mm::GraySkeletonCPP; 09969 using namespace wustl_mm::SkeletonMaker; 09970 09971 Volume * vimage = new Volume(image); 09972 float threshold = params["threshold"]; 09973 int min_curvew = params.set_default("min_curve_width", 4); 09974 int min_srfcw = params.set_default("min_surface_width", 4); 09975 bool mark_surfaces = params.set_default("mark_surfaces", true); 09976 Volume* vskel = VolumeSkeletonizer::PerformPureJuSkeletonization(vimage, "unused", static_cast<double>(threshold), min_curvew, min_srfcw); 09977 //VolumeSkeletonizer::CleanUpSkeleton(vskel, 4, 0.01f); 09978 if (mark_surfaces) { 09979 VolumeSkeletonizer::MarkSurfaces(vskel); 09980 } 09981 09982 vskel->getVolumeData()->owns_emdata = false; //ensure the EMData object will remain when the Volume and its VolumeData object are freed 09983 EMData* skel = vskel->get_emdata(); 09984 skel->update(); 09985 return skel; 09986 }
|
|
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.
Implements EMAN::Processor. Definition at line 9988 of file processor.cpp. References process(), and EMAN::EMData::update(). 09989 { 09990 EMData* em_skel = this->process(image); 09991 //TODO: use memcpy and copy metadata explicitly 09992 *image = *em_skel; //Deep copy performed by EMData::operator= 09993 image->update(); 09994 delete em_skel; 09995 em_skel = NULL; 09996 return; 09997 }
|
|
Definition at line 220 of file processor.cpp. |