[英]Change dicom Transfer Syntax showing no registered codec using mDCM
I am having issue while changing the Transfer Syntax. 更改传输语法时出现问题。
I am using mDCM
library and I have added the Dicom.Codec.dll to the project as well. 我正在使用
mDCM
库,并且已将Dicom.Codec.dll也添加到了项目中。
The compressed files are having 0002,0010,Transfer Syntax UID=1.2.840.10008.1.2.4.90
(JPEG 2000 Image Compression (Lossless Only)). 压缩文件具有
0002,0010,Transfer Syntax UID=1.2.840.10008.1.2.4.90
(JPEG 2000图像压缩(仅无损))。
Error: DicomCodecException was caught. 错误:DicomCodecException被捕获。 No registered codec for transfer syntax!
没有注册用于传输语法的编解码器!
My code: 我的代码:
string file = "C:\\Dicom\\1001.dcm";
string output = "C:\\Dicom\\Decompressed\\1001.dcm";
DicomFileFormat ff = new DicomFileFormat();
ff.Load(file, Dicom.DicomReadOptions.Default);
ff.ChangeTransferSytnax(DicomTransferSyntax.ExplicitVRLittleEndian, null); // Error here. No registered codec for transfer syntax!.
Dicom.Imaging.DicomImage im = new Dicom.Imaging.DicomImage(ff.Dataset);
System.Drawing.Image i = im.Render();
i.Save(output);
Another thing that I noted is that the tag 7FE0,0010,Pixel Data=0
. 我注意到的另一件事是标记
7FE0,0010,Pixel Data=0
。 For other dicom files, Pixel data
tag is having values greater than 0
. 对于其他dicom文件,
Pixel data
标签的值大于0
。
The file is not opening in my other dicom viewers (ezDICOM, DicomWorks, IrfanView etc.) as well. 我的其他dicom查看器(ezDICOM,DicomWorks,IrfanView等)也没有打开该文件。 So, I thought the file is corrupted.
因此,我认为该文件已损坏。 But, then the client gave us an
application(.exe)
which decompresses the file. 但是,然后客户端给了我们一个解压缩文件的
application(.exe)
。
After decompression, all my viewers was showing the image properly. 减压后,所有观众都正确显示了图像。
Decompressed files was having 7FE0,0010,Pixel Data=131072
. 解压缩的文件具有
7FE0,0010,Pixel Data=131072
。
As the error mentioned, I was not registering the codec. 正如错误所提到的,我没有注册编解码器。
This line registered the codec. 此行注册了编解码器。
Dicom.Codec.Jpeg2000.DcmJpeg2000Codec.Register();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.