GithubHelp home page GithubHelp logo

mri-longitudinal-analysis's Introduction

MRI pLGG Longitudinal Analysis

Analysis Pipeline Overview

Project Goals

Pediatric low-grade gliomas (pLGGs) have heterogeneous clinical presentations and prognoses. Given the morbidity of treatment, some suspected pLGGs, especially those found incidentally, are surveilled without treatment, though the natural histories of these tumors have yet to be systematically studied. We leveraged deep learning and multi-institutional data to methodically analyze longitudinal volumetric trajectories of pLGGs on surveillance, yielding insights into their growth trajectories and clinical implications. The objective is two-fold: first, to meticulously track and categorize the volumetric changes of pLGGs over time, and second, to identify any potential risk factors associated with significant volumetric changes that might need medical intervention.

Project Structure

The project is made up of two main steps, a data preparation one and a data analysis one. Data preparation consists of cohort selection, patients classification (package here), MRI imaging pre-processing (package here), a segmentation algorithm based on a nnU-Net architecture (package here) and the first block of the analysis, a volumetric analysis. In this analysis 3D segmentation extracted by the previous countouring algorithms are plotted over time yield insights into the trajectory of the individual patients and the overall cohort. In the data analysis step we perform three distinct analysis, a tumor classification analysis, where clinical risk factors for progression defined by a curve increase are obtained, a survival anaylsis based on a Kaplan Meier and a Cox-Hazards model and a prediction analysis, where we conduct a volumetric prediction of the tumors based on the historical data provided by the curves as well as progression prediction based on random forests and mixed-effects models.

Folder: lib/

This folder contains all external libraries that need to be installed separately in order to make use of all functuionalitites in the repository. They are listed below.

HDBET_Code/

Package needed for the pre-processing of MRI sequences. The preprocessing is done using the package provided in the previous link or using the file mri_preprocess_3d.py in source. To use this program, you need to modify the code to enter the path to the scans (T2W_dir) and where you want to save the output (output_path). Use the respective configuration files provided in the cfg/ folder. It is assumed that your scans and ground truth masks are in the same folder and that it if a scan name is .nii.gz, the corresponding mask is named _mask.nii.gz. If you dont have ground truth segmentations, comment out all the lines regarding them. The output should be fully preprocessed scans in the specified <output_path>. These scans will be saved with the nnunet naming convention (_0000.nii.gz for the scan). Masks will be located in the <output_path> specified for the model (name will be .nii.gz for the mask).

This step may take a couple of hours to run depending on how many scans are in your folder.

nnUNet/

Needed for the segmentation. The pLGGs were segmented using a T2W segmentation tool. The package and further instructions are here.

Folder: mri longitudinal analysis/

This is the main developed package which can also be installed by following the instructions:

git clone -b plgg_analysis https://github.com/jc-cp/mri-longitudinal-analysis
cd mri-longitudinal-analysis/mri_longitudinal_analysis
pip install -e .

It ontains two main folders with the auxiliary files located in utils/, the main analysis files in src/ and the repective configuration files where all of the specific paths and variable are defined.

cfg/

  • Do list of all cfg files.

src/

  • Finish the list of src files.

    Scripts
    • filter_clinical_data.py: Script that reads in the clinical data extracted from the hospital containing the cohort of 89 patients (60 with no operatios + 29 with later surgery).

templates/

In this folder several template files are contained that are used thoughtout the package. An example is a standard brain MRI that can be used for registration purposes.

utils/

This folder contains several files with different purposes, from simple file checking utilities to evaluation or filtering scripts for the provided data. Below a list of the files and their corresponding utilities.

Scripts
  • check_files.py: Script that checks the completeness and faultiness between files located in two directories in order to see if there are some misalignements in the number/ quality of data.
  • evaluation_t2w_files.py: Script that reads in the annotations performed after the initial review by the user of the T2 sequences and outputs some basic data + an histogram as initial statistic.
  • helper_functions.py: OPEN TODO
  • review_t2w.py: Reviewing script for the data pipeline. Each of the flags and paths should be adjusted depeding on the stage of the review process. E.g., if the flag of MOVING2REVIEW is activated, the reviewed files are moved to subfolders for a second review by a trained radiologist.

How to Run

If you want to run the whole pipeline in one go please follow the instructions below:

  • TODO

To Do's

  • Add instruction for HD-BET installation, considering adjustments and segmentation installment, e.g. branch
  • Add instruction for nnUnet installation
  • Rethink the interpolation in volume estimation with splines and statistical imputation
  • [ ]
  • [ ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.