Migration from VTK 5.10 to VTK 6.3

Hello everyone,

I had to perform a migration from VTK 5.10 to VTK 6.3 recently, but I have been stuck with an unexpected behavior with the vtkImageData I’m trying to visualize. The values that should be fully transparent as it was with VTK 5.10 now appear in blue with VTK 6.3. The only change related to the migration and this vtkImageData I did in the code was to use SetInputData rather than SetInput :

...
vtkSmartPointer<vtkGPUVolumeRayCastMapper> mapper = vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();
mapper->SetAutoAdjustSampleDistances(1);
mapper->SetBlendModeToComposite();

#if VTK_MAJOR_VERSION <= 5
    mapper->SetInput(myImageData);
#else
    mapper->SetInputData(myImageData);
#endif

mapper->Update();
...

You can see the difference here:

There may have been a change in how the management of vtkImageData is handled between the two versions, but I can’t get my finger on it. I’m not asking for a solution, but if maybe someone had a clue about where the problem could be coming from, it would be very helpful. :slightly_smiling_face:

These VTK versions are both very old. It is unlikely that anyone would remember how things exactly changed 10+ years ago; or volunteer to go back and investigate the differences. If you can keep your pace of VTK updates similar to the majority VTK users then you can expect to get help from the community; but if you fall back so much then probably the only option that is left for you is paying someone to help.

Note that there were huge changes in VTK 7, 8, and 9, which will break many more things in your code (for example, the entire OpenGL rendering backend was replaced), so you could save a lot of time if you jump directly to VTK9.