执行病理切片分析的六步流程。每一步都会打印一行机器可读的状态信息。
每一步必须打印一行以下格式的状态信息:
STEP_STATUS|step=
> 首次使用需要提供用户名和密码,通过环境变量传入:
> ```bash
> $env:PATHOLOGY_USERNAME = "你的用户名"
> $env:PATHOLOGY_PASSWORD = "你的密码"
> python scripts/step1_login_auth.py
> ```
>
>(环境变量已设置时自动跳过,无需重复输入)
python scripts/step2_get_cos_credentials.py [--credentials-url <url>] [--token-file <token_json_path>] [--output-file <credentials_json_path>]
python scripts/step3_upload_wsi_to_cos.py [--credentials-file <cos_credentials_json>] [--local-file <wsi_file>] [--organization <org_name>] [--date <YYYYMMDD>]
COS 路径格式(严格):
SLIDES/chunked_uploads/{YYYYMMDD}/{机构名称}/{文件 MD5}/{文件名}{扩展名}
python scripts/step4_create_wsi_file_record.py [--callback-url <url>] [--token-file <token_store_json>] [--upload-result-file <cos_upload_result_json>] [--disease <id>]
回调 path 格式(严格,默认行为):
chunked_uploads/{YYYYMMDD}/{机构名称}/{文件 MD5}/{文件名}{扩展名}
注意:
SLIDES/ 前缀SLIDES/ 前缀的 pathpython scripts/step5_create_wsi_record.py [--create-url <url>] [--token-file <token_store_json>] [--upload-result-file <cos_upload_result_json>] [--disease <id>] [--source <org_id>] [--is-run]
可选参数:
--create-url(默认:http://10.5.16.108/api/v1/image/create/)--token-file(默认:scripts/data/token_store.json)--upload-result-file(默认:scripts/data/cos_upload_result.json)--disease(必填)6:通用组织切片14:消化道活检AI--source(默认:3696)--is-run(默认 true)--no-is-run(可选,显式设为 false)--output-file(默认:scripts/data/wsi_record_result.json)第五步请求体字段:
filename:来自第三步上传的文件名total_md5:来自第三步的 file_md5disease:传入的疾病类型source:来源机构 IDis_run:是否立即运行python scripts/step6_get_ai_diagnosis_result.py [--list-url <url>] [--token-file <token_store_json>] [--wsi-record-file <wsi_record_result_json>] [--slide-id <id>] [--wait-seconds <seconds>] [--no-wait]
默认行为:
slide_id 来自第五步输出的 response.idGET http://10.5.16.108/api/v1/embed/image/list/?id=modified_ai_diagnosis_result_map.valueai_diagnosis_status 状态码说明:
0:未知1:排队中2:队列中3:分析中4:分析成功5:分析失败PATHOLOGY_USERNAME 和 PATHOLOGY_PASSWORD;如未设置,脚本报错退出并提示需要设置这两个环境变量。6 — 通用组织切片14 — 消化道活检AIscripts/data/token_store.json 已包含有效(未过期)的 token,第一步打印 skippedscripts/data/cos_credentials.json 存在且 expired_time 未过期,第二步打印 skippedai_diagnosis_status 不为 4 时,提醒用户 1 分钟后再试401,重新运行第一步刷新 token共 1 个版本