A minimal environment to package Jython modules with maven.
With ImageJ it is possible to use self written Jython modules to extend the functionality. Packages and modules can be placed at the directory
jars/Lib. ImageJ's Jython is configured to add
jars/Lib to the default search path for packages and modules.
If you want to use the Updater to distribute Jython packages and modules, it can be handy pack these files as a singe Jar file. As mavens is designed to create Jar files, it can be used to automate the packaging. This repository is a template for a maven project to achieve the given goal.
How-to use it
The prerequisite for using this template is to have maven installed. Afterwards only four steps will allow you to use batch_opener.py.
Clone this repository.
git clone email@example.com:m-entrup/imagej-jython-package
Create the jar file by running maven.
cd imagej-jython-package mvn package
Copy the jar file to
Libmay not exist, yet.
mkdir -p path-to-ImageJ/jars/Lib cp target/imagej-jython-package-0.1.0-SNAPSHOT.jar path-to-ImageJ/jars/Lib/
Start ImageJ and run the following Jython script.
# @File(label='Choose a directory', style='directory') import_dir from examplePackage import batch_opener images = batch_opener.batch_open_images(import_dir, recursive=True) for image in images: print(image)