Skip to main content
Image.sc forum https://github.com/ome/omero-figure/workflows/OMERO/badge.svg https://badge.fury.io/py/omero-figure.svg

OMERO.figure

An OMERO.web app for creating figures from images in OMERO.

For full details see SUPPORT.md.

Requirements

  • OMERO.web 5.6.0 or newer.

Installing from PyPI

This section assumes that an OMERO.web is already installed.

Install the app using pip:

NB: You need to ensure that you are running pip from the python environment where omero-web is installed. Depending on your install, you may need to call pip with, for example: /path/to_web_venv/venv/bin/pip install ...

$ pip install -U omero-figure

Add figure custom app to your installed web apps:

$ omero config append omero.web.apps '"omero_figure"'

Display a link to ‘Figure’ at the top of the webclient:

$ omero config append omero.web.ui.top_links '["Figure", "figure_index",
  {"title": "Open Figure in new tab", "target": "_blank"}]'

Add ‘Figure’ to the ‘Open with’ options, available from context menu on the webclient tree:

$ omero config append omero.web.open_with '["omero_figure", "new_figure",
  {"supported_objects":["images"], "target": "_blank", "label": "OMERO.figure"}]'

Now restart OMERO.web as normal.

Enabling figure export

This section assumes that an OMERO.server is already installed.

Figures can be exported as PDF or TIFF files using a script that runs on the OMERO.server. This script needs to be uploaded to the OMERO.server and its dependencies installed in the OMERO.server virtual environment.

The script can be uploaded using two alternative workflows, both of which require you to have the correct admin privileges. To find where OMERO.figure has been installed using pip, run:

$ pip show omero-figure

The command will display the absolute path to the directory where the application is installed e.g. ~/<virtualenv_name>/lib/python3.6/site-packages. Go to that directory.

Option 1: Connect to the OMERO server and upload the script via the CLI. It is important to be in the correct directory when uploading so that the script is uploaded with the full path: omero/figure_scripts/Figure_To_Pdf.py:

$ cd omero_figure/scripts
$ omero script upload omero/figure_scripts/Figure_To_Pdf.py --official

Option 2: Alternatively, before starting the OMERO.server, copy the script from the figure install /omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py to the OMERO.server path/to/OMERO.server/lib/scripts/omero/figure_scripts. Then restart the OMERO.server.

Now install the script’s dependencies:

  • Install reportlab PDF python package. This needs to be installed in the virtual environment where the OMERO.server is installed. Depending on your install, you may need to call pip with, for example: /path/to_server_venv/venv/bin/pip install ...

$ pip install "reportlab<3.6"
  • Optional: Figure legends can be formatted using Markdown syntax. To see this correctly in the exported PDF info page, we need Python Markdown:

$ pip install markdown

Upgrading OMERO.figure

After upgrading OMERO.figure with:

$ pip install -U omero-figure

You need to update the Figure export script using one of the 2 options described above. If using Option 1, you need to replace the existing script:

# Get the ID of the existing Figure_To_Pdf script:
$ omero script list

# Replace the script
$ cd omero_figure/scripts
$ omero script replace <SCRIPT_ID> omero/figure_scripts/Figure_To_Pdf.py

Development

We use Grunt for various tools. See http://figure.openmicroscopy.org/2014/05/01/testing-with-jshint-jasmine-grunt.html for an introduction.

Install Node from https://nodejs.org, then:

$ cd omero-figure
$ npm install

Install Grunt CLI as described on http://gruntjs.com/using-the-cli.

To build various resources into omero_figure/static run:

$ grunt build

This will concatenate js files into a single figure.js file, compile the underscore templates into templates.js and also copy the shape-editor.js from node_modules.

During development, you will want to peform the concatenation (concat) and template compilation (jst) tasks whenever the JavaScript or template files change. This can be achieved with:

$ grunt watch

It is also possible to develop figure in docker without installing anything locally. The Docker image is built on top of openmicroscopy/omero-web-standalone:latest, so you will have a fully functional omero-web environment while developing omero-figure. First build the Docker image:

$ docker build -t figure-devel .

To develop omero-figure you can either make all the changes within the Docker container itself by running:

$ docker run -ti -e OMEROHOST=YOUR_HOST -p 4080:4080 figure-devel

The preferred option is to mount the repository containing the omero-figure code. Make the changes locally and see the changes in the docker container. To do so, run:

::

$ docker run -ti -e OMEROHOST=YOUR_HOST -p 4080:4080 -v /PATH_TO_GIT_REPO/omero-figure:/home/figure/src figure-devel

After starting the container, run docker ps in another terminal to find the ID of the container. Then run:

$ docker exec -u 0 -it CONTAINER_ID bash   # replace CONTAINER_ID by the correct value
$ cd /home/figure/src
$ grunt watch

Release process

This repository uses bump2version to manage version numbers. To tag a release run:

$ bumpversion release

This will remove the .dev0 suffix from the current version, commit, and tag the release.

To switch back to a development version run:

$ bumpversion --no-tag [major|minor|patch]

specifying major, minor or patch depending on whether the development branch will be a major, minor or patch release. This will also add the .dev0 suffix.

Remember to git push all commits and tags.

License

OMERO.figure is released under the AGPL.

Metadata

Release files for omero-figure 6.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omero-figure 6.2.1
File Size Uploaded
omero-figure-6.2.1.tar.gz 597.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for omero-figure 6.2.1
File Interpreter ABI Platform
omero_figure-6.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / omero-figure-6.2.1.tar.gz

Download URL omero-figure-6.2.1.tar.gz
Size 597.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c0d4b077c2e608efd60aafc171f4dafe05e5eee3153710d5419383e7f6bc24d7
BLAKE2b-256 checksum
How to use checksums
107de327ecd913ce68aa050ea243fa3138fb9cae20c1d20bdd0adb2458e4e90d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release files / omero_figure-6.2.1-py3-none-any.whl

Download URL omero_figure-6.2.1-py3-none-any.whl
Size 648.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27aae98336140eafd73fc6a47e861af6984479db578d72055e597378829c642d
BLAKE2b-256 checksum
How to use checksums
11be514c614bd6297241edf590a574393ecc30e00e842cd2df763be4ff5466bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release history Release notifications | RSS feed

8.0.1

2 release files

7.4.1

2 release files

7.4.0

2 release files

7.3.1

2 release files

7.3.0

2 release files

7.2.1

2 release files

7.2.0

2 release files

7.1.0

2 release files

7.0.0

2 release files

6.2.2

2 release files

This release

6.2.1 This release

2 release files

6.2.0

2 release files

6.1.0

2 release files

6.0.1

2 release files

6.0.0

2 release files

5.1.0

2 release files

5.0.0

2 release files

4.4.3

2 release files

4.4.2

2 release files

4.4.1

2 release files

4.4.0

2 release files

4.3.2

2 release files

4.3.1

2 release files

4.3.0

2 release files

4.2.0

2 release files

4.1.0

1 release file

4.0.2

1 release file

4.0.1

1 release file

4.0.0

1 release file

3.2.1

1 release file

3.2.0

1 release file

3.1.2

1 release file

3.1.1

1 release file

3.1.0

1 release file

3.0.0

1 release file

2.0.1

1 release file

2.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page