The standard library contains nodes that allow to run Python scripts using an existing installation of Python. This means you will need to download Python, Anaconda, or Miniconda.
Setting up Python
You have the option to either select an existing Python environment, or let JIPipe install a new Conda environment into a folder.
To setup Python, navigate to
Project > Application settings > Extensions > Python integration.
There you will find a setting
Python environment that, by default, is not set up.
If you want to select an existing Python environment or let JIPipe handle the installation for you,
Select/Install button and select the appropriate operation. Follow the instructions provided
in the newly opened window.
You can also edit existing Python environments by selecting the
Edit button to, for example,
setup environment variables or change command line parameters.
You can find the nodes in the
Miscellaneous menu. You can find algorithms equivalent
to each of the Java standard algorithms:
|Python script||JIPipeParameterSlotAlgorithm||This algorithm allows users to run multiple parameter sets by optionally enabling an additional slot
|Python script (simple iterating)||JIPipeSimpleIteratingAlgorithm||A JIPipeParameterSlotAlgorithm that has one input slot and iterates over the input rows.|
|Python script (iterating)||JIPipeIteratingAlgorithm||A JIPipeParameterSlotAlgorithm that can have multiple input slots and match annotations of the input data to create data batches.|
|Python script (merging)||JIPipeMergingAlgorithm||A JIPipeParameterSlotAlgorithm that can have multiple input slots and match annotations of the input data to create data batches. The difference to JIPipeIteratingAlgorithm is that a batch can have duplicate items per slot.|
All Python script nodes share a set of variables that are available in the code:
||A dict of slot name to an instance of DataSlot. Each item represents the input data of the current data batch/current input.|
||A dict of slot name to an instance of DataSlot. Each item represents the output data of the current data batch/current output.|
Python nodes based on JIPipeSimpleIteratingAlgorithm, JIPipeIteratingAlgorithm, and JIPipeMergingAlgorithm repeat the script for each data batch (or at least once if there is none). Data batches organize the data of various input slots into one bundle that should be processed.
Data access is handled through temporary folders that contain input/output data in JIPipe standardized format. The nodes are supplied with a Python API that allows to read/write data and metadata in this format.
You can choose to not use the reading/writing functions provided by this package and access the input/output folders directly.
Each JIPipe data type provides information about the structure of the data folder. You can find it in [?] > Data type compendium.
Each node provides means to define Python variables inside the JIPipe environment via custom parameters. Each parameter value is passed as variable into Python - the name of the variable being determined by the unique ID of the parameter.
All Python nodes are multi-parameter capable (including iterating and merging nodes). “Python script (multi-parameter capable)” provides a unique variable
that contains any annotations of the current parameter set.