简体   繁体   English

如何从 CMOVE 正确存储 dicom 的像素数据?

[英]How can i CSTORE pixel data of dicom from CMOVE properly?

I have 1 running server for handle C-Move, 2 running server for handle C-Store and remote pacs server(GEPACS)我有 1 个用于处理 C-Move 的运行服务器,2 个用于处理 C-Store 和远程 pacs 服务器(GEPACS)的运行服务器

When i tried to C-Move command from remote pacs to C-Store handler, 1 server(py-netdicom) is build and save the file properly and 1 server(go-netdicom) is not.当我尝试从远程 pacs 向 C-Store 处理程序执行 C-Move 命令时,构建了 1 个服务器(py-netdicom)并正确保存文件,而 1 个服务器(go-netdicom)没有。

So there was couple of problems in go-netdicom.所以在 go-netdicom 中有几个问题。 I fixed the code can handle hexadecimals.我修复了可以处理十六进制的代码。 It originally not supported on go-netdicom. go-netdicom 最初不支持它。 This was fix almost every problems in my case but still cannot store pixel data properly.这几乎解决了我的所有问题,但仍然无法正确存储像素数据。

For example, I got 9117252 bytes from original signal from remote pacs and I saved the data itself, but actually it needs to be 18000000 bytes(got an error).例如,我从远程 pacs 的原始信号中获得了 9117252 个字节,并且我自己保存了数据,但实际上它需要 18000000 个字节(有错误)。 even CT images are short for 3 times(got approximately 180000, but need 524288)连 CT 图像都短了 3 次(得到了大约 180000,但需要 524288)

I think the problem caused by might be the encapsulation of pixel-data but not sure.我认为引起的问题可能是像素数据的封装,但不确定。

Is there any tip or some help?有什么提示或帮助吗?

Thank you.谢谢你。

EDIT 4 : I've got a clue.编辑 4 :我有一个线索。 link here 链接在这里

Somehow C-STORE command have a kind of transfer syntax.不知何故,C-STORE 命令有一种传输语法。 This offer to scp type(compressed or not) of data scu get.此提供 scp 类型(压缩或未压缩)的数据 scu 获取。 But still I don't have a idea which part of go-netdicom has to be changed.但是我仍然不知道必须更改 go-netdicom 的哪一部分。 I'll delete "python" tag because this is not related with python anymore.我将删除“python”标签,因为这不再与 python 相关。

I found the solution.我找到了解决方案。

Somehow, GEPACS send the certain transfer syntax for JPEG compression.不知何故,GEPACS 为 JPEG 压缩发送特定的传输语法。 if go-netdicom doesn't have the TransferSyntaxUID then pick the GEPACS's first transfer syntax and that was for JPEG compression.如果 go-netdicom 没有 TransferSyntaxUID,则选择 GEPACS 的第一个传输语法,即用于 JPEG 压缩。

i just put bigendian and explicitvr (GEPACS default) when transfersyntax is empty.当传输语法为空时,我只放置了 bigendian 和 explicitvr(GEPACS 默认值)。

which placed in contextmanager.go line 101 on AssociateRequest, line 127放在 contextmanager.go 第 101 行的 AssociateRequest 中,第 127 行

Hope this result help someone.希望这个结果对某人有所帮助。

Thank you谢谢

The problem here is that go-netdicom uses the first PresentationContext sent in the A_ASSOCIATE_RQ (As you can see in the last image).这里的问题是 go-netdicom 使用了 A_ASSOCIATE_RQ 中发送的第一个 PresentationContext(正如您在最后一张图片中看到的)。 So it accepts "2.16.840.1.113709.1.2.2" which is a privative Transfer Syntax and it is not in the DICOM standart, so no one can manage the C-STORE at the end.所以它接受“2.16.840.1.113709.1.2.2”,这是一种私有传输语法,它不在DICOM标准中,所以最后没有人可以管理C-STORE。

If you are reading this.. maybe you do not use go-netdicom but the problem could be the same if the error involves the transfer Syntax "2.16.840.1.113709.1.2.2", in the Centricity PACs documentation says: "It is expected that other vendors' applications will ignore all Presentation Context proposed with the GE Private Compress Express Transfer Syntax"如果您正在阅读本文...也许您不使用 go-netdicom 但如果错误涉及传输语法“2.16.840.1.113709.1.2.2”,则问题可能相同,Centricity PAC 文档中说:“这是预期的其他供应商的应用程序将忽略使用 GE Private Compress Express Transfer Syntax 提出的所有 Presentation Context”

在此处输入图片说明

And that is what we are suppose to do.这就是我们应该做的。 I see a list of PRs in go-netdicom so I suppose it is not mantained, so I will post the change for go-netdicom here.我在 go-netdicom 中看到了一个 PR 列表,所以我想它没有被维护,所以我将在这里发布 go-netdicom 的更改。 I made this changes in contextmanager.go and works like a charm:我在 contextmanager.go 中进行了此更改,并且效果很好:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM