# Extract selected segments

**URL:** <https://discourse.slicer.org/t/extract-selected-segments/31357>\
**Category:** Support\
**Created:** [August 25, 2023, 1:25pm UTC](https://discourse.slicer.org/t/extract-selected-segments/31357 "2023-08-25T13:25:50Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [August 25, 2023, 1:25pm UTC](https://discourse.slicer.org/t/extract-selected-segments/31357/1 "2023-08-25T13:25:50Z")

</div>

_(the topic was originally posted by @Samaneh - but it was accidentally rejected while reviewing the moderation queue)_

Hi everyone,  
I have got a series of mammography and ultrasound images that I segmented by 3d slicer. I want to extract selected segments using the codes below:

 ![Screenshot (233)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/f/3f5e3b97534b926a18fb1a7ba8534f642ab792ce.png)  
However, I do not have any “SegmentationExtracted.seg.nrrd” file to load in python.  
Can anyone guide me how to use these codes?

---

<div class="post-metadata">

**Author:** ![Samaneh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/samaneh/32/68514_2.png) [@Samaneh](https://discourse.slicer.org/u/Samaneh)\
**Post date:** [August 25, 2023, 3:47pm UTC](https://discourse.slicer.org/t/extract-selected-segments/31357/2 "2023-08-25T15:47:35Z")

</div>

Hi,  
I sent you a question about how to extract selected segments by the codes that I have sent to you, however it was accidentally rejected while reviewing the moderation queue.I would be greatly thankful if you answer my question.

---

<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:** [August 25, 2023, 5:43pm UTC](https://discourse.slicer.org/t/extract-selected-segments/31357/3 "2023-08-25T17:43:04Z")

</div>

> [@lassoan](#):
>
> “SegmentationExtracted.seg.nrrd” file to load in python

This is a placeholder for the file system path to the file where you saved your segmentation.
