2014-06-05 7 views
2

android에 DICOM 이미지를 표시하고 싶습니다. DICOM 이미지를 안드로이드에서 JPEG로 변환 할 수있는 방법이 있습니까?android에 DICOM 이미지 표시

현재 DICOM에서 비트 맵으로의 기본 변환은 null을 반환합니다. 어떤 생각을 계속할 것인가?

+0

DICOM 이미지가 무엇입니까? –

+0

이 링크 확인 http://stackoverflow.com/questions/5739349/how-to-access-dicom-file-on-android-os http://stackoverflow.com/questions/20094508/converting-dicom-image-to -jpeg-image – Randroid

+0

답장을 보내 주셔서 감사합니다. 위의 링크를 이미 확인했는데 BufferedImage 및 ImageIo 클래스는 Java 전용이며 Android에서 지원되지 않습니다. – Kalyani

답변

1

Imebra 안드로이드 자바 바인딩을 제공하고 문서를 표시 할 준비가 이미지를 추출하는 방법을 보여줍니다

// 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);