简体   繁体   English

DICOM中的JPEG无损

[英]JPEG Lossless in DICOM

In the DICOM spec one of the Transfer Syntaxes is 1.2.840.10008.1.2.4.70 defined as JPEG Lossless, Nonhierarchical, First- Order Prediction (Processes 14 [Selection Value 1]) . DICOM规范中,传输语法之一是1.2.840.10008.1.2.4.70定义为JPEG Lossless, Nonhierarchical, First- Order Prediction (Processes 14 [Selection Value 1])

What does "JPEG Lossless, Nonhierarchical, First- Order Prediction (Processes 14 [Selection Value 1])" mean? “JPEG无损,非等级,一阶预测(过程14 [选择值1])”是什么意思? Is this format the same as JPEG-LS? 这种格式与JPEG-LS相同吗? This page seems to indicate that there is some difference (JPEG-LS is listed in the bottom section). 此页面似乎表明存在一些差异(底部列出了JPEG-LS)。

Is is possible to read or write this format in Python? 是否可以在Python中读取或写入此格式? Looking over the docs for Pillow is no clear to me that the format is supported. 查看Pillow的文档对我来说并不清楚格式是否受支持。

This post is somewhat relevant . 这篇文章有点相关

JPEG Lossless First Order JPEG无损一阶

Identical to the main JPEG lossless, but with a constrained value for the
predictor, giving a slightly simplified algorithm, with slightly greater
speed, but slightly less compression on most images (2-5% typically)
(from medicalconnections wiki)

You may have a look at GDCM for encoding jpeg compressed dicom images. 您可以查看GDCM以编码jpeg压缩的dicom图像。 GDCM Wiki Link GDCM Wiki链接

JPEG Lossless and JPEG-LS are very different implementation for image compression. JPEG Lossless和JPEG-LS是用于图像压缩的非常不同的实现。 JPEG lossless is defined in standard document: ITU-T T.81, ISO/IEC IS 10918-1, while JPEG-LS is defined in ITU-T T.87, ISO/IEC IS 14495-1. JPEG无损在标准文件中定义:ITU-T T.81,ISO / IEC IS 10918-1,而JPEG-LS在ITU-T T.87,ISO / IEC IS 14495-1中定义。

JPEG-LS is a very different approach from all other JPEG-* compression family, since in its lossy form it is setup with a maximum bias from the original pixel. JPEG-LS是一种与所有其他JPEG- *压缩系列完全不同的方法,因为在其有损形式下,它设置为具有来自原始像素的最大偏差。 So you can generate a lossy JPEG-LS from an input file, where at maximum the difference in between the generated pixel and the original one, the difference is -say- 2. 因此,您可以从输入文件生成有损JPEG-LS,其中生成的像素与原始像素之间的差异最大,差值为-say-2。

Most toolkit on UNIX wont support JPEG Lossless originally because of some patent issue with the arithmetic codec: UNIX上的大多数工具包最初都不支持JPEG Lossless,因为算术编解码器存在一些专利问题:

Therefore IJG (aka libjpeg) is a very limited implementation of ITU T.81 and only provides by default on UNIX distribution the lossy 8bits compression form of the standard (sequential & progressive but not hierarchical ). 因此,IJG(又名libjpeg)是ITU T.81的非常有限的实现,并且仅在UNIX分发上提供标准的有损8比特压缩形式(顺序和渐进但不分层 )。 Neither the lossy 12bits, nor the lossless 16bits is available. 无论是有损12位还是无损16位都没有。 Technically the 12bits lossy should be possible, but since it requires a recompilation most distributions to not ship this library. 从技术上讲,12bits有损应该是可能的,但是因为它需要重新编译大多数发行版才能发送这个库。

All of the above is also correct when using the new libjpeg-turbo implementation, since libjpeg-turbo is only an optimized (binary compatible) version of the original libjpeg (version 6b to be precise). 所有上述内容在使用新的libjpeg-turbo实现时也是正确的,因为libjpeg-turbo只是原始libjpeg的优化(二进制兼容)版本(准确地说是版本6b)。

DICOM提供支持JPEG-LS图像压缩和DICOM标准的机制PS 3.5附录A定义了两种不同的传输语法,它们引用了JPEG-LS标准(ISO / IS-14495-1(JPEG-LS第1部分)。 “1.2.840.10008.1.2.4.80”的UID是无损的(保持位),UID为“1.2.840.10008.1.2.4.81”的传输语法是有损(近无损)压缩方案。

I had a similar problem and I solved using @JohnnyQ hints in this way: 我有类似的问题,我用这种方式解决了使用@JohnnyQ的提示:

conda install -n myenv -c clinicalgraphics gdcm
conda install -n myenv -c anaconda pillow

Also you can use pip install ... to install gdcm and pillow . 你也可以使用pip install ...来安装gdcm枕头 Take a look at https://pydicom.github.io/pydicom/stable/image_data_handlers.html 看看https://pydicom.github.io/pydicom/stable/image_data_handlers.html

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

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