I am working on rendering some volume data via cuda v6.5 sample code - volumeRender. I have some voxel data with different RGB color in another program. I want to render them by outputing them to .raw file format. However, how to output the exact same .raw format as input .raw file in volumeRender is confusing me a lot.
In my knowledgement, a .raw file can contain an array of volume data. I tried to open .raw file, named "Bucky.raw" , in volumrRender, with text editor, but it didn't work. The text was garbled text. So I have no clue of the format of the .raw file.
Next, I tried to read sample code and figure out how the .cpp file read this format. The only information I get was the volume size. It is
unsigned char * width * height * depth
.
Dose that mean each voxel data is represented by only one unsigned char? What does this unsigned char mean? Is it the gray scale of voxel?
I tried to output gray scale of my voxel RGB data, but the result is quite wired like below.
At the top is my voxel data and visualize by PCL. The other is the render result. Obviously, it's the wrong format for the volumeRender program.
I know there are lots of different formats of .raw files, but I think maybe there is only one kind of .raw format just for cuda sample code. Does anyone know how to store .raw format just like "Bucky.raw" format?