# Creating and Exporting 2D Bounding Boxes for Each Slice for Deep Learning Training

**URL:** <https://discourse.slicer.org/t/creating-and-exporting-2d-bounding-boxes-for-each-slice-for-deep-learning-training/41102>\
**Category:** Support\
**Created:** [January 15, 2025, 11:26pm UTC](https://discourse.slicer.org/t/creating-and-exporting-2d-bounding-boxes-for-each-slice-for-deep-learning-training/41102 "2025-01-15T23:26:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zupl1234](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@zupl1234](https://discourse.slicer.org/u/zupl1234)\
**Post date:** [January 15, 2025, 11:26pm UTC](https://discourse.slicer.org/t/creating-and-exporting-2d-bounding-boxes-for-each-slice-for-deep-learning-training/41102/1 "2025-01-15T23:26:34Z")

</div>

Hi,

I am working on annotating medical images (CT & MRI) using 3D Slicer, and I have the following use case:

I need to:

1. Annotate specific regions of interest by creating **2D bounding boxes** on **each slice** individually.
2. Extract the **2D coordinates** (X, Y) of the 4 corners of each bounding box for future use in training a deep learning model.

Could you please clarify:

- Is it possible to create 2D bounding boxes per slice in 3D Slicer?
- How can I extract the 2D coordinates of each bounding box?
- In what format can these annotations be exported (e.g., JSON, CSV, etc.) to facilitate their use in deep learning pipelines?

Thank you

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [January 15, 2025, 11:33pm UTC](https://discourse.slicer.org/t/creating-and-exporting-2d-bounding-boxes-for-each-slice-for-deep-learning-training/41102/2 "2025-01-15T23:33:17Z")

</div>

Yes, that should be quite easy if you are willing to do some python scripting. Otherwise not really.
