Display 3D volume from an array of images in OpenGL

I have a question about displaying a 3D volume made from an array of 2D grayscale images using OpenGL.

To be more precise, I only want to display the central slices of the volume in x, y and z directions.

I have successfully done this just by looping through the volume data at the coordinates I want to show and painting them using GL_POINTS, as shown here (displaying the z direction central slice):

for (x=0; x<sizeX; x++){
  for (y=0; y<sizeY; y++){

I know the real world dimensions of the voxels in mm so I was thinking of displaying the voxels as cubes with that dimensions instead of GL_POINTS like I'm doing it now. Is this a good way to do this? I have read somewhere that displaying voxels as cubes generally isn't a good idea.

Just to add, the volume consists of around 300 images with dimensions of 400x350px.


If your application is to display slices of dense volumetric data, I don't see the benifit of using either points or voxels. To me the best way to achieve what you are asking for is to use simple planes, that you texture map with your image data. You mention the dimensions of your grid data, if you want to visualize this fact, you could also use boxes instead of planes. Using texture maps should be far more efficient for your purpose compared to glPoint or using boxes to represent each individual voxel.

There are many Tutorials on the web which tell you how to do that (e.g. NeHe).

Need Your Help

Reg Expression in C#

c# .net regex connection-string

I gave the above string,I want to get the serveripaddress,DB1,uid and **** these values from that string.

Creating charts in java or javascript without images

javascript java charts jasper-reports jfreechart

One of the project requirements for my new java web project is to have dynamic charts that will load really fast.