Skip to content

m-entrup/imagej-jython-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imagej-jython-package

A minimal environment to package Jython modules with maven.

Motivation

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.

  1. Clone this repository.

    git clone git@github.com:m-entrup/imagej-jython-package
  2. Create the jar file by running maven.

    cd imagej-jython-package
    mvn package
  3. Copy the jar file to jars/Lib. Lib may 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/
  4. 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)

About

A minimal envirement to package Jython modules with maven.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages