Skip to content

Instantly share code, notes, and snippets.

@gazzar
Created December 20, 2019 05:41
Show Gist options
  • Save gazzar/d06a1cafdba9888a47d905e2664d070f to your computer and use it in GitHub Desktop.
Save gazzar/d06a1cafdba9888a47d905e2664d070f to your computer and use it in GitHub Desktop.
View data in a BigDataViewer hdf5 container in napari
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 20 11:31:51 2019
@author: grub0002
"""
import napari
import h5py
import dask
import dask.array as da
from dask_image.imread import imread
DATA = r'C:\Users\grub0002\unsynced\scratch\IMBL_Nov_Croton\linda_brain\recon.h5'
stack = h5py.File(DATA, 'r')
data0 = stack['/t00000/s00/0/cells']
data1 = stack['/t00000/s00/1/cells']
data2 = stack['/t00000/s00/2/cells']
data3 = stack['/t00000/s00/3/cells']
pyramid = [data0, data1, data2, data3]
with napari.gui_qt():
napari.view_image(pyramid, contrast_limits=[0, 200], is_pyramid=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment