# How to draw lines and annotate on vtkImageView2

**URL:** https://discourse.vtk.org/t/how-to-draw-lines-and-annotate-on-vtkimageview2/12110
**Category:** Support
**Tags:** python
**Created:** [August 7, 2023, 7:54am UTC](https://discourse.vtk.org/t/how-to-draw-lines-and-annotate-on-vtkimageview2/12110 "2023-08-07T07:54:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mmXIO](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mmxio/32/6128_2.png) [@mmXIO](https://discourse.vtk.org/u/mmXIO)
#### Post date: [August 7, 2023, 7:54am UTC](https://discourse.vtk.org/t/how-to-draw-lines-and-annotate-on-vtkimageview2/12110/1 "2023-08-07T07:54:46Z")

</div>

How to draw lines and annotate on vtkImageView2？How to use the python language, correctly use line classes such as vtkLineWidget and vtkImageTracerWidget in vtkImageView2？

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [August 8, 2023, 4:10am UTC](https://discourse.vtk.org/t/how-to-draw-lines-and-annotate-on-vtkimageview2/12110/2 "2023-08-08T04:10:46Z")

</div>

These two C++ examples may give you some ideas:

- [DrawOnAnImage](https://examples.vtk.org/site/Cxx/Images/DrawOnAnImage/)
- [DrawShapes](https://examples.vtk.org/site/Cxx/Images/DrawShapes/)

There are no Python examples using vtkImageView2.

---

<div class="post-metadata">

### Author: ![mmXIO](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mmxio/32/6128_2.png) [@mmXIO](https://discourse.vtk.org/u/mmXIO)
#### Post date: [August 8, 2023, 4:18am UTC](https://discourse.vtk.org/t/how-to-draw-lines-and-annotate-on-vtkimageview2/12110/3 "2023-08-08T04:18:23Z")

</div>

Thank you for your reply, when I load the dicom file with vtkImageView2, for example, I want to use vtkImageTracerWidget to sketch on it, but when the program runs, it cannot be overwritten, it seems that the image covers the widget, why?
