# Extract Green or Yellow slices as a stacked tif or gif or DICOM files

**URL:** <https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197>\
**Category:** Support\
**Created:** [December 23, 2020, 12:58pm UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197 "2020-12-23T12:58:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![qubalee](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/qubalee/32/9314_2.png) [@qubalee](https://discourse.slicer.org/u/qubalee)\
**Post date:** [December 23, 2020, 12:58pm UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197/1 "2020-12-23T12:58:45Z")

</div>

Hi,

I am trying to export both green and yellow views (as separated files) from a 3D volume, but I could not do it. When I convert it to DICOM, I got it from the Red view only. Is there any one can help in this?

thanks in advance  
Abdullah

---

<div class="post-metadata">

**Author:** ![qubalee](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/qubalee/32/9314_2.png) [@qubalee](https://discourse.slicer.org/u/qubalee)\
**Post date:** [December 23, 2020, 2:29pm UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197/2 "2020-12-23T14:29:54Z")

</div>

Hi there,

I am facing an issue with extracting a stacked tif file. I would like to extract a stacked tif or gif or DICOM files from one view only or each view separately, i.e., G or Y, but I could not make it.

I’d appreciate any help from you.

Thanks

---

<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:** [December 23, 2020, 3:37pm UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197/3 "2020-12-23T15:37:14Z")

</div>

If you export a 3D volume then it should not matter how the volume axes (IJK) are assigned to physical axis directions (RAS/LPS). What are you trying to achieve?

---

<div class="post-metadata">

**Author:** ![qubalee](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/qubalee/32/9314_2.png) [@qubalee](https://discourse.slicer.org/u/qubalee)\
**Post date:** [December 23, 2020, 4:43pm UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197/4 "2020-12-23T16:43:34Z")

</div>

> [@lassoan](#):
>
> (IJK)

Thanks, Lassoan, for your response.  
We are studying the variation among different orientations, IJK. The issue is not about calculating the volume, but something else. Is there any way to do it in Slicer?

Thanks again  
Abdullah

---

<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:** [December 23, 2020, 4:47pm UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197/5 "2020-12-23T16:47:44Z")

</div>

> [@qubalee](#):
>
> The issue is not about calculating the volume, but something else. Is there any way to do it in Slicer?

Since in Slicer you can do almost everything that is possible in medical image computing, the answer is most likely “yes”. Of course I can only guess, because I don’t know what you would like to do.

If you need want to study the effect of voxel spacing then you can use “Resample scalar volume” module to resample the input volume with arbitrary spacing along each axis.

---

<div class="post-metadata">

**Author:** ![qubalee](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/qubalee/32/9314_2.png) [@qubalee](https://discourse.slicer.org/u/qubalee)\
**Post date:** [December 23, 2020, 4:55pm UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197/6 "2020-12-23T16:55:05Z")

</div>

> [@lassoan](#):
>
> If you need want to study the effect of voxel spacing then you can use

Our study takes it slice by slice. So, we measure the area in 2D for each slice in each orientation.  
I don’t know yet how to export my files as a stacked tif or how to calculate the areas of each orientation in 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:** [December 23, 2020, 5:40pm UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197/7 "2020-12-23T17:40:30Z")

</div>

I assume you use Python for image segmentation on one slice at a time. For this, it does not matter what axes you chose as IJK because you can get the slices in any orientation, by numpy indexing. For example, you can get slices from the volume like this:

```python
sagittalSlice = voxels[sliceIndex,:,:]
coronalSlice = voxels[:,sliceIndex,:]
axialSlice = voxels[:,:,sliceIndex]

```

If you work with 3D data then you can probably get better results using networks that get the entire 3D data set. Check out [MONAI](https://monai.io/).

---

<div class="post-metadata">

**Author:** ![qubalee](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/qubalee/32/9314_2.png) [@qubalee](https://discourse.slicer.org/u/qubalee)\
**Post date:** [December 23, 2020, 5:43pm UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197/8 "2020-12-23T17:43:34Z")

</div>

Thanks, Lassoan.  
I will try it now.

---

<div class="post-metadata">

**Author:** ![qubalee](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/qubalee/32/9314_2.png) [@qubalee](https://discourse.slicer.org/u/qubalee)\
**Post date:** [July 10, 2021, 4:03am UTC](https://discourse.slicer.org/t/extract-green-or-yellow-slices-as-a-stacked-tif-or-gif-or-dicom-files/15197/9 "2021-07-10T04:03:14Z")

</div>

For the record, I solved this issue using screen capture, see below.

- Go to _Modules_ \> _Utilities_ \> _Screen Capture_.
- Input; Change _Master view to Green_ (Coronal) or Yellow (Sagittal).
- Output; Select your prefered _output directory_
- Click _Capture_.
