Last week I worked to create functions that would allow multiple subjects' data to be input to the connectivity model. I got stuck on replacing the function that manually scaled the data according to the type of sensor used, with MNE's functions for scaling. I followed my mentor's suggestions for creating this function and will go over it with him this week. I had to run the model for 16 subjects over the weekend. I will plot those results this week and if they are in agreement with what I expect from previous usage of the model with this dataset, I will move on to building the statistical model that measures the statistical differences between functionally connected networks.
Last week I attended a research conference where I presented a poster showing the application of the autoregressive model I am working to publish for this project. I shared measurements for a single condition as compared between a neurotypical population and a population with autism spectrum disorder. I was able to integrate a few stylistic/coding preferences as requested by my mentor. This week I will continue to work on the style edits as well as ensuring that the user interface for uploading data and using the model is minimal, requiring the minimal amount of data from the user, and that all the calculations are hidden from the user. One thing I'm having trouble with is deciding which functions and variables should be marked as private (indicated by a leading underscore) and which should be open to editing from the public. My goal for this week is to have the model itself publishable, so that next week I can move on to building the statistical model which will be used to calculate the statistical significance of the connectivity measures from the model.
Last week was successful. I was able to run PCA to decrease the dimensionality of the sensor data, covariance matrix, and forward matrix. This reduced dimension data is able to run through the connectivity model smoothly. I was also able to take a list of cortical labels from the user, which informs the model which cortical regions the functional connectivity should be measured. I implemented a graphing tool in order to plot the connectivity values between the chosen cortical regions over time. This week I am attending a research conference. Once I return, I will ensure the code is aligned with MNE-Python's formatting guidelines and work to publish it.
My changes last week had to be restored - in an attempt to have the user only interface with the minimum amount of functions, I hid some functions within other processes. However, the further I got in building my script for measuring functional connectivity, the more I needed variables that were hidden in other functions. So I restored my program to a previous version where all the variables I needed were available within the script, and did not require going into any other functions. My plan is to get the script working with all of the functions/variables needed to initiate the model within this script, and once things are working smoothly, I can shift things (with some guidance from mentorship) such that the user is interacting with as few functions/variables as possible. I was able to process the sample data successfully so that the model for functional connectivity could be initialized, and the algorithm could be ran so that the connectivity measurements could be made. However, the algorithm fitting the connectivity measurements is currently crashing python. I plan to take two steps that should fix this problem this week: 1) Perform PCA on the sensor data so that the algorithm performs on fewer dimensions. 2) Select regions of interest to perform the analysis on such that connectivity is only measured for user selected cortical regions.
Over the past week I was able to fix the issue I was facing with the sample dataset, by using MNE's functions to load a forward matrix from the sample data, instead of computing the matrix from the data myself. Then I was able to move some functions around so that the user only interfaces with the functions they absolutely need for working with their data. Next steps will be to test out MNE functions to see if some of my pre processing steps can be replaced. I did not hit any severe obstacles last week.