# How to use the command code of ExtractSkeleton

**URL:** <https://discourse.slicer.org/t/how-to-use-the-command-code-of-extractskeleton/5410>\
**Category:** Support\
**Created:** [January 18, 2019, 3:54am UTC](https://discourse.slicer.org/t/how-to-use-the-command-code-of-extractskeleton/5410 "2019-01-18T03:54:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [January 18, 2019, 3:54am UTC](https://discourse.slicer.org/t/how-to-use-the-command-code-of-extractskeleton/5410/1 "2019-01-18T03:54:48Z")

</div>

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

> <https://github.com/Slicer/Slicer/blob/main/Modules/CLI/ExtractSkeleton/SkelGraph.h>

```
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](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/d/5ddff09f26f96015328659074ea9dae012c3f5ea.jpeg)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 18, 2019, 4:44am UTC](https://discourse.slicer.org/t/how-to-use-the-command-code-of-extractskeleton/5410/2 "2019-01-18T04:44:42Z")

</div>

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](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting#Running_a_CLI_from_Python).
