# How to separate layers from a NRRD file?

**URL:** https://discourse.itk.org/t/how-to-separate-layers-from-a-nrrd-file/5661
**Category:** Beginner Questions
**Tags:** cpp
**Created:** [January 31, 2023, 9:21am UTC](https://discourse.itk.org/t/how-to-separate-layers-from-a-nrrd-file/5661 "2023-01-31T09:21:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sterben\_01](https://discourse.itk.org/user_avatar/discourse.itk.org/sterben_01/32/3181_2.png) [@Sterben\_01](https://discourse.itk.org/u/Sterben_01)
#### Post date: [January 31, 2023, 9:21am UTC](https://discourse.itk.org/t/how-to-separate-layers-from-a-nrrd-file/5661/1 "2023-01-31T09:21:28Z")

</div>

Hi!  
I am a beginner of ITK/VTK. Currently, I have an NRRD file, and it has three layers. If I want to separate it and write it to three files, which class should I use? I know how to read and write, but I don’t know how to separate it.  
I had tried this simple example [Sample](https://examples.itk.org/src/core/imageadaptors/extractchannelofimagewithmultiplecomponents/documentation) but I still didn’t get the concept of this code.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [January 31, 2023, 2:28pm UTC](https://discourse.itk.org/t/how-to-separate-layers-from-a-nrrd-file/5661/2 "2023-01-31T14:28:54Z")

</div>

What do you mean by “layers”? Is it channels? Segmentation labels? Something else? Is it maybe `.seg.nrrd` file? If so, [this thread](https://discourse.slicer.org/t/convert-seg-nrrd-to-nrrd-labelmap/17838) might be of interest.

---

<div class="post-metadata">

### Author: ![Sterben\_01](https://discourse.itk.org/user_avatar/discourse.itk.org/sterben_01/32/3181_2.png) [@Sterben\_01](https://discourse.itk.org/u/Sterben_01)
#### Post date: [February 1, 2023, 12:18am UTC](https://discourse.itk.org/t/how-to-separate-layers-from-a-nrrd-file/5661/3 "2023-02-01T00:18:21Z")

</div>

Thank you! I think I need to figure out the layers is channels or labels or something else.
