# modify line color/width of ResliceCursorWidget

**URL:** https://discourse.vtk.org/t/modify-line-color-width-of-reslicecursorwidget/1037
**Category:** Support
**Created:** [May 28, 2019, 4:50pm UTC](https://discourse.vtk.org/t/modify-line-color-width-of-reslicecursorwidget/1037 "2019-05-28T16:50:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tom1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/b487fb/32.png) [@tom1](https://discourse.vtk.org/u/tom1)
#### Post date: [May 28, 2019, 4:50pm UTC](https://discourse.vtk.org/t/modify-line-color-width-of-reslicecursorwidget/1037/1 "2019-05-28T16:50:18Z")

</div>

Dear community,  
what is the propper approach to modify the color and width of the center lines of a reslice cursor?  
I have noticed that vtkResliceCursorLineRepresentation provides access to the vtkResliceCursorActor, which has a method to modify the centerline properties, but where do the default colors (red, green, blue) come from?

Thanks for your help.  
Tom

---

<div class="post-metadata">

### Author: ![tom1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/b487fb/32.png) [@tom1](https://discourse.vtk.org/u/tom1)
#### Post date: [May 30, 2019, 11:51am UTC](https://discourse.vtk.org/t/modify-line-color-width-of-reslicecursorwidget/1037/2 "2019-05-30T11:51:41Z")

</div>

Finally, I managed to change the color and line width.  
So, for exmple:

vtkResliceCursorLineRepresentation lineRep = new vtkResliceCursorLineRepresentation();  
…  
vtkProperty prop = lineRep.GetResliceCursorActor().GetCenterlineActor(0).GetProperty();  
prop.SetSpecularColor(1,1,0);  
prop.SetDiffuseColor(1,1,0);  
prop.SetEdgeColor(1,1,0);  
prop.SetVertexColor(1,1,0);  
prop.SetLineWidth(3);  
prop.Modified();

did the trick. I missed to call Modified() and had to set SpecularColor, DiffuseColor, EdgeColor… instead of just Color.

If there is a better way, please let me know.

Best regards,  
Tom
