Run script
Run Fiji-compatible scripts directly within a MIA workflow.
Description
Run Fiji-compatible scripts directly within a MIA workflow. These can be used to perform advanced actions, such as making measurements that aren't explicitly supported in MIA or running additional plugins. Each script has access to the current workspace, thus providing a route to interact with and specify new images and objects. Scripts also have access to this module, which in turn can be used to access all modules in the current workflow. Scripts are run once per workflow execution.
Parameters
Parameter | Description |
---|---|
Script mode | Select the source for the script code:
|
Script language | Specify the language of the script written in the "Script text" box. This parameter is not necessary when loading a script from file, since the file extension provides the language information. |
Script text | Script code to be executed. Access to the active MIA workspace and module are provided by the first two lines of code ("#@ io.github.mianalysis.mia.object.Workspace workspace" and "#@ io.github.mianalysis.mia.module.Module thisModule"), which are included by default. With these lines present in the script, the workspace can be accessed via the "workspace" variable and the current module (i.e. this script module) via the "thisModule" variable. |
Script file | Select a script file to be run by this module. As with the "Script text" parameter, this script can start with the lines "#@ io.github.mianalysis.mia.object.Workspace workspace" and "#@ io.github.mianalysis.mia.module.Module thisModule", which provide access to the active workspace and this module. |
Add output | If images or new object collections have been added to the workspace during script execution they must be added here, so subsequent modules are aware of their presence. The act of adding an output via this method simply tells subsequent MIA modules the relevant images/object collections were added to the workspace; the image/object collection must be added to the workspace during script execution using the "workspace.addImage([image])" or "workspace.addObjects([object collection])" commands. |
Output type | Specifies the type of variable that has been added to the workspace during the script. These can either be images, new object collections or measurements associated with existing images or object collections. |
Output image | Name of the image that has been added to the workspace during script execution. This name must match that assigned to the image. |
Output objects | Name of the object collection that has been added to the workspace during script execution. This name must match that assigned to the object collection. |
Associated image | Image from the workspace (i.e. one already present before running this module) to which a measurement has been added during execution of the script. |
Metadata name | Name of a metadata item which has been added during execution of the script. |
Associated objects | Object collection from the workspace (i.e. one already present before running this module) to which a measurement has been added during execution of the script. |
Measurement name | Name of the measurement that has been added to either an image or objects of an object collection. This name must exactly match that assigned in the script. |
Parent name | Name of a parent object already in the workspace which has been related to the objects specified by "Children name" during execution of the script. |
Children name | Name of child objects already in the workspace which have been related to the objects specified by "Parent name" during execution of the script. |
Partners name 1 | Name of partner object already in the workspace which have been related to the objects specified by "Partners name 2" during execution of the script. |
Partners name 2 | Name of partner object already in the workspace which have been related to the objects specified by "Partners name 1" during execution of the script. |