Public Repository

Last pushed: 2 months ago
Short Description
Short description is empty for this repo.
Full Description

Code

Check out the source code for this project at neurodata/ndmg on Github.

Documentation

Please read the official ndmg docs.

Error Reporting

Experiencing problems? Please read existing issues to see if others are experiencing the same problem (don't forget to look at "closed" issues in case it has been fixed), and if you need more assistance open a new issue explaining what's happening so we can help.

Acknowledgement

When using this pipeline, please acknowledge us with the citations in the attached bibtex file.

Instructions

The neurodata/m3r-release Docker container enables users to run end-to-end connectome estimation on structural MRI or functional MRI right from container launch. The pipeline requires that data be organized in accordance with the BIDS spec. If the data you wish to process is available on S3 you simply need to provide your s3 credentials at build time and the pipeline will auto-retrieve your data for processing.

To get your container ready to run just follow these steps:

  • In your terminal, type:
    $ docker pull neurodata/m3r-release
    

(A) I do not wish to use S3:

You are good to go!

(B) I wish to use S3:

  • Add your secret key/access id to a file called credentials.csv in this directory on your local machine. A dummy file has been provided to make the format we expect clear. (This is how AWS provides credentials)

Now we're ready to launch our instances and process some data!

Like a normal docker container, you can startup your container with a single line.

I can start my container with:

$ docker run -ti neurodata/m3r-release
usage: ndmg_bids [-h]
                 [--participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]
                 [--bucket BUCKET] [--remote_path REMOTE_PATH]
                 bids_dir output_dir {participant}
ndmg_bids: error: too few arguments

We should've noticed that I got an error back suggesting that I didn't properly provide information to our container. Let's try again, with the help flag:

$ docker run -ti neurodata/m3r-release -h

usage: ndmg_bids [-h]
                 [--participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]
                 [--session_label SESSION_LABEL [SESSION_LABEL ...]]
                 [--task_label TASK_LABEL [TASK_LABEL ...]]
                 [--run_label RUN_LABEL [RUN_LABEL ...]] [--bucket BUCKET]
                 [--remote_path REMOTE_PATH] [--push_data] [--dataset DATASET]
                 [--atlas ATLAS] [--minimal] [--hemispheres] [--log] [--debug]
                 [--bg BG] [--nthreads NTHREADS] [--stc STC]

This is an end-to-end connectome estimation pipeline from M3r images

positional arguments:
  bids_dir              The directory with the input dataset formatted
                        according to the BIDS standard.
  output_dir            The directory where the output files should be stored.
                        If you are running group level analysis this folder
                        should be prepopulated with the results of the
                        participant level analysis.
  {participant,group}   Level of the analysis that will be performed. Multiple
                        participant level analyses can be run independently
                        (in parallel) using the same output_dir.
  {dwi,func}            Modality of MRI scans that are being evaluated.

optional arguments:
  -h, --help            show this help message and exit
  --participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]
                        The label(s) of the participant(s) that should be
                        analyzed. The label corresponds to
                        sub-<participant_label> from the BIDS spec (so it does
                        not include "sub-"). If this parameter is not provided
                        all subjects should be analyzed. Multiple participants
                        can be specified with a space separated list.
  --session_label SESSION_LABEL [SESSION_LABEL ...]
                        The label(s) of the session that should be analyzed.
                        The label corresponds to ses-<participant_label> from
                        the BIDS spec (so it does not include "ses-"). If this
                        parameter is not provided all sessions should be
                        analyzed. Multiple sessions can be specified with a
                        space separated list.
  --task_label TASK_LABEL [TASK_LABEL ...]
                        The label(s) of the task that should be analyzed. The
                        label corresponds to task-<task_label> from the BIDS
                        spec (so it does not include "task-"). If this
                        parameter is not provided all tasks should be
                        analyzed. Multiple tasks can be specified with a space
                        separated list.
  --run_label RUN_LABEL [RUN_LABEL ...]
                        The label(s) of the run that should be analyzed. The
                        label corresponds to run-<run_label> from the BIDS
                        spec (so it does not include "task-"). If this
                        parameter is not provided all runs should be analyzed.
                        Multiple runs can be specified with a space separated
                        list.
  --bucket BUCKET       The name of an S3 bucket which holds BIDS organized
                        data. You must have built your bucket with credentials
                        to the S3 bucket you wish to access.
  --remote_path REMOTE_PATH
                        The path to the data on your S3 bucket. The data will
                        be downloaded to the provided bids_dir on your
                        machine.
  --push_data           flag to push derivatives back up to S3.
  --dataset DATASET     The name of the dataset you are perfoming QC on.
  --atlas ATLAS         The atlas being analyzed in QC (if you only want one).
  --minimal             Determines whether to show a minimal or full set of
                        plots.
  --hemispheres         Whether or not to break degrees into hemispheres or
                        not
  --log                 Determines axis scale for plotting.
  --debug               flag to store temp files along the path of processing.
  --bg BG               Whether to produce big graphs.
  --nthreads NTHREADS   The number of threads you have available. Should be
                        approximately min(ncpu*hyperthreads/cpu, maxram/10).
  --stc STC             A file for slice timing correction. Options are a TR
                        sequence file (where each line is the shift in TRs),
                        up (ie, bottom to top), down (ie, top to bottom), and
                        interleaved.

Cool! That taught us some stuff. So now for the last unintuitive piece of instruction and then just echoing back commands I'm sure you could've figured out from here: in order to share data between our container and the rest of our machine, we need to mount a volume. Docker does this with the -v flag. Docker expects its input formatted as: -v path/to/local/data:/path/in/container. We'll do this when we launch our container, as well as give it a helpful name so we can locate it later on. Finally:

docker run -ti --name ndmg_test -v path/to/bids/root:/data neurodata/m3r-release /data /data/outputs participant func
Docker Pull Command
Owner
neurodata