Skip to main content

OMERO figure creation app

Project description

https://travis-ci.org/ome/omero-figure.svg?branch=master 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:

$ 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 server is run.

$ pip install reportlab
  • 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:
$ path/to/OMERO.server/bin/omero script list

# Replace the script
$ cd omero_figure/scripts
$ path/to/OMERO.server/bin/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

To update the demo figure app at http://figure.openmicroscopy.org/demo/ we have a grunt task that concats and moves js files into demo/. It also replaces Django template tags in index.html and various js code fragments with static app code. This is all handled by the grunt task:

$ grunt demo

This puts everything into the omero-figure/demo/ directory. This can be tested locally via:

$ cd demo/
$ python -m SimpleHTTPServer

Go to http://localhost:8000/ to test it. This will not install the script and dependencies required to export the figure as PDF.

To update the figure.openmicroscopy.org site:

It is also possible to run the demo in docker without installing anything locally:

$ docker build -t figure-demo .
$ docker run -ti --rm -p 8000:8000 figure-demo

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omero-figure-4.2.0.tar.gz (485.9 kB view details)

Uploaded Source

Built Distribution

omero_figure-4.2.0-py3-none-any.whl (535.3 kB view details)

Uploaded Python 3

File details

Details for the file omero-figure-4.2.0.tar.gz.

File metadata

  • Download URL: omero-figure-4.2.0.tar.gz
  • Upload date:
  • Size: 485.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7

File hashes

Hashes for omero-figure-4.2.0.tar.gz
Algorithm Hash digest
SHA256 13c1837b9f50acc9aeb269ba18e2208dfc49fca152f3f1ec68ace23be0efbfed
MD5 438725c76cbc44a53eaae9af406e367f
BLAKE2b-256 7fd829919f79ec9ab1876e8cd3b8655a54260b15762039d47c319a53db973355

See more details on using hashes here.

File details

Details for the file omero_figure-4.2.0-py3-none-any.whl.

File metadata

  • Download URL: omero_figure-4.2.0-py3-none-any.whl
  • Upload date:
  • Size: 535.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7

File hashes

Hashes for omero_figure-4.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c949291ae8cbd27c477c8904d060826c8eb6a2b03bf3581891b60c6ee2ca183d
MD5 25c46e59d9f52c6ba009fa133a4e074b
BLAKE2b-256 77a7d62f46f9736e2e0d6fff12fba176ea0c3a2de91495b29b49c12b73dca2d2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page