neu_draw

neu-draw: interactive 3D rendering of EM segment morphology in Jupyter.

Meshes, skeletons, synapse points and ROI meshes, drawn locally with pygfx. neu-glance, by contrast, builds states for a remote neuroglancer viewer.

  • neu_lib types (BBox, Frame, Mesh, Skeleton): re-exported here on purpose, as the same objects, so a notebook can write neu_draw.Skeleton.

  • scene: drawables, colours and camera intent. Pure.

  • layout: placing several objects side by side, as boxes in and offsets out. Pure.

  • sources: the only module that reads data.

  • viewstate: saved camera viewpoints, which outlive any one view. Pure.

  • backends: the pygfx renderer and the legend drawn inside the canvas.

  • toolbar: ipywidgets buttons above the canvas, loaded only when a view is shown.

The renderer is imported only by show(), never at package import: it needs a canvas backend, which fails outright on a headless machine. import neu_draw is safe anywhere.

Submodules

Functions

show(scene, *[, backend]) → Any

Render a Scene and return the backend's view.

Package Contents

neu_draw.show(scene: scene.Scene, *, backend: str = 'pygfx', **kwargs) → Any

Render a Scene and return the backend’s view.

The renderer is imported here, on first use. In a notebook the returned view displays itself; elsewhere it renders offscreen and .snapshot() returns the pixels.