OS: Windows 10, German language
Bug: Sometimes (not deterministic) images that are stored in serialzed scene files are corrupted and cannot be loaded again.
Reason: Space direction and spacing are encoded with a german locale. Thus comma is used instead of period in numbers.
Example for wrong/corrupted results:
space directions: (1,71875,-3,5123310729518307e-10,3,0111298036231874e-11) (3,5252146874999885e-10,1,7124684772869041,-0,14681034295537448) (7,5389304488104574e-18,0,44843898794449233,5,2308142286324655)
space origin: (-88,546974182128906,-142,40817260742188,-25,636287689208984)
Facts so far:
- It seems to be not determenistic. (*sigh*) Meaning that it may not happen on save and it could also happen to random images in the scene.
- It seems to happen only to images that have properties that must be serialzed. (E.g. Parameter maps of a fitting)
- It seems only to be a problem within the scene serialization. Storing the images directly never lead to problems so far.
- Putting an additional LocalSwitch directly befor the image writing of the IO class (mitkItkImageIO.cpp, l 625f; see below) seems to work arround the symptoms (but do not fixe the underlying problem!).
LocaleSwitch localeSwitch2("C"); m_ImageIO->Write(imageAccess.GetData());