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

ParameterDescription
Script modeSelect the source for the script code:
  • "Script file" Load the macro from the file specified by the "Script file" parameter.
  • "Script text" Script code is written directly into the "Script text" box.
Script languageSpecify 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 textScript 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 fileSelect 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 outputIf 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 typeSpecifies 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 imageName of the image that has been added to the workspace during script execution. This name must match that assigned to the image.
Output objectsName 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 imageImage 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 nameName of a metadata item which has been added during execution of the script.
Associated objectsObject 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 nameName 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 nameName 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 nameName 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 1Name 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 2Name of partner object already in the workspace which have been related to the objects specified by "Partners name 1" during execution of the script.