View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001783 | Slicer4 | Core: MRML | public | 2012-03-03 12:23 | 2014-03-06 06:10 |
Reporter | nicole | Assigned To | nicole | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | |||||
Target Version | Slicer 4.1.0 | Fixed in Version | Slicer 4.1.1 | ||
Summary | 0001783: Losing model hierarchy display nodes on scene save | ||||
Description | I think that the cleaning up of unreferenced nodes is deleting the display node that the model hierarchy node points to. The model hierarchy node doesn't inherit from displayable nodes, so it's using vtkMRMLDisplayableHierarchyNode's manual managment of display node id, but I suspect it's not using the correct set reference macro. | ||||
Steps To Reproduce | Load a model DisplayableHierarchyNode::UpdateReferences can't find the display node and sets the display node id to null, if you try to get the display node id for the model heirarchy node now, it will be empty. | ||||
Additional Information | In python: In some cases the saved mrml file will have a scene view that has the correct display node id, so restoring the scene view from the save point will lead to a valid display node on the hierarchy node. But just loading the mrml scene will usually result in missing display nodes. | ||||
Tags | No tags attached. | ||||
Can also cause a crash on scene close when saved a scene with fiducials in it, as the annotation hierarchy node lost its display node on scene save. |
|
Looks like the culprit is in the save data dialog when it calls: In RemoveUnreferencedDisplayNodes, it goes through the displayable nodes and makes sure each display node is pointed to by something. The problem is that the hierarchy nodes aren't displayable nodes, so their display nodes get removed. Alex: what's the best vtkMRMLScene method to call to trigger a clean up of unreferenced nodes after saving a mrml scene? |
|
More digging: if I keep the mrmlLogic calls out, creating a model hierarchy and then saving it, the hierarchy display node is fine in the scene references:
but when close the scene, it crashes with this error: ERROR: In /projects/birn/nicole/Slicer4/Slicer4/Libs/MRML/Core/vtkMRMLScene.cxx, line 1364 ASSERT failure in qMRMLSceneModel::onMRMLSceneNodeAboutToBeRemoved(): "A node has been removed from the scene but the scene model has never been notified it has been added in the first place. Maybe vtkMRMLScene::AddNodeNoNotify() has been used instead of vtkMRMLScene::AddNode", file /projects/birn/nicole/Slicer4/Slicer4/Libs/MRML/Widgets/qMRMLSceneModel.cxx, line 1131 Is something in the scene close removing nodes in the wrong order? |
|
It could be that something's watching for node removed events and removing related nodes before the scene RemoveAllNodesExceptSingletons gets to them in it's loop. Putting |
|
Did a quick test of checking for scene IsClosing, no crash. The combo of two methods trying to clean up the scene caused two interelated crashes, my recommendation is:
|
|
svn 19519 adds a check for IsClosign to the models OnMRMLSceneNodeRemoved |
|
svn 19525 removes the clearing out of display and storage nodes on scene save, need to make the modules respond to node removed events to clear out "extra" nodes that they've added (display, storage) for the nodes they manage. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2012-03-03 12:23 | nicole | New Issue | |
2012-03-03 12:23 | nicole | Status | new => assigned |
2012-03-03 12:23 | nicole | Assigned To | => alexy |
2012-03-03 12:43 | nicole | Note Added: 0003769 | |
2012-03-05 08:31 | nicole | Note Added: 0003783 | |
2012-03-05 09:09 | nicole | Note Added: 0003784 | |
2012-03-05 09:50 | nicole | Note Added: 0003785 | |
2012-03-05 10:02 | nicole | Note Added: 0003786 | |
2012-03-06 06:10 | nicole | Note Added: 0003791 | |
2012-03-06 11:05 | nicole | Note Added: 0003796 | |
2012-03-06 11:05 | nicole | Assigned To | alexy => nicole |
2012-03-06 11:05 | nicole | Status | assigned => resolved |
2012-03-06 11:05 | nicole | Resolution | open => fixed |
2012-05-03 07:04 | nicole | Status | resolved => closed |
2014-03-06 06:10 | jcfr | Fixed in Version | => Slicer 4.1.1 |