View Issue Details

IDProjectCategoryView StatusLast Update
0003138Slicer4Module Annotationspublic2017-06-07 23:27
Reporterkotwicz Assigned Tonicole  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.2.0 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0003138: Fiducials not displaying correctly in slice viewers
Description

fiducialNode = slicer.vtkMRMLAnnotationFiducialNode()
fiducialNode.Initialize(slicer.mrmlScene)
fiducialNode.SetFiducialCoordinates(0,0,0)

This causes the fiducial to appear in the green viewer but not the red or yellow viewer.

TagsNo tags attached.

Relationships

related to 0003164 closednicole Adding fiducial nodes via python creates memory leaks 

Activities

nicole

nicole

2013-07-12 06:35

administrator   ~0009022

From a quick test with that code snippet, it looks like the 2d fiducial displayable manager is not detecting that the fiducial has been added and that it needs to be displayed (the fiducial is showing up fine in 3d for me on a linux debug build after the initialize call), until there's a post initialization change in the fiducial's location.
Part of the problems is that initialize doesn't actually set any of the points, and the 3d manager defaults to setting the glyph at the origin, while the 2d one just doesn't display it. Setting the fiducial coordinates is required, but somehow that's not triggering an update.
On the mailing list you mentioned a work around, could you let me know what you did?

kotwicz

kotwicz

2013-07-12 06:39

reporter   ~0009023

  • the workaround I am using right now is:
    fiducialNode.SetDisplayVisibility(0)
    fiducialNode.SetDisplayVisibility(1)
nicole

nicole

2013-07-12 09:55

administrator   ~0009026

Digging back a bit in the bug archives, something similar had come up previously in bug 3164. If I try this order of python calls, the fiducial shows up in all the viewers for me:
f = slicer.vtkMRMLAnnotationFiducialNode()
f.SetFiducialCoordinates(0,0,0)
f.Initialize(slicer.mrmlScene)

Can you check to see if that works for you?

kotwicz

kotwicz

2013-07-12 10:01

reporter   ~0009027

Yes this does work, maybe the initialize function could set the fiducial coordinates to a default [0,0,0]...

nicole

nicole

2013-07-17 11:46

administrator   ~0009108

The annotations are getting deprecated for the Markups module, it makes the most sense right now to just provide a utility method on the logic to add a new fiducial, checked in as svn 22205[1].

fidID = slicer.modules.annotations.logic().AddFiducial(10.0, -50.0, 8.8, 'P1')
f = getNode(fidID)

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22205

Related Changesets

Slicer: 2145-support-for-installing-extension-from-file 241ce151

2013-07-17 15:45:27

naucoin

Details Diff
ENH: add a utility method to add a new fiducial

Prevents memory leaks and error messages from adding a fiducial
and a display node.

For access from python, use:
fidID = slicer.modules.annotations.logic().AddFiducial(10.0, -50.0, 8.8, 'P1')
fidNode = getNode(fidID)

Resolves issue 0003138



git-svn-id: http://svn.slicer.org/Slicer4/trunk@22205 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/Annotations/Logic/vtkSlicerAnnotationModuleLogic.cxx Diff File
mod - Modules/Loadable/Annotations/Logic/vtkSlicerAnnotationModuleLogic.h Diff File

Issue History

Date Modified Username Field Change
2013-05-31 11:11 kotwicz New Issue
2013-05-31 11:11 kotwicz Status new => assigned
2013-05-31 11:11 kotwicz Assigned To => nicole
2013-07-12 06:35 nicole Note Added: 0009022
2013-07-12 06:36 nicole Target Version => Slicer 4.3.0
2013-07-12 06:39 kotwicz Note Added: 0009023
2013-07-12 09:55 nicole Note Added: 0009026
2013-07-12 10:01 kotwicz Note Added: 0009027
2013-07-17 11:46 nicole Note Added: 0009108
2013-07-17 11:46 nicole Status assigned => resolved
2013-07-17 11:46 nicole Fixed in Version => Slicer 4.3.0
2013-07-17 11:46 nicole Resolution open => fixed
2013-07-17 11:50 nicole Relationship added related to 0003164
2013-07-17 12:17 kotwicz Status resolved => closed
2017-06-07 23:27 Changeset attached => Slicer 2145-support-for-installing-extension-from-file 241ce151