Monthly ArchiveMay 2012
Code Martin Pyka on 10 May 2012
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')
Tips Martin Pyka on 03 May 2012
When you have already preassumptions with regard to the coupling strength of the neural parameters or the hemodynamic parameters you can start the estimation of a DCM with a certain starting position.
All you have to do is, create a variable DCM.M.P and assign new values to it, e.g:
DCM.M.P = DCM.M.pE;
% alter DCM.M.P
save dcm_file DCM
The EM-algorithm will begin with the parameters specified in DCM.M.P.
Tips Martin Pyka on 01 May 2012
DCM is implemented in a framework that can be used to develop and test other models using the Expectation Maximization algorithm and Bayesian techniques. To understand how to use other models within this framework, I can recommend to look at spm_nlsi.m. After the return-command, at the end of the script, there is a nice short example, how to setup everything in order to test your own model.
And by the way: the code for the dynamic causal model can be found in spm_fx_dcm.m (the neural signal is in y(:,1), some hemodynamic parameters are stored in y(:,2:5)) and spm_gx_dcm.m (the hemodynamic forward model).