From 3bc4e9a2430c6b50941770f411f4c279a98f3026 Mon Sep 17 00:00:00 2001 From: Ross Lawrence <52179159+Lawreros@users.noreply.github.com> Date: Fri, 25 Feb 2022 14:45:53 -0500 Subject: [PATCH] update docker image (#410) * badge update * badge test * func output tree overhaul * concurant func and dwi pipelines * sort functional and diffusion output folder organization * m2g-f file output fix * remove iteration output * update for travis test * readme update * readme update * remove travis * update file output * pass push check * Docker file overhaul, switch base image to neurodebian: bionic-non-free * initial stable dockerfile * first round of version control for dockerfile * change cpac runner to python3.7 * fix missing module issue by making them visible to python3, also change installation order * vix missing xvfbwrapper * instruction update * update * README update * finish file definition * README rough draft * remove lfs requirement --- Dockerfile | 29 ++--- README.md | 348 ++++++++++++++++++++++++++--------------------------- 2 files changed, 181 insertions(+), 196 deletions(-) diff --git a/Dockerfile b/Dockerfile index f26211b2..effae08f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,20 +32,12 @@ RUN apt-get update && \ RUN pip3.7 install --upgrade pip -# Get neurodebian config -# RUN curl -sSL http://neuro.debian.net/lists/stretch.us-tn.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \ -# apt-key add /root/.neurodebian.gpg && \ -# (apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true) && \ -# apt-get update -qq -# RUN apt-get -f install - - # Configure git-lfs -RUN apt-get install -y apt-transport-https debian-archive-keyring -RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ - apt-get update && \ - apt-get install -y git-lfs +# RUN apt-get install -y apt-transport-https debian-archive-keyring +# RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ +# apt-get update && \ +# apt-get install -y git-lfs # #---------AFNI INSTALL--------------------------------------------------------# # # setup of AFNI, which provides robust modifications of many of neuroimaging algorithms @@ -197,27 +189,22 @@ RUN apt-get update && apt-get -y upgrade insighttoolkit4-python # setup of python dependencies for m2g itself, as well as file dependencies RUN \ pip3.7 install --no-cache-dir hyppo==0.1.3 nibabel==2.3.3 scipy==1.4.1 python-dateutil pandas==0.23.4 boto3==1.7.13 awscli==1.15.40 virtualenv + RUN \ pip3.7 install --no-cache-dir matplotlib nilearn sklearn cython vtk pyvtk fury==0.5.1 RUN \ pip3.7 install --no-cache-dir yamlordereddictloader -#got rid of awscli here^ RUN \ + pip3.7 install --no-cache-dir requests ipython duecredit graspy==0.3.0 scikit-image networkx dipy==1.1.1 pybids==0.12.0 # TODO: Update pybids RUN \ pip3.7 install --no-cache-dir plotly==1.12.9 configparser>=3.7.4 regex - -RUN \ - pip3.7 install s3transfer==0.3.7 - -RUN \ - pip3.7 install setuptools==57.5.0 RUN \ - pip3.7 install numba==0.52.0 + pip3.7 install s3transfer==0.3.7 setuptools==57.5.0 numba==0.52.0 # install ICA-AROMA RUN mkdir -p /opt/ICA-AROMA @@ -276,7 +263,7 @@ RUN pip3.7 install git+https://github.com/ChildMindInstitute/PyPEER.git RUN mkdir /m2g_atlases RUN \ - git clone https://github.com/neurodata/neuroparc -b remove-lfs && \ + git clone https://github.com/neurodata/neuroparc && \ mv /neuroparc/atlases /m2g_atlases && \ rm -rf /neuroparc RUN chmod -R 777 /m2g_atlases diff --git a/README.md b/README.md index f8d3acdb..808b5382 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ NeuroData's MR Graphs package, **m2g**, is a turn-key pipeline which uses structural and diffusion MRI data to estimate multi-resolution connectomes reliably and scalably. -## Contents +# Contents - [Overview](#overview) - [System Requirements](#system-requirements) @@ -27,47 +27,28 @@ NeuroData's MR Graphs package, **m2g**, is a turn-key pipeline which uses struct - [Manuscript Reproduction](#manuscript-reproduction) - [Issues](#issues) -## Overview +# Overview -The **m2g** pipeline has been developed as a one-click solution for human connectome estimation by providing robust and reliable estimates of connectivity across a wide range of datasets. The pipelines are explained and derivatives analyzed in our pre-print, available on [BiorXiv](https://www.biorxiv.org/content/early/2017/09/16/188706). +The **m2g** pipeline has been developed as a beginner-friendly solution for human connectome estimation by providing robust and reliable estimates of connectivity across a wide range of datasets. The pipelines are explained and derivatives analyzed in our pre-print, available on [BiorXiv](https://www.biorxiv.org/content/early/2017/09/16/188706). -## System Requirements +# System Requirements The **m2g** pipeline: -- was developed and tested primarily on Mac OSX, Ubuntu (14, 16, 18, 20), and CentOS (5, 6); -- made to work on Python 3.6; +- was developed and tested primarily on Mac OSX, Ubuntu (16, 18, 20), and CentOS (5, 6); +- made to work on Python 3.7; - is wrapped in a [Docker container](https://hub.docker.com/r/neurodata/m2g); - has install instructions via a Dockerfile; - requires no non-standard hardware to run; - has key features built upon FSL, AFNI, Dipy, Nibabel, Nilearn, Networkx, Numpy, Scipy, Scikit-Learn, and others; - takes approximately 1-core, < 16-GB of RAM, and 1 hour to run for most datasets. -## Installation Guide - -**m2g** relies on [FSL](http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation), [AFNI](https://afni.nimh.nih.gov/), [Dipy](http://nipy.org/dipy/), [networkx](https://networkx.github.io/), and [nibabel](http://nipy.org/nibabel/), [numpy](http://www.numpy.org/) [scipy](http://www.scipy.org/), [scikit-learn](http://scikit-learn.org/stable/), [scikit-image](http://scikit-image.org/), [nilearn](http://nilearn.github.io/). You should install FSL and AFNI through the instructions on their website, then install other Python dependencies as well as the package itself with the following: - - git clone https://github.com/neurodata/m2g.git - cd m2g - pip install -r requirements.txt - pip install . - -For the most up-to-date version of m2g, you can use the staging branch. This version is updated regularly, but may be less stable: - - git clone https://github.com/neurodata/m2g.git - cd m2g - git checkout staging - pip install -r requirements.txt - pip install . - -You can also install **m2g** from `pip` as shown below. Installation shouldn't take more than a few minutes, but depends on your internet connection. Note that to install the most up-to-date version of the pipeline, we currently recommend installing from github. - -### Install from pip - - pip install m2g +# Installation Guide ## Docker +While you can install **m2g** from `pip` using the command `pip install m2g`, as there are several dependencies needed for both **m2g** and **CPAC**, it is highly recommended to use **m2g** through a docker container: + **m2g** is available through Dockerhub, and the most recent docker image can be pulled using: docker pull neurodata/m2g:latest @@ -88,26 +69,71 @@ In order to create a docker container from the docker image and access it, use t docker run -it --entrypoint /bin/bash m2g:uniquelabel -## Tutorial +## Local Installation [COMING SOON] +Due to the versioning required for CPAC, along with `m2g-d`, we are currently working on streamlining the installation of `m2g`. Stay tuned for updates. + + + +# Usage + +The **m2g** pipeline can be used to generate connectomes as a command-line utility on [BIDS datasets](http://bids.neuroimaging.io) with the following: + + m2g --pipeline /input/bids/dataset /output/directory + +Note that more options are available which can be helpful if running on the Amazon cloud, which can be found and documented by running `m2g -h`. + + +## Docker Container Usage + +If running with the Docker container shown above, the `entrypoint` is already set to `m2g`, so the pipeline can be run directly from the host-system command line as follows: + + docker run -ti -v /path/to/local/data:/data neurodata/m2g /data/ /data/outputs + +This will run **m2g** on the local data and save the output files to the directory /path/to/local/data/outputs. Note that if you have created the docker image from github, replace `neurodata/m2g` with `imagename:uniquelabel`. + +Also note that currently, running `m2g` on a single bids-formatted dataset directory only runs a single scan. To run the entire dataset, we recommend parallelizing on a high-performance cluster or using `m2g`'s s3 integration. + + +# Tutorial + +## Structural Connectome Pipeline (`m2g-d`) -Once you have the pipeline up and running, you can run it with: +Once you have the pipeline up and running, you can run the structural connectome pipeline with: - m2g + m2g --pipeline dwi We recommend specifying an atlas and lowering the default seed density on test runs (although, for real runs, we recommend using the default seeding -- lowering seeding simply decreases runtime): - m2g --seeds 1 --parcellation desikan + m2g --pipeline dwi --seeds 1 --parcellation Desikan You can set a particular scan and session as well (recommended for batch scripts): - m2g --seeds 1 --parcellation desikan --participant_label