# VTK 9.5.0RC1: Question about vtkFastLabeledDataMapper

**URL:** <https://discourse.vtk.org/t/vtk-9-5-0rc1-question-about-vtkfastlabeleddatamapper/15653>\
**Category:** Support\
**Tags:** code\
**Created:** [May 20, 2025, 7:48pm UTC](https://discourse.vtk.org/t/vtk-9-5-0rc1-question-about-vtkfastlabeleddatamapper/15653 "2025-05-20T19:48:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukas](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@lukas](https://discourse.vtk.org/u/lukas)\
**Post date:** [May 20, 2025, 7:48pm UTC](https://discourse.vtk.org/t/vtk-9-5-0rc1-question-about-vtkfastlabeleddatamapper/15653/1 "2025-05-20T19:48:47Z")

</div>

I am trying the new vtkFastLabeledDataMapper in vtk9.5.0rc1. The documentation of the class sounds like it is a replacement of the vtkLabeledDataMapper, so I tried to adapt one of the VTK-Examples to use the vtkFastLabeledDataMapper.

I used the LabelContours example ([https://examples.vtk.org/site/Cxx/Visualization/LabelContours/](https://examples.vtk.org/site/Cxx/Visualization/LabelContours/)) and replaced the mapper and the actor. Here is the diff compared to the current master of the VTK-Examples repo:

```auto
diff --git a/src/Cxx/Visualization/LabelContours.cxx b/src/Cxx/Visualization/LabelContours.cxx
index 306e9c0a4f4..8a9907523c7 100644
--- a/src/Cxx/Visualization/LabelContours.cxx
+++ b/src/Cxx/Visualization/LabelContours.cxx
@@ -4,7 +4,7 @@
 #include <vtkContourFilter.h>
 #include <vtkDataArray.h>
 #include <vtkDoubleArray.h>
-#include <vtkLabeledDataMapper.h>
+#include <vtkFastLabeledDataMapper.h>
 #include <vtkLookupTable.h>
 #include <vtkMinimalStandardRandomSequence.h>
 #include <vtkNamedColors.h>
@@ -214,7 +214,7 @@ int main(int argc, char* argv[])
   surface->SetMapper(surfaceMapper);
 
   // The labeled data mapper will place labels at the points.
- vtkNew<vtkLabeledDataMapper> labelMapper;
+ vtkNew<vtkFastLabeledDataMapper> labelMapper;
   labelMapper->SetFieldDataName("Isovalues");
   labelMapper->SetInputData(labelPolyData);
   labelMapper->SetLabelModeToLabelScalars();
@@ -222,7 +222,7 @@ int main(int argc, char* argv[])
   labelMapper->GetLabelTextProperty()->SetColor(
       colors->GetColor3d("Gold").GetData());
 
- vtkNew<vtkActor2D> isolabels;
+ vtkNew<vtkActor> isolabels;
   isolabels->SetMapper(labelMapper);
 
   // Create a renderer and render window.

```

Compiling and running the changed code, does not show any labels. I get this output:

 ![Screenshot from 2025-05-20 21-31-29](https://discourse.vtk.org/uploads/default/original/2X/4/4d729dbfd797b1e5e25c32a0b9d9fd8880e963dc.png)

Do I need to make additional changes to the example code to get vtkFastLabeledDataMapper working or are there limitiations to the functionality of the class compared to vtkLabeledDataMapper?
