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 #592

Closed seankmartin closed 3 weeks 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:

Use the same buffers that were created for the 2d panels histograms Defines 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 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.

Sample rate in each chunk is chosen based on the number of visible chunks and the overall desired number of total samples.