The program is as follows, which works well in VTK8.2 :
//vtkNew<vtkGPUVolumeRayCastMapper> volumeMapper;
vtkSmartPointer<vtkGPUVolumeRayCastMapper> volumeMapper = vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();
volumeMapper->SetInputData(reader->GetOutput());
volumeMapper->SetSampleDistance(volumeMapper->GetSampleDistance() / 2); //设置光线采样距离
volumeMapper->SetBlendModeToMaximumIntensity();
But it can’t work in VTK 9.2. The problem is that the volumeMapper is null pointer.
Is anyone konw why? thank you