omero-figure


Nameomero-figure JSON
Version 6.2.2 PyPI version JSON
download
home_pagehttps://github.com/ome/omero-figure
SummaryOMERO figure creation app
upload_time2024-04-26 12:37:28
maintainerNone
docs_urlNone
authorThe Open Microscopy Team
requires_python>=3
licenseAGPL-3.0
keywords omero.web figure
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://img.shields.io/badge/dynamic/json.svg?label=forum&url=https%3A%2F%2Fforum.image.sc%2Ftags%2Fomero-figure.json&query=%24.topic_list.tags.0.topic_count&colorB=brightgreen&suffix=%20topics&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAABPklEQVR42m3SyyqFURTA8Y2BER0TDyExZ+aSPIKUlPIITFzKeQWXwhBlQrmFgUzMMFLKZeguBu5y+//17dP3nc5vuPdee6299gohUYYaDGOyyACq4JmQVoFujOMR77hNfOAGM+hBOQqB9TjHD36xhAa04RCuuXeKOvwHVWIKL9jCK2bRiV284QgL8MwEjAneeo9VNOEaBhzALGtoRy02cIcWhE34jj5YxgW+E5Z4iTPkMYpPLCNY3hdOYEfNbKYdmNngZ1jyEzw7h7AIb3fRTQ95OAZ6yQpGYHMMtOTgouktYwxuXsHgWLLl+4x++Kx1FJrjLTagA77bTPvYgw1rRqY56e+w7GNYsqX6JfPwi7aR+Y5SA+BXtKIRfkfJAYgj14tpOF6+I46c4/cAM3UhM3JxyKsxiOIhH0IO6SH/A1Kb1WBeUjbkAAAAAElFTkSuQmCC
    :target: https://forum.image.sc/tag/omero-figure
    :alt: Image.sc forum

.. image:: https://github.com/ome/omero-figure/workflows/OMERO/badge.svg
    :target: https://github.com/ome/omero-figure/actions

.. image:: https://badge.fury.io/py/omero-figure.svg
    :target: https://badge.fury.io/py/omero-figure


OMERO.figure
============

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

For full details see `SUPPORT.md <https://github.com/ome/omero-figure/blob/master/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 <https://pip.pypa.io/en/stable/>`_:

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 <https://bitbucket.org/rptlab/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 <https://python-markdown.github.io/>`_:

::

    $ 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 <https://pypi.org/project/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 <https://semver.org/>`_. This will also add the ``.dev0`` suffix.

Remember to ``git push`` all commits and tags.

License
-------

OMERO.figure is released under the AGPL.

Copyright
---------

