UI state management in scripted modules

When PickAndPaint module was developed, Python scripted module development was still quite immature. Nowadays I would recommend to create the module using Qt Designer and use updateParameterNodeFromGUI/updateGUIFromParameterNode methods to synchronize parameter node content with GUI. See ScriptedDesigner module template as an example and this discussion for some more details.

Also note that the new markups widgets offer possibilities that were not feasible before. For example, @Sunderlandkyl just implemented drawing of open and closed curves on surfaces (will be announced tomorrow) and you can use these surfaces for defining surface regions. It would be also feasible now to implement constraining of markup points to a selected surface in Slicer core (and in 3D views, markups snap to visible surfaces already).

There are a few other small issues, such as:

  • Node ID must never be stored in a node attribute, because node IDs can be changed when a scene is loaded and the existing scene contains nodes by the same IDs. Always use node references instead.
  • Logic should never use and GUI functions (currently the logic may display popup windows)
  • Logging macros should be used instead of print