View Issue Details

IDProjectCategoryView StatusLast Update
0000971Slicer3Base Codepublic2010-10-12 09:38
Reporterpohl Assigned Toalexy  
PriorityurgentSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformOSUbutnu 9.10 64 bitOS Version
Summary0000971: Scene import does not work correctly
Description

Scene import does not work correctly when nodes in the mrml file reference a node whose ID is getting changed to an ID that also already exist in the mrml file

Steps To Reproduce
  • load in a scalar volume in Slicer ( vtkMRMLScalarVolumeNode1 )
  • now load in a mrml file where the ids vtkMRMLScalarVolumeNode1 and vtkMRMLScalarVolumeNode2 exist and another node in the file is referencing vtkMRMLScalarVolumeNode1. In the attached MRML file (MRIHumanBrain.mrml), vtkMRMLEMSAtlasNode1 references vtkMRMLScalarVolumeNode1 which is the volume with name atlas_whitematter.
  • Save the scene to a new file (MRIHumanBrain-after.mrml). vtkMRMLEMSAtlasNode1 now references vtkMRMLScalarVolumeNode5 which is the node with name "atlas_background". The node with name "atlas_whitematter" has now the id vtkMRMLScalarVolumeNode2.
Additional Information

Here is what happens:

when slicer imports the file then it detects that the id vtkMRMLScalarVolumeNode1 already exists in the scene and thus changes the id of the node in the file to vtkMRMLScalarVolumeNode2 as well as adding it to ReferencedIDChanges in vtkMRMLScene::AddNodeNoNotify . Now, in vtkMRMLScene::UpdateNodeReferences the reference of vtkMRMLEMSAtlasNode1 is changed from vtkMRMLScalarVolumeNode1 to vtkMRMLScalarVolumeNode2.

When slicer now imports vtkMRMLScalarVolumeNode2 from the file, it detects that this id already exists in the scene too. It repeats the previous procedure. The reference of vtkMRMLEMSAtlasNode1 that pointed in the file to ID vtkMRMLScalarVolumeNode1 and was changed to vtkMRMLScalarVolumeNode2 is now changed again to vtkMRMLScalarVolumeNode3 which is not the original volume anymore!

This is repeated until a unique id is found that is not changed anymore ! That is why all of vtkMRMLEMSAtlasNode1 references now point to the same id , which is vtkMRMLScalarVolumeNode5

TagsNo tags attached.

Activities

2010-09-12 07:23

 

MRIHumanBrain.tar (102,400 bytes)
alexy

alexy

2010-10-07 12:43

developer   ~0002045

Kilian, could you attach the original scene and scene you are trying to import?

2010-10-08 06:54

 

SceneBug971.tar (112,640 bytes)
pohl

pohl

2010-10-08 06:55

developer   ~0002050

See SceneBug971.tar - You can also simply load in any volume and then import SceneToImport

alexy

alexy

2010-10-08 07:39

developer   ~0002051

Fixed on Slicer3 trunk:
Added ReservedID API to scene, to avoid the assigning of non-unique id's during scene Import.
At revision: 15172
Kilian, could you try it on the Slicer3 trunk.

pohl

pohl

2010-10-11 13:39

developer   ~0002056

Yes - it seems to work now - thanks

Kilian

alexy

alexy

2010-10-12 09:38

developer   ~0002058

Checked in into Slicer3.6 and Slicer4 branches.
Closing since Kilian has verified the fix.

Issue History

Date Modified Username Field Change
2010-09-12 07:23 pohl New Issue
2010-09-12 07:23 pohl File Added: MRIHumanBrain.tar
2010-09-14 12:28 pohl Status new => assigned
2010-09-14 12:28 pohl Assigned To => alexy
2010-10-07 12:43 alexy Note Added: 0002045
2010-10-08 06:54 pohl File Added: SceneBug971.tar
2010-10-08 06:55 pohl Note Added: 0002050
2010-10-08 07:39 alexy Note Added: 0002051
2010-10-08 07:39 alexy Status assigned => resolved
2010-10-08 07:39 alexy Resolution open => fixed
2010-10-11 13:39 pohl Note Added: 0002056
2010-10-12 09:38 alexy Note Added: 0002058
2010-10-12 09:38 alexy Status resolved => closed