简体   繁体   English

Android尚不支持DICOM JPEG压缩

[英]DICOM JPEG compression not yet supported in Android

DicomDroid.jar used to open a .dcm formated image in my Android application. DicomDroid.jar曾经在我的Android应用程序中打开.dcm格式的图像。 I got the follwing exception when try to open it. 尝试打开它时出现以下异常。

java.io.IOException: DICOM JPEG compression not yet supported

Adding my code below 在下面添加我的代码

try {



    // Read the imagefile into a byte array (data[])
                File imagefile = new File(path);
                byte[] data = new byte[(int) imagefile.length()];
                FileInputStream fis = new FileInputStream(imagefile);
                fis.read(data);
                fis.close();

                // Create a DicomReader with the given data array (data[])
                DicomReader DR = new DicomReader(data);

} catch (Exception ex) {

Log.e("ERROR", ex.toString());

}

What can be done to avoid this error? 如何避免该错误?

Thanks in advance. 提前致谢。

The cause is pretty obvious. 原因很明显。 That DICOM library doesn't support that particular kind of DICOM file. 该DICOM库不支持该特定种类的DICOM文件。

There's not much you can do about it ... unless you are prepared to enhance the library yourself. 您对此无能为力...除非您准备自己增强图书馆。


But I think you have probably made a mistake in setting up your instrument to generate DICOM files with JPEG compression. 但是我认为您可能在设置仪器以使用JPEG压缩生成DICOM文件时犯了一个错误。 JPEG is lossy, and best practice is to capture and store images with the best resolution feasible. JPEG有损,最佳实践是以可行的最佳分辨率捕获和存储图像。 If you need to downgrade resolution to reduce bandwidth, it would be better to 如果您需要降低分辨率以减少带宽,则最好

  1. save a high resolution DICOM, 保存高分辨率DICOM,
  2. convert the DICOM to a low resolution JPG, and 将DICOM转换为低分辨率JPG,并
  3. send the JPEG. 发送JPEG。

Another option is to get the Dicom file in an uncompressed format (ej: Explicit VR Little Endian). 另一个选择是获取未压缩格式的Dicom文件(例如,Explicit VR Little Endian)。 This is the simplest dicom file format and every dicom library has support for such format. 这是最简单的dicom文件格式,每个dicom库都支持这种格式。

So, when you get your Dicom file from your PACS, force this transfer syntax. 因此,当您从PACS获取Dicom文件时,请强制使用此传输语法。 This way, your dicom library will be able to deal with the image file. 这样,您的dicom库将能够处理图像文件。

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

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