medInria/medInria-public — pull request #140 by fvichot (2014-01-24 17:23:56+00:00)
Title: Fix bug introduced by upgrading to VTK 5.10

So, after a long chase, I finally got it. After a git bisect from VTK 5.8 to VTK 5.10.1, I found that the bug was due to commit 9b4061 in VTK, which made sure to re-sort the nodes of the color transfer function when their value were updated. That wasn't taken into account by an optimisation in the vtkImageView3D, which tries to only modifies node values instead of flushing and recreating the whole color transfer function when the number of color nodes, except that by modifying node values, their sort order might change, so more or less randomising the lookup table and making a mess of the display.

Unless I'm mistaken, this should only be run when the lookup table is changed, so performance is not critical, so I just removed the optimisation altogether, and now we regenerate the whole color transfer function everytime. A quick usage test did not seem to show any worsening of the window/level speed.