figurl-tiled-image

View a stack of tiled images via deck.gl


License
Apache-2.0
Install
pip install figurl-tiled-image==0.2.2

Documentation

figurl-tiled-image

View a stack of tiled images using deck.gl.

See this example

This project uses kachery-cloud and figurl.

IMPORTANT: This package is intended for collaborative sharing of data for scientific research. It should not be used for other purposes.

Installation and setup

It is recommended that you use a conda environment with Python >= 3.8 and numpy.

pip install --upgrade figurl_tiled_image

Or install from source:

git clone https://github.com/scratchrealm/figurl-tiled-image
cd figurl-tiled-image
pip install -e .

Configure your kachery-cloud client (only do this once on your computer)

kachery-cloud-init
# follow the instructions to associate your client with your Google user name on kachery-cloud

Basic usage

From Numpy array:

import numpy as np
from figurl_tiled_image import TiledImage

array1 = ... # create a color image numpy array [N1 x N2 x 3] uint8
array2 = ... # create a color image numpy array [N1 x N2 x 3] uint8

X = TiledImage(tile_size=4096)
X.add_layer('layer 1', array1)
X.add_layer('layer 2', array2)
url = X.url(label='Numpy example')
print(url)

From image file:

import pyvips
from figurl_tiled_image import TiledImage

filename1 = '/path/to/some/image1.png' # substitute the path to your image
image1 = pyvips.new_from_file(filename1)

filename2 = '/path/to/some/image2.png' # substitute the path to your image
image2 = pyvips.new_from_file(filename2)

X = TiledImage(tile_size=4096)
X.add_layer('layer 1', image1)
X.add_layer('layer 2', image2)
url = X.url(label='Example')
print(url)

Example - Mandelbrot set

mandelbrot_example

See examples/multipanel_mandelbrot.py and examples/multipanel_mini_mandelbrot.py

Example - Visualization of ephys data

spikeinterface_example

See examples/spikeinterface_example.py (requires SpikeInterface installation and access to raw data file).

For developers

The front-end code is found in the gui/ directory. It uses typescript/react and is deployed as a figurl visualization plugin.

You can run a local development version of this via:

cd gui
# One-time install
yarn install 

# Start the web server
yarn start

Then replace v=gs://figurl/figurl-tiled-image-2 by v=http://localhost:3000 in the URL you are viewing. Updates to the source code will live-update the view in the browser. If you improve the visualization, please contribute by creating a PR.