View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001536 | Slicer4 | Core: Usability | public | 2011-11-10 12:09 | 2012-12-22 05:03 |
Reporter | fedorov | Assigned To | alexy | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | |||||
Target Version | Slicer 4.2.2-1 | Fixed in Version | Slicer 4.2.2-1 | ||
Summary | 0001536: Model slice intersections do not work | ||||
Description | in svn r18665 | ||||
Tags | No tags attached. | ||||
related to | 0001551 | closed | nicole | Model does not show up after model maker is completed |
related to | 0002332 | closed | inorton | slicer intersection of streamlines has stopped working |
related to | 0001632 | closed | inorton | Slice intersections are not working consistently |
parent of | 0001650 | closed | inorton | Model intersection doesn't show up on slice when adding the model in a module |
has duplicate | 0002499 | closed | alexy | Crash after turning on slice intersections and moving sliders in the 2D viewers |
has duplicate | 0002570 | closed | alexy | Newly created fiberbundles do not display in slice viewer, when tubes on slices is turned on |
related to | 0001384 | closed | inorton | Slice intersections only work in green viewer |
related to | 0002262 | closed | jcfr | Fix memory leaks associated with ModelDisplayableManager refactor |
related to | 0002267 | closed | nicole | Add "SliceIntersectionWidth" property to ModelDisplayNode |
related to | 0002766 | assigned | alexy | Refactor SliceModelDisplayableManager |
related to | 0002769 | acknowledged | alexy | Refactor ModelDisplayableManager |
Yes, model intersections are turned off on purpose for performance (decided at the last slicer4 tcon). Isaiah is working on a replacement. |
|
Committed, please let me know any issues. |
|
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=18702 |
|
Tested using Win32 binary build downloaded here: http://slicer.cdash.org/viewFiles.php?buildid=4838 Screenshot attached: no slice intersections with model on any of the slices. Error messages in the log: ERROR: In ....\VTK\Rendering\vtkOpenGLPolyDataMapper2D.cxx, line 69 ERROR: In ....\VTK\Rendering\vtkOpenGLPolyDataMapper2D.cxx, line 69 ERROR: In ....\VTK\Rendering\vtkOpenGLPolyDataMapper2D.cxx, line 69 ERROR: In ....\VTK\Rendering\vtkOpenGLPolyDataMapper2D.cxx, line 69 ERROR: In ....\VTK\Rendering\vtkOpenGLPolyDataMapper2D.cxx, line 69 ERROR: In ....\VTK\Rendering\vtkOpenGLPolyDataMapper2D.cxx, line 69 |
|
2011-11-18 04:27
|
|
I guess the scene notifications must work differently on scene import, which is what the modelmaker does. I'll change it to rebuild from MRML in such case. Maybe on NodeAdded, it should be a pretty small performance hit most of the time. except when you have 200 models loaded eg atlas. |
|
Resolved by Nicole's commit for 0001551 |
|
The intersections don't seem to update when the model is moved - here are two cases: 1) turn on slice intersections from the crosshair tool bar - they show up in the right place initially, but do not update in response to scroll/pan/zoom of the slices. 2) Put a model or fiber bundle in a transform and it updates in the 3D view but not in the slice intersection. |
|
I checked, and this is still an unresolved issue. The intersection updates to the correct one only if the slice slider is moved. |
|
In today's nightly build (Slicer 4.1.0-rc1-2012-03-16) the problem is still unresolved. How to reproduce: Run this script in the Slicer python console: sphere = vtk.vtkSphereSource() Show a slice => the slice intersection doesn't appear - ERROR! Save the model, load the model from file, enable slice intersection => the slice intersection appears - so the model was correct. |
|
Tested with Slicer 4.1 and slice intersections appear correctly. The only problem is that there is a a very specific order that has to be followed, e.g., So, there are still some issues with the update mechanism (notification about changes not always propagated through the entire pipeline), but at least there is now a solution for the problem. |
|
On the mac the intersections do not appear correctly, as of 4-16 |
|
Performed more testing with Slicer 4.1 on Windows and the problem still exists in when Slicer is build in debug mode. |
|
Isaiah, you've provided a work-in-progress solution a few weeks ago. What is the status of that fix? Do you need help in code review, testing, ...? |
|
On my Mac build: Red viewer shows two Slice Intersections. Using the Slice scroller, Slice Intersections do not update UNLESS the Slice is visible in the 3D view. (A configure event will also cause the intersections to update to reflect the current slice positions.) |
|
Working on a patch where: I reordered the calls in SliceLogic::UpdateSliceNodes() so that CreateSliceModel() is called after UpdateSliceNode() and UpdateSliceCompositeNode(). I changed CreateSliceModel() to use the SliceNode->GetLayoutColor(). These changes make it so the slice intersections are colored automatically, including the CompareViews. |
|
Added some debugging messages. These illustrate a call stack where when Slicer is starting ModelSliceDisplayableManager::OnMRMLSceneNodeAdded(vtkMRMLModelDisplayNode2) which illustrates that only two unique display nodes are processed by ModelSliceDisplayableManager::OnMRMLSceneNodeAddedEvent(). Should be three unique display nodes. Also, if you close the scene. The call stacks are different ModelSliceDisplayableManager::OnMRMLSceneNodeAdded(vtkMRMLModelDisplayNode1) where all 3 display nodes are processed. After closing the scene, the slice intersections work better. The appear in all the Slice Viewers. But they are not colored and they still need to have the Slice plane visible in order to update their position in the other viewers. |
|
I am concerned with the trace through the code and how the STL containers are managed. There are cases where a container is being iterated over and function calls on each element can cause other functions which may be trying to modify the container. We need to be careful with STL because certain operations on a container can invalidate an iterator on that container. Classic example is adding a element to a vector while iterating over the vector. Maps and sets are more robust to edits while being iterated over. |
|
Isaiah sent me a rework of the code for Slice Intersections. Uncertain as to whether it addresses all the issues. But it appeared to fix some of the issues I was observing. I changed how the colors are assigned. There is an issue that if more compare views are created, you need to toggle the Slice Intersections on and off. Probably need to tie into an event in the DisplayableManager. I have a branch on github with Isaiah's modifications and my changes. https://github.com/millerjv/Slicer4/tree/IsaiahsSliceIntersections |
|
resolved in r20455 |
|
Seems to work, thanks! Is it possible to make the model intersection lines thicker, or have thickness user-controllable? |
|
Hi Andrey, yes, the old tcl code used SetLineWidth=3 on the actor. I like this for the slice-position lines but I think it's really ugly even at 2 for general models. This could be generalized for user-selection by making a property on the DisplayNode, ie "SliceIntersectionThickness", which could then be set appropriately thick by slicelogic for the slice models, and default to something thin for other models. I don't want to touch the core nodes so i'll open a feature request for this. After such option is available then it will take 1 line each in the displayable manager and slicelogic to include. |
|
Dear issue reporter, Good news :) Slicer developers SOLVED the problem you reported - YOU now need to VERIFY and CLOSE this issue. |
|
I still see two issues: 1) when the model is generated in the scene (from Editor or from python console), the outlines in slice intersection do not show up. To reproduce, see Andras' script in this comment: http://www.na-mic.org/Bug/view.php?id=1536#c3885. See screenshot attached tested with Jul 25 nightly. 2) if I load a model with "Add data", the intersection shows up, but slice interactions are very slow (tested with MR Head and threshold-based model). |
|
2012-07-27 19:52
|
|
Tested on Tested on Slicer-4.1.0-2012-09-03-win-amd64.exe and it still does not work (the slice intersection does not appear if the script above (0003885) is executed). If the following workaround is used then the intersection can be forced to appear, but it's not acceptable in the long term:
|
|
I tried today. slice intersections from a model works for me. Slice intersections from the cross hair toolbar: They display properly, but when I use shift plus mouse movement in the slice viewer to change the slice position, it crashes slicer. |
|
I can confirm the crash reported by Ron. Very easy to replicate using his instructions. Leads to the stack trace below. Thread 1, Queue : com.apple.main-thread |
|
Hi Isaiah - I showed this to Alex and he said he could look at it if you don't have time or run out of options. -Steve |
|
Added vtkPolyData->Modified() as a workaround for crash in vtkCutter in order to update bounds of the locator. |
|
The slice intersections of the added model nodes do not appear, and the only thing that makes them appear is to show/hide a model hierarchy. I used the code Andras wrote in the comment 0003885. Can someone please take a look at it? Thank you! |
|
I found that the difference was made by calling Still, it would be nice if I wouldn't have to call it explicitly. |
|
To clarify:
I tested it on revisions 21301 (Nov 1) and 21321 (Nov 7). |
|
Adding models in GUI and enabling slice intersection seems to work ok. http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21412 |
|
Would it make more send to move the call to: this->SetUpdateFromMRMLRequested(1); after // Escape if the scene a scene is being closed, imported or connected this->AddDisplayableNode(vtkMRMLDisplayableNode::SafeDownCast(node)); I would like to make sure the root cause of the issue is fixed and not as a side effect of modified event on the displayable manager ... |
|
Jc, no, your suggestion does not make sense to me. When node is added I want to request update from mrml whether in batch mode or not. This is same logic as in vtkMRMLModelDisplayableManager::OnMRMLSceneNodeAdded which you made originally I believe. |
|
Hi Alex, For your subsequent commit, it would be great to write down what motivates a given change. In this case, you could mention you inspired from what was done in vtkMRMLModelDisplayableManager and then it appear to solve the problem. All of that said, I still didn't understand the root cause of the change. Indeed, the two displayable managers are different. Within vtkMRMLModelDisplayableManager at the end of the batch processing the event EndBatchProcessingEvent is invoked. Then the function "UpdateFromMRMLScene" is called Considering that the function "UpdateFromMRMLScene" is overwritten in "vtkMRMLModelDisplayableManager" so that RequestRender is called, it all makes sens. In case of the vtkMRMLModelSliceDisplayableManager, the function UpdateFromMRMLScene is not overwritten .. and i didn't understand what was triggering the rendering. // ------ Here is what happens: this->SetUpdateFromMRMLRequested(1); // Escape if the scene a scene is being closed, imported or connected this->AddDisplayableNode(vtkMRMLDisplayableNode::SafeDownCast(node)); // Content of RequestRender if (this->Internal->UpdateFromMRMLRequested) // Content of UpdateFromMRML So it means that this->UpdateFromMRML() is doing something that OnMRMLNodeAdded is not doing. Could it be the check on the node type ? Anyway, I think I solved that issue here: https://github.com/finetjul/Slicer/commit/522471e0d006dde98a852445e9308bd4834a8c5f Good catch ! // --------------------- He also mentioned that in OnMRMLSceneNodeAdded, the following code should be changed: 564 if ( !node->IsA("vtkMRMLModelNode") ) into if ( !this->Internal->UseDisplayableNode(node) ) // ------------------ Alex> Please, review J2 patch and suggestion and integrate :) |
|
Looking at the problem with a fresh eye, I will report below my observations: 1) The patch proposed by Julien is indeed not for "vtkMRMLModelDisplayableManager" or "vtkMRMLModelSliceDisplayableManager" but for "vtkMRMLVolumeGlyphSliceDisplayableManager". 2) The patch you proposed will impact performance. Everything will be cleared and recreated each time a node is added. 3) The work Julien did for "vtkMRMLVolumeGlyphSliceDisplayableManager" should serve as a basis for both the Slice Model displayable manager and the Model Displayable Manager. See https://github.com/finetjul/Slicer/compare/b3a33043b43fcf9b95d34d0a6f4eae305de17445...2374-glyph-slice-display-node 4) I created other issues to illustrate the fact the displayable managers should be refactored. See 0002766 and 0002769 |
|
JC, sorry to say but your comments still do not make sense to me.
Why you keep changing the status from fixed? The functionality works and the code is checked in. |
|
I update the note 7276 to clarify. We should probably discuss it during next hangout with Julien :) Ps: I changed the status ones from Resolved to Feedback, and an other time to "assigned. Now there is two new issues to track the fact the Model and Slice Model displayable manager should be re-factored. This issue can be closed. |
|
@alexy: |
|
Yes, it seems to be broken again. It was working few days ago. |
|
Given the current state:
@Alex: You should consider adding a cpp unit test similar to the python code of Csaba. |
|
Fixed showing of slice intersections, made it more efficient. Full vtkMRMLModelSliceDisplayableManager::UpdateFromMRML() is only called when batch processing is done. svn at revision: 21461 |
|
Model/slice intersections visible on 2d slice do not show up in the slice in 3d view (see screenshot). |
|
2012-12-21 10:58
|
|
Regarding Andrey's comment 7596, that makes sense - the overlay is done as a vtkActor2D poly line in the slice renderer so it's not expected to show up in the 3D view. If this is desired or required or expected, we should open a child issue as a feature request (this issue is already pretty long!). |
|
Steve, I agree. But I cannot close the bug because it has unresolved children. |
|
The core issue is resolved, but some related issues are still outstanding. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2011-11-10 12:09 | fedorov | New Issue | |
2011-11-10 12:21 | pieper | Note Added: 0003302 | |
2011-11-10 12:21 | pieper | Assigned To | => inorton |
2011-11-10 12:21 | pieper | Status | new => acknowledged |
2011-11-16 19:32 | inorton | Note Added: 0003321 | |
2011-11-16 19:33 | inorton | Note Added: 0003322 | |
2011-11-16 19:33 | inorton | Status | acknowledged => resolved |
2011-11-16 19:33 | inorton | Fixed in Version | => Slicer 4.0 RSNA |
2011-11-16 19:33 | inorton | Resolution | open => fixed |
2011-11-16 19:34 | inorton | Relationship added | related to 0001384 |
2011-11-18 04:27 | fedorov | Note Added: 0003329 | |
2011-11-18 04:27 | fedorov | Status | resolved => feedback |
2011-11-18 04:27 | fedorov | Resolution | fixed => reopened |
2011-11-18 04:27 | fedorov | File Added: Screen shot 2011-11-18 at 9.25.39 .png | |
2011-11-18 19:17 | inorton | Note Added: 0003332 | |
2011-11-18 19:17 | inorton | Status | feedback => acknowledged |
2011-11-20 07:13 | inorton | Relationship added | related to 0001551 |
2011-11-20 07:14 | inorton | Note Added: 0003339 | |
2011-11-20 07:14 | inorton | Status | acknowledged => resolved |
2011-11-20 07:14 | inorton | Resolution | reopened => fixed |
2011-11-21 12:03 | pieper | Note Added: 0003341 | |
2011-11-21 12:03 | pieper | Resolution | fixed => reopened |
2011-11-22 18:27 | inorton | Status | resolved => acknowledged |
2012-01-19 18:24 | fedorov | Note Added: 0003513 | |
2012-02-21 09:11 | inorton | Relationship added | parent of 0001632 |
2012-02-21 09:12 | inorton | Relationship added | parent of 0001650 |
2012-03-16 11:05 | lassoan | Note Added: 0003885 | |
2012-04-11 06:00 | lassoan | Note Added: 0004000 | |
2012-04-16 09:02 | kikinis | Note Added: 0004023 | |
2012-04-17 12:53 | lassoan | Note Added: 0004038 | |
2012-04-17 12:55 | lassoan | Note Added: 0004039 | |
2012-05-03 09:53 | millerjv | Note Added: 0004152 | |
2012-05-04 11:54 | millerjv | Note Added: 0004165 | |
2012-05-04 11:55 | millerjv | Note Edited: 0004165 | |
2012-05-04 11:59 | millerjv | Note Added: 0004166 | |
2012-05-04 12:03 | millerjv | Note Added: 0004167 | |
2012-05-22 14:34 | fedorov | Target Version | => Slicer 4.2.0 AHM Summer 2012 |
2012-05-23 06:15 | millerjv | Note Added: 0004579 | |
2012-06-21 19:38 | inorton | Note Added: 0004899 | |
2012-06-21 19:38 | inorton | Status | acknowledged => resolved |
2012-06-21 19:38 | inorton | Resolution | reopened => fixed |
2012-06-24 13:17 | fedorov | Note Added: 0004914 | |
2012-06-24 13:17 | fedorov | Status | resolved => feedback |
2012-06-24 13:17 | fedorov | Resolution | fixed => reopened |
2012-06-26 13:12 | jcfr | Relationship added | related to 0002262 |
2012-06-26 21:04 | inorton | Note Added: 0004943 | |
2012-06-26 21:05 | inorton | Status | feedback => resolved |
2012-06-26 21:05 | inorton | Resolution | reopened => fixed |
2012-06-26 21:08 | inorton | Relationship added | related to 0002267 |
2012-07-27 15:36 | jcfr | Note Added: 0005324 | |
2012-07-27 19:52 | fedorov | Note Added: 0005434 | |
2012-07-27 19:52 | fedorov | Status | resolved => feedback |
2012-07-27 19:52 | fedorov | Resolution | fixed => reopened |
2012-07-27 19:52 | fedorov | File Added: 2012-07-27_2351.png | |
2012-07-27 19:55 | jcfr | Relationship added | related to 0002332 |
2012-09-04 15:39 | lassoan | Note Added: 0005965 | |
2012-09-26 04:06 | kikinis | Note Added: 0006220 | |
2012-09-28 09:06 | pieper | Note Added: 0006267 | |
2012-09-28 09:06 | pieper | Severity | minor => crash |
2012-10-02 13:23 | pieper | Note Added: 0006344 | |
2012-10-02 13:25 | pieper | Relationship added | has duplicate 0002499 |
2012-10-09 06:11 | alexy | Status | feedback => assigned |
2012-10-09 06:11 | alexy | Assigned To | inorton => alexy |
2012-10-09 10:31 | alexy | Note Added: 0006474 | |
2012-10-09 10:31 | alexy | Status | assigned => resolved |
2012-10-09 10:31 | alexy | Resolution | reopened => fixed |
2012-10-30 10:28 | pieper | Relationship added | has duplicate 0002570 |
2012-11-07 11:06 | pinter | Note Added: 0007105 | |
2012-11-07 11:06 | pinter | Status | resolved => assigned |
2012-11-07 11:34 | pinter | Note Added: 0007109 | |
2012-11-07 11:41 | pinter | Note Added: 0007110 | |
2012-11-07 11:43 | jcfr | Fixed in Version | Slicer 4.0.0 => |
2012-11-07 11:43 | jcfr | Target Version | Slicer 4.2.0 => Slicer 4.2.1 |
2012-11-07 11:44 | pinter | Note Edited: 0007110 | |
2012-11-14 09:53 | alexy | Note Added: 0007223 | |
2012-11-14 09:53 | alexy | Status | assigned => resolved |
2012-11-14 14:00 | jcfr | Note Added: 0007227 | |
2012-11-14 14:12 | jcfr | Status | resolved => feedback |
2012-11-14 14:12 | jcfr | Resolution | fixed => reopened |
2012-11-14 15:05 | alexy | Note Added: 0007230 | |
2012-11-14 15:05 | alexy | Status | feedback => resolved |
2012-11-14 15:05 | alexy | Resolution | reopened => fixed |
2012-11-15 04:25 | jcfr | Note Added: 0007231 | |
2012-11-15 04:25 | jcfr | Status | resolved => assigned |
2012-11-15 04:27 | jcfr | Note Edited: 0007231 | |
2012-11-15 04:48 | jcfr | Note Edited: 0007231 | |
2012-11-16 05:13 | jcfr | Note Added: 0007276 | |
2012-11-16 05:50 | alexy | Note Added: 0007279 | |
2012-11-16 05:53 | jcfr | Note Edited: 0007276 | |
2012-11-16 05:57 | jcfr | Relationship added | related to 0002766 |
2012-11-16 05:57 | jcfr | Relationship added | related to 0002769 |
2012-11-16 05:58 | jcfr | Note Edited: 0007276 | |
2012-11-16 06:02 | jcfr | Note Added: 0007280 | |
2012-11-16 06:20 | pinter | Note Added: 0007282 | |
2012-11-16 06:53 | alexy | Note Added: 0007287 | |
2012-11-16 07:05 | jcfr | Note Added: 0007288 | |
2012-11-16 12:02 | jcfr | Target Version | Slicer 4.2.1 => Slicer 4.2.2 |
2012-11-25 08:14 | alexy | Note Added: 0007364 | |
2012-11-25 08:16 | alexy | Status | assigned => resolved |
2012-12-07 18:29 | jcfr | Fixed in Version | => Slicer 4.2.2 |
2012-12-21 10:58 | fedorov | Note Added: 0007569 | |
2012-12-21 10:58 | fedorov | Status | resolved => feedback |
2012-12-21 10:58 | fedorov | Resolution | fixed => reopened |
2012-12-21 10:58 | fedorov | File Added: Screen Shot 2012-12-21 at 15.57.20 .png | |
2012-12-21 11:51 | pieper | Note Added: 0007570 | |
2012-12-21 19:27 | fedorov | Note Added: 0007571 | |
2012-12-21 19:27 | fedorov | Status | feedback => resolved |
2012-12-21 19:27 | fedorov | Resolution | reopened => fixed |
2012-12-22 05:01 | pieper | Relationship deleted | parent of 0001632 |
2012-12-22 05:02 | pieper | Relationship added | related to 0001632 |
2012-12-22 05:03 | pieper | Note Added: 0007573 | |
2012-12-22 05:03 | pieper | Status | resolved => closed |