View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003684 | Slicer4 | Core: MRML | public | 2014-05-09 12:38 | 2018-03-02 11:01 |
Reporter | ogdenk | Assigned To | nicole | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | Slicer 4.3.1 | ||||
Target Version | Slicer 4.7.0 | Fixed in Version | Slicer 4.7.0 | ||
Summary | 0003684: Unable to save and reopen Freesurfer surface models and scalar overlays using .mrml scene file | ||||
Description | I am using Slicer to view some of the results from Freesurfer. I have in a directory the brain.mgz file, the surface models for the right and left hemisphere pial surfaces (lh.pial and rh.pial), and the scalar overlay files for the cortical thickness rh.thickness and lh.thickness. I can open these all as expected and get a really nice display of the cortical thickness as well as a coronal slice to refer to. I save everything and create the .mrml file for the scene. When I open the scene again, my pial models no longer display, though I can see them in the Models module. I can still see the coronal slice where I left it, just no models. Here is my order of events:
At this point everything looks fine.
I then close Slicer and reopen by double clicking the .mrml file or just reopen from within Slicer. The models are then invisible. I noticed that in the Models module, when I select one of the models and look at the Scalars, there is no active scalar listed and none in the dropdown. | ||||
Tags | No tags attached. | ||||
related to | 0004143 | assigned | Sunderlandkyl | Freesurfer surface is not aligned to the MR volume |
Reproducible on a Mac debug build. Downloaded the bert Freesurfer test data set[1], made a scene as described. When saving the scene, rh.pial and lh.pial are missing in the node list, but Slicer saved links to them in the .mrml file, and the display node has the active scalar set, and it has an overlay storage node. When load the scene: ERROR: In /Users/nicole/Slicer4-svn/Slicer/Libs/MRML/Core/vtkMRMLFreeSurferModelOverlayStorageNode.cxx, line 79 lh model has file name lh.thickness [1] http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/Data |
|
There are a few layers of bugs here, the first one appears when loading the scalar overlay: After loading lh.pial, the model node has one storage node, the model storage node. When you select the scalar file (lh.thickness) to load onto the surface lh.pial, the scalar overlay reader invokes the models logic AddScalar. That calls AddAndObserveStorageNodeID before it calls read data on the scalar overylay storage node. At this point stepping through the code there are two storage node references on the storable node and all is correct. But then ReadData at the storage node superclass calls the ReadDataInternal and then calls SetAndObserveStorageNodeID which over writes the model storage node reference with the scalar overlay storage node id. Changing the vtkMRMLStorageNode to use AddAndObserve instead of SetAndObserve, that goes through the newer reference management system which determines how many storage node references there are and adds to the end, witout checking if the currently passed storage node id exists in the list already. So just reading in the lh.pial surface ends up with 2 storage node ids, both vtkMRMLFreeSurferModelStorageNode1 (due to the combo of Add in the vtkMRMLStorageNode and Set in ModelsLogic AddModel(filename)). Adding the scalar overlay after that results in four storage node ids, two of the model storage node, two of the overlay storge node. One solution: not add the observation in the models logic AddScalar but make sure that the storage node does use add, and make sure that AddAndObserve checks for the id existing already. Adding a check on HasNodeReferenceID in AddAndObserve and returning null if it's found gets things further and exposes the save bugs. A question directed to people who have a better grasp on the new reference management system: can HadNodeReferenceID return -1 on failure, and the Nth value on success that we can pass to UpdateNthNodeReference? Does it even need to be updated at that point? I need to do further testing on if changing the Set to an Add in the storage node with the duplicate check will have any side effects, see this commit: |
|
When saving the correctly loaded scene, the FS model is set to save as a .vtk file but there are some missing pieces:
|
|
FreeSurfer lh.* test data uploaded to: |
|
Fixed in r26092. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2014-05-09 12:38 | ogdenk | New Issue | |
2014-05-09 12:38 | ogdenk | Status | new => assigned |
2014-05-09 12:38 | ogdenk | Assigned To | => alexy |
2014-05-12 06:05 | nicole | Note Added: 0011718 | |
2014-05-12 06:05 | nicole | Assigned To | alexy => nicole |
2015-11-18 12:57 | nicole | Target Version | => Slicer 4.5.1 |
2015-12-09 12:10 | nicole | Note Added: 0013670 | |
2015-12-09 12:13 | nicole | Note Added: 0013671 | |
2015-12-15 17:15 | nicole | Note Added: 0013687 | |
2016-03-01 10:09 | nicole | Relationship added | related to 0004143 |
2016-10-12 02:56 | jcfr | Target Version | Slicer 4.5.1 => Slicer 4.7.0 |
2017-06-14 17:03 | lassoan | Status | assigned => resolved |
2017-06-14 17:03 | lassoan | Resolution | open => fixed |
2017-06-14 17:03 | lassoan | Fixed in Version | => Slicer 4.7.0 |
2017-06-14 17:03 | lassoan | Note Added: 0014840 | |
2018-03-02 11:01 | jcfr | Status | resolved => closed |