In my custom module, the user can adjust the size and position of the image capture of the RGY slice view windows. I would like to implement a button that will show the area to be captured by accessing the QPainter of the slice view window and then drawing a red rectangle in that window.
Here is an example of the script I have been trying to use:
layoutManager = slicer.app.layoutManager()
greenView = layoutManager.sliceWidget(‘Green’).sliceView()
michelangelo = qt.QPainter(greenView)
Nothing shows up after running the code.