#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 6903 of file processor.h. 06904 {
06905 return "Creates a skeleton of the 3D image by considering whether density is above or below a threshold value.";
06906 }
|
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 6894 of file processor.h. 06895 {
06896 return NAME;
06897 // return "gorgon.binary_skel";
06898 }
|
|
|
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 6907 of file processor.h. References EMAN::TypeDict::put(). 06908 {
06909 TypeDict d;
06910 d.put("threshold", EMObject::FLOAT, "Threshold value.");
06911 d.put("min_curve_width", EMObject::INT, "Minimum curve width.");
06912 d.put("min_surface_width", EMObject::INT, "Minimum surface width.");
06913 d.put("mark_surfaces", EMObject::BOOL, "Mark surfaces with a value of 2.0f, whereas curves are 1.0f.");
06914 return d;
06915 }
|
|
|
Definition at line 6899 of file processor.h. 06900 {
06901 return new BinarySkeletonizerProcessor();
06902 }
|
|
|
Definition at line 9698 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(). 09699 {
09700 using namespace wustl_mm::GraySkeletonCPP;
09701 using namespace wustl_mm::SkeletonMaker;
09702
09703 Volume * vimage = new Volume(image);
09704 float threshold = params["threshold"];
09705 int min_curvew = params.set_default("min_curve_width", 4);
09706 int min_srfcw = params.set_default("min_surface_width", 4);
09707 bool mark_surfaces = params.set_default("mark_surfaces", true);
09708 Volume* vskel = VolumeSkeletonizer::PerformPureJuSkeletonization(vimage, "unused", static_cast<double>(threshold), min_curvew, min_srfcw);
09709 //VolumeSkeletonizer::CleanUpSkeleton(vskel, 4, 0.01f);
09710 if (mark_surfaces) {
09711 VolumeSkeletonizer::MarkSurfaces(vskel);
09712 }
09713
09714 vskel->getVolumeData()->owns_emdata = false; //ensure the EMData object will remain when the Volume and its VolumeData object are freed
09715 EMData* skel = vskel->get_emdata();
09716 skel->update();
09717 return skel;
09718 }
|
|
|
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 9720 of file processor.cpp. References process(), and EMAN::EMData::update(). 09721 {
09722 EMData* em_skel = this->process(image);
09723 //TODO: use memcpy and copy metadata explicitly
09724 *image = *em_skel; //Deep copy performed by EMData::operator=
09725 image->update();
09726 delete em_skel;
09727 em_skel = NULL;
09728 return;
09729 }
|
|
|
Definition at line 219 of file processor.cpp. |
1.3.9.1