# using vtkLabeledContourMapper got error message “Error must have verts, program and vao”

**URL:** <https://discourse.vtk.org/t/using-vtklabeledcontourmapper-got-error-message-error-must-have-verts-program-and-vao/8975>\
**Category:** Development\
**Created:** [July 20, 2022, 6:22am UTC](https://discourse.vtk.org/t/using-vtklabeledcontourmapper-got-error-message-error-must-have-verts-program-and-vao/8975 "2022-07-20T06:22:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuNie](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/a5b964/32.png) [@YuNie](https://discourse.vtk.org/u/YuNie)\
**Post date:** [July 20, 2022, 6:22am UTC](https://discourse.vtk.org/t/using-vtklabeledcontourmapper-got-error-message-error-must-have-verts-program-and-vao/8975/1 "2022-07-20T06:22:23Z")

</div>

hello! I was tring to use vtkLabeledContourMapper to show the contour line and label. But when I run my code, I got a message window shows that “Error must have verts, program and vao”. My code is shown as below.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/3/36693c2a7d4911633230ae84696d0f4c463c71f3.png)

I knew that there is no OpenGL program when vtk trying to draw the label triangles. But I just don’t know how to fix this. Is there anything else I need to config in the vtkLabeledContourMapper?

---

<div class="post-metadata">

**Author:** ![avilia60](https://discourse.vtk.org/user_avatar/discourse.vtk.org/avilia60/32/5306_2.png) [@avilia60](https://discourse.vtk.org/u/avilia60)\
**Post date:** [August 19, 2022, 6:27am UTC](https://discourse.vtk.org/t/using-vtklabeledcontourmapper-got-error-message-error-must-have-verts-program-and-vao/8975/2 "2022-08-19T06:27:56Z")

</div>

having same problem here

---

<div class="post-metadata">

**Author:** ![YuNie](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/a5b964/32.png) [@YuNie](https://discourse.vtk.org/u/YuNie)\
**Post date:** [August 19, 2022, 6:37am UTC](https://discourse.vtk.org/t/using-vtklabeledcontourmapper-got-error-message-error-must-have-verts-program-and-vao/8975/3 "2022-08-19T06:37:23Z")

</div>

@avilia60 I finded out why. It’s because in vtkLabeledContourMapper, if the contour line only contain 2 points, the mapper will not place labels in between the contour line. I tried to feed the vtkContourFilter output to vtkStripper, then use the vtkStripper output to vtkLabeledContourMapper, problem solved.

---

<div class="post-metadata">

**Author:** ![avilia60](https://discourse.vtk.org/user_avatar/discourse.vtk.org/avilia60/32/5306_2.png) [@avilia60](https://discourse.vtk.org/u/avilia60)\
**Post date:** [August 22, 2022, 2:30am UTC](https://discourse.vtk.org/t/using-vtklabeledcontourmapper-got-error-message-error-must-have-verts-program-and-vao/8975/4 "2022-08-22T02:30:44Z")

</div>

Thank you so much, that really helped.
