# Export segmentation to file API

**URL:** <https://discourse.slicer.org/t/export-segmentation-to-file-api/20302>\
**Category:** Development\
**Created:** [October 22, 2021, 3:15pm UTC](https://discourse.slicer.org/t/export-segmentation-to-file-api/20302 "2021-10-22T15:15:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karam\_AbuGhalieh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/karam_abughalieh/32/9855_2.png) [@Karam\_AbuGhalieh](https://discourse.slicer.org/u/Karam_AbuGhalieh)\
**Post date:** [October 22, 2021, 3:15pm UTC](https://discourse.slicer.org/t/export-segmentation-to-file-api/20302/1 "2021-10-22T15:15:13Z")

</div>

is there a way to use the export segmentation functionality without opening Slicer,  
I have a folder of many segmented .nii file and I am looking for a script that can convert it to .obj file.

---

<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:** [October 22, 2021, 6:29pm UTC](https://discourse.slicer.org/t/export-segmentation-to-file-api/20302/2 "2021-10-22T18:29:13Z")

</div>

Yes, sure that should be no problem at all. You can put your code snippet into a .py file and run it [Slicer’s Python environment](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#run-a-python-script-file-in-the-slicer-environment).
