Saving DICOM images using Imebra library

379 views Asked by At

In my Android project I am currently using Imebra library to extract image frames from a dicom file and save them as Bitmaps. After that I use ffmpeg to create a video from these frames. Every thing is working well so far, but my only concern is whether I will loose any quality or information by using following methods from Imebra library:

Image image = imageIterator.next();
TransformsChain chain = transform(image);
Bitmap bitmap = getBitmap(image, chain);

Furthermore, if I am using any information by saving my image frames as bitmaps, can I save them as the raw format (by raw I mean imebra.Image, I am not sure if that's the same as .raw format?) and use them directly with ffmpeg?

1

There are 1 answers

0
Paolo Brandoli On BEST ANSWER

The image you get with DrawBitmap::getBitmap is always an RGB 24 bit per pixel one: you will lose information in the case that the image uses more than 8 bit per color channel (e.g. a 16 bit grayscale image will lose the lower 8 bit of the pixel information).

You could get an higher bit per pixel number by avoiding using DrawBitmap::getBitmap and by applying directly the transforms yourself (VOI/LUT, color transformation, high bit transform). After you have an Image with the desired color space and bit per pixel, than use the Image::GetReadingDataHandler to access the image underlying memory and generate the bitmap for ffmpeg.

Disclosure: I'm the author of Imebra.