2016-2022, The Open Microscopy Environment



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ome/omero-figure",
    "name": "omero-figure",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "OMERO.web, figure",
    "author": "The Open Microscopy Team",
    "author_email": "ome-devel@lists.openmicroscopy.org.uk",
    "download_url": "https://files.pythonhosted.org/packages/f6/f9/a4df063e091e7c928b4c95601b4b2c9ba8e0d04bd786fba9ec12fd2cace9/omero-figure-6.2.2.tar.gz",
    "platform": null,
    "description": ".. image:: https://img.shields.io/badge/dynamic/json.svg?label=forum&url=https%3A%2F%2Fforum.image.sc%2Ftags%2Fomero-figure.json&query=%24.topic_list.tags.0.topic_count&colorB=brightgreen&suffix=%20topics&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAABPklEQVR42m3SyyqFURTA8Y2BER0TDyExZ+aSPIKUlPIITFzKeQWXwhBlQrmFgUzMMFLKZeguBu5y+//17dP3nc5vuPdee6299gohUYYaDGOyyACq4JmQVoFujOMR77hNfOAGM+hBOQqB9TjHD36xhAa04RCuuXeKOvwHVWIKL9jCK2bRiV284QgL8MwEjAneeo9VNOEaBhzALGtoRy02cIcWhE34jj5YxgW+E5Z4iTPkMYpPLCNY3hdOYEfNbKYdmNngZ1jyEzw7h7AIb3fRTQ95OAZ6yQpGYHMMtOTgouktYwxuXsHgWLLl+4x++Kx1FJrjLTagA77bTPvYgw1rRqY56e+w7GNYsqX6JfPwi7aR+Y5SA+BXtKIRfkfJAYgj14tpOF6+I46c4/cAM3UhM3JxyKsxiOIhH0IO6SH/A1Kb1WBeUjbkAAAAAElFTkSuQmCC\n    :target: https://forum.image.sc/tag/omero-figure\n    :alt: Image.sc forum\n\n.. image:: https://github.com/ome/omero-figure/workflows/OMERO/badge.svg\n    :target: https://github.com/ome/omero-figure/actions\n\n.. image:: https://badge.fury.io/py/omero-figure.svg\n    :target: https://badge.fury.io/py/omero-figure\n\n\nOMERO.figure\n============\n\nAn OMERO.web app for creating figures from images in OMERO.\n\nFor full details see `SUPPORT.md <https://github.com/ome/omero-figure/blob/master/SUPPORT.md>`_.\n\nRequirements\n------------\n\n* OMERO.web 5.6.0 or newer.\n\n\nInstalling from PyPI\n--------------------\n\nThis section assumes that an OMERO.web is already installed.\n\nInstall the app using `pip <https://pip.pypa.io/en/stable/>`_:\n\nNB: You need to ensure that you are running ``pip`` from the python environment\nwhere ``omero-web`` is installed. Depending on your install, you may need to\ncall ``pip`` with, for example: ``/path/to_web_venv/venv/bin/pip install ...``\n\n::\n\n    $ pip install -U omero-figure\n\nAdd figure custom app to your installed web apps:\n\n::\n\n    $ omero config append omero.web.apps '\"omero_figure\"'\n\nDisplay a link to 'Figure' at the top of the webclient:\n\n::\n\n    $ omero config append omero.web.ui.top_links '[\"Figure\", \"figure_index\",\n      {\"title\": \"Open Figure in new tab\", \"target\": \"_blank\"}]' \n\n\nAdd 'Figure' to the 'Open with' options, available from context menu on\nthe webclient tree:\n\n::\n\n    $ omero config append omero.web.open_with '[\"omero_figure\", \"new_figure\",\n      {\"supported_objects\":[\"images\"], \"target\": \"_blank\", \"label\": \"OMERO.figure\"}]'\n\nNow restart OMERO.web as normal.\n\n\nEnabling figure export\n----------------------\n\nThis section assumes that an OMERO.server is already installed.\n\nFigures 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\ninstalled in the OMERO.server virtual environment.\n\nThe script can be uploaded using two alternative workflows, both of which require you to have the correct admin privileges.\nTo find where OMERO.figure has been installed using pip, run:\n\n::\n\n    $ pip show omero-figure\n\nThe 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.\n\n*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``:\n\n::\n\n    $ cd omero_figure/scripts\n    $ omero script upload omero/figure_scripts/Figure_To_Pdf.py --official\n\n*Option 2*: Alternatively, before starting the OMERO.server, copy the script from the figure install\n``/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.\n\nNow install the script's dependencies:\n\n\n* Install `reportlab <https://bitbucket.org/rptlab/reportlab>`_ PDF python package.\n  This needs to be installed in the virtual environment where the ``OMERO.server`` is installed. Depending on your install, you may need to\n  call ``pip`` with, for example: ``/path/to_server_venv/venv/bin/pip install ...``\n\n::\n\n    $ pip install \"reportlab<3.6\"\n\n* Optional: Figure legends can be formatted using Markdown syntax. To see this correctly in the exported PDF info page, we need `Python Markdown <https://python-markdown.github.io/>`_:\n\n::\n\n    $ pip install markdown\n\nUpgrading OMERO.figure\n----------------------\n\nAfter upgrading OMERO.figure with:\n\n::\n\n    $ pip install -U omero-figure\n\nYou need to update the Figure export script using one of the 2 options described\nabove. If using *Option 1*, you need to *replace* the existing script:\n\n::\n\n    # Get the ID of the existing Figure_To_Pdf script:\n    $ omero script list\n\n    # Replace the script\n    $ cd omero_figure/scripts\n    $ omero script replace <SCRIPT_ID> omero/figure_scripts/Figure_To_Pdf.py\n\n\nDevelopment\n-----------\n\nWe use Grunt for various tools.\nSee http://figure.openmicroscopy.org/2014/05/01/testing-with-jshint-jasmine-grunt.html\nfor an introduction.\n\nInstall Node from https://nodejs.org, then:\n\n::\n\n    $ cd omero-figure\n    $ npm install\n\nInstall Grunt CLI as described on http://gruntjs.com/using-the-cli.\n\nTo build various resources into ``omero_figure/static``  run:\n\n::\n\n    $ grunt build\n\nThis will concatenate js files into a single figure.js file,\ncompile the underscore templates into templates.js and also\ncopy the shape-editor.js from node_modules.\n\nDuring development, you will want to peform the concatenation\n(``concat``) and template compilation (``jst``) tasks whenever\nthe JavaScript or template files change. This can be achieved\nwith:\n\n::\n\n\t$ grunt watch\n\nIt is also possible to develop figure in docker without installing anything locally.\nThe Docker image is built on top of ``openmicroscopy/omero-web-standalone:latest``, so you will have a fully functional\nomero-web environment while developing ``omero-figure``. \nFirst build the Docker image:\n\n::\n\n   $ docker build -t figure-devel .\n\n\nTo develop ``omero-figure`` you can either make all the changes within the Docker container itself by running:\n::\n\n\n    $ docker run -ti -e OMEROHOST=YOUR_HOST -p 4080:4080 figure-devel\n\nThe 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:\n\n::\n    $ docker run -ti -e OMEROHOST=YOUR_HOST -p 4080:4080  -v /PATH_TO_GIT_REPO/omero-figure:/home/figure/src figure-devel\n\n\nAfter starting the container, run ``docker ps`` in another terminal to find the ID of the container. Then run:\n\n::\n\n   $ docker exec -u 0 -it CONTAINER_ID bash   # replace CONTAINER_ID by the correct value\n   $ cd /home/figure/src\n   $ grunt watch\n\n\n\nRelease process\n---------------\n\nThis repository uses `bump2version <https://pypi.org/project/bump2version/>`_ to manage version numbers.\nTo tag a release run::\n\n    $ bumpversion release\n\nThis will remove the ``.dev0`` suffix from the current version, commit, and tag the release.\n\nTo switch back to a development version run::\n\n    $ bumpversion --no-tag [major|minor|patch]\n\nspecifying ``major``, ``minor`` or ``patch`` depending on whether the development branch will be a `major, minor or patch release <https://semver.org/>`_. This will also add the ``.dev0`` suffix.\n\nRemember to ``git push`` all commits and tags.\n\nLicense\n-------\n\nOMERO.figure is released under the AGPL.\n\nCopyright\n---------\n\n2016-2022, The Open Microscopy Environment\n\n\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0",
    "summary": "OMERO figure creation app",
    "version": "6.2.2",
    "project_urls": {
        "Download": "https://github.com/ome/omero-figure/archive/v6.2.2.tar.gz",
        "Homepage": "https://github.com/ome/omero-figure"
    },
    "split_keywords": [
        "omero.web",
        " figure"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92e2912e30f3fab103af51fe0ffc21bca4220b1eb56f2f83c67d334ad8a53c83",
                "md5": "0a12f2eacf851042203654b3f02e2f88",
                "sha256": "63025d632707ccc7d2a42397499b7c8e6f8085584d79f5d20fbcd1ff6ba14d53"
            },
            "downloads": -1,
            "filename": "omero_figure-6.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0a12f2eacf851042203654b3f02e2f88",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 648493,
            "upload_time": "2024-04-26T12:37:26",
            "upload_time_iso_8601": "2024-04-26T12:37:26.168590Z",
            "url": "https://files.pythonhosted.org/packages/92/e2/912e30f3fab103af51fe0ffc21bca4220b1eb56f2f83c67d334ad8a53c83/omero_figure-6.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f6f9a4df063e091e7c928b4c95601b4b2c9ba8e0d04bd786fba9ec12fd2cace9",
                "md5": "d25fdee7478893ca6f898b6116bbe961",
                "sha256": "4cf9a49d8d5fb8dc04a9885ae5a4c8f03e5e3bbdb15d598175eb879db9321e58"
            },
            "downloads": -1,
            "filename": "omero-figure-6.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d25fdee7478893ca6f898b6116bbe961",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 597542,
            "upload_time": "2024-04-26T12:37:28",
            "upload_time_iso_8601": "2024-04-26T12:37:28.646170Z",
            "url": "https://files.pythonhosted.org/packages/f6/f9/a4df063e091e7c928b4c95601b4b2c9ba8e0d04bd786fba9ec12fd2cace9/omero-figure-6.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-26 12:37:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ome",
    "github_project": "omero-figure",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "omero-figure"
}
        
Elapsed time: 0.24103s