alexrockhill's Blog

Week 6: A start on the main GUI and lots of helper PRs

alexrockhill
Published: 07/19/2021

This week I worked on adding volume labels based on a Freesurfer anatomical segmentation file and plotting those files with an mne.viz.Brain object which operates in Freesurfer surface space and has lots of flexibility for 3D plotting. Next, it's developing the core GUI as much as possible until the end of GSoC and making it smooth and well tested. I'm not stuck on anything and it's been a good week for getting some PRs merged.
View Blog Post

Week 5: Merging PR, Progress

alexrockhill
Published: 07/12/2021

This week, I made a lot of progress on setting up for the GUI. A PR is approved that refactors the freesurfer functions that are necessary for the GUI. Also, more thought and effort went into the data a typical user would have, their workflow and the coordinate frames that the image processing will function in. This has culminated in two more PRs in progress for refactoring the electrode volume morphing, which contains many functions that will be reused in the pipeline, and adding anatomical segmentations from a montage which uses those functions. Those anatomical segmentations will be used to provide functionality that takes a label, uses marching cubes to determine surfaces and displays the 3D surfaces along with the electrode contacts. Those PRs will be in the coming weeks. Halfway though, much progress has been made and I'm happy with where the project is at and confident that a good product can be delivered on time.
View Blog Post

Week 4: More Debugging and Catching up

alexrockhill
Published: 07/04/2021

This week I started porting over the GUI and figuring out the integration questions like how to set the rendering backend as well as laying the groundwork (raising an issue and discussing) smaller PRs which will help such as adding subcortical freesurfer recon-all structures to plotting which will need to happen to visualize everything nicely. Things are moving along and the (almost) merged PR that sorts out the registration and diffeomorphic warping is done (except for a few housekeeping items). That was very complicated to integrate into existing code but, in the end, I'm very happy that the tests all passed and this implementation is functionally equivalent to the previous but also gives accurate MR-CT alignments that the last one did not. The API is simpler, and there was a bit of a workaround that after each step the registration was applied instead of being used as a seed for the next step as the API of Dipy suggests is the best case. In fact, there was trouble with this seeding method and the apply method gave great results and was consistent in forward and back tests. Next week, I'll really concentrate on the GUI and hope to get everything working and lightning quick so that I can get feedback on the layout and usability and go from there.
View Blog Post

Week 3: A Bit of A Delay but Maybe Quicker in the End

alexrockhill
Published: 06/26/2021

This week I was scheduled to be working on the VTK implementation of the graphical user interface but instead finished and polished (or are nearly done polishing with a lot of Eric's help) the affine registration and symmetric diffeomorphic registration steps to be done efficiently and reuse existing morphing code. This lays the groundwork for later developments, such as weeks 5 and 6 when the contact identification algorithms will be improved because we used a 3D image to do the SDR morph and had to label all the voxels that the contacts occupied from their centroid location. This is an essential step in the automating of contact identification and will be important as I both port over the GUI and add an automated identification algorithm.
View Blog Post

Week 2: Getting into the Implementation

alexrockhill
Published: 06/19/2021

This week I worked on translating existing code to register a CT to an MRI and warp one MRI to an average template into a mne-python example. The existing code works great, but there are quite a few dependencies so I looked into refactoring and reimplementing. That hasn't gone smoothly yet but I think I have learned quite a bit about all the algorithm implementations so that I know what needs to be done. I was able to eliminate a skimage dependency by refactoring to use the marching cubes implementation in VTK so that was the first success. I might have to add back the skimage dependency if I reimplement the histogram registration though. I am a bit stuck on getting the example to execute quickly and making it easy to understand for the user as multiple dependencies and their formats make that tough. I'm waiting for reviews to help out with that as I move on to improving the implementation of the GUI by embedding VTK plots instead of matplotlib.
View Blog Post