V 友们,有没有医疗行业的,懂 DICOM 的?

222 天前
 ChenSino

我司有个需求是这样的: 要求实现解析 dicom(多帧)文件,把他转化成多个图片,然后把每个图片拿去调用 ai 组的一个接口(标出病灶,结节,返回坐标集合),拿到每个图片的坐标后,根据坐标绘制图片把病灶圈起来得到新的图片,然后再用新的图片替换原 dicom 中的图片,实现播放 dicom 时,能看到每帧上圈出来的病灶。

图片根据坐标绘制很好实现,绘制完后如何再把他写入原 dicom 文件呢?我用的 java 的 dcm4che 库,文档几乎可以说是没有,代码注释也是少得可怜,有经验的的大佬能否指点一下如何做,或者哪里可以获取到 dcm4che 的更详细资料?

ps: 不要问我为什么 ai 不支持直接在多帧 dicom 上标注,俺也不敢说也不敢问

2693 次点击
所在节点    程序员
34 条回复
coolwulf
222 天前
You shouldn't convert dicom to images directly since RGB image is losing a lot of details in the dicom. Should just put the data in a Ndarray, then get a single slice if you need to call a 2D model. However you should be using a 3D model for this kind of application.
worldqiuzhi
222 天前
dcm4che 本来就支持呀 先把原始 dcm 头信息保存到 xml 里 再把处理完的图片转 dcm 并把头信息写回不就可以了吗
coolwulf
222 天前
@kaiz We are hiring. I see you are a post-doc in case you are looking for a job. Contact me.
tiwizz
222 天前
@ChenSino gdcm 可能还需要注意一下 GetPhotometricInterpretation(),即数据格式是不是"YBR_FULL",需要转 rgb 这类的。
ChenSino
222 天前
@worldqiuzhi 老哥指点一下,就是找不到他的使用文档
worldqiuzhi
222 天前
@ChenSino dcm2xml: Convert DICOM file in XML presentation Convert <dicom-file> (or the standard input if <dicom-file> = '-') in XML
presentation and optionally apply XSLT stylesheet on it. Writes result to
standard output.
usage: jpg2dcm
Encapsulate JPEG, JPEG 2000 Part 1, JPEG 2000 Part 15 (HTJ2K) image or
MPEG2, MP4 or Quicktime video file(s) (or present in directories) into
DICOM file(s) (or into DICOM directory). DICOM attributes can be specified
via command line (using -m option) or a XML file (using -f option). If
both the options are specified, system will generate metadata first from
sample metadata file then from file specified by user, then add the
attributes specified individually on command line and lastly read the
header from the file to get specific information in accordance with the
content type of the file. The Type 1 and Type 2 attributes, if missing
will be generated by the system.
putaozhenhaochi
222 天前
dicom 协议挺麻烦的。 肯定是在前端标注。
NeroKamin
222 天前
@kaiz 大佬!
CodingNew
222 天前
“解析 dicom(多帧)文件,把他转化成多个图片” 用 python 哈,java 搞这个不给力。
574402766
222 天前
我们是读进来以后转成二维数组把轮廓像素点 hu 值改掉再存成 dicom 送去归档...
ChenSino
221 天前
@CodingNew 这一步很好实现,java 读取 dicom 获取多帧很好做,但是编辑写入数据、图片到 dicom 好像不太好操作,关键是没有文档不知道怎么下手。
ChenSino
221 天前
@574402766 我们也是 ai 处理后返回像素的坐标点集合,要把它描迹--
tiwizz
221 天前
@ChenSino 模型结果最好不要放回 dicom 里面,这个是前端工作干的事情啊。react jsx 例如这样: <div id="content" style={{ width: '800px', height: '600px', }} ref={imgRef}>
<img
id="image-content"
src={`data:image/png;base64,${imgbase64}`}
/>
<canvas ref={canvasDrawRef} width="800px" height="600px" />
</div>
在 canvas 层里面描绘你的结果,img 仍然是你解析的 dicom 图像。只要注意 canvas img 大小变化同步。
tiwizz
221 天前
@ChenSino 额,或者直接就 canvas 上同时绘制图像和你的模型结果。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/994024

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX