Hello,

I have a data model and a GUI. In the data model I have a list of image data.
Qt Code:
  1. QList<ImageData>
To copy to clipboard, switch view to plain text mode 

Each image data can hold a 3-dimensional vector of unit's.
Qt Code:
  1. QVector< QVector< QVector<uint> > > m_3dData
To copy to clipboard, switch view to plain text mode 
.

From the GUI I want to request a 2-dimensional slice from m_3dData, but in any order.

As soon as GUI requests this, I need to calculate the minimum and maximum pixel values from the specified slice and create a auto scaled image from it and display in the GUI.

The requested slice is typically in the range of 1 x 800 x 800 pixels wide. I access the vector using m_3dData[dim1][dim2][dim3] which results in 160,000 + 160,000 accesses (for getting min and maximum pixels once and for creating auto scaled rgb values from it again). This takes 50 + 50 milliseconds or so which is a lot for me.

My questions are:
  • Is QVector the right structure for this purpose?
  • Is there a better way to access this structure?


Thanks you!

Regards
Vikram