jupyterlab-polus-render


Namejupyterlab-polus-render JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryA Jupyterlab extension for Polus Render.
upload_time2024-04-12 21:33:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseThe MIT License (MIT) Copyright (c) 2024 PolusAI Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ipython jupyter widgets
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.
</br>

<img src="images/image.png"/>

## Requirements

* JupyterLab >= 4.0

## Install

You can install using `pip`:

```bash
pip install jupyterlab_polus_render
```

## Uninstall

To remove the extension, execute:

```bash
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:

```bash
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:

```bash
jupyter labextension list
```

## Sample usage
```Python
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:
```bash
conda create -n jupyterlab_polus_render-dev -c conda-forge nodejs python jupyterlab=4.0.11 ipywidgets
conda activate jupyterlab_polus_render-dev
```

```bash
# 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.

```bash
# 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

```bash
# 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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "jupyterlab-polus-render",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "IPython, Jupyter, Widgets",
    "author": null,
    "author_email": "\"Akshat Saini, Jeff Chen\" <akshat.saini@axleinfo.com>",
    "download_url": "https://files.pythonhosted.org/packages/01/bb/5e11bf63b3393bbf2b28bc318f3c6650ec7e1a14d045947b70d077290786/jupyterlab_polus_render-1.0.1.tar.gz",
    "platform": null,
    "description": "# Jupyterlab Polus Render\n\nJupyterLab Polus Render makes Polus Render available as a JupyterLab extension. \n\nPolus 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.\n\nThe are three ways to load the data:\n1. Specifying a URL to the server serving the data.\n2. Specifying a local path to a file from JupyterLab.\n3. Dragging-and-dropping the dataset.\n</br>\n\n<img src=\"images/image.png\"/>\n\n## Requirements\n\n* JupyterLab >= 4.0\n\n## Install\n\nYou can install using `pip`:\n\n```bash\npip install jupyterlab_polus_render\n```\n\n## Uninstall\n\nTo remove the extension, execute:\n\n```bash\npip uninstall jupyterlab_polus_render\n```\n\n## Troubleshoot\n\nIf you are seeing the frontend extension, but it is not working, check\nthat the server extension is enabled:\n\n```bash\njupyter server extension list\n```\n\nIf the server extension is installed and enabled, but you are not seeing\nthe frontend extension, check the frontend extension is installed:\n\n```bash\njupyter labextension list\n```\n\n## Sample usage\n```Python\nfrom jupyterlab_polus_render import Render\n\n# Initiates Polus Render.\nRender()\n\n# Shows a tiff image by providing the local path. \nRender(imagePath = 'images/LuCa-7color_3x3component_data.ome.tif')\n\n# Shows a tiff image by providing the local path along with an overlay used for the image. \nRender(imagePath = 'images/LuCa-7color_3x3component_data.ome.tif', overlayPath = 'images/overlay_render2.json')\n\n# Shows a tiff image by providing a remote url. \nRender(imagePath = 'https://viv-demo.storage.googleapis.com/LuCa-7color_3x3component_data.ome.tif')\n\n# Shows a zarr dataset by providing the local path along with an overlay used for the dataset. \nRender(imagePath = 'images/pyramid.zarr', overlayPath = 'images/overlay_render2.json')\n```\n\n# Implementation Details\n\n### Frontend\n- 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. \n\n### Backend \n- 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.  \n\n###\n- In summary, the Jupyterlab Polus Render extension combines the frontend and the backend components into a single extension.\n\n\n# API Endpoints\n\n- `/jupyterlab-polus-render/image/(.+)`: Shows tiff images and zarr datasets at a specfied path.\n\n\n## Contributing\n### Development Install\n\nCreate a dev environment:\n```bash\nconda create -n jupyterlab_polus_render-dev -c conda-forge nodejs python jupyterlab=4.0.11 ipywidgets\nconda activate jupyterlab_polus_render-dev\n```\n\n```bash\n# Clone the repo to your local environment\n# Change directory to the jupyterlab_polus_render directory\n# Install package in development mode\npip install -e .\n# Link your development version of the extension with JupyterLab\njupyter labextension develop . --overwrite\n# Server extension must be manually installed in develop mode\njupyter server extension enable jupyterlab_polus_render\n# Rebuild extension Typescript source after making changes\njlpm run build\n```\n\n### How to see your changes\n#### Typescript:\nIf you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different\nterminals to watch for changes in the extension's source and automatically rebuild the widget.\n\n```bash\n# Watch the source directory in one terminal, automatically rebuilding when needed\njlpm run watch\n# Run JupyterLab in another terminal\njupyter lab\n```\n\nAfter a change wait for the build to finish and then refresh your browser and the changes should take effect.\n\n#### Python:\nIf you make a change to the python code then you will need to restart the notebook kernel to have it take effect.\n\n\n### Development uninstall\n\n```bash\n# Server extension must be manually disabled in develop mode\njupyter server extension disable jupyterlab_polus_render\npip uninstall jupyterlab_polus_render\n```\n\nIn development mode, you will also need to remove the symlink created by `jupyter labextension develop`\ncommand. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`\nfolder is located. Then you can remove the symlink named `jupyterlab_polus_render` within that folder.\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2024 PolusAI  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A Jupyterlab extension for Polus Render.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/PolusAI/jupyterlab-extensions/tree/master/jupyterlab_polus_render"
    },
    "split_keywords": [
        "ipython",
        " jupyter",
        " widgets"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5e3665f4bc01ff2c72c41971ab18e27818bb6eca39975bbab115fc79b282dca4",
                "md5": "87caa84005757653d469af46072477f2",
                "sha256": "5ae0aae377b072a08a785e1962730d4debeb934dc2b871186f1fe06d0f892691"
            },
            "downloads": -1,
            "filename": "jupyterlab_polus_render-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "87caa84005757653d469af46072477f2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 8127069,
            "upload_time": "2024-04-12T21:33:15",
            "upload_time_iso_8601": "2024-04-12T21:33:15.766780Z",
            "url": "https://files.pythonhosted.org/packages/5e/36/65f4bc01ff2c72c41971ab18e27818bb6eca39975bbab115fc79b282dca4/jupyterlab_polus_render-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "01bb5e11bf63b3393bbf2b28bc318f3c6650ec7e1a14d045947b70d077290786",
                "md5": "16cf49ec16325be9c97cf1dc9a2ae2a5",
                "sha256": "87dc961bd3b8eb14ebc4bb796c9d74e049fdc679d1d95f5e5668c9702b12a755"
            },
            "downloads": -1,
            "filename": "jupyterlab_polus_render-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "16cf49ec16325be9c97cf1dc9a2ae2a5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 8295898,
            "upload_time": "2024-04-12T21:33:21",
            "upload_time_iso_8601": "2024-04-12T21:33:21.221449Z",
            "url": "https://files.pythonhosted.org/packages/01/bb/5e11bf63b3393bbf2b28bc318f3c6650ec7e1a14d045947b70d077290786/jupyterlab_polus_render-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-12 21:33:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PolusAI",
    "github_project": "jupyterlab-extensions",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jupyterlab-polus-render"
}
        
Elapsed time: 0.24397s