Page MenuHomePhabricator

Surfaces are nor stored correctly in MITK scene files
Closed, ResolvedPublic

Description

When storing surfaces in MITK scene files the material properties are not stored correctly. All surfaces are black when loading the scene file.( See attached screenshots).
Storing surfaces in scene files had worked in the past.

wrong.png (1×1 px, 284 KB)

Event Timeline

heime added a subscriber: heime.

The ambient and diffusion light properties are set to zero when saving the surface to a scene file.

correct.png (1×1 px, 296 KB)

This bug is relevant for the upcoming release. Changen target mile stone…

The change of the scalartype from float to double seems to be responsible for the problem. The material coefficients properties are stored in double in the scenefile:

<property key="material.ambientCoefficient" type="FloatProperty">

<float value="0.0500000007450581" />

</property>

before the scalartype switch to double the property only had 2 digits:

<property key="material.ambientCoefficient" type="FloatProperty">

<float value="0.05" />

</property>

When the scene file is loaded, the double number is set to zero.
The problem seems to be caused by the tinyxml issue described in T16328.
And should be fixed by resolving T16328.

The problem is caused by reading the double number in the xml, not by writing it.

I wrote a unit test for writing and reading double values with many digits after the comma in mitkTinyXMLTest.cpp::Test_DoubleValueWriteOut_manyDecimalPlaces()
That's why I do not think the problem is the TinyXML reading/writin but rather caused by an implication of having read out a value with many digits after the comma.

Was a locale misconfiguration after an update. Restarting the system solved the problem.