# vtkResliceImageViewer lookup table

**URL:** https://discourse.vtk.org/t/vtkresliceimageviewer-lookup-table/4394
**Category:** Support
**Created:** [October 11, 2020, 8:37pm UTC](https://discourse.vtk.org/t/vtkresliceimageviewer-lookup-table/4394 "2020-10-11T20:37:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ppiorun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ppiorun/32/2435_2.png) [@ppiorun](https://discourse.vtk.org/u/ppiorun)
#### Post date: [October 11, 2020, 8:37pm UTC](https://discourse.vtk.org/t/vtkresliceimageviewer-lookup-table/4394/1 "2020-10-11T20:37:10Z")

</div>

Hello,  
I have a DICOM visualization using my kind of four pane view. Initially I used vtkImageViewer2, but wanted to show reslice cursor, so moved to vtkResliceImageViewer. After processing I want to select certain voxels with specified color (hard-coded red for now), so I’m setting custom lookup table:

```
	imageViewer->GetWindowLevel()->SetOutputFormatToRGB();
auto lut = vtkLookupTable::New();
lut->SetAboveRangeColor(1, 0, 0, 1);
lut->SetUseAboveRangeColor(true);
lut->SetHueRange(0, 0);
lut->SetSaturationRange(0, 0);
lut->SetRange(SHRT_MIN, SHRT_MAX - 1); // leave the max value for selection
lut->Build();
imageViewer->GetWindowLevel()->SetLookupTable(lut);

```

The code worked for vtkImageViewer2, but is not working for vtkResliceImageViewer. Just as it would not use color above range.

I’m also using following code for sharing cursor between 3 projections view:

```
	cbk = vtkSmartPointer<vtkResliceCursorCallback>::New();

for (int i = 0; i < 3; i++)
{
	vtkResliceCursorLineRepresentation* rep =
		vtkResliceCursorLineRepresentation::SafeDownCast(
			riw[i]->GetResliceCursorWidget()->GetRepresentation());
	riw[i]->SetResliceCursor(riw[0]->GetResliceCursor());
	rep->GetResliceCursorActor()->
		GetCursorAlgorithm()->SetReslicePlaneNormal(i);
	
	cbk->RCW[i] = riw[i]->GetResliceCursorWidget();
	riw[i]->GetResliceCursorWidget()->AddObserver(vtkResliceCursorWidget::ResliceAxesChangedEvent, cbk);
	riw[i]->GetResliceCursorWidget()->AddObserver(vtkResliceCursorWidget::WindowLevelEvent, cbk);
	riw[i]->GetResliceCursorWidget()->AddObserver(vtkResliceCursorWidget::ResliceThicknessChangedEvent, cbk);
	riw[i]->GetResliceCursorWidget()->AddObserver(vtkResliceCursorWidget::ResetCursorEvent, cbk);
	riw[i]->GetResliceCursorWidget()->SetEnabled(1);
}

riw[0]->GetResliceCursor()->SetThickness(1, 1, 1);
riw[0]->GetResliceCursor()->SetHole(0);

```

Any help would be appreciated!

---

<div class="post-metadata">

### Author: ![ppiorun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ppiorun/32/2435_2.png) [@ppiorun](https://discourse.vtk.org/u/ppiorun)
#### Post date: [November 15, 2020, 9:53pm UTC](https://discourse.vtk.org/t/vtkresliceimageviewer-lookup-table/4394/2 "2020-11-15T21:53:37Z")

</div>

I managed to solve the issue by overriding lookup table settings for reslice cursor line representations:

```
	auto lut = vtkLookupTable::SafeDownCast(rep->GetLookupTable());
	lut->SetUseAboveRangeColor(true);
	lut->SetAboveRangeColor(255, 0, 0, 255);
```
