# draw lines on DICOM image with vtkImageViewer2

**URL:** https://discourse.vtk.org/t/draw-lines-on-dicom-image-with-vtkimageviewer2/652
**Category:** Development
**Created:** [April 1, 2019, 3:53am UTC](https://discourse.vtk.org/t/draw-lines-on-dicom-image-with-vtkimageviewer2/652 "2019-04-01T03:53:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![719mikelee5](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/7/e274bd/32.png) [@719mikelee5](https://discourse.vtk.org/u/719mikelee5)
#### Post date: [April 1, 2019, 3:53am UTC](https://discourse.vtk.org/t/draw-lines-on-dicom-image-with-vtkimageviewer2/652/1 "2019-04-01T03:53:35Z")

</div>

Hello, friends

I’m trying to draw lines on DICOM CT image.  
vtkImageViewer2 is my prefer to display the DICOM image. And I need to draw lines on the displayed image too, but it seems could not work.  
I found that vtkImageActor works, and if vtkImageMapToWindowLevelColors involved, which means the follow code used, then the lines will be covered by the image as vtkImageViewer2 did.

Code:  
vtkSmartPointer imageActor = vtkSmartPointer::New();

imageActor-\>SetInputData(reader-\>GetOutput); // reader is an instance of vtkDICOMImageReader

vtkSmartPointer windowLevel = vtkSmartPointer::New();  
imageActor-\>GetMapper()-\>SetInputConnection(windowLevel-\>GetOutputPort());

windowLevel-\>SetWindow(2000);  
windowLevel-\>SetLevel(200);

m\_pRender-\>AddActor(imageActor); // m\_pRender is an instance of vtkRenderer;

Would you help me on this issue, please?
