Hi Manuel,
thanks a lot for this question. It is indeed an interesting use case to create instructions that are paired with an image.
One way that comes to my mind is using the add-on module ReadValues to load an excel or csv file where you can define a list of image paths and you can add further columns to define parameters or whether a certain test should be done.
A sequencer could look like:
In this example, there are four branches who represent different tests to be done.
A Condition module in each branch is used to check whether the branch should be processed or not.
A UserIO module could be used to tell a user what do do in this step before the sub-routine starts that is represented in my example via a CustomFunction module.
The problem that you have to change the image in the widget Image is related to the fact that you can only select one variable, but you cannot change the variable later on. This is why the content of the selected variable must change which is done in the above example by using a ReadValues module that sweeps through a list of image paths and returns them when iterating through the rows.
There is another trick by using a Calc module at the beginning of the sequencer to create a variable in the system that again represents a path selected by the Image widget.
It is now possible to add CustomFunction scripts that programmatically changes the value of this parameter by setting a new image path using the ParameterManager.
I have added a description to the Wiki about the article of the ParameterManager
However, this second way should be used with care, because first of all it leads to creating individual code that is hard to reuse. Often, it is not easy to see where the magic happens if not well documented and can easily break if a variable is renamed. Still, it is one possibility that might help you.
A last option would be to add a CustomFunction script that comes with a custom widget that is showing the image and can have further logic.
As this use case is not used that often but should become something that is easy to do, we could also discuss how to improve the modular system of SweepMe! to make such things easier.
Best, Axel