# How can I adjust the opacity and color of the segmentation in a DRR (Digitally Reconstructed Radiograph)?

**URL:** https://discourse.vtk.org/t/how-can-i-adjust-the-opacity-and-color-of-the-segmentation-in-a-drr-digitally-reconstructed-radiograph/13380
**Category:** Support
**Created:** [February 24, 2024, 6:28am UTC](https://discourse.vtk.org/t/how-can-i-adjust-the-opacity-and-color-of-the-segmentation-in-a-drr-digitally-reconstructed-radiograph/13380 "2024-02-24T06:28:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dorsapiri](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/a698b9/32.png) [@dorsapiri](https://discourse.vtk.org/u/dorsapiri)
#### Post date: [February 24, 2024, 6:28am UTC](https://discourse.vtk.org/t/how-can-i-adjust-the-opacity-and-color-of-the-segmentation-in-a-drr-digitally-reconstructed-radiograph/13380/1 "2024-02-24T06:28:00Z")

</div>

I have a program that takes DICOM series and generates a 2D DRR image using vtkImageReslice. I would like to incorporate functionality to adjust the opacity and contrast of the DRR image. However, I’m unsure where in my code to add this option and how to implement it.

```auto
vtkDICOMImageReader reader = vtkDICOMImageReader.New();
reader.SetDirectoryName(dicomDirectory);
reader.Update();
vtkImageData imageData = reader.GetOutput();
vtkImageReslice reslice = vtkImageReslice.New();
reslice.SetInputData(imageData );
reslice.SetOutputDimensionality(2);
reslice.SlabTrapezoidIntegrationOn();
reslice.SetSlabSliceSpacingFraction(1);
reslice.InterpolateOn();
reslice.SetSlabModeToMax();
reslice.SetSlabNumberOfSlices(slabNumberOfSlices);
reslice.Update();
vtkImageActor actor = new();
actor.SetInputData(reslice.GetOutput());
var renderWindow = renderWindowControl.RenderWindow;
renderWindow.GetRenderers().GetFirstRenderer().AddActor(actor);

```
