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.