calcia · physics-based calcium-imaging simulator基于物理的钙成像模拟器

Grow a brain.
Then photograph it.
先长出一块大脑,
再给它拍照。

calcia builds neural tissue from first principles — vasculature, somata, dendrites, expression — and then simulates the microscope that images it. Nothing below was drawn by hand. calcia 从第一性原理构建神经组织——血管、胞体、树突、表达——再模拟给它成像的显微镜。下面没有一帧是手画的。

drag the scene to orbit拖动画面可旋转

One parameter. Two worlds.一个参数,两个世界。

Same tissue. Same cells. Same spikes. The only difference is whether light is allowed to scatter on its way out of the brain — and that single number decides whether anything is resolvable at all. 同一块组织、同一批细胞、同一串放电。唯一的区别是光在出脑的路上允不允许散射——而就是这一个数,决定了你还能不能分辨出任何东西。

no scattering无散射
real tissue真实组织

We know where every cell is.每一个细胞在哪,我们都知道。

This is the part real microscopy can never give you. Every dot is a neuron we placed, with a position we wrote down before the first photon was simulated. Drag the threshold to see how many of them the imaging actually gives back. 这是真实显微镜永远给不了你的东西。每个点都是我们亲手放进去的神经元,位置在第一个光子被模拟之前就已写定。拖动阈值,看看成像最后还能还给你几个。

Click a cell. That is its calcium.点一个细胞,那就是它的钙信号。

Every trace is the ground-truth fluorescence of one neuron, frame-aligned with the movie above it. In a real recording you would have to infer these. Here they are simply known. 每条曲线都是一个神经元的真值荧光,与上方影片逐帧对齐。真实记录里这些只能靠推断,在这里它们是已知的。

Five stages, no shortcuts.五个阶段,没有捷径。

  1. 01

    Tissue组织

    Vessels are grown as a graph and routed by Dijkstra; somata are sampled by exclusion around them; dendrites colonize whatever space is left. 血管以图的形式生长并用 Dijkstra 布线;胞体在其周围按排斥采样;树突去占领剩下的空间。

  2. 02

    Optics光学

    A Fresnel wave-optics point spread function, broadened by tissue scattering. This is the picture of the microscope itself. 菲涅耳波动光学点扩散函数,再由组织散射展宽。这就是显微镜本身的样子。

    Point spread function, lateral and axial
  3. 03

    Calcium钙动力学

    Spikes drive a calcium binding model, which drives indicator saturation. The indicator's own nonlinearity is in there, not bolted on afterwards. 放电驱动钙结合模型,再驱动指示剂饱和。指示剂自身的非线性在模型里,而不是事后叠加。

  4. 04

    Scan扫描

    The volume is convolved with the PSF and sampled the way the instrument samples it, with breathing- and heartbeat-shaped motion applied during the exposure. 体积与 PSF 卷积,并按仪器真实的采样方式采样,曝光期间叠加呼吸与心跳形状的运动。

  5. 05

    Noise噪声

    Poisson, then lognormal gain, then read noise — in that order, because that is the order the photons meet them. 先泊松、再对数正态增益、最后读出噪声——顺序如此,因为光子就是按这个顺序遇到它们的。

    before noise加噪前
    what the camera records相机记录到的

Not one brain. A population of them.不是一块脑子,而是一整群。

Change the seed and the vasculature, the cell placement and the expression all change with it. A method that only works on one volume does not work. 换一个随机种子,血管、细胞排布、表达强度就全都跟着变。只在一个体积上成立的方法,等于不成立。

What this page costs your laptop这个页面让你的电脑付出了什么

Almost nothing, on purpose. The 3D is genuinely rendered here, in about 330 lines of WebGL with no library — but growth is not animated on the CPU. Every dendrite segment carries the growth iteration it was born on, and the vertex shader decides what exists yet. Nothing is rebuilt per frame. 刻意做到几乎为零。3D 是真的在你的浏览器里渲染的,约 330 行 WebGL、零依赖库——但生长不是靠 CPU 逐帧算的。每一段树突都带着它诞生的那一次迭代,由顶点着色器决定此刻哪些存在。每帧不重建任何东西。

Section板块 What runs in your browser在你浏览器里跑的东西
Growth scene生长场景one static vertex buffer; per frame the page writes a single float and issues four draw calls一个静态顶点缓冲;每帧只写一个浮点数、发四次绘制调用
Its payload它的数据量333 KB of geometry, uploaded to the GPU once — versus 9.4 MB of video decoded continuously333 KB 几何数据,只上传一次——而视频版是 9.4 MB 且要持续解码
Compare slider对比滑块a CSS clip rectangle一个 CSS 裁剪矩形
Ground truth真值叠加a few hundred canvas circles, redrawn only on input数百个 canvas 圆,仅在交互时重绘
Traces曲线static canvas + a one-pixel playhead静态 canvas + 一根 1 像素游标
Everything off-screen屏幕外的一切the render loop stops; videos pause, unbuffered and undecoded渲染循环停止;视频暂停、不缓冲、不解码