Report:
There is a rendering issue when loading older scene files (probably from before T17547, 04/2014) into a current Workbench. CT images that should be displayed with a black-to-white lookup-table are displayed in all colors of the rainbow (see original report on mitk-users quoted at the end of this description).
Analysis:
Digging into this problem shows that those images would have two aspects that mess up now:
- they refer to a rendering mode LevelWindow_Color which has been removed in T17547
- they do not have a lookup table, which was not required before either named bug or before a different rendering change
Proposed solution:
I found the easiest and probably most reasonable solution as follows:
- SceneReaderV1 (the class that reads a .mitk file and constructs DataNodes and properties) will by default remove all default properties from a newly created DataNode after it calls SetData. This is well justified behavior (explained below).
- We could and should add local exceptions to this behavior to handle compatibility issues like above. In the specific case, we need to keep the default lookup table that is generated, which happens to be a reasonable one for CT images (black-to-white)
Testing:
I'll provide a .mitk scene file that demonstrates this behavior. This allows manual testing. However, I'll also try to set up an automatic test that loads this file and verifies correct rendering (relation to T18280).
Explanation on suppressing default properties in scene loader:
We want to load scenes that are the same as before. There can
be two interpretations of this:
- data is restored correctly
- visual appearance is restored correctly.
- would be exactly achieved if we remove all new default properties
and only load those properties that existed when saving the scene.
This would avoid new properties "appearing".
One could argue that the minority of applications cares for the exact
set of properties. But here comes
- sometimes properties are changed in their type (PointSet's or Surface's
"line width" from int to float). The mapper implements a reasonable
fallback behavior (use new default type, if not present, look for
the old one). If now we would have a scene loader that both keeps
default properties (e.g. line width 1.5) and adds loaded properties
(e.g. line width 10), we would have another backwards compatibility
problem.
Quoting Ingmar Wegner on mitk-users (25/09/15), also mentioned in T19294:
I just debugged into the serialization because all images within
our project files that we created before moving to the 2015.05.0
release show up in rainbow color, not in gray values.
I found out that there has been a change in the serialization.
Now there is an additional property "LookupTable" in the
properties file.
During loading an mitk file the default behavior is to add a
rainbow LUT. I guess that is to support other image types from
the diffusion application?
But as the "old" project files don't contain the property the
images get also drawn in rainbow color.
Then if you go into the DataManager plugin and want to reset
the colormap it automatically switches to "grayscale" once the
context menu opens up.