android - 在 Android 上显示 DICOM 图像

标签 android dicom

我想在 Android 上显示 DICOM 图像。有没有办法在 Android 上将 DICOM 图像转换为 JPEG?

当前 DICOM 到位图的默认转换返回 null。知道如何继续吗?

最佳答案

Imebra为 android 提供 Java 绑定(bind),文档显示如何提取准备显示的图像:

   // Allocate a transforms chain: contains all the transforms to execute before displaying
    //  an image. Can be empty
    TransformsChain transformsChain = new TransformsChain();

    // Let's use a DrawBitmap object to generate a buffer with the pixel data. We will
    // use that buffer to create an Android Bitmap
    com.imebra.dicom.DrawBitmap drawBitmap = new com.imebra.dicom.DrawBitmap(image, transformsChain);

    int temporaryBuffer[] = new int[1]; // Temporary buffer. Just used to get the needed buffer size
    int bufferSize = drawBitmap.getBitmap(image.getSizeX(), image.getSizeY(), 0, 0, image.getSizeX(), image.getSizeY(), temporaryBuffer, 0);
    int buffer[] = new int[bufferSize]; // Ideally you want to reuse this in subsequent calls to getBitmap()

    // Now fill the buffer with the image data and create a bitmap from it
    drawBitmap.getBitmap(image.getSizeX(), image.getSizeY(), 0, 0, image.getSizeX(), image.getSizeY(), buffer, bufferSize);

    Bitmap renderBitmap = Bitmap.createBitmap(buffer, image.getSizeX(), image.getSizeY(), Bitmap.Config.ARGB_8888);
    imageView.setImageBitmap(renderBitmap);

关于android - 在 Android 上显示 DICOM 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24056033/

相关文章:

Android 动画嵌套 fragment

dicom - DICOM 中 bool 值的最佳值表示是什么?

matlab - 在Matlab上用于3D数据的椭圆拟合

android - 在 Android 中查找速度和带宽

android - 如何链接键盘上的按钮以启动新屏幕?

java - 如何用 Java 读取 DICOM 文件的内容?

iphone - 使用iPhone的ImageMagick读取Dicom图像

python - 如何使用 gdcm 和 Python 解压压缩的 DICOM 图像?

android - 如何关闭抽屉导航以使用“返回主页”图标按钮?

android - JSON 和安卓