Re: [Gdcm2] Buffer problem in Qt environment
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mathieu M. <mat...@gm...> - 2009-06-16 10:02:59
|
On Tue, Jun 16, 2009 at 10:45 AM, Sylvain ADAM<syl...@ho...> wrote:
> Salut Mathieu.
>
> Thanks for the answers !!
>
> Yeah I finally got almost what I wanted by displaying my image in a QImage.
> But as I said earlier, well, I'm still using the RGB16 format of the QImage
> class.
>
> The RGB888 format doesn't work. I actually looked over the API (maybe not
> deep enough), both from GDCM and Qt, and I still don't have any clue on how
> to display my image correctly in Qt and how to access 16bits pixel
> information at coordinate (x, y) on the original image!
>
> For now, I can just get the grayscale value on my QImage (which is actually
> blue-green because of the format used) by calculating it using the RGB
> value. So I get a gray value from 0 to 140, which is not the usual gray
> value for a DICOM image in here. We usually have something from 0 to 2000
> ~ich.
>
> I tried the getPhotometricInterpretation() function, to see what does this
> return: MONOCHROME2. And that's it. The getSamplesPerPixel returns 1. I'm
> afraid my image knowledge is a bit limited!
>
> As the QImage is my display image, getting information from it is not what I
> intend to do ('cause for display reasons, we don't really need 16-bits, do
> we?).
>
>
> Another thing for now, does anyone have had this error before? This happens
> when I'm using the buffer. This is just displayed by my application output
> in debugging mode:
>
>
> HEAP[IntensityProfileGUI.exe]:
>
> Invalid Address specified to RtlFreeHeap( 05080000, 04DAA558 )
>
> The message is displayed twice in my debugger. Well, even if I'm using two
> or one buffer, and when I comment the buffer line, it does not appear
> anymore.
>
> Thanks for helping me.
MONOCHROME2 and getSamplesPerPixel really means you only have one
component (=grayscale) per pixel, do not try to tell Qt there are 3
using the RGB16 format. Depending on the value from GetPixelFormat()
you may need a 16 bits QtImage or 8bits QtImage (or even 32bits).
Check you example such as ConvertPIL.py / ConvertNumpy.py /
ConvertMPL.py, to see how gdcm can be used to pass the raw byte buffer
to 3rd party library.
HTH
--
Mathieu
|