Page MenuHomePhabricator

Scene serialization is corrupted due to images stored with wrong locale
Closed, ResolvedPublic

Description

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());

Revisions and Commits

Event Timeline

Pushed new branch T24692-Scene_serialization_is_corrupted_due_to_image_with_wrong_locale.

Work around for the wrong locale

WARNING: This is not a real fix for the problem documented in T24692. It cures the symptomes, but the underlying problem (why is the locale becomming wrong?) is not yet identified or fixed.
floca added a revision: Restricted Differential Revision.Apr 23 2018, 2:11 PM
kislinsk added a project: Restricted Project.
kislinsk added a subscriber: kislinsk.

Currently fixed with workaround, hence no pressing issue. Set priority to low but add #community_day tag.

kislinsk added a project: Auto-closed.

Hi there! ๐Ÿ™‚

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. ๐Ÿš‘

Best wishes,
The MITK devs

floca removed a project: Auto-closed.
kislinsk added a project: Auto-closed.

Hi there! ๐Ÿ™‚

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. ๐Ÿš‘

Best wishes,
The MITK devs

kislinsk claimed this task.
kislinsk added a project: Moved to git.dkfz.de.

This task was closed here on Phabricator since it was migrated to GitLab. Please continue on GitLab.