Page MenuHomePhabricator

Volume visualisation plugin - saving and loading transfer functions does not work properly
Closed, ResolvedPublic

Description

When saving and loading a transfer function under linux, the loaded transfer function differs from the saved one.

Event Timeline

This bug was produced on a linux machine with following locale config:

LANG="en_US.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"

The issue can be resolved by changing
LC_NUMERIC="de_DE.UTF-8" to LC_NUMERIC="en_US.UTF-8"

The transfer function is serialized using tinyXML. If the locale is not set properly and the system locale is not English the reading and writing of data is incorrect. Setting the locale before reading and writing data probably solves this problem.

The point is that this had to be done in every single serializer that uses tinyXML. The better way is to set it in tinyXML directly.

There are similar bugs that have the same problems, e.g. http://bugs.mitk.org/show_bug.cgi?id=18405

This should be fixed with with T18405.

Could you check this please with the current master? A superbuild to rebuild tinyxml ist required.