本文介绍了Android开发:如何打开一个.dcm文件作为位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在做一个Android应用程序的DICOM继code打开图片DROM RES /绘制的ussual图像格式,但它不与.dcm工作

I'm currently trying to make an android dicom appFollowing code opens pictures drom res/drawable in "ussual" image formats, but it doesn't work with .dcm

public class BitmapView extends View
{
    public BitmapView(Context context) {
            super(context);
    }
    @Override
    public void onDraw(Canvas canvas) {
    Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.test);
        canvas.drawColor(Color.BLACK);
        canvas.drawBitmap(bmp, 10, 10, null);
    }
}

在主要活动:

in the main activity:

protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(new BitmapView(this));     
    }

在此先感谢!

thanks in advance!

推荐答案

DICOM是一种普通的容器。里面DICOM文件,你可以找到一个巨大的各种图像格式。从为RGB灰度的,由单一帧多帧的,用像素值的范围不是在普通8位(RGB / RGBA 24/32),而且在12位或16位灰度。

Dicom is a kind of generic container. Inside a Dicom file you can find a huge variety of image formats. From grayscale ones to RGB, from single frame to multiframe ones, with pixel value ranges not in the ordinary 8 bit (24/32 in RGB/RGBA) but also in 12 or 16 bit grayscales.

的DICOM文件包括许多元件(字段)指示的内容的类型和这些内容甚至如何应。它不是那么简单了DICOM图像转换为BMP。

Dicom files include many elements (fields) indicating the type of the contents and even how such contents should be presented. It is not as simple as converting the Dicom image to BMP.

如果您是从PACS检索DICOM图像,我会建议使用 WADO 服务。这样,您就可以得到JPEG图像(已应用了presentation状态到DICOM文件的内容的结果)。

If you are retrieving Dicom images from a PACS, I would suggest using WADO service. This way, you can obtain Jpeg images (the results of having applied a presentation state to the contents of the Dicom file).

另一种选择是使用一些实用程序将DICOM文件转换为更传统的图像格式。也有一些优秀的开源工具,如 dcmj2pnm ,从的工具。

The other option is to use some utility to convert the Dicom file to a more conventional image format. There are some excellent open source tools, such as dcmj2pnm, from the DCMTK toolkit.

这篇关于Android开发:如何打开一个.dcm文件作为位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 00:48