Hacking a workflow¶
The orange-canvas allows users to add Python script to a workflow
And with it users can add some processing to it and ultimately bring some flexibility to it.
For example here we simply get the in data
, print his identifier and define it as out data
Usually the input parameter will be data
(map to in_data
) or a volume (map to in_volume
)
A list of example script are available from the python script documentation page
When the python object has several link connected to the same input like `data` we will move from `in_data` to `in_datas`. This can be disconcerting.
Usually a recommanded practice is to limit link to an input to one.
The python script will be executed in the main Qt thread. As a consequence during it execution the GUI will not be responsive. So if your processing is heavy you might experience some gui freezing.
Exercice A: modify the 'data' energy and resume processing¶
In [ ]:
Exercise B: print the shape of a reconstructed slice
¶
Help:
- reconstructed slices identifiers can be obtain from latest_reconstructions property. It returns a list of identifiers (url of the volumes)
- you can convert volume identifiers to volume object by using the VolumeFactory.create_tomo_object_from_identifier
- from the volume object you can load the data by calling
volume.load_data()
. It returns a numpy array
In [ ]: