FITS in Blender : Method 3 


This method is completely different to the others. The problem with mesh objects is that they use a lot of memory. However, there is a way to quite neatly sidestep this problem and display even more information in the realtime view. This method is easily the most powerful of the 3 I've experimented with, and is suitable for pretty much all FITS files.

For whatever reason, displaying image textures in the realtime view uses far less memory than having coloured objects representing each pixel. So this script imports image sequences onto a series of planes each separated by the equivalent of 1 pixel. For the Blender aficionados, with GLSL materials there's no need for the images to have alpha channels or even use UV mapping, which makes things easier.

Example using a single image. With the planes close together, it's virtually impossible to tell that this isn't truly volumetric.

Of course this means you have to have a decent graphics card, but this is true of method 2 as well. You also have to pre-render the images. kvis is the only suitable program I know of to do this. Its ability to export "data ppm" movies allows it to export images of the correct size regardless of the screen window size. Unfortunately, it gets a little messy at this stage.

kvis appears to have a bug so that it can't export movies from anything other than the XY projection. A workaround is to reorder the cube in miriad so that each projection can be rotated to correspond to kvis' XY projection. The images then have to be correctly rotated and flipped or they might not match up with each other. They also have to be converted from .ppm into something Blender can handle - I use "Pearl Mountain Image Resizer", which is free and very good.

Once that's done there is a more serious complication to deal with. Blender doesn't automatically check which direction the viewpoint is pointing, so looking from one direction may be fine but from the opposite, transparency isn't handled correct.ly. Fortunately, thanks to Kai Kostak I found a workaround for this. I won't bore you with even more details - the net result is that you can view the FITS file from any direction, freely and in realtime.


Unlike the other scripts, this doesn't require any special python modules since it's just importing images. It's fast but there is a loading time of about 2 minutes when GLSL is activated. Also, only very limited control over the imported images is possible within Blender - so if things look ugly, you probably have to re-render.

Perhaps the best thing about this method is that it doesn't depend at all on the original file format since it loads image sequences. So it's easy enough, for example, to show volumetric effects created within Blender in this way. And by importing multiple projections of the original cube, it's possible to show the volume from any direction. A .blend containing the scripts can be found here.


rhysy.net | feedback@rhysy.net