This week for Scientific Visualization, we’re talking about volume rendering and using VTK to explore some data. I got some datasets from The Volume Library and after a little tinkering, got VTK to render them. (And now a quick aside on how to do this as I didn’t find much information on the subject).
I used a tool (pvm2raw) available as part of the V^3 library to convert the pvm files to raw, but VTK requires its own simple header. I actually found that this particular header didn’t work (perhaps a VTK versioning problem?) and so taking guidance from this, checked the header of one of the VTK-included volumes:
1
|
|
This header more or less included a little information on the grid size, spacing and representation of the data:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Concatenating the header with the raw:
<div class=’bogus-wrapper’>
At that point, I was in business and was able to move on to generating pretty pictures. Granted, these datasets are pretty sparse, but still VTK did a pretty reasonable job. Update: a comment asked for a little bit more detail on this assignment, and so I’m including my report for the project.
[gallery link=”file” orderby=”ID”]
I was amazed today that we can see inside of things… without taking them apart. What an age to live in. Especially the virtual autopsy table I read about recently. In 20 years, we’ll have Firefly-style real-time holographic body scans (ignore music, skip to 0:45):