How to use the command code of ExtractSkeleton

I went calculat a skeleton by input a script for a label, then I read the code of Slicer/Modules/CLI/ExtractSkeleton/.

void ExtractSkeletalGraph(const unsigned char *image, const int dim[3]);

// Extract maximal path between 2 points in the m_Graph
void FindMaximalPath();

// Sample points along the maximal path.
// requestedNumberOfPoints is an approximate number of points to be returned.
void SampleAlongMaximalPath(int requestedNumberOfPoints, std::deque &axis_points);

I used slicer.modules.ExtractSkeleton.ExtractSkeletalGraph(label-1,3),but slicer tell me couldnot found module “ExtractSkeleton”.

If I went run extractskeleton like the follow pictrue, which codes I should write?
Thanks.
360%E6%88%AA%E5%9B%BE-233030281

Type slicer.modules.extractskeleton in the Python console and you’ll see that object type is qSlicerCLIModule, which means that it is a CLI module. See how to run CLI modules from Python here.

1 Like