How can I obtain all loaded data in the scene via python, if such data exists? I need to create a conditional that only runs a certain function if the scene already has some data, otherwise the user is prompted to load data.
Also what are the different data types that can be loaded by the user? For example, scene, volume, sequence, and transforms can be loaded by the user via the slicer.util.load… function, but I do not know all the possible types/functions
For this use case, I would rather observe the MRML scene for new nodes added and react to the first addition (you can also filter the type of nodes you want to consider), then you can remove the observer or simply ignore subsequent event triggers.
There are a lot of data types that the user can load, and this also depends on the extensions installed by the user. slicer.util.load.. are utility functions to load the most commonly used types, but they don’t represent the whole extent of possibilities. In the approach described (observing the MRML Scene) above you will be “notified” for any data type loaded, even data supported by other modules.