# Extracting the three 2d slices of data shown by the 3 planes defined in 3d Slicer

**URL:** <https://discourse.slicer.org/t/extracting-the-three-2d-slices-of-data-shown-by-the-3-planes-defined-in-3d-slicer/18383>\
**Category:** Support\
**Created:** [June 28, 2021, 7:31pm UTC](https://discourse.slicer.org/t/extracting-the-three-2d-slices-of-data-shown-by-the-3-planes-defined-in-3d-slicer/18383 "2021-06-28T19:31:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![elarson](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@elarson](https://discourse.slicer.org/u/elarson)\
**Post date:** [June 28, 2021, 7:31pm UTC](https://discourse.slicer.org/t/extracting-the-three-2d-slices-of-data-shown-by-the-3-planes-defined-in-3d-slicer/18383/1 "2021-06-28T19:31:08Z")

</div>

I can manipulate the 3 2d planes in 3d slicer and visualize the the planes of data I want to extract. The data is 3d+t ultrasound data. Ideally I would like to export the data as 2d ultrasound multi-frame data to 3 separate DICOM files. Is there a way to do this within 3D Slicer GUI or with an extension (SlicerHeart perhaps)?

Simply put, I want to export the data I see presented on the screen for each plane without diving into python coding. Am I missing something obvious? If I have to use python then how would I get the data for each of the planes shown in 3D Slicer?

---

<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 29, 2021, 12:08am UTC](https://discourse.slicer.org/t/extracting-the-three-2d-slices-of-data-shown-by-the-3-planes-defined-in-3d-slicer/18383/2 "2021-06-29T00:08:45Z")

</div>

If it is just for creating a list of images or video for a powerpoint presentation then you can use Screen Capture module for this.

If it is for exporting training data for deep learning or other analysis or processing then you need to somehow specify what you need. The easiest is to express this using Python scripting. For example, you can get access to the entire volume sequence as a 4D numpy array (see example [here](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#access-voxels-of-a-4d-volume-as-a-single-numpy-array)) and then you can extract any data from it, any way you need.

---

<div class="post-metadata">

**Author:** ![elarson](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@elarson](https://discourse.slicer.org/u/elarson)\
**Post date:** [June 29, 2021, 1:59pm UTC](https://discourse.slicer.org/t/extracting-the-three-2d-slices-of-data-shown-by-the-3-planes-defined-in-3d-slicer/18383/3 "2021-06-29T13:59:21Z")

</div>

I need the data for analysis purposes.

I have found an example of how to get the 4d array of data in python.

Now I want to extract the data as the axial, sagittal, and coronal slices defined by the user. Since the 4d array isn’t aligned with the user defined slices/orientations, what python code would get me the interpolated data along the user defined slices?

---

<div class="post-metadata">

**Author:** ![elarson](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@elarson](https://discourse.slicer.org/u/elarson)\
**Post date:** [June 29, 2021, 6:05pm UTC](https://discourse.slicer.org/t/extracting-the-three-2d-slices-of-data-shown-by-the-3-planes-defined-in-3d-slicer/18383/4 "2021-06-29T18:05:38Z")

</div>

More precisely, I want the “Reformat” view for the red, green, and yellow slices.

---

<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 30, 2021, 1:43am UTC](https://discourse.slicer.org/t/extracting-the-three-2d-slices-of-data-shown-by-the-3-planes-defined-in-3d-slicer/18383/5 "2021-06-30T01:43:27Z")

</div>

Do you need this for data augmentation for deep learning?

---

<div class="post-metadata">

**Author:** ![elarson](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@elarson](https://discourse.slicer.org/u/elarson)\
**Post date:** [June 30, 2021, 3:14pm UTC](https://discourse.slicer.org/t/extracting-the-three-2d-slices-of-data-shown-by-the-3-planes-defined-in-3d-slicer/18383/6 "2021-06-30T15:14:45Z")

</div>

I want to extract standard AP4, AP2, AP3, and SAX 2d ultrasound clips from a 3d data set for input to another software analysis tool that only accepts 2d ultrasound clips. I probably should have stated the problem this way from the start, but I tend to have bottom up view of things…

---

<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:** [July 9, 2021, 3:14pm UTC](https://discourse.slicer.org/t/extracting-the-three-2d-slices-of-data-shown-by-the-3-planes-defined-in-3d-slicer/18383/7 "2021-07-09T15:14:26Z")

</div>

You can create a markups ROI node, make it so thin that it only extracts a single slice, then use Crop volume sequence module to extract that slice from all the volumes in the sequence. If you get stuck at any of these steps then let us know.
