Adding Rulers to Python Code

I am currently working on a plugin for people not familiar with Slicer to use, so I am trying to keep the plugin self-contained. I am trying to add functionality for the user to add rulers for it for later measurements. What is the best way to do this? The only thing I’ve had some success with so far is using markerTable = slicer.qSlicerSimpleMarkupsWidget() but it only supports fiducial markers rather than rulers.

Very good.

By default, qSlicerSimpleMarkupsWidget's node selector shows fiducial nodes, but you can get the node selector combobox and set node types (class names) that you want to work with.

If you just want to place a line (not display point coordinates) then it is probably better to use simpler and more compact markups place widget.