Skip to content

μViewer

William Silversmith edited this page Nov 9, 2018 · 18 revisions
from cloudvolume import CloudVolume, view, hyperview

channel_vol = CloudVolume(...)
seg_vol = CloudVolume(...)
img = channel_vol[...]
seg = seg_vol[...]

img.view() # works on VolumeCutouts
seg.view()
view(img) # alternative for arbitrary numpy arrays
view(seg) 
hyperview(img, seg) # img and seg shape must match

>>> Viewer server listening to http://localhost:8080

Point your browser at http://localhost:8080 after starting the viewer as depicted above.

CloudVolume includes a built-in dependency free viewer for 3D volumetric datasets smaller than about 2GB uncompressed. It can be useful if you want to visualize arbitrary numpy arrays, a cutout without the surrounding area, a cutout from a distributed job, or if you are unwilling or unable to set up your files to work with neuroglancer. This capability supplements the save_images feature that can save a numpy array into an image stack.

Features

  • Image and Segmentation
  • X, Y, Z axial reslicing
  • uint8, uint16, uint32, float32, and float64 data types
  • Single image viewer and "hyperview" which combines an EM image and a segmentation overlay.
  • Hover highlight of segmentation and dynamic recoloring
  • Neuroglancer keyboard controls
  • Mapping of image pixels to neuroglancer coordinates
  • Up to 2GB individual volumes (two volumes can add to more than this limit).

Controls

Control Command
Change Slice Scroll, comma, period, W, S
Change Axis Space, A, D
Freeze Voxel Information Left Click
Recolor Segmentation L
Clear Selected Segmentation X
Change Segmentation Opacity +, -

Image View

Grayscale view

Segmentation View

Segmentation View

Composite View (Hyperview)

Composite View (Hyperview)

How does it work?

The microviewer server uses the standard Python http.server (formerly the SimpleHTTPServer) and thus requires no dependencies.

The client is in Javascript and is based on the open source custom 2D canvas renderer written for eyewire.org called DataCube. DataCube has an extremely simple, but fast, design based representing volumetric images as 1D typed arrays and rendering 2D reslices. The small footprint makes it simple to include in many different contexts, and the code supports fetching the image in different orientations from the source array, making various transformations simple to implement (though care is required to make them fast).

Consider using DataCube in your own project: https://github.com/seung-lab/data-cube-x

--
Made with <3.