Git Product home page Git Product logo

minc-bpipe-library's Introduction

Library of bpipe functions for processing minc files

====================================================

minc-bpipe-library provides a set of chainable minc file processing functions to (pre)process data. At the moment is our star preprocessing pipeline. By default it will perform: N4correction, Cutneck, Head and Brain masks (using BEAST) and registration to MNI (using ANTs).

To run in any computer it requires http://www.bic.mni.mcgill.ca/ServicesSoftware/ServicesSoftwareMincToolKit, https://github.com/ssadedin/bpipe/ and gnu-parallel.

To run it on Scinet see below.

To control which stages are run, edit pipeline.bpipe and add stage names using "+" to the "run" stage.

The default in pipeline.bpipe is what has experimentally determined to be a best-practice run.

Stages are listed in the minc-library.bpipe, correction stages such as denoising, n3 and n4, and normalize should be run before any other stages. Typically after this linear_antsRegistration would be run, which will allow other processing such as VBM, cutneck, deface and beast to be done in MNI space.

For convenience, "segments" have been defined for some processing jobs (beast, cutneck, VBM) which are multi-step. These may conflict with each other if you try to combine them, so instead you must specifiy their individual stages.

Stage options have been chosen based on best pratices from publications where applicable but can be changed.

Once you have defined your stages, you can run your pipeline on the SGE cluster with:

> git clone https://github.com/CobraLab/minc-bpipe-library.git
#Edit minc-bpipe-library/pipeline.bpipe as you see fit
> module load bpipe #needed to run bpipe
> module load minc-toolkit minc-toolkit-extras #needed for most stages
> cd /path/to/store/outputs
#Choose n to be the smaller of (number of input files, 240)
> bpipe run -n<number> /path/to/pipeline.bpipe /path/to/inputs/*mnc

Output filenames from bpipe will be of the form <inputname>.stage1.stage2.stage3.ext where the last stage name will be the last run. commandlog.txt will be generated by bpipe describing all the commands run for the pipeline. This is a very good file to keep around as as a note of what happened to your data.

Some stages produce both mnc files and xfm files, see the $output variables for what is generated.

#Scinet Operation Inputs are split into 8 file chunks and submitted as local bpipe jobs on scinet nodes

Steps

  1. git clone https://github.com/CobraLab/minc-bpipe-library.git
  2. rm minc-bpipe-library/bpipe.config
  3. sed -i 's#/opt/quarantine#/project/m/mchakrav/quarantine#g' minc-bpipe-library/minc-library.bpipe
  4. mkdir bpipe-outputs && cd bpipe-outputs
  5. module load scinet
  6. Use ..//minc-bpipe-library/bpipe-batch.sh ../minc-bpipe-library/pipeline.bpipe /path/to/my/inputs/*.mnc > joblist to generate a joblist
  7. Use ../minc-bpipe-library/qbatch joblist 1 12:00:00 to submit jobs to scinet queing system

Example:

  1. Create a folder for preprocessing (i.e. mkdir preproc) and cd into it cd preproc.

  2. Point the bpipe-batch.sh to where pipeline.bpipe is installed and then to where the T1s you are using are.

bpipe-batch.sh /home/m/mchakrav/egarza/bin/minc-bpipe-library/pipeline.bpipe /home/m/mchakrav/egarza/scratch/adhd_gen/preproc/files/*.mnc > joblist

  1. Check the joblist file using nano

  2. Submit the jobs:

qbatch joblist 1 12:00:00

  1. QC the resulting files. For MAGeT or CIVET you want to use the n4corrected.cutneckapplyautocrop.mnc in native space. You can also use the .beastmask.mnc files for CIVET.

QC Generation

For pipelines at the CIC, QC images are automatically generated.

The script generate-bpipe-QC.sh is used to generate standardized views of the final outputs for quality control on SciNet:

#In your output directory
> module load scinet-dev
> mkdir QC
> for file in *linear_bestlinreg.cutneckapplyautocrop.beastnormalize.mnc; do ../minc-bpipe-library/generate-bpipe-QC.sh $file QC/$(basename $file .mnc).jpg; done

QC example:

for file in *linear_bestlinreg.cutneckapplyautocrop.beastnormalize.mnc; do ~/bin/minc-bpipe-library/generate-bpipe-QC.sh $file QC/$(basename $file .mnc).jpg;done

minc-bpipe-library's People

Contributors

gdevenyi avatar egarza avatar

Watchers

James Cloos avatar  avatar Xiao avatar

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.