PDA

View Full Version : Display my data array as an image



OzQTNoob
4th December 2012, 04:16
Hi all,

I will try an explain what I am after so that it is clear.

I have an array of floats that I have read from my binary data file and they are stored in the following manner array[x][y][z] which is a multidimensional QVector.

z in this case represents a spectral band so the entire array is a number of [x][y] images for each band [z]

My question is how do I display one of these image planes? e.g. array[x][y][0] for example

Cheers
Oz

amleto
4th December 2012, 07:05
Make a pixmap with dimensions x,y.

Define a sensible colormap.

Transform your array values into color and save in correct pixmap pixel.

See qcolormap and qpixmap

Edit: looks like qcolormap isn't quite what I thougt, so you might have to make your own map for that step.

OzQTNoob
4th December 2012, 07:07
Thanks for that I will give it a go and see how I go.

Cheers
Oz

turns out Im still to much of a noob to figure it out. Read many web articles, still confused. A simple example might help me

myta212
4th December 2012, 07:58
Hi,
I look this website create a simple demo like your problem.
You need to create a colormap and convert your data to colormap. Please check at this site.

http://toto-share.com/2012/12/qt-imagesc-simple-code/

Best regards,

myta212

OzQTNoob
4th December 2012, 08:06
I will check out your link.

cheers
Oz

Uwe
4th December 2012, 09:17
The Qwt package ( http://qwt.sf.net ) offers a plot item called spectrogram that might be what you are looking for.

Uwe