Page MenuHomePhabricator

data and node properties are not saved on XP
Closed, ResolvedPublic

Description

On Windows XP if I save a project and reopen it, all the nodes are
called "unnamed". On a Windows 7 PC and on Linux the original node
names are restored.

I checked the .mitk file, the problem is that the properties are not saved.

Look at the <properties file=""> tags below.
The files are missing, only the images and this html is there inside the zip.

<?xml version="1.0" encoding="UTF-8" ?>
<Version Writer="..\..\..\..\MITK\Modules\SceneSerialization\mitkSceneIO.cpp"
Revision="$Revision: 17055 $" FileVersion="1" />
<node UID="OBJECT_2012011710542534577471">

<source UID="OBJECT_2012011710542543113498" />
<data type="Image" file="aaaaaa_Anatomical_Image.pic" />
<properties file="" />

</node>
<node UID="OBJECT_2012011710542586584063">

<source UID="OBJECT_2012011710542543113498" />
<data type="Image" file="baaaaa_VFA_Series.pic" />
<properties file="" />

</node>
<node UID="OBJECT_2012011710542543113498">

<source UID="OBJECT_20120117105425X3079317" />
<properties file="" />

</node>
<node UID="OBJECT_20120117105425X3079317">

<properties file="" />

</node>
<node UID="OBJECT_2012011710542530930509">

<source UID="OBJECT_2012011710542543113498" />
<data type="Image" file="caaaaa_DCE_Series.pic" />
<properties file="" />

</node>

I debugged it and the problem is in the PropertyListSerialize::Serialize function.

In line 62, it calls an ITK function that converts the path to Unix and Windows style, respectively. Additionally, if the path contains space, it wraps it within double quotes.

However, the XiXMLDocument::SaveFile (line 99) does not seem to like this format. It returns false with no error description.

The reason for which it occurred only on XP is that the property file is created in the .mitk directory that is under "Documents and Settings". On Windows 7 it is probably under the Users that contains no space, so it's not enclosed within double quotes.

I added an if statement after line 62 that removes the enclosing double quotes from the path if they are present.

With this fix the project are saved well, but when I open it, the application crashes.

Event Timeline

The crash is not related to this issue.
It was because the metainformation of 4D images was incorrect in the nrrd files:

NRRD0004

  1. Complete NRRD file format specification at:
  2. http://teem.sourceforge.net/nrrd/format.html

type: float
dimension: 4
space dimension: 4
sizes: 128 128 8 6
space directions: (0.3125,0,0,-107374176) (0,0.3125,0,-107374176) (0,0,1.5,-107374176) (0,0,0,-107374176)
kinds: domain domain domain domain
endian: little
encoding: raw
space origin: (0,0,0,-107374176)

I am ugrading MITK to check if this happens with the latest version or not.

For this issue, you find a patch here:

https://github.com/cim-unito/MITK/issues/29

This issue could be closed by merging that one lined patch.

For the spacing issue there is a new bug report here: #10959

New remote branch pushed: bug-10848-PropertiesNotSavedOnWinXP

[943ead]: Merge branch 'bug-10848-PropertiesNotSavedOnWinXP'

Merged commits:

2013-03-20 15:08:59 Stefan Kislinskiy [5bbe44]
Properties are saved now if temporary path contains spaces.

New remote branch pushed: bug-10848-PropertiesNotSavedOnWinXP2

[ffcb84]: Merge branch 'bug-10848-PropertiesNotSavedOnWinXP2'

Merged commits:

2013-03-20 15:57:40 Stefan Kislinskiy [716458]
COMP: front() and back() not supported for std::string prior to C++11.