Code Martin Pyka on 10 May 2012 11:54 pm
I have no time to update BrainBlend for newer versions of SPM and Blender. Therefore, here is a small routine that exports a Nifti image to the 8-Bit RAW format which can be used in Blender to visualize structural and functional images as 3d-voxel cloud.
function exportData(img, output, scaling)
vol = spm_vol(img);
data = spm_read_vols(vol);
data = uint8(data*scaling);
fid = fopen(output, 'wb')
fwrite(fid, data, 'uint8')