vtkSlicerMarkupsLogic methods from v4.8 missing from master version

I’m trying to upgrade the code of modules developed for slicer4.6 with python 2.7 into slicer5.0.3 with python3.9

All went good until i found out that some methods are missing in the new slicer version.

mlogic = slicer.modules.markups.logic()
  
mlogic.SetDefaultMarkupsDisplayNodeTextScale(1.3)
mlogic.SetDefaultMarkupsDisplayNodeGlyphScale(1.5)
mlogic.SetDefaultMarkupsDisplayNodeColor(0.39, 0.78, 0.78) 
mlogic.SetDefaultMarkupsDisplayNodeSelectedColor(0.39, 1.0, 0.39)

slicer gives me errors saying slicer.modules.markups.logic() doesnt have any of those methods. and that’s true! In slicer 5.0.3 all those methods are gone.

What can i do? Are those methods moved somewhere else with different names?

See description of the API change here: Documentation/Nightly/Developers/Tutorials/MigrationGuide - Slicer Wiki

1 Like
  • GetDefaultMarkups…() and SetDefaultMarkups…() methods are removed. Instead default display node can be accessed by GetDefaultMarkupsDisplayNode() method and default values can be get/set in that class.
slicer.modules.markups.logic().GetDefaultMarkupsDisplayNode()
1 Like