Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
jupyterlab-cors-enabled-polus-render
Advanced tools
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:
Please note that usage differs significantly from https://pypi.org/project/polus-render/0.0.4.0.1.5/
pip install "git+https://github.com/PolusAI/jupyterlab-extensions.git#egg=jupyterlab_polus_render&subdirectory=jupyterlab_polus_render"
export RENDER_URL="<Polus Render URL>"
You may also run %env RENDER_URL <Polus Render URL>
in a notebook to set the enviromental variable.
You will need to restart Jupyter Server for render-server-ext
endpoints to take effect.
jupyterlab_polus_render
| LICENSE
| MANIFEST.in // Packaging entries
| pyproject.toml // Pypi config
| README
└───render-server-ext // Server extension used by jupyterlab_polus_render
└───polus
| polus_render.py // Main file, contains render function used by user
jupyterlab_polus_render
root directory.py -m build
py -m twine upload dist/*
__token__
as user and reference API keys for passwordpyproject.toml
MANIFEST.in
to bundle them with Pypi packageJupyterLab Polus Render is bundled with a build of Polus Render which supporting the following functionality
Version | Zarr from URL/Path | TIF from URL/Path | Micro-JSON Support | Zarr/TIF Drag & Drop | Micro-JSON Drag & Drop |
---|---|---|---|---|---|
Static | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
from polus.polus_render import render
# pathlib and urllib are built-ins
from urllib.parse import urlparse
from pathlib import Path
# Make sure to keep track of your JupyterLab url and file root if your root is not at "/home/joyvan".
JL_URL = urlparse("https://<JUPYTERHUB_URL>/user/<USERNAME>/user-namespaces/lab?")
# Embeds an IFrame of a static build of Polus Render into Jupyter Lab, this is sufficient if your file root is "/home/joyvan/"
render(nbhub_url=JL_URL)
# Same as above; however, if your file root is "/Users/jeff.chen/", your invocation will require nb_root argument
render(nbhub_url=JL_URL, \
nb_root=Path("/Users/jeff.chen/"))
# Embeds an IFrame of a static build of Polus Render with an image hosted at "/home/joyvan/zarr files/pyramid.zarr"
render(nbhub_url=JL_URL, \
image_location=Path(r"zarr files/pyramid.zarr"))
# Embeds an IFrame of a static build of Polus Render with an image and overlay file
render(nbhub_url=JL_URL, \
image_location=Path("zarr files/pyramid.zarr"), \
microjson_overlay_location=Path("overlay files/x00_y01_c1_segmentations.json"))
# Embeds an IFrame of a static build of Polus Render with remote image
render(nbhub_url=JL_URL, \
image_location=urlparse("https://viv-demo.storage.googleapis.com/LuCa-7color_3x3component_data.ome.tif"))
def render(nbhub_url:ParseResult, nb_root:PurePath = Path(os.getenv('HOME')) if "HOME" in os.environ else Path("/home/jovyan/"),
image_location:Union[ParseResult, PurePath] = "",
microjson_overlay_location:Union[ParseResult, PurePath] = "", width:int=960, height:int=500, use_static:bool = True)->str:
"""
Embeds Polus Render into a JupyterLabs notebook with the help of `render-server-ext`
Param:
nbhub_url (ParseResult): URL used used for jupyterhub. Contains '/lab/' in its uri
nb_root (PurePath): Root path used to search files in. Default is os.getenv('HOME') else \"/home/joyvan/\""
if HOME does not exist.
if absolute paths will be used for images and json files.
image_location(ParseResult|Purepath): Acquired from urllib.parse.ParseResult or Path, renders url in render.
If not specified, renders default render url.
microjson_overlay_location(ParseResult|Purepath): Acquired from urllib.parse.ParseResult or Path, renders url in render.
If not specified, renders default render url
width (int): width of render to be displayed, default is 960
height (int): height of render to be displayed, default is 500
use_static (bool): Use static build of render, default is True
Returns: Render URL
"""
FAQs
Displays Polus Render dashboard in Jupyter Notebooks.
We found that jupyterlab-cors-enabled-polus-render demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.