google / neuroglancer

WebGL-based viewer for volumetric data
Apache License 2.0
1.02k stars 283 forks source link

Feature - CDF in invlerp if only 3D view shown of image layer #588

Closed seankmartin closed 1 month ago

seankmartin commented 1 month ago

Allows invlerps to show CDFs even if only 3D data is being rendered.

Adds to the volume rendering code, with the overall idea as:

  1. Use the same buffers that were created for the 2d panels histograms
  2. Define a vertex shader that samples a random part of a chunk for each input point, and based on the bin of the histogram it would fall in, increments the count for that bin by one
  3. Run this vertex shader over each visible chunk of the volume renderer.

At the moment, the 3d histogram calculations are not run when the camera is moving, when there are slice views present, in wireframe mode, or if all histograms are currently hidden.

Open to thoughts! One thing that would be nice to change before moving out of draft would be to make the number of samples taken in each chunk variable.