How to separate layers from a NRRD file?

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 but I still didn’t get the concept of this code.

What do you mean by “layers”? Is it channels? Segmentation labels? Something else? Is it maybe .seg.nrrd file? If so, this thread might be of interest.

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