# Apply threshold for vtkImagePlaneWidget visualization

**URL:** https://discourse.vtk.org/t/apply-threshold-for-vtkimageplanewidget-visualization/11145
**Category:** Support
**Created:** [April 6, 2023, 12:41pm UTC](https://discourse.vtk.org/t/apply-threshold-for-vtkimageplanewidget-visualization/11145 "2023-04-06T12:41:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Peter](https://discourse.vtk.org/user_avatar/discourse.vtk.org/peter/32/3487_2.png) [@Peter](https://discourse.vtk.org/u/Peter)
#### Post date: [April 6, 2023, 12:41pm UTC](https://discourse.vtk.org/t/apply-threshold-for-vtkimageplanewidget-visualization/11145/1 "2023-04-06T12:41:17Z")

</div>

Hi!

Currently I am using vtkImagePlaneWidget to visualize a NIFTI volume.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/4/46e8a5d9c30b219ece604f95687ac9222aa2ff39.png)

I am simply using the following methods to define the appearance:

> imagePlaneWidget[i]-\>GetColorMap()-\>SetLookupTable(NULL);  
> imagePlaneWidget[i]-\>GetColorMap()-\>SetOutputFormatToLuminance();  
> imagePlaneWidget[i]-\>SetWindowLevel(window, level);

Now I want to achieve something similar to the threshold slider in 3D Slicer:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/f/f84e78b7183e048e2ee70f27b88ef8ae2c55af19.jpeg)

Values which are lower or higher should be hidden (e.g. to remove the black “background”).

How this can be achieved? I checked vtkImageThreshold, vtkVolumeProperty etc., but I could not figure out what is the right approach.

Thank you!
