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.

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 on other sites

What language?
What API?
What do you mean "turn discrete values in xyz coordinates"?

Share on other sites

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)]

• 10
• 16
• 14
• 18
• 15