I am using Slicer to create a widget for an application in which I would like to save my work. I see in slicer there is saveScene() in which I can do an mrml or a mrb file - which I can get to work. However, the widget also includes variables and structures as such as “self.variable1, self.variable2.subvariable2, etc.” These “self.variables” are important to my GUI’s widget and logic classes. The issue is when I save the scene I am successful in saving the fiducial nodes and image that was brought into slicer because they are slicer nodes (I believe) but the :self.variables" associated with the widget do not save. In other words, when I try to re-open my saved scene the program fails because the self.A and other variables are not saved within the scene.
Is there an easy way to save these “self.variables” so I can reopen slicer after closing it to where I was last with the values back in my variables? Is there a suggested solution to reopening slicer with reimporting these self.variables back into the program quickly if slicer can not save the variables?