Closed neurofractal closed 2 years ago
Hi @neurofractal
I've got an experimental version of this working, and it looks like should work. But as you'll see we'll actually have to think about how we want to make this a permenant addtion.
Below are the anatomy/sensor coregistrations using 4 scenarios.
As you can see from a eyeball of these. If we use the default behaviour of SPM and it turns out the fiducials are close to where they ideally should be, its no better than just a bog standard template. But hacking the code to use an EEG-like behaviour looks promising! I'm just going to quantify the errors to see how much better it might be.
Thanks George - looks really promising. A couple of thoughts:
Yeah I think as you'll see from the plot below your obervation about point one is correct, but I think its because that the canonical mesh cuts off not inferior to the brain enough for it to really minimse the issues. We definitely need to get the anatomical fiducial locations yes,
The plot below is the difference in vertiex locations (Euclidian distance) between the non-linear warp to native space, and the other simplified fits, plotted in the same order as above.
Interestingly, even though from eyeballing fits 2 and 3 look similar above, it turns out using the headshape points gets the average error down a few millimeters. Using the EEG behvior (fit 4) looks like it should perform better, it does. BUT it does appear to get the variation in the error down. And becayse of the cutoff of the MRI in SPM its the infereior errors which have the largest error.
Interesting...
Just some overlap plots, blue is the native, and red is the approximation, again in the order of the first post.
Just doing the lead field error (assume Nolte model). Just incase for some reason it turns out the way it warps the brain/csf boundary for the different approximations is somehow more important than just source position error...
Measuring the relative error between the leadfields from the native MRI fit and the ximplifications. (norm of the difference of lead fields, scaled by norm of the native lead field). Option three (template + headshape MEG style) gives the lowest error based on SPM's way of dipole modelling.
I think what this tells us is that the simple additional fitting based on the iPad generated headshape is the way to go.
This is somwhat of a relief as to get the EEG method of headshape fitting on MEG data requires some hacking of how we communcated to SPM that this is OPM data - something we currently do not do. To get the MEG method working just requires changes to spm_opm_create.
Thoughts?
Sounds good.. although I guess it's just the occipital cortex which is biasing the bottom right plot? I'll investigate which bits of the headshape to include/leave out...
Would you be able to share your code for calculating relative error between the leadfields? Then I can test my Thin Plate Spline (TPS) Warp approach...
Yeah happy to share my code. Its a mess as I wrote it very quickly. But it should give you the ground work!
https://gist.github.com/georgeoneill/e5407bca5321a438404953274cd0958e
I'm going to consider this basic headshape implementaiton issue closed.
spm_opm_create should have an S.headshape input, in which headshape can be associated with fiducial info for better coregistration