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.
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);