使用DicomDroid lib

时间:2013-03-10 16:36:15

标签: android bitmap byte dicom

我试图在我的Android应用程序中使用DicomDroid lib(http://code.google.com/p/dicom-droid/)。 在开发过程中,我发现了一些不允许我继续进行的事情:

1)这个lib根本没有文档。只有jar文件。我在eclipse和示例(http://dicom-droid.googlecode.com/svn/trunk/)中使用我的提示来阅读DICOM图像。我可以在哪里获得文档?

2)有两种方法可以从lib中的DICOM获取图片:

a)获取Bitmap类对象

b)获取字节数组

我尝试了a),不幸的是这种方式绘制了错误的16位图像。如何更改Bitmap对象或重新编码以绘制16位正确?

我试图获取字节并处理它们,但是当我将它们编码为位图时 - 生成的位图为空(无法编码)

String balloc = info[10];
String w = info[8];
String h = info [9];

int b_alloc = new Integer(balloc);
int W = new Integer(w);
int H = new Integer(h);

/*int bts_lc = Integer.parseInt(info[10]);
int wt = Integer.parseInt(info[9]);
int ht = Integer.parseIn t(info[8]);*/
byte[] array = new byte[(b_alloc/8) * W * H];
array = DR.getPixels();

new AlertDialog.Builder(context)
    .setTitle("identity's done")
.setMessage("")
.setNeutralButton("Ok",
    new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
    }
        }).show();

Bitmap bmpe = BitmapFactory.decodeByteArray(array, 0, array.length);
if(bmpe == null)
{
    new AlertDialog.Builder(context)
    .setTitle("DICOM Header Information")
    .setMessage("dfsdfdgfdgfdgdfgdfg")
    .setNeutralButton("Ok",
        new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            }
            }).show();
}

我无法找到我做错的事情,以及如何从lib中解码获取的数组。

另一个问题是从String转换为int。我在设备上调试了代码,并在转换过程中停止执行。

0 个答案:

没有答案
相关问题