# How to use endoscopy in python

**URL:** <https://discourse.slicer.org/t/how-to-use-endoscopy-in-python/15211>\
**Category:** Support\
**Created:** [December 24, 2020, 1:52pm UTC](https://discourse.slicer.org/t/how-to-use-endoscopy-in-python/15211 "2020-12-24T13:52:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yee\_lu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yee_lu/32/9292_2.png) [@yee\_lu](https://discourse.slicer.org/u/yee_lu)\
**Post date:** [December 24, 2020, 1:52pm UTC](https://discourse.slicer.org/t/how-to-use-endoscopy-in-python/15211/1 "2020-12-24T13:52:55Z")

</div>

Now I have some txt files which have some centerline nodes，I want to generate endoscopy in batch, how to use endoscopy in python?

---

<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:** [September 5, 2021, 1:07am UTC](https://discourse.slicer.org/t/how-to-use-endoscopy-in-python/15211/2 "2021-09-05T01:07:30Z")

</div>

You can load a text file in [json](https://slicer.readthedocs.io/en/latest/developer_guide/modules/markups.html#markups-json-file-format-mrk-json) format as a markups curve node (just change the `"type": "Fiducial"` to `"type": "Curve"`) and then use Endoscopy module to guide the renderer camera through the his trajectory. After each step, you can create a snapshot of the view and in the end merge them into a video using Screen Capture module.
