Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

cool_xo

Help ~ 3D visulisation of 2D slices

This topic is 5826 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am new to Graphics Programming. I would really appreciate if anyone can help, or give some opinion to my problem. =( At work, I''m given a task to write a software which takes in slices of 2D data files, and display them in a 3D environment. It is used for Ground Penetrating Radar stuff... like, the users can see what''s underground in 3D(where previously can only see 2D slices). I have to use VC++ & MFC(no money, no choice) and DirectX(since i''m using a ATI card)... I would like to know: (1) Basically, what should be the approach be? I don''t understand how can I change data points into a solid 3D cube. (2) Do I need to write a 3D engine myself.. since I can''t find anything in DirectX which allows me to colour in a surface pixel by pixel according to the data point''s value. Thanks in advance. I''m really puzzled.... any comments will do. thank you thank you~

Share this post


Link to post
Share on other sites
Advertisement
look up "voxel"

i can send you some simple sample code using directx 7 if you REALLY need some help. just email me at Raptor85@earthlink.net (i wont send you all of it, just the functions you need, then write a directdraw 7 app to use them in

___________________
-Nicholas Anton
-www.geocities.com/nickanton7/

REFUSE TO BUY WINDOWS XP! STAY WITH 98se!! MICROSOFT CUTTING SUPPORT FOR OLDER PROGRAMS IS A VERY BAD THING.

Share this post


Link to post
Share on other sites
Hey, this is my favorite topic! The words you want to look for are volume visualization, and volume rendering. You want to put all the 2d slices into a big data file. You look at this data set as if it were a 3d scalar field => accessing any coordinate will return one real number (ie f(x,y,z) = d).There are several ways to visualize volume datasets. They can be classified into two big categories. Isourface rendering, and DVR (direct volume rendering).

Isosurface rendering uses techniques (look up Marching Cubes Algorithm), to extract a surface of constant value in the data set into triangles. You can then render this mesh using opengl or something. The good thing about this type of rendering is that it is fast and can be easily accelerated by hardware.

DVR produces cooler images and conveys more data information in one image by basically rendering everything (it is not restricted to rendering just surfaces of constant value (level sets) of a data set. Methods of DVR include raytracing and splatting, which you can easily look up online. Basically, in DVR, you visualize a data set as a big glowing cube of jello, with different values being different colors and intensities. It is generally a lot slower than rendering isosurfaces, but produces better quality images.

Share this post


Link to post
Share on other sites
hmmm.... I really appreciate ur replys. But now... I''m still pretty confused since there''s 2 different methods posted by 2 diff person. =\

I''m looking up ''voxel'' and ''March Cube'' now... another thing I don''t quite understand is with using these algorithms.. how can DirectX be of any help? I know that DX can build up a mesh and stuff.... but how can I used DX to accelerate the calculation of algorithms quicker?

Oh... If there''s an 3rd opinion... I would love to hear it too.

Share this post


Link to post
Share on other sites
quote:

Oh... If there's an 3rd opinion... I would love to hear it too.


There always is

3D textures. It's a very simple and high quality way to render volumes. Put your volumetric data slices into a 3D texture. Then render view aligned 2D slices from back to front, that cut through the 3D texture. The hardware will automatically interpolate the right values from the volume. You just have to select an appropriate blend mode. Newer 3D cards have specialized blending modes for volume visualization.

The Marching cube algorithm will produce a totally different type of volume (isosurface), that might or might not be what you want. And BTW, it is patented, so be careful when using it for commercial applications inside the US. [Edit: oh, you're from down-under. It shouldn't be a problem to use there ]

/ Yann

[edited by - Yann L on September 2, 2002 10:08:42 PM]

Share this post


Link to post
Share on other sites
I have no idea what is the magnitude of the data you''re working with, but if it has a large amount of detail, it''s quite possible that 3D textures might be too slow. If this is the case, you can always save the 2D slices to their individual textures, then layer them on top of each other to create an illusion of depth. Of course, you lose a decent amount of detail going this route, but if you have a decent fill rate for your card it will almost certainly run in real time.

Share this post


Link to post
Share on other sites
In term of magnitude... say for a 1x1 meter surface, I have to sample around 40 slices in 2 directions(i.e. perpendicular to each other), which adds up to 80 slices. And for each slice the number of data points will be around 512x2048.

Is that big??

Ohh...... I need to have the functionality to do Isosurface AND just plain volumne visualisation(display like a cube). Soo... I think Match Cube maybe needed to do Isosurface then.

OH, if this is the case, should I have 2 different algorithm, one for Isosurface, and one for the cube display??

Share this post


Link to post
Share on other sites
quote:

In term of magnitude... say for a 1x1 meter surface, I have to sample around 40 slices in 2 directions(i.e. perpendicular to each other), which adds up to 80 slices. And for each slice the number of data points will be around 512x2048.

Is that big??


Yes In luminance-only mode, we''re talking about 84MB texture data here, in RGB mode it sums up to 250MB. And that''s without mipmaps. What 3D card do you want to run the whole thing on ?

quote:

Ohh...... I need to have the functionality to do Isosurface AND just plain volumne visualisation(display like a cube). Soo... I think Match Cube maybe needed to do Isosurface then.


Yes, marching cubes is definitely the best choice for isosurfaces.

quote:

OH, if this is the case, should I have 2 different algorithm, one for Isosurface, and one for the cube display??


Well, you can also visualize isosurfaces on a standard 3D data grid. But the quality of marching cubes will be far better, and it will be faster. So, yes, you should use two separate algorithms. The only problem that could arise with marching cubes is the initial processing phase. Your data set must be transformed into geoemtry before you can visualize it. So expect a serious slowdown (esp. at the resolution you need), if using animated datasets, or if changing the isosurface threshold value in realtime.

/ Yann

Share this post


Link to post
Share on other sites
I''m using the ATI RAGE Mobility 128 AGP4x card, and the client is currently using the same labtop as I''m now. Soo... I''m just a bit worried that it maybe too slow to display it.

If it''s not too much trouble, would u happen to know how DirectX can be used to make my life easier? Which part can I use DX to do it for me..... and which part do I need to write myself??

I''m new to DirectX.. so, I would like to get a better idea on what the structure and design of my software should be.

Ohh... thanks again Yann L. Ohh... or anyone that can help me too. =)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!