Jump to content
  • Advertisement
Sign in to follow this  

ho can I read 3d volumes in raw format?

This topic is 2943 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

hi, Any idea ho can I read 3d volumes in raw format? Also how can I turn discrete values in xyz coordinates? thanks in advance, Alex

Share this post


Link to post
Share on other sites
Advertisement
We need much more information than that.

What language?
What API?
What "raw" values are you talking about? What's "raw" about them?
Read them from where?
What do you mean "turn discrete values in xyz coordinates"?

Share this post


Link to post
Share on other sites
On the absence of more information:

The typical volume data stored in a .RAW file is usually stored linearly:

slice1, slice2....sliceN where each slice is Width x Height long.

Pseudo code for reading a RAW volume data file (note: assumes scalars):

Size = Width * Height * Depth;
for i to Size
data = read NBytes.

where NBytes is the storage size of the data (sizeof( byte ) for 8-bit, sizeof( byte * 2) for 16-bit, etc). This, of course depending on the language, could be much faster. Example in C:

fread( data, NBytes * Width * Height * Depth, RAWfile );

Then to access a point at x, y, z: data[x + (y * Width) + (z * Width * Height)]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!