# Loading annotations/labels in python for training

**URL:** <https://discourse.slicer.org/t/loading-annotations-labels-in-python-for-training/18236>\
**Category:** Support\
**Tags:** python, annotations\
**Created:** [June 20, 2021, 4:55pm UTC](https://discourse.slicer.org/t/loading-annotations-labels-in-python-for-training/18236 "2021-06-20T16:55:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhruba](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@Dhruba](https://discourse.slicer.org/u/Dhruba)\
**Post date:** [June 20, 2021, 4:55pm UTC](https://discourse.slicer.org/t/loading-annotations-labels-in-python-for-training/18236/1 "2021-06-20T16:55:40Z")

</div>

I want to load my nii.gz file and corresponding ROI annotations (.csv) in python for training purposes. I am not sure the right way to do that. Can you give me some reference code or documentation on loading annotations? Also, how can I be sure if the annotation is in the right place after loading in? Is there a way to check this?

---

<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:** [June 24, 2021, 4:01pm UTC](https://discourse.slicer.org/t/loading-annotations-labels-in-python-for-training/18236/2 "2021-06-24T16:01:29Z")

</div>

See specification of markups file formats [here](https://slicer.readthedocs.io/en/latest/developer_guide/modules/markups.html).

All the file formats are human-readable and self-describing, so you can just save a markups (point list, line, curve, ROI, …) in Slicer and see what information is saved and how.
