Skip to main content

Jupyterlab Polus Render

JupyterLab Polus Render makes Polus Render available as a JupyterLab extension.

Polus Render allows visualizing tiled raster datasets in Zarr and TIFF formats, as well as vector overlays in MicroJSON format. It uses lookup tables to map intensity values in these datasets to colors.

The are three ways to load the data:

  1. Specifying a URL to the server serving the data.
  2. Specifying a local path to a file from JupyterLab.
  3. Dragging-and-dropping the dataset.

Requirements

  • JupyterLab >= 4.0

Install

You can install using pip:

pip install jupyterlab_polus_render

Uninstall

To remove the extension, execute:

pip uninstall jupyterlab_polus_render

Troubleshoot

If you are seeing the frontend extension, but it is not working, check that the server extension is enabled:

jupyter server extension list

If the server extension is installed and enabled, but you are not seeing the frontend extension, check the frontend extension is installed:

jupyter labextension list

Sample usage

from jupyterlab_polus_render import Render

# Initiates Polus Render.
Render()

# Shows a tiff image by providing the local path. 
Render(imagePath = 'images/LuCa-7color_3x3component_data.ome.tif')

# Shows a tiff image by providing the local path along with an overlay used for the image. 
Render(imagePath = 'images/LuCa-7color_3x3component_data.ome.tif', overlayPath = 'images/overlay_render2.json')

# Shows a tiff image by providing a remote url. 
Render(imagePath = 'https://viv-demo.storage.googleapis.com/LuCa-7color_3x3component_data.ome.tif')

# Shows a zarr dataset by providing the local path along with an overlay used for the dataset. 
Render(imagePath = 'images/pyramid.zarr', overlayPath = 'images/overlay_render2.json')

Implementation Details

Frontend

  • The frontend part of the extension effectively utilizes the @labshare/polus-render npm package which is used to visualize tiled TIFF images and overlays given the URL of the image/overlay.

Backend

  • The backend functionality, including serving images is handled by the server extension. This extension is integrated with the Jupyterlab server environment and allows custom functionality based on the application's needs.

  • In summary, the Jupyterlab Polus Render extension combines the frontend and the backend components into a single extension.

API Endpoints

  • /jupyterlab-polus-render/image/(.+): Shows tiff images and zarr datasets at a specfied path.

Contributing

Development Install

Create a dev environment:

conda create -n jupyterlab_polus_render-dev -c conda-forge nodejs python jupyterlab=4.0.11 ipywidgets
conda activate jupyterlab_polus_render-dev
# Clone the repo to your local environment
# Change directory to the jupyterlab_polus_render directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Server extension must be manually installed in develop mode
jupyter server extension enable jupyterlab_polus_render
# Rebuild extension Typescript source after making changes
jlpm run build

How to see your changes

Typescript:

If you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the widget.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

After a change wait for the build to finish and then refresh your browser and the changes should take effect.

Python:

If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.

Development uninstall

# Server extension must be manually disabled in develop mode
jupyter server extension disable jupyterlab_polus_render
pip uninstall jupyterlab_polus_render

In development mode, you will also need to remove the symlink created by jupyter labextension develop command. To find its location, you can run jupyter labextension list to figure out where the labextensions folder is located. Then you can remove the symlink named jupyterlab_polus_render within that folder.

Release files for jupyterlab-polus-render 1.0.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 jupyterlab-polus-render 1.0.1
File Size Uploaded
jupyterlab_polus_render-1.0.1.tar.gz 8.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyterlab-polus-render 1.0.1
File Interpreter ABI Platform
jupyterlab_polus_render-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 MB

Release files / jupyterlab_polus_render-1.0.1.tar.gz

Download URL jupyterlab_polus_render-1.0.1.tar.gz
Size 8.3 MB
Tags Source
SHA-256 checksum
How to use checksums
87dc961bd3b8eb14ebc4bb796c9d74e049fdc679d1d95f5e5668c9702b12a755
BLAKE2b-256 checksum
How to use checksums
01bb5e11bf63b3393bbf2b28bc318f3c6650ec7e1a14d045947b70d077290786
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / jupyterlab_polus_render-1.0.1-py3-none-any.whl

Download URL jupyterlab_polus_render-1.0.1-py3-none-any.whl
Size 8.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5ae0aae377b072a08a785e1962730d4debeb934dc2b871186f1fe06d0f892691
BLAKE2b-256 checksum
How to use checksums
5e3665f4bc01ff2c72c41971ab18e27818bb6eca39975bbab115fc79b282dca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

0.1.0

2 release files

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