August 27, 2015

Wrapping Up / Winding Down

C-day + ~10 weeks

By the end of the project, I finished or almost finished all of the major improvements for the signal space separation (SSS) algorithm. The initial SSS implementation required about six weeks to understand and then implement to a degree that matched the proprietary version of the software. Other than the fundamental algorithm, there are three major “expansion packs” that make the algorithm more attractive for real-world noise rejection. The first is the ability to reconstruct bad channels; since we are oversampling the spherical harmonic bases, we can actually reconstruct the signals at bad sensors where we were forced to throw out that sensor’s data. There are two other extensions – fine calibration and temporospatial SSS (tSSS) – that are both underway but not yet complete. As described before, channel reconstruction, fine calibration, and tSSS are all methods to remove more noise from the MEG signals. Even beyond these published algorithms, we have improvements included in our fine calibration procedure beyond the proprietary SSS algorithm. Of course, I’ll keep working on these extensions until they are finished so that our library has a powerful and complete implementation of the SSS functionality.


Now that the GSoC project is over, I’m glad I followed a post-doc’s advice to use the program as a chance to explore concepts outside my thesis area that manifest in code that’s helpful to our source imaging community. There were a number of technical skills I now have that I didn’t have before and probably wouldn’t have gained without this opportunity. I’m much more familiar with the concepts behind Git and Github as well as a better collaborator having worked with a number of MNE-Python’s other coders. To understand and implement the SSS algorithm, I also had to (heavily) brush up my physics and, in particular, Maxwell’s equations and spherical harmonics. The fact that I had a practical application of these concepts served as a great carrot to stay motivated as much of the necessary mathematical concepts were in impressively dense papers from before the 1980s. At the very least, I'll have one fancy physics concept to draw on a cocktail napkin many years from now.

Schools out for the (remaining) summer.

August 7, 2015

Fine calibration: one of many SSS improvements

SSS itself implemented, I’m now trying to process a back-log of improvements that were made since the algorithm’s initial publication in the mid-2000s. There are four or five of these modifications, some of which will boost noise rejection by an order of magnitude or more. The first set of three improvements goes under the umbrella term “fine calibration.”

The SSS algorithm depends heavily on the location and geometry of the MEG sensors. Therefore, it’s not surprising that any small error in the believed location or behavior these sensors will introduce a significant error in the filter’s output. Fine calibration consists of three modifications to correct for these sensor inconsistencies. For all of these improvements, we record empty room data and construct a “fine calibration” file. The first fix updates the orientation of each sensor coil. Because the sensor coils pickup the magnetic flux through their coil loops, a more accurate estimate of the true orientation will yield more accurate representation in the multipolar moment space. The second fix concerns the gradiometers only. Again, there are small imperfections in the MEG coils, and gradiometers measure small signal differences between pairs of loops. If one gradiometer loop has any physical differences from its twin, a substantial error will be introduced into the recorded signal. Therefore, we simulate small point-like magnetometers at the center of each gradiometer to account for this gradiometer “imbalance.” The third and final fix is concerned with imperfections in the magnetometers. Again, we’re dealing with physical devices, so we measure if any of these sensors have readings that are slightly too high or low in amplitude and correct for this with a calibration coefficient from that same fine calibration file. This final improvement has a relatively small effect compared to the first two.


I’ve finished the code for the fine calibration implementation, but the filtered results aren’t a close enough match with the proprietary code just yet.  On the bright side, the undiscovered bug not causing the filter to completely fail. Once I find the issue, I’ll be on a sprint to implement temporal SSS before the end of summer!