Looking at the git blame
for the dipole code, I think I’m addressing this question mostly to @larsoner, but I’d love input from anyone who knows something about for Xfit handles multiple dipoles.
What I’m trying to achieve: Using evoked data, I have created multiple dipoles in MEGIN’s Xfit tool. Now, I would like to take these dipoles and create the corresponding source timecourses for them on single-epoch data.
Problem: Doing this in Xfit would be a cumbersome process, as it doesn’t support epoched data, so I would have to convert a single epoch to an evoked object, load it into Xfit, get the timecourses, convert it back, etc. Not fun. MNE-Python can compute the timecourse given a single dipole position and orientation through the fit_dipole
function. However, it cannot do this for multiple dipoles at the same time. It is important to do this at the same time and not dipole-a-dipole, because sensor activity that has been “assigned” to one dipole should not be assigned to the second one. To the best of my knowledge, Xfit achieves this by first whitening the leadfield and evoked data before computing the source timecourses.
Desired solution: I’m trying to modify the fit_dipole
function so that multiple values for pos
and ori
can be supplied corresponding to multiple dipoles. But these functions are long and complicated. Some help would be greatly appreciated.