public void VolumeRender(vtk.vtkImageData VoxelDatat) { VoxelData = VoxelDatat; renWin.AddRenderer(ren1); iren.SetRenderWindow(renWin); double[] inputRange = VoxelData.GetScalarRange(); vtk.vtkPiecewiseFunction opacityTransferFunction = new vtk.vtkPiecewiseFunction(); opacityTransferFunction.AddPoint(inputRange[0], 0); opacityTransferFunction.AddPoint(inputRange[1], 1); vtk.vtkColorTransferFunction colorTransferFunction = new vtk.vtkColorTransferFunction(); colorTransferFunction.AddRGBPoint(inputRange[0], 1.0, 1.0, 1.0); colorTransferFunction.AddRGBPoint(inputRange[1], 1.0, 1.0, 1.0); volumeProperty.SetColor(colorTransferFunction); volumeProperty.SetScalarOpacity(opacityTransferFunction); volumeProperty.ShadeOff(); volumeProperty.SetInterpolationTypeToLinear(); volume.SetProperty(volumeProperty); setRAY(); ren1.AddVolume(volume); ren1.ResetCamera(); renWin.Render(); addBusyObservers(); iren.Initialize(); iren.Enable(); }