Hi all,
I’d like to show the scalar bar like when I do DataProbe -> ScalarBar -> Enable -> Foreground. Do you know how I can do this? I’ve always had a hard time accessing the DataProbe stuff from Python.
Cheers,
Fernando
Hi all,
I’d like to show the scalar bar like when I do DataProbe -> ScalarBar -> Enable -> Foreground. Do you know how I can do this? I’ve always had a hard time accessing the DataProbe stuff from Python.
Cheers,
Fernando
Hi @Fernando - this should work for you (although we might want to think of a better API).
qt.QSettings().setValue('DataProbe/sliceViewAnnotations.scalarBarEnabled', True)
import DataProbeLib
DataProbeLib.SliceAnnotations().updateSliceViewFromGUI()
Thanks, Steve. That worked great to enable the scalar bar. Do you know how I can specifically show the foreground one?
It’ll be a similar pattern - have a look at the various options in the code…
I did! But the choice between background and foreground doesn’t seem to be part of those settings…
Right - looks like that setting is not persisted in the settings. Maybe you want to add code to persist it to be consistent. Probably the best thing to do would be to expose a proper logic API for these in the DataProbe code.
Data probe (that includes scalar widget management) would need to be completely rewritten. We’ve been planning to do this but there have been always higher-priority tasks.
@Fernando If you can achieve what you need with small changes then go on, but if you have some more time then it would be great if you could help with redesign/reimplementation of the feature.
I’ll let you know if I find a solution. @lassoan, that code has always been a bit obscure to me, but I’m happy to help if I can.
Update: the argument to setValue
here needs to be an int not a boolean in order to be restored correctly:
qt.QSettings().setValue('DataProbe/sliceViewAnnotations.scalarBarEnabled', 1)
import DataProbeLib
DataProbeLib.SliceAnnotations().updateSliceViewFromGUI()