# Cannot get label layer and foreground layer volumes

**URL:** <https://discourse.slicer.org/t/cannot-get-label-layer-and-foreground-layer-volumes/20588>\
**Category:** Development\
**Tags:** segmentation\
**Created:** [November 11, 2021, 9:20pm UTC](https://discourse.slicer.org/t/cannot-get-label-layer-and-foreground-layer-volumes/20588 "2021-11-11T21:20:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shazam\_L](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shazam_l/32/10264_2.png) [@Shazam\_L](https://discourse.slicer.org/u/Shazam_L)\
**Post date:** [November 11, 2021, 9:20pm UTC](https://discourse.slicer.org/t/cannot-get-label-layer-and-foreground-layer-volumes/20588/1 "2021-11-11T21:20:43Z")

</div>

Hello,

I seem to get background layer volume but everything else is nullptr.  
I can visually see segmentations and there is a labellayer present  
This is my setup

```auto
vtkSlicerApplicationLogic* appLogic = vtkSlicerApplicationLogic::SafeDownCast(
    qSlicerApplication::application()->applicationLogic()
  );
  if (!appLogic) return theList;
  d->sliceLogic = vtkMRMLSliceLogic::SafeDownCast(
    appLogic->GetSliceLogic(sliceNode)
  );
  if (!d->sliceLogic) return theList;

  layerLogic["B"] = vtkMRMLSliceLayerLogic::SafeDownCast(d->sliceLogic->GetBackgroundLayer());
  layerLogic["F"] = vtkMRMLSliceLayerLogic::SafeDownCast(d->sliceLogic->GetForegroundLayer());
  layerLogic["L"] = vtkMRMLSliceLayerLogic::SafeDownCast(d->sliceLogic->GetLabelLayer());
 // Some loop
      volumeNode = vtkMRMLVolumeNode::SafeDownCast(
           d->sliceLogic->GetLayerVolumeNode(i)
       );

```

---

<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:** [November 12, 2021, 5:55am UTC](https://discourse.slicer.org/t/cannot-get-label-layer-and-foreground-layer-volumes/20588/2 "2021-11-12T05:55:29Z")

</div>

Segmentations are not displayed using slice layers, but by they have their own displayable manager. You can change a segmentation node’s display properties via its display node.
