实验室版 API
实验室版提供ECGFounder、文本生成单导联、单导联生成十二导联、三导联生成十二导联、PPG信号生成单导联以及单导联生成心脏超声的核心能力。
注意事项
🔬 欢迎使用实验室 API!
目前所有接口均处于公测阶段,功能可能会不定期调整。
为确保正常访问和数据安全,请进入 科研合作页面 联系工作人员获取专属访问密钥。
💡 温馨提示:请妥善保管您的密钥,避免泄露或滥用。
适用场景
- 医学研究
- 心电模型验证
MCMA接口
POST /api/v1/experimental/mcma
通过输入单导联信号可以生成十二导联信号。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ecgData | array | ✅ | ECG信号数据数组(ADC值) |
| ecgSamplerate | number | ✅ | 采样率,单位Hz(推荐250-500) |
| original | boolean | ❌ | 是否输出原始波形,默认true |
请求示例
curl -X POST "https://api.heartvoice.com.cn/api/v1/experimental/mcma" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ecgData": [512, 515, 520, 518, 525, ...],
"ecgSampleRate": 500
}'
响应示例
{
"errorCode": "0",
"msg": "成功",
"data": [
[
-0.0005600000149570405,
0.05680999904870987,
-0.002580000087618828,
0.02824000082910061,
...
]
]
}
可视化展示
import ecg_plot
ecg_plot.plot(gen_ecg12, sample_rate=fs, title='ECG 12')
ecg_plot.show()

文献
@article{chen2024multi,
title={Multi-channel masked autoencoder and comprehensive evaluations for reconstructing 12-lead ECG from arbitrary single-lead ECG},
author={Chen, Jiarong and Wu, Wanqing and Liu, Tong and Hong, Shenda},
journal={npj Cardiovascular Health},
volume={1},
number={1},
pages={34},
year={2024},
publisher={Nature Publishing Group UK London}
}
Chen, J., Wu, W., Liu, T., & Hong, S. (2024). Multi-channel masked autoencoder and comprehensive evaluations for reconstructing 12-lead ECG from arbitrary single-lead ECG. npj Cardiovascular Health, 1(1), 34.
DiffuSETS接口
POST /api/v1/experimental/diffuSets
通过输入心电图诊断结果、年龄、性别以及心率即可生成对应的心电图。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| text | str | ✅ | 临床诊断文本,多个诊断需要用'|'分隔开 |
| age | int | ✅ | 年龄 |
| sex | str | ✅ | 性别 |
| hr | int | ✅ | 心率 |
| batch | int | ❌ | 选择生成ECG的数量 |
请求示例
curl -X POST "https://api.heartvoice.com.cn/api/v1/experimental/diffuSets" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": 'Sinus rhythm|Normal ECG.', # Clinical text report, multi-reports should be split by '|'
"age": 50, # Age of patient
"sex": 'M',
"hr": 80,
'batch': 1
}'
响应示例
{
"errorCode": "0",
"msg": "成功",
"data": {
"textImg": "[\"iVBORw0KGgoAAAANSUhI=...\"]"
}
}