Skip to the content.

Viet Hoang

GSoC x LORIS image

Google Summer of Code 2021 Submission

Organization

International Neuroinformatics Coordinating Facility (INCF)

Project title

Improve LORIS-MRI imaging codebase

Mentors

Christine Rogers, Cecile Madjar

Project Description and Overview

The goal of this project was to improve the imaging code base (LORIS-MRI) by refactoring existing tables in the database and developing scripts that will streamline the workflow of LORIS-MRI developers.

Deliverables

  1. Setup/Familiarization with LORIS
    The first stage involves setting up the development environment, installing LORIS and LORIS-MRI, and learning more about LORIS.
  2. Refactor existing tables in the database to improve their usability
    This portion of the program was during the coding period. There are some tables with fields that were defining poorly, often with ‘hacky’ default/special values. These hacks could create problems downstream as scripts that accessed these tables had to always take into account these special cases.
  3. Improve error checking and display more messages during the installation for users.
    There were some steps during installation that had a higher probability of going wrong for users. To amend that, I implemented some checks for these errors to inform the user if anything goes wrong and to stop the installation from proceeding any further.
  4. Add DevOps tools that will assist with the workflow of developers and reduce syntax errors in the code. Initially, there was no step in the Python development pipeline that would check the code for syntax or stylistic errors. I added a Python linter (flake8) as a GitHub action that would scan Python code in every pull request and annotate all the errors that is found.

Summer Timeline

May

Despite recently graduating from computer science and biology program recently, I never had any prior internship experience before. As such, my first couple weeks were difficult and there was a steep learning curve. For example, I ran into some problems with my VM setup, installed the wrong PHP version, and my had a few issues with the LORIS installation. The overall process of getting setup took much longer than anticipated, and it probably would have been much faster if I had more experience. Nevertheless, I finished setting up, and it was a valuable learning experience!

June

Throughout June I was assigned Issues by Cecile to work on. The first issues were easy (mostly documentation), and the difficulty for future Issues started slowly ramping up. I learned how to program in Perl by writing a script that allows the user to make a copy of a folder anywhere they want locally. This differs from copying and pasting because all the files in the copied folder will be a symbolic link. This allows the possibility of creating a ‘copy’ of a very large folder without having to do a full copy and paste.

July

July was also spent working on assigned Issues. I mainly worked on Issues pertaining to refactoring databases to improve their usability. I also worked on improving the installation scripts by adding some error checking features.

August

During August on worked on fixing syntatical errors in all the Python scripts using a Python linter called flake8. In addition, I implemented a new GitHub Action. This Action goes through Python files in PRs and annotates syntax or stylistic errors.

Merged Pull Requests

  1. [Loris-MRI] #634, #635: Fixed typo in version 23.0 and main README
  2. [Loris-MRI] 638: Add new script that replicates RaisinBread dataset
    • Added a new script that makes a local copy of the RaisinBread data set. Instead of copying files from the original data set, symlinks are created instead.
  3. [Loris] 7496, [Loris-MRI] 640: Setting default value of ScannerID in mri_protocol to be NULL instead of 0
    • Set the default value of ScannerID in the mri_protocol to be NULL. Before these changes, the default value was 0
  4. [Loris-MRI] 641: Added a check to see if /data/incoming/ was created in imaging_install.sh
    • Added a check in imaging_install.sh to see if /data/incoming/ was successfully created. If not, instructions on how to do it manually are provided.
  5. [Loris-MRI] 642: Add database connection check in imaging_install.sh
    • A new check is added to ensure that the connection to the database is valid. If the user provides invalid credentials, then the script will alert them and abort.
  6. [Loris-MRI] 643: Improved distribution detection to imaging_install.sh
    • Improved distribution detection by adding support for all Debian-based (Ubuntu, Debian) and RedHat-based (RedHat, CentOS, Fedora, Oracle) distributions.

Open Pull Requests

  1. [Loris] 7515: Added EchoTime field in the violation tables
    • The EchoTime field has been added to two violation tables: MRICandidateErrors, and mri_violations_log.
  2. [Loris] 7525, [Loris-MRI] 650: Replace Center_name in mri_protocol with CenterID from psc
    • This PR replaces the Center_name field with CenterID from the psc table. When an mri_protocl is not restricted to a specific center, the default value is NULL (instead of ZZZZ/AAAA like before).
  3. [Loris-MRI] 651: Added a GitHub Action that will run flake8 on submitted PRs
    • A new Python linter, flake8, has been added as a GitHub Action. It will run on every submitted PR and annotate all the errors that it finds.
  4. [Loris-MRI] 652, 653 , 654 , 655 , 656 , 657 , 658 , 659 , 650 , 661 , 662 , 663 , 664 , 665 , 666 , 667 , 668: Ran flake8 on all Python files in Loris-MRI

Documentation

Orignal Proposal
This was my orginal proposal that I submitted for my application to GSoC.

GGSoC Roadmap
This document contains a summarized roadmap of my goals and my accomplishments as a GSoC student at LORIS

Weekly Reports
A document that covers in detail what I have done each week during this internship (after the onboarding period).

GSoC Presentation

An August 3rd I gave a presentation to the LORIS team regarding the work that I have done so far in the summer. It was a great opportunity to tell the team about my story, background, and what motivated me to pursue this internship. I then went through each of the stages in the GSoC program, and I briefly talked about the PRs that I submitted. I finshed the presentation by talking about my current assignments!

My Experience

The whole GSoC program has been a fantastic experience and this was my very first opportunity to actually code for an organization and to collaborate and contribute to such a large open-source project. Most of my time in undergrad was spent doing research projects, and one of my biggest regrets is not having any industry experience or contributing to an open-source project. GSoC provided the perfect opportunity for me and I am so grateful that I decided to hop onboard. I learned so much through my mentors, and my time at LORIS was wonderful, even if it had to be done remotely.

Thank you GSoC and LORIS for providing me with this amazing opportunity!