View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004306 | Slicer4 | Module Markups | public | 2016-11-18 13:03 | 2017-06-13 17:54 |
Reporter | fepegar | Assigned To | nicole | ||
Priority | normal | Severity | block | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Product Version | Slicer 4.6.1 | ||||
Target Version | Fixed in Version | ||||
Summary | 0004306: Markups are slow | ||||
Description | I'm working on characterization of geometric distortion in MRI, with a stereotactic phantom containing around 2000 points. It would be convenient to represent and modify these points using markups, but Slicer is not happy when there are "many" markups in the scene. I don't know whether there are any tricks or advice for me or I just should use simpler classes. | ||||
Steps To Reproduce | import numpy as np mn = slicer.vtkMRMLMarkupsFiducialNode() LEKSELL_XMIN, LEKSELL_XMAX = 100-50, 100+50 The loop takes some time...for point in points: slicer.mrmlScene.AddNode(mn) Once the fiducials are in the scene, I tried to lock them using the GUI of Markups module (to see it it goes faster) and Slicer hangs forever. | ||||
Tags | No tags attached. | ||||
The code as written goes through the loop really fast (< 2s on my machine, release build on Linux) because the node isn't in the scene yet, the slow part comes with adding the node at the end There have been various speed ups incorporated in the code, but this is a case I haven't tested before. There are various commands that you can try to let the program know that you're batch processing, this is with assuming you move the adding of the node to the scene right after you create it (with no modify flag setting, I killed the add loop since it was super slow): flag = mn.StartModify() This results in: The lock works more for interactive mode, stopping the constant intersection checks with each fiducial. If you don't need the text to display you can add: and that will result in a speed up in interacting with the fiducials, but not in adding them to the scene originally. The other thing you can do is to make sure that you do the lock/visibility etc settings on the list as a whole, rather than iterating through each fiducial, which is what you're doing in python, but in the GUI, you need to use the toggles right beside the list name drop down, rather than the multi drop downs right above the table. That will cause any checks to hit the list status first rather than having to go down into the individual fiducial level to check. If you're still finding the GUI too slow for you, consider using a different data structure and the glyph mapper that's used for displaying transforms. I'm not as familiar with that but could dig up some pointers. |
|
Markups is intended to be used for manual marking/editing of point positions. There is no specific limit for number of points that can be added to a list, but performance is optimal if there are less than 100 points. For visualizing more points, it is recommended to use a vtkMRMLModelNode, which contains vtkPolyData generated by a vtkGlyph3D filter. (this not is also added to markups node documentation) |
|
I ended up using a vtkGlyph for this project. Thanks for having looked into this. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2016-11-18 13:03 | fepegar | New Issue | |
2016-11-18 13:03 | fepegar | Status | new => assigned |
2016-11-18 13:03 | fepegar | Assigned To | => nicole |
2016-11-18 13:03 | fepegar | Relationship added | related to 0004239 |
2016-11-18 13:03 | fepegar | Relationship added | related to 0001714 |
2016-11-18 13:04 | fepegar | Relationship added | related to 0001091 |
2016-11-21 19:10 | nicole | Note Added: 0014254 | |
2017-06-09 21:07 | lassoan | Status | assigned => resolved |
2017-06-09 21:07 | lassoan | Resolution | open => won't fix |
2017-06-09 21:07 | lassoan | Note Added: 0014700 | |
2017-06-13 17:47 | fepegar | Note Added: 0014829 | |
2017-06-13 17:54 | lassoan | Status | resolved => closed |