brainsmatics 1.2.8 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -4
- package/dist/component/2d/charts/ChartViewer.d.ts +1 -0
- package/dist/component/2d/charts/SpatialAdjacencyChart.d.ts +2 -0
- package/dist/component/2d/charts/spatialAdjacencyData.d.ts +28 -0
- package/dist/component/2d/charts/structureVolumes.d.ts +14 -0
- package/dist/component/3d/aichat/circuitPanel.d.ts +14 -0
- package/dist/component/3d/aichat/index.d.ts +1 -0
- package/dist/component/3d/functionLoop/ConnectivityCard.d.ts +2 -0
- package/dist/component/3d/functionLoop/connectionCurve.d.ts +9 -0
- package/dist/component/3d/functionLoop/connectionStyle.d.ts +5 -0
- package/dist/component/3d/functionLoop/index.d.ts +0 -1
- package/dist/component/3d/functionLoop/modelConnectionFilter.d.ts +20 -0
- package/dist/component/3d/sequenceRegistration/SequenceRegistrationPanel.d.ts +2 -1
- package/dist/component/3d/sequenceRegistration/api.d.ts +5 -2
- package/dist/component/3d/sequenceRegistration/exportResult.d.ts +15 -0
- package/dist/component/3d/sequenceRegistration/poseEditor.d.ts +2 -0
- package/dist/component/3d/sequenceRegistration/stamPlane.d.ts +13 -1
- package/dist/component/3d/sequenceRegistration/types.d.ts +12 -0
- package/dist/component/store/auxiliaryStore.d.ts +2 -0
- package/dist/component/store/brainRenderStore.d.ts +3 -0
- package/dist/component/store/functionLoopStore.d.ts +45 -6
- package/dist/component/util/brainRegionApi.d.ts +14 -0
- package/dist/decoder-CLokFc0V.mjs +8 -0
- package/dist/decoder-D9LU4bUo.js +1 -0
- package/dist/{deflate-CowmveuV.js → deflate-BeH9s0iP.js} +1 -1
- package/dist/{deflate-_ZycUeZq.mjs → deflate-BzzTt5CL.mjs} +1 -1
- package/dist/{index-tBE0HArS.mjs → index-DXi3wJl5.mjs} +66894 -65419
- package/dist/{index-DEgHZlr6.js → index-Vl_BECD1.js} +539 -535
- package/dist/index.js +1 -1
- package/dist/index.mjs +34 -33
- package/dist/{lerc-DtHzaIbU.mjs → lerc-DBBnh9Ss.mjs} +1 -1
- package/dist/{lerc-LVs7qdot.js → lerc-ayrexzv9.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -54,7 +54,11 @@ export default function App() {
|
|
|
54
54
|
|
|
55
55
|
- 展示 3D 标准脑图谱。
|
|
56
56
|
- 在同一个 Three.js 场景中展示脑区、核团、血管、神经元等对象。
|
|
57
|
-
-
|
|
57
|
+
- 各场景共用的模型右键菜单仅在右击时打开,并保留当次模型的操作目标;从模型移入菜单后可正常选择。普通菜单在移出菜单卡片、选择菜单项或点击外部后关闭,带方位筛选的菜单改为点击外部、按 Esc 或选择普通菜单项关闭,避免嵌套下拉框交互被打断;重新悬停模型不会自动打开。
|
|
58
|
+
- FBX 脑区模型右键菜单的 AI 分组显示“知识解释、连接查询、条件筛选、比较分析、环路探索、跨模态验证、研究规划、病毒注射”八个分类标题,不展示问题正文;点击标题后发送包含当前核团名称的对应问题。例如右击 OLF 的“病毒注射”发送“以 OLF 为靶点做自动病毒注射。”,坐标和路径继续由现有 AI 工作流处理。菜单支持视口边界避让及超高滚动。SWC 保留胞体位置、轴突投射、形态特征三个神经元专属问题;两类菜单均携带当次右击模型的名称/ID,中英文随全局语言切换。
|
|
59
|
+
- FBX 核团菜单仅在 Knowledge 页签提供“查看上游核团”和“查看下游核团”,其他 Tab 不显示这两个入口,切走后旧菜单回调也不再执行。从当前 `soma_axon` 数据的胞体 `soma` 与轴突 `axon` 神经元 ID 交集推导核团(候选 `id=1`,排除自身),按共享神经元去重后的数量降序选择最多 10 个,同分保留数据顺序。新增模型使用连接展示的透明度,已显示模型不重复加载或隐藏,重复点击不会继续追加下一批。同步查询当前核团与这些核团的完整 `FunctionalCircuit` 数据,自动开启病毒示踪、MRI、电生理、光遗传、突触连接及接口返回的单神经元列表,不截断连接证据;没有证据的脑区对不编造连线。无匹配核团时提示,不用 `up/down` 神经元 ID 直接充当核团名称。
|
|
60
|
+
- 用户已开启连接显示时,FBX 右键菜单顶部提供独立的“方位筛选”区域,与模型操作和 AI 问题菜单分开。支持数据库 `relation.stam_direction_points.direction_points` 定义的全部 26 个方向(6 单向、12 双向、8 三向),使用可搜索的多选下拉框,按单一方位、双向组合、三向组合分组;列表限高 200px,超出内部滚动。已选条件最多显示两个标签,其余收为 `+N`,不再平铺全部选项。点击标题旁的说明按钮后,在筛选框下方展开自动换行的说明,再次点击收起;不使用会遮挡或被滚动容器裁切的悬浮提示,重新打开菜单时默认收起。说明按钮支持键盘操作及展开状态提示。选择立即生效,多选取并集;操作筛选时菜单不因鼠标移出而关闭,点击外部、按 Esc 或选择普通菜单项关闭。组合方向要求同一端点的同一方位短语包含全部分量,例如“背外侧”同时满足背侧和外侧,“吻背内侧”同时满足吻侧、背侧和内侧;分别选择“背侧”“外侧”仍是 OR,并不等于选择“背外侧”。删除最后一个标签或点击分组中的“清空”恢复原有连接选择,Knowledge 中的“取消连接筛选”入口保留。匹配仅使用当前核团端点的 `region_start_modifier` / `region_end_modifier`,支持英文连写、空格、连字符、下划线及中文组合,不用另一端修饰词、摘要、中心坐标或空间邻接关系推断。未标注方位或无法明确映射的解剖术语不归入所选方位。筛选同步更新证据列表与已开启类型的 3D 连线,不自动开启其他连接;Knowledge 显示当前条件及无匹配提示。后端继续使用配套 `Brain_lit/app.py` 的 `FunctionalCircuit` 完整响应字段。
|
|
61
|
+
- 点击问题复用现有 AI 对话、登录和流式响应:登录后自动打开并发送,未登录时先保留问题并要求登录。已有请求、历史加载或待填表单时仅填入草稿,不打断当前操作。SWC 回答要求依据该神经元的真实数据,无法获取的测量不得以脑区常识替代。
|
|
58
62
|
- 加载并展示 SWC 神经元形态数据;悬停时红色高亮,移至空白、其他神经元或画布外后恢复原色,快速移开同样生效。
|
|
59
63
|
- SideBar 搜索支持脑区缩写、英文全名和中文名,不区分大小写,忽略首尾及重复空格,支持多个关键词;Neurons 的脑区选项和已选标签仅显示缩写与英文全名,搜索结果优先显示精确匹配。输入搜索词不会修改已选筛选条件。
|
|
60
64
|
- Regions 搜索框内的 `Cc` 小图标用于切换严格匹配,悬浮显示说明,开启后高亮;严格模式仅完整匹配脑区缩写、英文全名或中文名(仍忽略大小写及多余空格)。原样式的放大镜按钮和回车均可立即执行搜索,修改文字仍自动搜索。Neurons 保持原来的下拉输入框样式,不显示 `Cc` 或额外搜索按钮,输入即搜索。
|
|
@@ -71,15 +75,24 @@ export default function App() {
|
|
|
71
75
|
- 支持 TIFF 图像栈体积分析相关工作流。
|
|
72
76
|
- 提供基于 Ant Design X 的 AI 对话界面,支持 Markdown、工具调用结果和图表结果展示。
|
|
73
77
|
- 支持功能环路分析,包括连接关系、基因表达、突触、单神经元等数据展示。
|
|
74
|
-
-
|
|
78
|
+
- Knowledge 的 Interest 卡片提供核团下拉框,复用当前脑区树,支持按缩写、英文全名和中文名搜索;每次选择添加一个核团并加载对应模型,可连续添加且不重复,仍可通过标签删除、清空或点击 Analyze 分析。已审核病毒注射路径保持只读,不显示该选择框。
|
|
79
|
+
- Knowledge 的病毒示踪、磁共振、电生理、光遗传、突触管道统一使用贝塞尔曲线。每条连接(含不同证据类型和反向连接)分配独立的螺旋偏移方向与幅度,避免同端点管道沿整条路径重合;同一展示周期内关闭再开启保留原偏移,清空展示后重新分配。保留共同端点,不保证任意视角下的二维投影无交叉;弧线仅表示脑区连接关系,不代表真实轴突轨迹或手术进针路径。
|
|
80
|
+
- Knowledge 五类连接统一显示为细管道,保留 `TubeGeometry` 和证据数量到半径的映射 `min((10 + 证据数 × 5) × 0.0004, 0.01)`(单条证据半径 `0.006` 场景单位)。管道和箭头与对应类型卡片左侧圆点共用颜色(病毒标记绿、磁共振蓝、电生理紫、光遗传黄、突触粉),强度对应的透明度保持不变。管道与箭头支持悬停提亮、手势光标和点击文献,保留沿整条路径的宽不可见拾取区域。拖拽和隐藏连接不触发文献弹窗,无文献时显示空状态,支持点击 DOI 跳转。短距离连接缩短端点,非病毒坐标重合连接使用三次贝塞尔环;病毒同脑区或坐标重合时仍显示绿色点,不生成管道、箭头或注射器。
|
|
81
|
+
- Knowledge 病毒标记保持原列表名称、气泡和样式:顺行显示 `→`,逆行(`Retrograde`)显示 `←`,三维箭头严格跟随列表方向,不根据注射点字段重新改变列表方向。同一脑区对的顺行、逆行分别统计证据、文献、强度并独立开关,每条连接只有一个箭头。标题感叹号仍显示原提示“左侧为靶点,右侧为注射点”,中英文保持原文。
|
|
82
|
+
- Knowledge 磁共振保持原来的单张“磁共振 / MRI”卡片、脑区对名称、`modality_end` 气泡及配色,不追加 A/B、结构性/功能性或实线/虚线说明文字。内部按“脑区对+`modality_type`”分别统计并控制连接:`A` 为结构性实线细管道,`B` 为功能性虚线细管道(沿弧长移除部分管道面形成真实间隔)。同一脑区对的两类证据为独立列表记录和错开的三维管道,单项开关各自独立,原卡片总开关同时控制两类;未知或缺少类型不根据 `modality` 文本猜测为 A/B。
|
|
75
83
|
- Knowledge 页签跟随全局语言(`en_us` / `zh_cn`)显示中英文:包括脑区选择提示、分析按钮、证据类型、分子指纹/连接卡片、图例、统计、悬浮说明及证据来源弹窗;脑区标识、基因/受体名称和文献内容保持原始数据。
|
|
76
84
|
- Knowledge 基因分布按“基因名(不区分大小写)+脑区”过滤重复圆球和标签;保留原有圆球材质、颜色、透明度和立体文字,标签仍选取该组有 DOI 且影响因子最高的文献。
|
|
77
85
|
- 文献文字不再显示“双击查看”悬浮提示;双击 DOI 跳转保持不变。
|
|
78
86
|
- 文献立体文字在加入场景时立即对齐相机,字体首次异步加载和命中缓存时均生效,无需先操作场景。
|
|
79
87
|
- 突触受体预览使用非负的固定随机种子计算球面偏移,避免部分受体(如 `beta2-containing nAChRs`)生成 NaN 坐标而无法显示。
|
|
80
88
|
- Knowledge 子项小眼睛、类型总开关及 AI 展示共用同一份选中状态:单次操作不会重复绘制,AI 展示后可直接用小眼睛关闭。神经递质/受体分布与突触连接独立控制,关闭一类不会改变另一类。
|
|
89
|
+
- Knowledge 基因/受体总开关和 AI 多名称展示按类型批量调用 `ExpressionSearch`,不再逐名称并发或串行请求;基因与受体仍分开查询。批量结果可供后续单项和子集复用,重叠在途查询只补取缺失名称,缓存按类型与排除脑区隔离。连接展示复用已有分析数据,不逐条补发请求。
|
|
81
90
|
- 分析、连接展示及基因/受体预览复用现有 Loading 遮罩;并发或嵌套加载全部结束后才收起,失败时释放 loading 并提示错误。关闭或清空展示会取消在途预览,迟到的数据不会重新显示。
|
|
82
|
-
- `FunctionLoop` controller 的 `loadMethodData`、`previewGene`、`previewReceptor` 返回 `Promise<void>`,调用方应等待展示完成并处理失败;`removeGroupData`
|
|
91
|
+
- `FunctionLoop` controller 的 `loadMethodData`、`previewGene`、`previewReceptor` 返回 `Promise<void>`,调用方应等待展示完成并处理失败;`previewGene` / `previewReceptor` 的首参支持单个名称或名称数组。`removeGroupData` 同时更新场景与开关状态;批次中关闭单项不影响其余项,关闭全部则取消该批次的展示等待。
|
|
92
|
+
- AI 对话通过 `brain-3d-commander` 的结构化 `circuit_panel` 自动更新 Knowledge:标题按意图显示“脑区”“连接关系”“病毒注射”,或现有的病毒标记、电生理、光遗传、磁共振、突触、基因、神经递质/受体、单神经元分类。脑区列表来自 `region_ids`,不依赖 `highlight_region`;连接聚焦不高亮脑区时也能更新面板。
|
|
93
|
+
- `circuit_panel` 示例:`{"category":"connections","region_ids":["VTA","ACB"]}`。可选 `connections:[{"source_id":"VTA","target_id":"ACB"}]` 仅用于已核验方向;不确定方向时省略,面板保留查询脑区间两个方向的证据。`GeneExpression` / `Neurotransmitter` 可携带 `gene_names` / `receptor_names` 复用现有预览。
|
|
94
|
+
- 注射分类仅展示真实 `injection_path` 的靶点、进针端点、规避核团和穿经结构,坐标使用 STAM `[ML, DV, AP]`、10 μm 体素;缺少审计结果时明确显示不可用,不以连接证据代替手术针道,也不自动运行普通环路分析。
|
|
95
|
+
- 异步模型勾选不会覆盖 AI 当前查询;手动勾选脑区树恢复“脑区”模式。切换历史会话恢复最近一条结构化面板指令;旧历史没有该字段时不从正文推测。
|
|
83
96
|
|
|
84
97
|
## 主要导出
|
|
85
98
|
|
|
@@ -117,7 +130,7 @@ import {
|
|
|
117
130
|
- 模式选择器由 `Auxiliary` 内部渲染,与下方 Tabs 共用宽度和纵向布局;宿主不再另放一条绝对定位的模式栏。英文、长译文和放大字体可以换行,折叠后模式选项纵向排列。未配置对应工具的模式不可选。
|
|
118
131
|
- 普通面板内容保持左右等量留白,清除右侧 Tabs 默认的额外页内边距。Knowledge 卡片使用完整内容宽度,其高度跟随 Tabs 的实际可用空间,不再按视口减固定值计算;只有内容超长时由 Knowledge 自身滚动,外层不叠加滚动条。
|
|
119
132
|
- `src/component/3d/auxiliary/panels.ts` 集中维护 `AuxiliaryPanelId`、工具名、URL 类型、页面标题及引导信息。新增面板时先更新此注册表,再添加对应内容,不要另建 index/URL 映射。
|
|
120
|
-
- 代码入口使用公开导出的 `AuxiliaryPanelId`,通过 `task3DStore.auxiliary.controller?.tabChange(AuxiliaryPanelId.FunctionalLoop)`(或 `Auxiliary` ref 上同一 controller
|
|
133
|
+
- 代码入口使用公开导出的 `AuxiliaryPanelId`,通过 `task3DStore.auxiliary.controller?.tabChange(AuxiliaryPanelId.FunctionalLoop)`(或 `Auxiliary` ref 上同一 controller)切换。切换到不同 Tab 时清理当前功能的场景内容、已加载模型及勾选状态、Knowledge 连接与筛选,关闭旧菜单和引导;基础脑图谱、坐标及光照保留。离开 Knowledge 时取消在途分析,切换前启动但尚未完成的 FBX 加载结果不会重新填回场景。再次点击当前 Tab 不重复清理。直接设置 `rightTabIndex` 不是功能切换入口。
|
|
121
134
|
- 初始链接按 `rightTab` → `rightTabIndex` → `type` → `index` → 首个可用面板的优先级解析,并检查工具配置和模式。已有数字 ID、`type=slicing`、`index=Slicing` 等链接仍可打开;`rightTab=sequence-registration` 可直接打开序列配准。显式面板优先于旧链接残留的模式值。
|
|
122
135
|
- 切换后统一写入分享链接缓冲区的 `rightTab`、`rightTabIndex`、`type`、`mode`,移除旧引导 `index`;与原有分享机制一致,不修改浏览器地址栏。功能环路不会再落入体积分析的 URL/标题分支。
|
|
123
136
|
- 引导只维护一个 `activeTour` 面板 ID。旧链接的 `index` 只触发实际打开面板的引导,并遵守原有“不再显示”设置;工具栏引导入口可手动重新打开当前面板的引导。切换面板会关闭旧引导,长引导内容在视口内滚动。
|
|
@@ -155,6 +168,15 @@ import {
|
|
|
155
168
|
|
|
156
169
|
图表组件基于 ECharts,适合展示脑区统计、连接关系、证据矩阵、功能环路结果和分析摘要。
|
|
157
170
|
|
|
171
|
+
`SpatialAdjacencyChart` 空间邻接图在面板的实际宽高内排布全部节点,不使用放大的滚动画布或内部横向/纵向滚动条。布局按解剖方位扇区、真实气泡半径和边界进行碰撞检查;拥挤时同步缩小整张图的显示尺寸,不删掉邻居,重叠标签可隐藏并通过悬浮查看。排布重试有上限,不能保持最小可见尺寸时显示放大面板提示,不生成零尺寸节点;扩大面板后自动恢复。连线粗细仍表示接触面积。
|
|
172
|
+
|
|
173
|
+
气泡使用**相对体积的对数显示面积**,避免极大父结构使其余核团全部被压到同一个最小尺寸。所有已测量节点(包括中心)共用 `t = (log(v)-log(vmin))/(log(vmax)-log(vmin))`、`diameter = sqrt(dmin²+t×(dmax²-dmin²))`;`dmin=0.28×dmax`,`dmax` 随面板与节点数自适应。这不是严格的物理面积比例,图中明确标为 `Relative volume, display-scaled / Log-scaled area`;悬浮显示精确 `volume_mm3`。直接使用组件时,中心传 `center_volume_mm3`,邻居传 `volume_mm3`;真正缺失的测量以空心虚线标识,不将接触面积当体积。
|
|
174
|
+
|
|
175
|
+
`ChartViewer` 接收简化的 `center_region`/`neighbors`、STAM `subject`/`all_adjacent` 或 `query.spatial_results` 邻接结果后,通过现有 brainRegion 代理调用 `POST /app-api/brainRegion-api/StructureVolumes`,按中心及全部显示邻居ID一次性查询真实体积;**不依赖AI是否保留体积字段,也不要求这些ID出现在同一份STAM直接邻居列表**。请求体为 `{"structure_ids":["VTA","PAG"],"hemisphere":"left"}`,成功响应为 `{code:200,data:{atlas_version,hemisphere,volumes:[{structure_id,voxel_count,volume_mm3}],missing_structure_ids}}`。半球使用明确配置,缺省为STAM的 `left`。请求更新或卸载时取消旧查询,迟到结果不覆盖当前图;查询中显示加载状态,服务失败或测量响应无效时显示错误而不绘制一圈等大缺省气泡,成功后仅对真正缺失的ID显示警告。
|
|
176
|
+
|
|
177
|
+
测量接口归属 `D:/Brain_lit` 数据后端,使用其现有数据库连接和 `POST /StructureVolumes` 公共数据路由;当前服务端口为5000,现有 brainRegion 代理指向 `192.168.50.32:5000`。无需AI对话服务的登录 Cookie、专用测量路由或额外部署,也不向前端暴露数据库凭据;失败响应使用 `{code:400|503,message:...}`,客户端保留服务端错误信息,不重试或回退到其他后端。已有结构化邻接数据的旧会话也会按ID补查体积;缺少真实邻接数据时仍显示空状态,不根据脑区ID编造方向、接触面积或类别。`VTAScreenshotHydration` 故意不提供体积和STAM工具上下文,覆盖截图中的VTA、PAG、IF、MBmot、SNc、IPN、PH、LHA、ZI、RN、SNr、STN共12个结构;PAG/MBmot/ZI位置仅为布局示例,MBmot为包含VTA的上位结构,其体积不是独立小核团体积。
|
|
178
|
+
|
|
179
|
+
|
|
158
180
|
### 通用组件和工具
|
|
159
181
|
|
|
160
182
|
```tsx
|
|
@@ -327,6 +349,8 @@ npm run build
|
|
|
327
349
|
npm run storybook
|
|
328
350
|
```
|
|
329
351
|
|
|
352
|
+
默认监听 `0.0.0.0:6006`,可通过 `http://本机内网IP:6006` 访问;其他设备访问仍需 Windows 防火墙放行该端口。Storybook 开发服务会暴露故事、源码及开发通道,仅用于可信局域网,不要直接映射到公网。
|
|
353
|
+
|
|
330
354
|
也可使用 `bun run storybook`。Storybook 会自动发现 `.storybook/middleware.js` 并加载 API 代理,无需在 `.storybook/main.ts` 中导入或注册;代理仍使用 CommonJS,已有环境变量覆盖和 WebSocket 路由保持不变。
|
|
331
355
|
|
|
332
356
|
### 组件故事的组织方式
|
|
@@ -9,12 +9,14 @@ export interface SpatialNeighbor {
|
|
|
9
9
|
direction_code?: string;
|
|
10
10
|
contact_area?: number;
|
|
11
11
|
total_contact_area_um2?: number;
|
|
12
|
+
volume_mm3?: number;
|
|
12
13
|
structure_type?: 'nucleus' | 'fiber_tract' | 'ventricular_structure' | 'cortical_area' | string;
|
|
13
14
|
}
|
|
14
15
|
export interface SpatialAdjacencyData {
|
|
15
16
|
center_region: string;
|
|
16
17
|
center_name_zh?: string;
|
|
17
18
|
center_name_en?: string;
|
|
19
|
+
center_volume_mm3?: number;
|
|
18
20
|
neighbors?: SpatialNeighbor[];
|
|
19
21
|
adjacent_regions?: SpatialNeighbor[];
|
|
20
22
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SpatialAdjacencyData, SpatialNeighbor } from './SpatialAdjacencyChart';
|
|
2
|
+
export interface NormalizedSpatialAdjacencyData extends SpatialAdjacencyData {
|
|
3
|
+
neighbors: SpatialNeighbor[];
|
|
4
|
+
hemisphere?: string;
|
|
5
|
+
}
|
|
6
|
+
interface SpatialChartConfig {
|
|
7
|
+
chart_type: string;
|
|
8
|
+
region_ids: string[];
|
|
9
|
+
center_region?: string;
|
|
10
|
+
hemisphere?: string;
|
|
11
|
+
spatial_adjacency_data?: unknown;
|
|
12
|
+
adjacency_data?: unknown;
|
|
13
|
+
}
|
|
14
|
+
interface SpatialSourceTool {
|
|
15
|
+
name: string;
|
|
16
|
+
status: string;
|
|
17
|
+
args?: {
|
|
18
|
+
skill_name?: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
};
|
|
21
|
+
data?: unknown;
|
|
22
|
+
result?: unknown;
|
|
23
|
+
}
|
|
24
|
+
/** Parse simplified chart data, raw STAM neighbors, or query results, including JSON envelopes. */
|
|
25
|
+
export declare function normalizeSpatialAdjacencyData(value: unknown, centerRegion?: string): NormalizedSpatialAdjacencyData | null;
|
|
26
|
+
/** Resolve only a chart's nearest preceding, successful, same-message STAM adjacency result. */
|
|
27
|
+
export declare function enrichSpatialChartConfig<T extends SpatialChartConfig>(config: T, tools: readonly SpatialSourceTool[], chartToolIndex: number): T;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type AnatomyHemisphere = 'left' | 'right';
|
|
2
|
+
export interface StructureVolume {
|
|
3
|
+
structure_id: string;
|
|
4
|
+
voxel_count: number;
|
|
5
|
+
volume_mm3: number;
|
|
6
|
+
}
|
|
7
|
+
export interface StructureVolumesResponse {
|
|
8
|
+
atlas_version: string;
|
|
9
|
+
hemisphere: AnatomyHemisphere;
|
|
10
|
+
volumes: StructureVolume[];
|
|
11
|
+
missing_structure_ids: string[];
|
|
12
|
+
}
|
|
13
|
+
/** One authoritative batch for exactly the displayed IDs; no model/tool-field fallback. */
|
|
14
|
+
export declare function fetchStructureVolumes(structureIds: string[], hemisphere: AnatomyHemisphere, signal: AbortSignal): Promise<StructureVolumesResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FunctionLoopPanelCategory } from '../../store/functionLoopStore';
|
|
2
|
+
export interface CircuitPanelConnection {
|
|
3
|
+
source_id: string;
|
|
4
|
+
target_id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CircuitPanelCommand {
|
|
7
|
+
category: FunctionLoopPanelCategory;
|
|
8
|
+
region_ids: string[];
|
|
9
|
+
connections?: CircuitPanelConnection[];
|
|
10
|
+
gene_names?: string[];
|
|
11
|
+
receptor_names?: string[];
|
|
12
|
+
}
|
|
13
|
+
/** Consume only explicit structured intent; never infer a query from answer text or highlights. */
|
|
14
|
+
export declare function circuitPanelFromToolResult(value: unknown): CircuitPanelCommand | null;
|
|
@@ -10,6 +10,7 @@ interface ProgressSegment {
|
|
|
10
10
|
}
|
|
11
11
|
export interface ProgressItem {
|
|
12
12
|
name: string;
|
|
13
|
+
displayName?: string;
|
|
13
14
|
segments: ProgressSegment[];
|
|
14
15
|
bubbleText: string;
|
|
15
16
|
bubbleColor: string;
|
|
@@ -24,6 +25,7 @@ export interface ProgressItem {
|
|
|
24
25
|
interface ConnectivityCardProps {
|
|
25
26
|
color: string;
|
|
26
27
|
title: string;
|
|
28
|
+
directionNote?: string;
|
|
27
29
|
progressItems: ProgressItem[];
|
|
28
30
|
totalHeight?: number;
|
|
29
31
|
onViewMore?: (itemName?: string) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
interface ConnectionCurve {
|
|
3
|
+
curve: THREE.QuadraticBezierCurve3 | THREE.CubicBezierCurve3;
|
|
4
|
+
startPoint: THREE.Vector3;
|
|
5
|
+
endPoint: THREE.Vector3;
|
|
6
|
+
}
|
|
7
|
+
/** Each display-wide lane has a distinct direction and radius, including reverse connections. */
|
|
8
|
+
export declare function createKnowledgeConnectionCurve(center1: THREE.Vector3, center2: THREE.Vector3, lane: number): ConnectionCurve;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare function isRetrogradeTracing(direction?: string): boolean;
|
|
3
|
+
export declare function getMRIModalityType(modalityType?: string): string;
|
|
4
|
+
/** Keep cylindrical geometry and evidence weighting, but every connection stays thin. */
|
|
5
|
+
export declare function createConnectionTubeGeometry(curve: THREE.Curve<THREE.Vector3>, evidenceCount: number, dashed?: boolean): THREE.TubeGeometry;
|
|
@@ -8,7 +8,6 @@ interface FunctionloopProps {
|
|
|
8
8
|
style: React.CSSProperties;
|
|
9
9
|
setFunctionLoopSwcData: React.Dispatch<React.SetStateAction<SwcTreeItem[]>>;
|
|
10
10
|
fbxCheckItems: string[];
|
|
11
|
-
rightTabIndex: number;
|
|
12
11
|
setLeftMenuTabIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
13
12
|
regionColors?: Record<string, string>;
|
|
14
13
|
onRegionRemove?: (region: string) => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ConnectionDirection = 'upstream' | 'downstream';
|
|
2
|
+
export declare const MODEL_CONNECTION_COMPARTMENTS: readonly ["dorsal", "ventral", "rostral", "caudal", "medial", "lateral", "dorsal_medial", "dorsal_lateral", "ventral_medial", "ventral_lateral", "rostral_dorsal", "rostral_ventral", "rostral_medial", "rostral_lateral", "caudal_dorsal", "caudal_ventral", "caudal_medial", "caudal_lateral", "rostral_dorsal_medial", "rostral_dorsal_lateral", "rostral_ventral_medial", "rostral_ventral_lateral", "caudal_dorsal_medial", "caudal_dorsal_lateral", "caudal_ventral_medial", "caudal_ventral_lateral"];
|
|
3
|
+
export type ModelConnectionCompartment = typeof MODEL_CONNECTION_COMPARTMENTS[number];
|
|
4
|
+
export interface ModelConnectionFilter {
|
|
5
|
+
region: string;
|
|
6
|
+
compartments: ModelConnectionCompartment[];
|
|
7
|
+
}
|
|
8
|
+
interface RegionNeurons {
|
|
9
|
+
soma: string[];
|
|
10
|
+
axon: string[];
|
|
11
|
+
id: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Use neuron membership, not the legacy up/down fields. Return at most ten
|
|
15
|
+
* regions ranked by unique shared neuron count; ties retain data order.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getConnectedRegions(connections: Record<string, RegionNeurons>, region: string, direction: ConnectionDirection): string[];
|
|
18
|
+
/** Match any selected internal orientation at the clicked raw endpoint only. */
|
|
19
|
+
export declare function matchesModelConnection(value: unknown, filter: ModelConnectionFilter): boolean;
|
|
20
|
+
export {};
|
|
@@ -8,7 +8,7 @@ interface Props {
|
|
|
8
8
|
onSectionChange?: (slice: SequenceSlice, section: 0 | 1 | 2) => Promise<void>;
|
|
9
9
|
onTransformModeChange?: (mode: SequenceTransformMode) => void;
|
|
10
10
|
onSaveTransform?: (slice: SequenceSlice, transform: SequenceTransform) => Promise<number>;
|
|
11
|
-
onRegisterTransformSaver?: (saver: (sliceId: string, transform: SequenceTransform) => Promise<number>) => void;
|
|
11
|
+
onRegisterTransformSaver?: (saver: ((sliceId: string, transform: SequenceTransform) => Promise<number>) | null) => void;
|
|
12
12
|
onRegisterLivePoseListener?: (listener: ((sliceId: string, pose: SequenceLivePose, committed: boolean) => void) | null) => void;
|
|
13
13
|
onSequenceVolumeGeometry?: (geometry: SequenceVolumeGeometry | null) => void;
|
|
14
14
|
onGetExportPose?: (slice: SequenceSlice, size: {
|
|
@@ -16,6 +16,7 @@ interface Props {
|
|
|
16
16
|
height: number;
|
|
17
17
|
}) => SequenceLivePose | null;
|
|
18
18
|
onGetLivePose?: (sliceId: string) => SequenceLivePose | null;
|
|
19
|
+
onBusyChange?: (busy: boolean) => void;
|
|
19
20
|
}
|
|
20
21
|
declare const SequenceRegistrationPanel: React.FC<Props>;
|
|
21
22
|
export default SequenceRegistrationPanel;
|
|
@@ -12,12 +12,15 @@ export declare const getSequenceSession: (id: string) => Promise<SequenceSession
|
|
|
12
12
|
export declare function createSequenceSession(input: Pick<SequenceSession, "name" | "startFrame" | "spacingMode" | "defaultSpacingUm">): Promise<SequenceSession>;
|
|
13
13
|
export declare function updateSequenceSession(sessionId: string, input: Partial<Pick<SequenceSession, "name" | "startFrame" | "spacingMode" | "defaultSpacingUm">>): Promise<SequenceSession>;
|
|
14
14
|
export declare function uploadSequenceSlice(sessionId: string, file: File, idempotencyKey: string): Promise<SequenceSlice>;
|
|
15
|
-
export declare function updateSequenceSlice(sessionId: string, slice: SequenceSlice, patch: Partial<Pick<SequenceSlice, "targetFrame" | "sec" | "positionOffsetUm">>
|
|
15
|
+
export declare function updateSequenceSlice(sessionId: string, slice: SequenceSlice, patch: Partial<Pick<SequenceSlice, "targetFrame" | "sec" | "positionOffsetUm">> & {
|
|
16
|
+
pixelSpacingUm?: [number, number];
|
|
17
|
+
}): Promise<SequenceSlice>;
|
|
16
18
|
export declare function reorderSequenceSlices(sessionId: string, sliceIds: string[]): Promise<{
|
|
17
19
|
ok: boolean;
|
|
18
20
|
}>;
|
|
19
|
-
export declare function saveSequenceTransform(sessionId: string, sliceId: string, revision: number, transform: SequenceTransform): Promise<{
|
|
21
|
+
export declare function saveSequenceTransform(sessionId: string, sliceId: string, revision: number, transform: SequenceTransform, keepalive?: boolean): Promise<{
|
|
20
22
|
revision: number;
|
|
21
23
|
transform: SequenceTransform;
|
|
22
24
|
}>;
|
|
23
25
|
export declare function deleteSequenceSlice(sessionId: string, sliceId: string): Promise<void>;
|
|
26
|
+
export declare function deleteSequenceSession(sessionId: string): Promise<void>;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { SequenceLivePose } from "./stamPlane";
|
|
2
2
|
import type { SequenceRegistrationExportV3, SequenceSlice } from "./types";
|
|
3
|
+
/** Same recoverable JSON format accepted by the annotation workspace importer. */
|
|
4
|
+
export declare function createSequenceExportBackup(items: {
|
|
5
|
+
result: SequenceRegistrationExportV3;
|
|
6
|
+
sourceImagePreview: Blob;
|
|
7
|
+
}[], batchId: string): Promise<{
|
|
8
|
+
schemaVersion: number;
|
|
9
|
+
batchId: string;
|
|
10
|
+
items: {
|
|
11
|
+
result: SequenceRegistrationExportV3;
|
|
12
|
+
preview: {
|
|
13
|
+
type: string;
|
|
14
|
+
data: string;
|
|
15
|
+
};
|
|
16
|
+
}[];
|
|
17
|
+
}>;
|
|
3
18
|
export declare function createSequenceExportResult(slice: SequenceSlice, pose: SequenceLivePose, exportId: string): SequenceRegistrationExportV3;
|
|
4
19
|
export declare function mapSequenceExports<T, R>(items: T[], operation: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
@@ -22,5 +22,7 @@ export declare function mountPoseEditor(host: HTMLElement, options: Options): {
|
|
|
22
22
|
}) => void;
|
|
23
23
|
fit: () => void;
|
|
24
24
|
setMode: (mode: "translate" | "rotate") => void;
|
|
25
|
+
setOutlineOpacity: (value: number) => void;
|
|
26
|
+
setHideOutlineWhileRotating: (value: boolean) => void;
|
|
25
27
|
dispose: () => void;
|
|
26
28
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
+
/** Keep scene textures and off-scene exports on exactly the same physical plane. */
|
|
3
|
+
export declare function sequencePlaneSize(size: THREE.Vector3, section: number, raster?: {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
}): [number, number];
|
|
2
7
|
import type { SequenceSlice, StamPlane } from "./types";
|
|
3
8
|
import type { TargetTifFrameMapping, TargetTifGeometry } from "./atlasReslicingReference";
|
|
4
9
|
export interface SequenceSlicePose {
|
|
@@ -18,7 +23,7 @@ export interface SequencePhysicalPose {
|
|
|
18
23
|
}
|
|
19
24
|
export interface SequenceVolumeGeometry extends TargetTifGeometry {
|
|
20
25
|
}
|
|
21
|
-
type DefaultSequencePlacement = Pick<SequenceSlice, "targetFrame" | "sequenceOrder" | "positionOffsetUm">;
|
|
26
|
+
type DefaultSequencePlacement = Pick<SequenceSlice, "targetFrame" | "sequenceOrder" | "positionOffsetUm" | "defaultStartFrame" | "placementAdjusted">;
|
|
22
27
|
export interface SequenceLivePose {
|
|
23
28
|
annotationTarget?: {
|
|
24
29
|
datasetId: string;
|
|
@@ -67,6 +72,13 @@ export interface StamGeometryMetadata {
|
|
|
67
72
|
sliceCoordinateToPhysicalUm: number[];
|
|
68
73
|
}
|
|
69
74
|
export declare function applyStamGeometryMetadata(brain: THREE.Object3D, value: unknown): boolean;
|
|
75
|
+
export declare function sequencePlacementRange(placement: DefaultSequencePlacement, geometry?: SequenceVolumeGeometry | null): {
|
|
76
|
+
requestedFrame: number;
|
|
77
|
+
frame: number;
|
|
78
|
+
frameCount: number;
|
|
79
|
+
limited: boolean;
|
|
80
|
+
} | null;
|
|
81
|
+
export declare function sequenceDefaultFrame(placement: DefaultSequencePlacement, geometry?: SequenceVolumeGeometry | null): number | null;
|
|
70
82
|
/**
|
|
71
83
|
* Derive the default coronal plane position from the sequence's one-based
|
|
72
84
|
* target frame and physical spacing. The known 10 µm reference mapping uses
|
|
@@ -16,6 +16,7 @@ export interface StamPlane {
|
|
|
16
16
|
pixelSpacingUm: [number, number];
|
|
17
17
|
}
|
|
18
18
|
export interface SequenceTransform {
|
|
19
|
+
defaultPlacement?: boolean;
|
|
19
20
|
position: {
|
|
20
21
|
x: number;
|
|
21
22
|
y: number;
|
|
@@ -60,6 +61,7 @@ export interface SequenceRegistrationExportV2 {
|
|
|
60
61
|
exportedAt: string;
|
|
61
62
|
}
|
|
62
63
|
export interface SequenceRegistrationExportV3 {
|
|
64
|
+
sourceGeometry?: SequenceSourceGeometry;
|
|
63
65
|
schemaVersion: 3;
|
|
64
66
|
exportId: string;
|
|
65
67
|
sessionId: string;
|
|
@@ -136,13 +138,23 @@ export interface SequenceRegistration {
|
|
|
136
138
|
atlasWasResliced?: boolean;
|
|
137
139
|
previewAvailable?: boolean;
|
|
138
140
|
}
|
|
141
|
+
export interface SequenceSourceGeometry {
|
|
142
|
+
widthPx: number;
|
|
143
|
+
heightPx: number;
|
|
144
|
+
pixelSpacingUm: [number, number] | null;
|
|
145
|
+
physicalSizeUm: [number, number] | null;
|
|
146
|
+
calibrationSource: string;
|
|
147
|
+
}
|
|
139
148
|
export interface SequenceSlice {
|
|
149
|
+
sourceGeometry?: SequenceSourceGeometry;
|
|
140
150
|
id: string;
|
|
141
151
|
sessionId: string;
|
|
142
152
|
originalFilename: string;
|
|
143
153
|
fileSize: number;
|
|
144
154
|
sequenceOrder: number;
|
|
145
155
|
targetFrame: number;
|
|
156
|
+
placementAdjusted?: boolean;
|
|
157
|
+
defaultStartFrame?: number;
|
|
146
158
|
sec: number;
|
|
147
159
|
positionOffsetUm: number;
|
|
148
160
|
status: SequenceSliceStatus;
|
|
@@ -35,6 +35,7 @@ export declare class AuxiliaryStore {
|
|
|
35
35
|
gridVisible: boolean;
|
|
36
36
|
azimuth: number;
|
|
37
37
|
aiChatVisible: boolean;
|
|
38
|
+
aiQuestion: string | null;
|
|
38
39
|
constructor();
|
|
39
40
|
setOffsetFactor(value: StateUpdate<number>): void;
|
|
40
41
|
setController(controller: AuxiliaryController | null): void;
|
|
@@ -52,4 +53,5 @@ export declare class AuxiliaryStore {
|
|
|
52
53
|
setGridVisible(value: StateUpdate<boolean>): void;
|
|
53
54
|
setAzimuth(value: StateUpdate<number>): void;
|
|
54
55
|
setAiChatVisible(value: StateUpdate<boolean>): void;
|
|
56
|
+
setAiQuestion(question: string | null): void;
|
|
55
57
|
}
|
|
@@ -67,6 +67,7 @@ export declare class BrainRenderStore {
|
|
|
67
67
|
nodeData: Record<string, BrainNodeDataValue>;
|
|
68
68
|
boundingBox: BrainBoundingBox;
|
|
69
69
|
useHighResModels: boolean;
|
|
70
|
+
private fbxLoadGeneration;
|
|
70
71
|
constructor();
|
|
71
72
|
setScene(scene: THREE.Scene): void;
|
|
72
73
|
setCameraLight(light: THREE.PointLight): void;
|
|
@@ -88,6 +89,8 @@ export declare class BrainRenderStore {
|
|
|
88
89
|
setBoundingBox(boundingBox: BrainBoundingBox): void;
|
|
89
90
|
setUseHighResModels(enabled: boolean): void;
|
|
90
91
|
loadSceneFBX(options: LoadSceneFBXOptions, extractedSurface?: MutableObjectRef<THREE.Object3D | null>): void;
|
|
92
|
+
/** Prevent model requests from repopulating a cleared workspace. */
|
|
93
|
+
cancelPendingFBXLoads(): void;
|
|
91
94
|
loadFBX(options: LoadFBXOptions): void;
|
|
92
95
|
setViewAngle(angle: string): void;
|
|
93
96
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type StateUpdate } from "./stateUpdate";
|
|
2
|
+
import type { InjectionPath } from "../3d/injectionPath";
|
|
3
|
+
import { type ModelConnectionFilter } from "../3d/functionLoop/modelConnectionFilter";
|
|
4
|
+
export type FunctionLoopPanelCategory = "brain_regions" | "connections" | "injection" | "ViralTracing" | "Electrophysiology" | "Optogenetics" | "MRI" | "Synapse" | "GeneExpression" | "Neurotransmitter" | "swc_tree";
|
|
2
5
|
/**
|
|
3
6
|
* The analysis payload keyed by connection method. Structurally the
|
|
4
7
|
* `functionLoopDataType` the functionLoop component declares; kept as an index
|
|
@@ -6,6 +9,16 @@ import { type StateUpdate } from "./stateUpdate";
|
|
|
6
9
|
* interfaces that only the component and its cards use.
|
|
7
10
|
*/
|
|
8
11
|
export type FunctionLoopData = Record<string, unknown[] | undefined>;
|
|
12
|
+
export interface FunctionLoopPanelFilter {
|
|
13
|
+
category: FunctionLoopPanelCategory;
|
|
14
|
+
regionIds: string[];
|
|
15
|
+
connections: Array<{
|
|
16
|
+
source_id: string;
|
|
17
|
+
target_id: string;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
/** Derive a panel view without truncating evidence or changing the shared raw data. */
|
|
21
|
+
export declare function filterFunctionLoopData(data: FunctionLoopData, filter: FunctionLoopPanelFilter): FunctionLoopData;
|
|
9
22
|
/** `loadMethodData`'s optional grouping filter. */
|
|
10
23
|
export type FunctionLoopFilterGroup = {
|
|
11
24
|
region_start_id: string;
|
|
@@ -19,8 +32,8 @@ export interface FunctionLoopController {
|
|
|
19
32
|
removeGroupData(id: string, groupName?: string): void;
|
|
20
33
|
triggerAnalysis(overrideRegions?: string[]): Promise<void>;
|
|
21
34
|
loadMethodData(id: string, filterGroup?: FunctionLoopFilterGroup | null, externalData?: unknown): Promise<void>;
|
|
22
|
-
previewGene(geneName: string, excludeRegions?: string[]): Promise<void>;
|
|
23
|
-
previewReceptor(receptorName: string, excludeRegions?: string[]): Promise<void>;
|
|
35
|
+
previewGene(geneName: string | string[], excludeRegions?: string[]): Promise<void>;
|
|
36
|
+
previewReceptor(receptorName: string | string[], excludeRegions?: string[]): Promise<void>;
|
|
24
37
|
}
|
|
25
38
|
/** Scene builders and pending-display cleanup owned by FunctionalAnalysisTab. */
|
|
26
39
|
export interface FunctionalAnalysisController {
|
|
@@ -28,8 +41,8 @@ export interface FunctionalAnalysisController {
|
|
|
28
41
|
removeGroupData(id: string, groupName?: string): void;
|
|
29
42
|
triggerAnalysis(overrideRegions?: string[]): Promise<void>;
|
|
30
43
|
loadMethodData(id: string, filterGroup?: FunctionLoopFilterGroup, externalData?: unknown): Promise<void>;
|
|
31
|
-
previewGene(geneName: string, excludeRegions?: string[]): Promise<void>;
|
|
32
|
-
previewReceptor(receptorName: string, excludeRegions?: string[]): Promise<void>;
|
|
44
|
+
previewGene(geneName: string | string[], excludeRegions?: string[]): Promise<void>;
|
|
45
|
+
previewReceptor(receptorName: string | string[], excludeRegions?: string[]): Promise<void>;
|
|
33
46
|
}
|
|
34
47
|
/** Shared analysis data and the canonical selection driving scene visibility. */
|
|
35
48
|
export declare class FunctionLoopStore {
|
|
@@ -37,8 +50,16 @@ export declare class FunctionLoopStore {
|
|
|
37
50
|
linkRegions: string[];
|
|
38
51
|
/** Heading shown above the region chips, e.g. `"PL5 → OLF"`. */
|
|
39
52
|
linkRegionsTitle: string;
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
panelCategory: FunctionLoopPanelCategory;
|
|
54
|
+
panelInjectionPath: InjectionPath | null;
|
|
55
|
+
panelConnections: Array<{
|
|
56
|
+
source_id: string;
|
|
57
|
+
target_id: string;
|
|
58
|
+
}>;
|
|
59
|
+
/** AI intent is independent of asynchronously loaded/highlighted models. */
|
|
60
|
+
private hasExplicitPanelSelection;
|
|
61
|
+
/** Full results are kept independently of the current panel filter. */
|
|
62
|
+
private rawFunctionLoopData;
|
|
42
63
|
controller: FunctionLoopController | null;
|
|
43
64
|
/**
|
|
44
65
|
* The child `FunctionalAnalysisTab`'s own controller. Registered and cleared
|
|
@@ -49,7 +70,15 @@ export declare class FunctionLoopStore {
|
|
|
49
70
|
/** Canonical `${id}_${displayName}` keys; swc_tree may use its bare type. */
|
|
50
71
|
selectedMethods: string[];
|
|
51
72
|
private loadingCount;
|
|
73
|
+
modelConnectionFilter: ModelConnectionFilter | null;
|
|
74
|
+
get hasDisplayedConnections(): boolean;
|
|
75
|
+
setModelConnectionFilter(filter: ModelConnectionFilter | null): void;
|
|
52
76
|
get isLoading(): boolean;
|
|
77
|
+
/** Use the same selection for the heading and the cards below it. */
|
|
78
|
+
get panelTitleKey(): string;
|
|
79
|
+
isPanelMethodVisible(id: string): boolean;
|
|
80
|
+
get connectionSourceData(): FunctionLoopData;
|
|
81
|
+
get functionLoopData(): FunctionLoopData;
|
|
53
82
|
get expandedViralItems(): Set<string>;
|
|
54
83
|
get expandedMRIItems(): Set<string>;
|
|
55
84
|
get expandedElectrophysiologyItems(): Set<string>;
|
|
@@ -60,6 +89,16 @@ export declare class FunctionLoopStore {
|
|
|
60
89
|
getExpandedItems(id: string): Set<string>;
|
|
61
90
|
constructor();
|
|
62
91
|
setLinkRegions(value: StateUpdate<string[]>): void;
|
|
92
|
+
setPanelCategory(category: FunctionLoopPanelCategory): void;
|
|
93
|
+
setPanelInjectionPath(path: InjectionPath | null): void;
|
|
94
|
+
setPanelConnections(pairs: Array<{
|
|
95
|
+
source_id: string;
|
|
96
|
+
target_id: string;
|
|
97
|
+
}>): void;
|
|
98
|
+
/** Explicit user tree edits take ownership back from an AI query. */
|
|
99
|
+
syncRegionsFromTree(regions: string[]): void;
|
|
100
|
+
/** Model-load completion must not replace a query's canonical region list. */
|
|
101
|
+
syncRegionsFromModels(regions: string[]): boolean;
|
|
63
102
|
setLinkRegionsTitle(value: StateUpdate<string>): void;
|
|
64
103
|
setFunctionLoopData(value: StateUpdate<FunctionLoopData>): void;
|
|
65
104
|
setController(controller: FunctionLoopController | null): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FunctionLoopData } from '../store/functionLoopStore';
|
|
2
|
+
/** Region/name lists are sets for these endpoints. Preserve identifier case. */
|
|
3
|
+
export declare const normalizeRegionIds: (values: string[]) => string[];
|
|
4
|
+
export declare const getStableRegionIdsKey: (regionIds: string[]) => string;
|
|
5
|
+
export interface BrainRegionRadarItem {
|
|
6
|
+
input_name: string;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export declare function fetchFunctionalCircuitData(regionIds: string[], signal?: AbortSignal): Promise<FunctionLoopData>;
|
|
10
|
+
export declare function getCachedFunctionalCircuitData(regionIds: string[]): FunctionLoopData | undefined;
|
|
11
|
+
/** Already supplied AI results can also serve charts and subsequent panel selections. */
|
|
12
|
+
export declare function cacheFunctionalCircuitData(regionIds: string[], data: FunctionLoopData): void;
|
|
13
|
+
export declare function fetchExpressionData(category: 'GeneExpression' | 'Neurotransmitter', names: string[], excludeRegions: string[], signal?: AbortSignal): Promise<unknown[]>;
|
|
14
|
+
export declare function fetchBrainRegionRadarData(regionIds: string[], signal?: AbortSignal): Promise<BrainRegionRadarItem[]>;
|