GithubHelp home page GithubHelp logo

alejoe91 / figurl-tiled-image Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scratchrealm/figurl-tiled-image

0.0 0.0 0.0 289 KB

View a tiled image using deck.gl

License: Apache License 2.0

Shell 0.16% Python 4.84% TypeScript 91.49% CSS 1.06% HTML 1.96% Jinja 0.50%

figurl-tiled-image's Introduction

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.

figurl-tiled-image's People

Contributors

magland avatar alejoe91 avatar jsiegle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.