Fig. 1: The software architecture of PyImageJ.

Blue shows the Python environment and example Python applications. Red shows the ImageJ2 software stack with example plugins running in a special Python-integrated Java virtual machine (JVM). In the Python environment, PyImageJ uses JPype (from the scyjava layer) to create the Python-integrated JVM that will run the ImageJ2 software stack. In the Java environment, this encapsulated JVM incorporates all the user-requested Java libraries, including ImageJ, ImageJ2 and additional plugins — for example, from Fiji and/or other ImageJ update sites. The top Python layer, PyImageJ, provides access to the ImageJ2 gateway and Python convenience functions. The Python-side imglyb interfaces with the Java-side ImgLib2. Finally, the Python scyjava layer provides the foundational components such as JVM configuration and type conversions.