Page history Edit this page How do I edit this website?

ImageJ.JS

ImageJ.JS is web version of ImageJ, we compiled ImageJ (version 1) from Java into Javascript with a Java compiler called CheerpJ. In addition to the modification for making it work better within the browser, importantly, we integrated it with the ImJoy plugin ecosystem. The project is currently under active development within the ImJoy Team led by Wei Ouyang.

The latest documentation with full details are avaiable at ImageJ.JS github repo, we hightlight a few features below.

Getting started

You can run ImageJ with all mainstream browsers with one click, no installation and no Java runtime environment needed. It also works on mobile devices.

To see how it works, click the “Run” button below:

Copyprint("You just started ImageJ.JS!")

To use ImageJ.JS outside the wiki, you can click this link: https://ij.imjoy.io.

Please also checkout our interactive introduction slides by clicking the “Run” button below:

Copyapi.createWindow({ src: 'https://slides.imjoy.io/?slides=https://gist.githubusercontent.com/oeway/3968df06b663088eca66f9bd8df94e81/raw/ImageJ.JS-slides-for-OME-Meetings-2021.md', passive: true })

(There is also a 3-minute introduction video associated with the interactive slides)

Sharing images or macro via URL

To facilitate the sharing of images, macro, and plugins, ImageJ.JS web app supports loading predefined images, macro or plugin by constructing a URL. If you made a ImageJ macro that you want to share, you can store them in your project repo on Github, or simply go to Gist(https://gist.github.com), paste it and get the URL. For example, we stored a demo macro here: https://gist.github.com/oeway/ab45cc8295efbb0fb5ae1c6f9babd4ac. Then wen can construct an URL for sharing where user can directly click and run: https://ij.imjoy.io/?run=https://gist.github.com/oeway/ab45cc8295efbb0fb5ae1c6f9babd4ac . This URL can be shared as is, or further shorten by one of the short URL service (e.g. tiny.cc).

ImJoy Integration

ImageJ.JS supports two-way integration with ImJoy, meaning you can either use it as an ImJoy plugin or load other ImJoy plugins into ImageJ.JS. This a a powerful combination, since it brings useful features from ImageJ including file IO, image processing plugins, macro scripting together with web plugins in ImJoy for building easy to use modern UI and powerful deep learning libraries.

In the standalone mode (simply go to https://ij.imjoy.io), you will have access to ImJoy features via the ImJoy icon located in the top-left corner of ImageJ. You can load ImJoy plugins into the workspace via a plugin URL, especially for those plugin that calls ImageJ.JS.

For example, the following code shows how to call ImageJ.JS api from an ImJoy plugin:

Copyasync function run(){
    const ij = await api.createWindow({src: "https://ij.imjoy.io"})
    await ij.runMacro(`print("hello world");`)
}

run()

The most common use case is to use it with Python, e.g. in a Jupyter notebook or in ImJoy.

Try an online demo: Binder

Interactive documentation

ImageJ.JS is a browser application that can be easily embedded into an website including project site and documentation.

In fact, we have added the support for running ImageJ in the ImageJ wiki, so you can directly run ImageJ macro and other ImJoy plugins.

For example, you can click and try the Run button bellow to see a basic imagej macro for image segmentation (Thanks to Romain Guiet who provided this minimal example):

Copyrun("Blobs (25K)");
setAutoThreshold("Default");
setOption("BlackBackground", true);
run("Convert to Mask");
run("Analyze Particles...", "size=5-Infinity add");

Run ImageJ.JS and ImJoy in ImageJ wiki

You can easily turn a markdown code block into executable and editable code block by:

  1. Add "imjoy" to extensions in the metadata of your markdown file (a.k.a Front Matter);
  2. Add a comment <!-- ImJoyPlugin: { ... } --> before your code block. Inside the {} you can pass settings for setting up the ImJoy plugin.

For example, you may have the following in the begining of your page:

Copy---
title: My Awesome Page
extensions: ["imjoy"]
---

And now, whthin the page, you can use the following to add a executable and editable code block:

Copy<!-- ImJoyPlugin: { "type": "macro"} -->
```javascript
print("hello");
```

To make it editable immediately, you can set startup_mode to "edit":

Copy<!-- ImJoyPlugin: { "type": "macro", "startup_mode": "edit", "editor_height": "100px"} -->
```javascript
print("hello");
```

For more detailed usage, please refer to ImJoy Docs.

Run ImageJ.JS in interactive slides

Similar to the ImageJ wiki integration, you can also create interactive slides which has ImageJ.JS directly embeded in. This features is useful for teaching purposes, it enables seamless interactive live demo during the presentation and the students can also go back to the same slides and interact with the demos.

You can click this link or the “Run” button below:

Copyapi.createWindow({ src: 'https://slides.imjoy.io/?slides=https://raw.githubusercontent.com/imjoy-team/imjoy-slides/master/slides/run-imagej.js-side-by-side.md', passive: true })

For more detailed usage, please refer to ImJoy Slides.

Integrate ImageJ.JS to your own website

If you have a project page, website or online data repository which you would like to allow users to run ImageJ.JS, you can integrate ImageJ.JS to make your data and analysis workflow interactive. Since ImageJ.JS is also an ImJoy plugin, the recommend way to integrate ImageJ.JS is to load the ImJoy core to your site by following the integration docs, and then run the following code to instantiate ImageJ.JS:

Copyasync function run(){
    const ij = await api.createWindow({src: "https://ij.imjoy.io"})
    // call the imagej.js api, see https://github.com/imjoy-team/imagej.js
}
run()

Citation

ImageJ.JS is a part of the ImJoy project, please consider citing the ImJoy paper on Nature Methods (https://www.nature.com/articles/s41592-019-0627-0, free access ):

CopyOuyang, W., Mueller, F., Hjelmare, M. et al. ImJoy: an open-source computational platform for the deep learning era. Nat Methods (2019) doi:10.1038/s41592-019-0627-0

Alternatively, you can also cite: DOI.

  1. GNU Lesser General Public License
    The GNU Lesser General Public License (LGPL) is a free, open source license for software and other kinds of works.
  2. Why Closed-Source Is Wrong
    This page has a few war stories about having to fight with developing software where you should not need to fight.
  3. GNU General Public License
    The GNU General Public License (GPL) is a free, open source license for software and other kinds of works.
  4. Apache Software License
    The Apache License is a permissive free software license, imposing minimal restrictions on the redistribution of covered software.
  5. Detect Information Loss
    How to detect various forms of information loss in images
  6. Eclipse Public License
    The Eclipse Public License (EPL) is a free, open source software license.
  7. Color Image Processing
    Images with color come in three different forms: pseudo-color, 24-bit RGB image, or color composite image.
  8. Why Open Source?
    This page highlights the benefits of open source software.
  9. BIG Licensing
    Components distributed via the BIG-EPFL update site were developed by the Biomedical Imaging Group (BIG) at the École Polytechnique Fédérale de Lausanne (EPFL).
  10. Public Domain
    Software in the public domain disclaims all copyright interest, being freely available to everyone for any purpose, with no attribution or acknowledgement required.
  11. Deconvolution
    corrects the systematic error of blur (loss of contrast in smaller features) in optical systems such as fluorescence microscopy images.
  12. Visualization
    is a set of techniques for graphically illustrating scientific data, enabling scientists to better understand, illustrate, and glean insight from their data.
  13. BSD Licenses
    BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the redistribution of covered software.
  14. Voxelization
    Voxelization is the process of converting a data structures that store geometric information in a continuous domain (such as a 3D triangular mesh) into a rasterized image (a discrete grid).
  15. MIT License
    The MIT License is a permissive free software license, imposing minimal restrictions on the redistribution of covered software.
  16. Licensing
    This page describes the legal structure of ImageJ and SciJava projects.