gyasis / MLMedic

Putting powerful tools in the hand of clinicians

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MLMedic

Putting great tools in the hand of clinicians. https://github.com/MLMedic/MLMedic

This is the project repository for the Brisbane health hack 2019. The goal is to develop an interface for applying mashine learning models to medical imaging data.

Feature List:

  1. platform-independent GUI in Python / Electron / ?
  2. Import of Dicom data
  3. Applying Machine Learning models to this dicom data (example: Segmentation and Highlighting of Brain Lesions)
  4. Visualising Output

Optional Feature List:

  • Model zoo online with upload possibility
  • Model conversion from Tensorflow, PyTorch, Caffe, Theano .... to be able to be used in our GUI
  • Local Transfer Learning to adjust models to available data at the local site

Getting started:

Data:

  • 3T and 7T MPRAGE and MP2RAGE anatomical scans
  • dicom and nii format
  • link via email

Available Models:

Availabe Tools (need to be trained first):

Example how a current applicaiton of a model looks like:

https://github.com/DLTK/models/tree/master/ukbb_neuronet_brain_segmentation

  • install miniconda https://conda.io/miniconda.html or anaconda
  • wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
  • bash Miniconda3-latest-Linux-x86_64.sh
  • conda install tensorflow
  • pip install dltk
  • clone model repo:
  • download Models:
  • wget http://www.doc.ic.ac.uk/~mrajchl/dltk_models/model_zoo/neuronet/spm_tissue.tar.gz
  • tar -xzf spm_tissue.tar.gz (into /models/ukbb_neuronet_brain_segmentation/
  • copy files from spm_tissue/0/1513180449 up one level to spm_tissue/0
  • adjust paths in /models/ukbb_neuronet_brain_segmentation/config_spm_tissue.json so they point to the path /models/ukbb_neuronet_brain_segmentation/spm_tissue or whatever is relevant.
  • create and add this to /models/ukbb_neuronet_brain_segmentation/files.csv in two lines: id,t1,fsl_fast,fsl_first,spm_tissue,malp_em,malp_em_tissue 5404127,3T.nii.gz,T1_brain_seg.nii.gz,all_fast_firstseg.nii.gz,T1_brain_seg_spm.nii.gz,T1_MALPEM.nii.gz,T1_MALPEM_tissues.nii.gz
  • download 3T file from link provided on owncloud and name it 3T.nii.gz, place it in /models/ukbb_neuronet_brain_segmentation/
  • run the model!
    • python deploy.py --csv files.csv --config config_spm_tissue.json

Another example that needs Torch (if someone knows how to convert this to tensorflow/TF.js!):

From https://github.com/Entodi/MeshNet

  • First you need Torch!
  • Steps taken from https://dwijaybane.wordpress.com/2017/07/22/installing-torch-7-deep-learning-on-ubuntu-16-04/
    • sudo apt-get install --no-install-recommends git software-properties-common
    • export TORCH_ROOT=~/torch
    • git clone https://github.com/torch/distro.git $TORCH_ROOT --recursive
    • cd $TORCH_ROOT
    • ./install-deps
    • ./install.sh -b
  • Now download the models for MeshNet AKA BrainChop
  • Download the 3T data from owncloud link
  • Install python and dependencies if you haven't:
    • pip install nipy
  • Conform T1 to 1mm voxel size in coronal slice direction with side length 256.
    • (Freesurfer required) mri_convert brainDir/t1.nii brainDir/t1_c.nii -c
  • Convert nifti to numpy format
    • python nifti2npy.py brainDir/t1_c.nii --npy_file brainDir/T1.npy
  • Create segmentation using predict.lua providing path to directory with brain npy file brainDir
    • th predict.lua -modelFile ./saved_models/model_Mon_Jul_10_16:43:55_2017/model_219.t7 -brainPath brainDir
  • Convert numpy segmentation file to nifti format by providing base nifti file
    • python npy2nifti.py segmentation.npy t1_c.nii

Can we replace this with a nice GUI that ideally doesnt need a python installation?

Data to play with

https://cloudstor.aarnet.edu.au/plus/s/JGt804o3cGXc5xf

About

Putting powerful tools in the hand of clinicians

License:BSD 2-Clause "Simplified" License


Languages

Language:Jupyter Notebook 98.5%Language:Python 1.3%Language:JavaScript 0.1%Language:HTML 0.1%Language:CSS 0.0%