From 6d10dc83d3f3a2ca699a261d8f4b2c3ccf552a02 Mon Sep 17 00:00:00 2001
From: Fidel Alfaro Almagro <falmagro@fmrib.ox.ac.uk>
Date: Thu, 9 Feb 2023 10:00:07 +0000
Subject: [PATCH] Re-created bip repository

---
 .gitattributes                                |    5 +
 .gitignore                                    |    6 +
 MANIFEST.in                                   |    0
 README.md                                     |   12 +
 bip/commands/__init__.py                      |   13 +
 bip/commands/bb_get_b0s.py                    |  103 ++
 bip/commands/bb_read_json_field.py            |   77 +
 bip/commands/get_dwell_time.py                |   28 +
 bip/data/FileTree.tree                        |    3 +
 bip/data/GDC/UKB.txt                          |    3 +
 .../MNI/MNI152_T1_1mm_BigFoV_facemask.nii.gz  |    3 +
 bip/data/MNI/MNI152_T1_1mm_brain_mask.nii.gz  |    3 +
 .../MNI152_T1_1mm_brain_mask_dil_GD7.nii.gz   |    3 +
 .../MNI/MNI152_T1_1mm_left_eye_dil.nii.gz     |    3 +
 .../MNI/MNI152_T1_1mm_right_eye_dil.nii.gz    |    3 +
 .../MNI/MNI152_T1_2mm_brain_mask_bin.nii.gz   |    3 +
 bip/data/MNI/MNI_to_MNI_BigFoV_facemask.mat   |    3 +
 bip/data/asl/asl_format.txt                   |    3 +
 .../ukb_rois/._HO_L_Cerebral_WM_thr80.nii.gz  |    3 +
 .../ukb_rois/._HO_R_Cerebral_WM_thr80.nii.gz  |    3 +
 .../._MNI_seg_max_prob_masked_RandL.nii.gz    |    3 +
 .../._MostProbableSupplier_sm3.nii.gz         |    3 +
 .../asl/ukb_rois/._VesMasks_sm3Thr80.nii.gz   |    3 +
 .../asl/ukb_rois/._create_biobank_ASL_ROIs.sh |    3 +
 .../ukb_rois/HO_L_Cerebral_WM_thr80.nii.gz    |    3 +
 .../asl/ukb_rois/HO_L_Cerebral_WM_thr80.txt   |    3 +
 .../ukb_rois/HO_R_Cerebral_WM_thr80.nii.gz    |    3 +
 .../asl/ukb_rois/HO_R_Cerebral_WM_thr80.txt   |    3 +
 .../MNI_seg_max_prob_masked_RandL.nii.gz      |    3 +
 .../MNI_seg_max_prob_masked_RandL.txt         |    3 +
 .../ukb_rois/VascularTerritories_ero.nii.gz   |    3 +
 .../asl/ukb_rois/VascularTerritories_ero.txt  |    3 +
 .../asl/ukb_rois/create_biobank_ASL_ROIs.sh   |    3 +
 bip/data/config/ideal_config_sizes.json       |    3 +
 .../config/ideal_config_sizes_CNS_KCL.json    |    3 +
 .../config/ideal_config_sizes_CNS_LIV.json    |    3 +
 bip/data/config/ideal_config_sizes_UKBB.json  |    3 +
 bip/data/config/naming_pattern_CNS_KCL.json   |    3 +
 bip/data/config/naming_pattern_CNS_LIV.json   |    3 +
 bip/data/config/naming_pattern_UKBB.json      |    3 +
 bip/data/dMRI/autoptx/luts/._c1.lut           |    3 +
 bip/data/dMRI/autoptx/luts/._c10.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c11.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c12.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c13.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c14.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c15.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c16.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c17.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c18.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c19.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c2.lut           |    3 +
 bip/data/dMRI/autoptx/luts/._c20.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c21.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c22.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c23.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c24.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c25.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c26.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c27.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c28.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c29.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c3.lut           |    3 +
 bip/data/dMRI/autoptx/luts/._c30.lut          |    3 +
 bip/data/dMRI/autoptx/luts/._c4.lut           |    3 +
 bip/data/dMRI/autoptx/luts/._c5.lut           |    3 +
 bip/data/dMRI/autoptx/luts/._c6.lut           |    3 +
 bip/data/dMRI/autoptx/luts/._c7.lut           |    3 +
 bip/data/dMRI/autoptx/luts/._c8.lut           |    3 +
 bip/data/dMRI/autoptx/luts/._c9.lut           |    3 +
 bip/data/dMRI/autoptx/luts/c1.lut             |    3 +
 bip/data/dMRI/autoptx/luts/c10.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c11.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c12.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c13.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c14.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c15.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c16.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c17.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c18.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c19.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c2.lut             |    3 +
 bip/data/dMRI/autoptx/luts/c20.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c21.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c22.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c23.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c24.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c25.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c26.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c27.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c28.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c29.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c3.lut             |    3 +
 bip/data/dMRI/autoptx/luts/c30.lut            |    3 +
 bip/data/dMRI/autoptx/luts/c4.lut             |    3 +
 bip/data/dMRI/autoptx/luts/c5.lut             |    3 +
 bip/data/dMRI/autoptx/luts/c6.lut             |    3 +
 bip/data/dMRI/autoptx/luts/c7.lut             |    3 +
 bip/data/dMRI/autoptx/luts/c8.lut             |    3 +
 bip/data/dMRI/autoptx/luts/c9.lut             |    3 +
 bip/data/dMRI/autoptx/protocols/._ar_l        |    3 +
 bip/data/dMRI/autoptx/protocols/._ar_r        |    3 +
 bip/data/dMRI/autoptx/protocols/._atr_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._atr_r       |    3 +
 bip/data/dMRI/autoptx/protocols/._cgc_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._cgc_r       |    3 +
 bip/data/dMRI/autoptx/protocols/._cgh_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._cgh_r       |    3 +
 bip/data/dMRI/autoptx/protocols/._cst_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._cst_r       |    3 +
 bip/data/dMRI/autoptx/protocols/._fma         |    3 +
 bip/data/dMRI/autoptx/protocols/._fmi         |    3 +
 bip/data/dMRI/autoptx/protocols/._ifo_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._ifo_r       |    3 +
 bip/data/dMRI/autoptx/protocols/._ilf_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._ilf_r       |    3 +
 bip/data/dMRI/autoptx/protocols/._mcp         |    3 +
 bip/data/dMRI/autoptx/protocols/._ml_l        |    3 +
 bip/data/dMRI/autoptx/protocols/._ml_r        |    3 +
 bip/data/dMRI/autoptx/protocols/._ptr_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._ptr_r       |    3 +
 bip/data/dMRI/autoptx/protocols/._slf_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._slf_r       |    3 +
 bip/data/dMRI/autoptx/protocols/._str_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._str_r       |    3 +
 bip/data/dMRI/autoptx/protocols/._unc_l       |    3 +
 bip/data/dMRI/autoptx/protocols/._unc_r       |    3 +
 .../autoptx/protocols/ar_l/._exclude.nii.gz   |    3 +
 bip/data/dMRI/autoptx/protocols/ar_l/._invert |    3 +
 .../dMRI/autoptx/protocols/ar_l/._seed.nii.gz |    3 +
 .../dMRI/autoptx/protocols/ar_l/._stop.nii.gz |    3 +
 .../autoptx/protocols/ar_l/._target.nii.gz    |    3 +
 .../autoptx/protocols/ar_l/exclude.nii.gz     |    3 +
 bip/data/dMRI/autoptx/protocols/ar_l/invert   |    0
 .../dMRI/autoptx/protocols/ar_l/seed.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ar_l/stop.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ar_l/target.nii.gz |    3 +
 .../autoptx/protocols/ar_r/._exclude.nii.gz   |    3 +
 bip/data/dMRI/autoptx/protocols/ar_r/._invert |    3 +
 .../dMRI/autoptx/protocols/ar_r/._seed.nii.gz |    3 +
 .../dMRI/autoptx/protocols/ar_r/._stop.nii.gz |    3 +
 .../autoptx/protocols/ar_r/._target.nii.gz    |    3 +
 .../autoptx/protocols/ar_r/exclude.nii.gz     |    3 +
 bip/data/dMRI/autoptx/protocols/ar_r/invert   |    0
 .../dMRI/autoptx/protocols/ar_r/seed.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ar_r/stop.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ar_r/target.nii.gz |    3 +
 .../autoptx/protocols/atr_l/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/atr_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/atr_l/._stop.nii.gz     |    3 +
 .../autoptx/protocols/atr_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/atr_l/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/atr_l/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/atr_l/stop.nii.gz  |    3 +
 .../autoptx/protocols/atr_l/target.nii.gz     |    3 +
 .../autoptx/protocols/atr_r/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/atr_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/atr_r/._stop.nii.gz     |    3 +
 .../autoptx/protocols/atr_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/atr_r/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/atr_r/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/atr_r/stop.nii.gz  |    3 +
 .../autoptx/protocols/atr_r/target.nii.gz     |    3 +
 .../autoptx/protocols/cgc_l/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/cgc_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/cgc_l/._stop.nii.gz     |    3 +
 .../autoptx/protocols/cgc_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/cgc_l/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/cgc_l/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/cgc_l/stop.nii.gz  |    3 +
 .../autoptx/protocols/cgc_l/target.nii.gz     |    3 +
 .../autoptx/protocols/cgc_r/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/cgc_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/cgc_r/._stop.nii.gz     |    3 +
 .../autoptx/protocols/cgc_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/cgc_r/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/cgc_r/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/cgc_r/stop.nii.gz  |    3 +
 .../autoptx/protocols/cgc_r/target.nii.gz     |    3 +
 .../autoptx/protocols/cgh_l/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/cgh_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/cgh_l/._stop.nii.gz     |    3 +
 .../autoptx/protocols/cgh_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/cgh_l/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/cgh_l/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/cgh_l/stop.nii.gz  |    3 +
 .../autoptx/protocols/cgh_l/target.nii.gz     |    3 +
 .../autoptx/protocols/cgh_r/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/cgh_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/cgh_r/._stop.nii.gz     |    3 +
 .../autoptx/protocols/cgh_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/cgh_r/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/cgh_r/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/cgh_r/stop.nii.gz  |    3 +
 .../autoptx/protocols/cgh_r/target.nii.gz     |    3 +
 .../autoptx/protocols/cst_l/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/cst_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/cst_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/cst_l/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/cst_l/seed.nii.gz  |    3 +
 .../autoptx/protocols/cst_l/target.nii.gz     |    3 +
 .../autoptx/protocols/cst_r/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/cst_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/cst_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/cst_r/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/cst_r/seed.nii.gz  |    3 +
 .../autoptx/protocols/cst_r/target.nii.gz     |    3 +
 .../autoptx/protocols/fma/._exclude.nii.gz    |    3 +
 bip/data/dMRI/autoptx/protocols/fma/._invert  |    3 +
 .../dMRI/autoptx/protocols/fma/._seed.nii.gz  |    3 +
 .../autoptx/protocols/fma/._target.nii.gz     |    3 +
 .../dMRI/autoptx/protocols/fma/exclude.nii.gz |    3 +
 bip/data/dMRI/autoptx/protocols/fma/invert    |    0
 .../dMRI/autoptx/protocols/fma/seed.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/fma/target.nii.gz  |    3 +
 .../autoptx/protocols/fmi/._exclude.nii.gz    |    3 +
 bip/data/dMRI/autoptx/protocols/fmi/._invert  |    3 +
 .../dMRI/autoptx/protocols/fmi/._seed.nii.gz  |    3 +
 .../autoptx/protocols/fmi/._target.nii.gz     |    3 +
 .../dMRI/autoptx/protocols/fmi/exclude.nii.gz |    3 +
 bip/data/dMRI/autoptx/protocols/fmi/invert    |    0
 .../dMRI/autoptx/protocols/fmi/seed.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/fmi/target.nii.gz  |    3 +
 .../autoptx/protocols/ifo_l/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/ifo_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/ifo_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/ifo_l/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/ifo_l/seed.nii.gz  |    3 +
 .../autoptx/protocols/ifo_l/target.nii.gz     |    3 +
 .../autoptx/protocols/ifo_r/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/ifo_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/ifo_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/ifo_r/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/ifo_r/seed.nii.gz  |    3 +
 .../autoptx/protocols/ifo_r/target.nii.gz     |    3 +
 .../autoptx/protocols/ilf_l/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/ilf_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/ilf_l/._stop.nii.gz     |    3 +
 .../autoptx/protocols/ilf_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/ilf_l/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/ilf_l/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/ilf_l/stop.nii.gz  |    3 +
 .../autoptx/protocols/ilf_l/target.nii.gz     |    3 +
 .../autoptx/protocols/ilf_r/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/ilf_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/ilf_r/._stop.nii.gz     |    3 +
 .../autoptx/protocols/ilf_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/ilf_r/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/ilf_r/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/ilf_r/stop.nii.gz  |    3 +
 .../autoptx/protocols/ilf_r/target.nii.gz     |    3 +
 .../autoptx/protocols/mcp/._exclude.nii.gz    |    3 +
 bip/data/dMRI/autoptx/protocols/mcp/._invert  |    3 +
 .../dMRI/autoptx/protocols/mcp/._seed.nii.gz  |    3 +
 .../autoptx/protocols/mcp/._target.nii.gz     |    3 +
 .../dMRI/autoptx/protocols/mcp/exclude.nii.gz |    3 +
 bip/data/dMRI/autoptx/protocols/mcp/invert    |    0
 .../dMRI/autoptx/protocols/mcp/seed.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/mcp/target.nii.gz  |    3 +
 .../autoptx/protocols/ml_l/._exclude.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ml_l/._seed.nii.gz |    3 +
 .../dMRI/autoptx/protocols/ml_l/._stop.nii.gz |    3 +
 .../autoptx/protocols/ml_l/._target.nii.gz    |    3 +
 .../autoptx/protocols/ml_l/exclude.nii.gz     |    3 +
 .../dMRI/autoptx/protocols/ml_l/seed.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ml_l/stop.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ml_l/target.nii.gz |    3 +
 .../autoptx/protocols/ml_r/._exclude.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ml_r/._seed.nii.gz |    3 +
 .../dMRI/autoptx/protocols/ml_r/._stop.nii.gz |    3 +
 .../autoptx/protocols/ml_r/._target.nii.gz    |    3 +
 .../autoptx/protocols/ml_r/exclude.nii.gz     |    3 +
 .../dMRI/autoptx/protocols/ml_r/seed.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ml_r/stop.nii.gz   |    3 +
 .../dMRI/autoptx/protocols/ml_r/target.nii.gz |    3 +
 .../autoptx/protocols/ptr_l/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/ptr_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/ptr_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/ptr_l/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/ptr_l/seed.nii.gz  |    3 +
 .../autoptx/protocols/ptr_l/target.nii.gz     |    3 +
 .../autoptx/protocols/ptr_r/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/ptr_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/ptr_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/ptr_r/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/ptr_r/seed.nii.gz  |    3 +
 .../autoptx/protocols/ptr_r/target.nii.gz     |    3 +
 .../autoptx/protocols/slf_l/._exclude.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/slf_l/._invert     |    3 +
 .../autoptx/protocols/slf_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/slf_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/slf_l/exclude.nii.gz    |    3 +
 bip/data/dMRI/autoptx/protocols/slf_l/invert  |    0
 .../dMRI/autoptx/protocols/slf_l/seed.nii.gz  |    3 +
 .../autoptx/protocols/slf_l/target.nii.gz     |    3 +
 .../autoptx/protocols/slf_r/._exclude.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/slf_r/._invert     |    3 +
 .../autoptx/protocols/slf_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/slf_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/slf_r/exclude.nii.gz    |    3 +
 bip/data/dMRI/autoptx/protocols/slf_r/invert  |    0
 .../dMRI/autoptx/protocols/slf_r/seed.nii.gz  |    3 +
 .../autoptx/protocols/slf_r/target.nii.gz     |    3 +
 .../autoptx/protocols/str_l/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/str_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/str_l/._stop.nii.gz     |    3 +
 .../autoptx/protocols/str_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/str_l/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/str_l/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/str_l/stop.nii.gz  |    3 +
 .../autoptx/protocols/str_l/target.nii.gz     |    3 +
 .../autoptx/protocols/str_r/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/str_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/str_r/._stop.nii.gz     |    3 +
 .../autoptx/protocols/str_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/str_r/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/str_r/seed.nii.gz  |    3 +
 .../dMRI/autoptx/protocols/str_r/stop.nii.gz  |    3 +
 .../autoptx/protocols/str_r/target.nii.gz     |    3 +
 .../autoptx/protocols/unc_l/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/unc_l/._seed.nii.gz     |    3 +
 .../autoptx/protocols/unc_l/._target.nii.gz   |    3 +
 .../autoptx/protocols/unc_l/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/unc_l/seed.nii.gz  |    3 +
 .../autoptx/protocols/unc_l/target.nii.gz     |    3 +
 .../autoptx/protocols/unc_r/._exclude.nii.gz  |    3 +
 .../autoptx/protocols/unc_r/._seed.nii.gz     |    3 +
 .../autoptx/protocols/unc_r/._target.nii.gz   |    3 +
 .../autoptx/protocols/unc_r/exclude.nii.gz    |    3 +
 .../dMRI/autoptx/protocols/unc_r/seed.nii.gz  |    3 +
 .../autoptx/protocols/unc_r/target.nii.gz     |    3 +
 bip/data/dMRI/autoptx/struct_list.json        |    3 +
 bip/data/dMRI/b0_threshold.txt                |    3 +
 .../dMRI_reg_optimal_parameters/exampleReg    |    3 +
 .../dMRI_reg_optimal_parameters/exampleReg_2  |    3 +
 .../dMRI_reg_optimal_parameters/exampleReg_3  |    3 +
 .../dMRI_reg_optimal_parameters/oxford_s1.cnf |    3 +
 .../dMRI_reg_optimal_parameters/oxford_s2.cnf |    3 +
 .../dMRI_reg_optimal_parameters/oxford_s3.cnf |    3 +
 .../rotterdam_s1.cnf                          |    3 +
 .../rotterdam_s2.cnf                          |    3 +
 .../rotterdam_s3.cnf                          |    3 +
 bip/data/fMRI_fsf/designF.txt                 |    3 +
 bip/data/fMRI_fsf/designS.txt                 |    3 +
 bip/data/fMRI_fsf/design_ICA_nonSmoothed.fsf  |    3 +
 bip/data/fMRI_fsf/design_TASK.fsf             |    3 +
 bip/data/fix/UKBB_model.pyfix_model           |    3 +
 bip/data/fix/UKBB_model_2.pyfix_model         |    3 +
 bip/data/fnirt/bb_fnirt.cnf                   |    3 +
 bip/data/netmats/groupMask1.nii.gz            |    3 +
 bip/data/netmats/groupMask2.nii.gz            |    3 +
 bip/data/netmats/groupMask5.nii.gz            |    3 +
 bip/data/netmats/groupMask5a.nii.gz           |    3 +
 bip/data/netmats/melodic_IC_100.nii.gz        |    3 +
 bip/data/netmats/melodic_IC_25.nii.gz         |    3 +
 bip/data/swMRI/hann_filter.txt                |    3 +
 bip/ext_wrappers/__init__.py                  |   14 +
 bip/ext_wrappers/extwrapperutils.py           | 1297 +++++++++++++++++
 bip/ext_wrappers/freesurfer.py                |   31 +
 bip/main.py                                   |  356 +++++
 bip/pipelines/__init__.py                     |    0
 bip/pipelines/dMRI_diff/__init__.py           |    0
 bip/pipelines/dMRI_diff/dMRI_diff.py          |   52 +
 bip/pipelines/dMRI_diff/diff_autoptx.py       |  122 ++
 bip/pipelines/dMRI_diff/diff_bedpostx.py      |   85 ++
 bip/pipelines/dMRI_diff/diff_dtifit.py        |   87 ++
 bip/pipelines/dMRI_diff/diff_eddy.py          |   91 ++
 bip/pipelines/dMRI_diff/diff_noddi.py         |   87 ++
 bip/pipelines/dMRI_diff/diff_tbss.py          |  161 ++
 bip/pipelines/dMRI_fieldmap/__init__.py       |    0
 bip/pipelines/dMRI_fieldmap/dMRI_fieldmap.py  |   35 +
 .../dMRI_fieldmap/fieldmap_post_topup.py      |  148 ++
 .../dMRI_fieldmap/fieldmap_pre_topup.py       |  202 +++
 bip/pipelines/dMRI_fieldmap/fieldmap_topup.py |   35 +
 bip/pipelines/fMRI_rest/__init__.py           |    0
 bip/pipelines/fMRI_rest/fMRI_rest.py          |   35 +
 bip/pipelines/fMRI_rest/rfMRI_fix.py          |   98 ++
 bip/pipelines/fMRI_rest/rfMRI_melodic.py      |   48 +
 bip/pipelines/fMRI_rest/rfMRI_netmats.py      |   52 +
 bip/pipelines/fMRI_rest/rfMRI_netmats_fnc.py  |  139 ++
 bip/pipelines/fMRI_rest/rfMRI_prepare.py      |  115 ++
 bip/pipelines/fMRI_task/__init__.py           |    0
 bip/pipelines/fMRI_task/fMRI_task.py          |   30 +
 bip/pipelines/fMRI_task/tfMRI_feat.py         |   26 +
 bip/pipelines/fMRI_task/tfMRI_prepare.py      |  115 ++
 bip/pipelines/struct_T1/T1_QC_CNR_corners.py  |   89 ++
 bip/pipelines/struct_T1/T1_QC_CNR_eyes.py     |  109 ++
 bip/pipelines/struct_T1/T1_QC_COG.py          |   50 +
 bip/pipelines/struct_T1/T1_brain_extract.py   |  103 ++
 bip/pipelines/struct_T1/T1_defacing.py        |   66 +
 bip/pipelines/struct_T1/T1_fast.py            |   44 +
 bip/pipelines/struct_T1/T1_first.py           |   42 +
 bip/pipelines/struct_T1/T1_gdc.py             |   36 +
 bip/pipelines/struct_T1/T1_sienax.py          |  145 ++
 bip/pipelines/struct_T1/__init__.py           |    0
 bip/pipelines/struct_T1/struct_T1.py          |   53 +
 .../struct_T2_FLAIR/T2_FLAIR_apply_bfc.py     |   38 +
 .../struct_T2_FLAIR/T2_FLAIR_brain_extract.py |   91 ++
 .../struct_T2_FLAIR/T2_FLAIR_defacing.py      |   67 +
 bip/pipelines/struct_T2_FLAIR/T2_FLAIR_gdc.py |   38 +
 bip/pipelines/struct_T2_FLAIR/__init__.py     |    0
 .../struct_T2_FLAIR/struct_T2_FLAIR.py        |   37 +
 bip/pipelines/struct_asl/asl_get_IDPs.py      |   72 +
 bip/pipelines/struct_asl/asl_proc.py          |  167 +++
 bip/pipelines/struct_asl/struct_asl.py        |   29 +
 bip/pipelines/struct_swMRI/struct_swMRI.py    |   26 +
 bip/pipelines/struct_swMRI/swMRI_gdc.py       |   36 +
 bip/pipelines/struct_swMRI/swMRI_proc.py      |  121 ++
 bip/pipelines/struct_swMRI/swMRI_proc_fnc.py  |  121 ++
 bip/utils.py                                  |  116 ++
 init_vars                                     |   18 +
 requirements.txt                              |   12 +
 setup.py                                      |   11 +
 413 files changed, 6465 insertions(+)
 create mode 100644 MANIFEST.in
 create mode 100644 README.md
 create mode 100644 bip/commands/__init__.py
 create mode 100755 bip/commands/bb_get_b0s.py
 create mode 100755 bip/commands/bb_read_json_field.py
 create mode 100755 bip/commands/get_dwell_time.py
 create mode 100644 bip/data/FileTree.tree
 create mode 100644 bip/data/GDC/UKB.txt
 create mode 100644 bip/data/MNI/MNI152_T1_1mm_BigFoV_facemask.nii.gz
 create mode 100755 bip/data/MNI/MNI152_T1_1mm_brain_mask.nii.gz
 create mode 100644 bip/data/MNI/MNI152_T1_1mm_brain_mask_dil_GD7.nii.gz
 create mode 100755 bip/data/MNI/MNI152_T1_1mm_left_eye_dil.nii.gz
 create mode 100755 bip/data/MNI/MNI152_T1_1mm_right_eye_dil.nii.gz
 create mode 100755 bip/data/MNI/MNI152_T1_2mm_brain_mask_bin.nii.gz
 create mode 100644 bip/data/MNI/MNI_to_MNI_BigFoV_facemask.mat
 create mode 100755 bip/data/asl/asl_format.txt
 create mode 100755 bip/data/asl/ukb_rois/._HO_L_Cerebral_WM_thr80.nii.gz
 create mode 100755 bip/data/asl/ukb_rois/._HO_R_Cerebral_WM_thr80.nii.gz
 create mode 100755 bip/data/asl/ukb_rois/._MNI_seg_max_prob_masked_RandL.nii.gz
 create mode 100755 bip/data/asl/ukb_rois/._MostProbableSupplier_sm3.nii.gz
 create mode 100755 bip/data/asl/ukb_rois/._VesMasks_sm3Thr80.nii.gz
 create mode 100755 bip/data/asl/ukb_rois/._create_biobank_ASL_ROIs.sh
 create mode 100755 bip/data/asl/ukb_rois/HO_L_Cerebral_WM_thr80.nii.gz
 create mode 100755 bip/data/asl/ukb_rois/HO_L_Cerebral_WM_thr80.txt
 create mode 100755 bip/data/asl/ukb_rois/HO_R_Cerebral_WM_thr80.nii.gz
 create mode 100755 bip/data/asl/ukb_rois/HO_R_Cerebral_WM_thr80.txt
 create mode 100755 bip/data/asl/ukb_rois/MNI_seg_max_prob_masked_RandL.nii.gz
 create mode 100755 bip/data/asl/ukb_rois/MNI_seg_max_prob_masked_RandL.txt
 create mode 100755 bip/data/asl/ukb_rois/VascularTerritories_ero.nii.gz
 create mode 100755 bip/data/asl/ukb_rois/VascularTerritories_ero.txt
 create mode 100755 bip/data/asl/ukb_rois/create_biobank_ASL_ROIs.sh
 create mode 100644 bip/data/config/ideal_config_sizes.json
 create mode 100755 bip/data/config/ideal_config_sizes_CNS_KCL.json
 create mode 100755 bip/data/config/ideal_config_sizes_CNS_LIV.json
 create mode 100755 bip/data/config/ideal_config_sizes_UKBB.json
 create mode 100755 bip/data/config/naming_pattern_CNS_KCL.json
 create mode 100755 bip/data/config/naming_pattern_CNS_LIV.json
 create mode 100755 bip/data/config/naming_pattern_UKBB.json
 create mode 100755 bip/data/dMRI/autoptx/luts/._c1.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c10.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c11.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c12.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c13.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c14.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c15.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c16.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c17.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c18.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c19.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c2.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c20.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c21.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c22.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c23.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c24.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c25.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c26.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c27.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c28.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c29.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c3.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c30.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c4.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c5.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c6.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c7.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c8.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/._c9.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c1.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c10.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c11.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c12.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c13.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c14.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c15.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c16.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c17.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c18.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c19.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c2.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c20.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c21.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c22.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c23.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c24.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c25.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c26.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c27.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c28.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c29.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c3.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c30.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c4.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c5.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c6.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c7.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c8.lut
 create mode 100755 bip/data/dMRI/autoptx/luts/c9.lut
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ar_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ar_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._atr_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._atr_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._cgc_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._cgc_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._cgh_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._cgh_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._cst_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._cst_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._fma
 create mode 100755 bip/data/dMRI/autoptx/protocols/._fmi
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ifo_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ifo_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ilf_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ilf_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._mcp
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ml_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ml_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ptr_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._ptr_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._slf_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._slf_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._str_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._str_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/._unc_l
 create mode 100755 bip/data/dMRI/autoptx/protocols/._unc_r
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/._invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/._invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ar_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_l/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_l/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_r/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_r/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/atr_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_l/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_l/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_r/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_r/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgc_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_l/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_l/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_r/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_r/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cgh_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/cst_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fma/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fma/._invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/fma/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fma/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fma/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fma/invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/fma/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fma/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fmi/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fmi/._invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/fmi/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fmi/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fmi/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fmi/invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/fmi/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/fmi/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ifo_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_l/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_l/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_r/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_r/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ilf_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/mcp/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/mcp/._invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/mcp/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/mcp/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/mcp/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/mcp/invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/mcp/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/mcp/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_l/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_l/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_r/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_r/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ml_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/ptr_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_l/._invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_l/invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_r/._invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_r/invert
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/slf_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_l/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_l/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_r/._stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_r/stop.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/str_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_l/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_l/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_l/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_l/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_l/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_l/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_r/._exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_r/._seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_r/._target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_r/exclude.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_r/seed.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/protocols/unc_r/target.nii.gz
 create mode 100755 bip/data/dMRI/autoptx/struct_list.json
 create mode 100755 bip/data/dMRI/b0_threshold.txt
 create mode 100755 bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg
 create mode 100755 bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg_2
 create mode 100755 bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg_3
 create mode 100755 bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s1.cnf
 create mode 100755 bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s2.cnf
 create mode 100755 bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s3.cnf
 create mode 100755 bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s1.cnf
 create mode 100755 bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s2.cnf
 create mode 100755 bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s3.cnf
 create mode 100755 bip/data/fMRI_fsf/designF.txt
 create mode 100755 bip/data/fMRI_fsf/designS.txt
 create mode 100755 bip/data/fMRI_fsf/design_ICA_nonSmoothed.fsf
 create mode 100755 bip/data/fMRI_fsf/design_TASK.fsf
 create mode 100644 bip/data/fix/UKBB_model.pyfix_model
 create mode 100644 bip/data/fix/UKBB_model_2.pyfix_model
 create mode 100755 bip/data/fnirt/bb_fnirt.cnf
 create mode 100644 bip/data/netmats/groupMask1.nii.gz
 create mode 100644 bip/data/netmats/groupMask2.nii.gz
 create mode 100644 bip/data/netmats/groupMask5.nii.gz
 create mode 100644 bip/data/netmats/groupMask5a.nii.gz
 create mode 100644 bip/data/netmats/melodic_IC_100.nii.gz
 create mode 100644 bip/data/netmats/melodic_IC_25.nii.gz
 create mode 100644 bip/data/swMRI/hann_filter.txt
 create mode 100755 bip/ext_wrappers/__init__.py
 create mode 100644 bip/ext_wrappers/extwrapperutils.py
 create mode 100644 bip/ext_wrappers/freesurfer.py
 create mode 100755 bip/main.py
 create mode 100644 bip/pipelines/__init__.py
 create mode 100644 bip/pipelines/dMRI_diff/__init__.py
 create mode 100755 bip/pipelines/dMRI_diff/dMRI_diff.py
 create mode 100755 bip/pipelines/dMRI_diff/diff_autoptx.py
 create mode 100755 bip/pipelines/dMRI_diff/diff_bedpostx.py
 create mode 100755 bip/pipelines/dMRI_diff/diff_dtifit.py
 create mode 100755 bip/pipelines/dMRI_diff/diff_eddy.py
 create mode 100755 bip/pipelines/dMRI_diff/diff_noddi.py
 create mode 100755 bip/pipelines/dMRI_diff/diff_tbss.py
 create mode 100644 bip/pipelines/dMRI_fieldmap/__init__.py
 create mode 100644 bip/pipelines/dMRI_fieldmap/dMRI_fieldmap.py
 create mode 100755 bip/pipelines/dMRI_fieldmap/fieldmap_post_topup.py
 create mode 100755 bip/pipelines/dMRI_fieldmap/fieldmap_pre_topup.py
 create mode 100755 bip/pipelines/dMRI_fieldmap/fieldmap_topup.py
 create mode 100755 bip/pipelines/fMRI_rest/__init__.py
 create mode 100755 bip/pipelines/fMRI_rest/fMRI_rest.py
 create mode 100755 bip/pipelines/fMRI_rest/rfMRI_fix.py
 create mode 100755 bip/pipelines/fMRI_rest/rfMRI_melodic.py
 create mode 100755 bip/pipelines/fMRI_rest/rfMRI_netmats.py
 create mode 100644 bip/pipelines/fMRI_rest/rfMRI_netmats_fnc.py
 create mode 100755 bip/pipelines/fMRI_rest/rfMRI_prepare.py
 create mode 100755 bip/pipelines/fMRI_task/__init__.py
 create mode 100755 bip/pipelines/fMRI_task/fMRI_task.py
 create mode 100755 bip/pipelines/fMRI_task/tfMRI_feat.py
 create mode 100755 bip/pipelines/fMRI_task/tfMRI_prepare.py
 create mode 100755 bip/pipelines/struct_T1/T1_QC_CNR_corners.py
 create mode 100755 bip/pipelines/struct_T1/T1_QC_CNR_eyes.py
 create mode 100755 bip/pipelines/struct_T1/T1_QC_COG.py
 create mode 100755 bip/pipelines/struct_T1/T1_brain_extract.py
 create mode 100755 bip/pipelines/struct_T1/T1_defacing.py
 create mode 100755 bip/pipelines/struct_T1/T1_fast.py
 create mode 100755 bip/pipelines/struct_T1/T1_first.py
 create mode 100755 bip/pipelines/struct_T1/T1_gdc.py
 create mode 100755 bip/pipelines/struct_T1/T1_sienax.py
 create mode 100755 bip/pipelines/struct_T1/__init__.py
 create mode 100755 bip/pipelines/struct_T1/struct_T1.py
 create mode 100755 bip/pipelines/struct_T2_FLAIR/T2_FLAIR_apply_bfc.py
 create mode 100755 bip/pipelines/struct_T2_FLAIR/T2_FLAIR_brain_extract.py
 create mode 100755 bip/pipelines/struct_T2_FLAIR/T2_FLAIR_defacing.py
 create mode 100755 bip/pipelines/struct_T2_FLAIR/T2_FLAIR_gdc.py
 create mode 100644 bip/pipelines/struct_T2_FLAIR/__init__.py
 create mode 100755 bip/pipelines/struct_T2_FLAIR/struct_T2_FLAIR.py
 create mode 100755 bip/pipelines/struct_asl/asl_get_IDPs.py
 create mode 100755 bip/pipelines/struct_asl/asl_proc.py
 create mode 100755 bip/pipelines/struct_asl/struct_asl.py
 create mode 100755 bip/pipelines/struct_swMRI/struct_swMRI.py
 create mode 100755 bip/pipelines/struct_swMRI/swMRI_gdc.py
 create mode 100755 bip/pipelines/struct_swMRI/swMRI_proc.py
 create mode 100755 bip/pipelines/struct_swMRI/swMRI_proc_fnc.py
 create mode 100755 bip/utils.py
 create mode 100755 init_vars
 create mode 100644 requirements.txt
 create mode 100644 setup.py

diff --git a/.gitattributes b/.gitattributes
index e793abd..ca63599 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,6 @@
+*.nii.gz filter=lfs diff=lfs merge=lfs -text
+*.pyfix_model filter=lfs diff=lfs merge=lfs -text
+*.lut filter=lfs diff=lfs merge=lfs -text
+*.zip filter=lfs diff=lfs merge=lfs -text
+bip/data/* filter=lfs diff=lfs merge=lfs -text
 bip/data/** filter=lfs diff=lfs merge=lfs -text
diff --git a/.gitignore b/.gitignore
index 63e6c93..3fe5323 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,8 @@ __pycache__/
 # Distribution / packaging
 .Python
 build/
+obsolete/
+structure
 develop-eggs/
 dist/
 downloads/
@@ -22,10 +24,14 @@ parts/
 sdist/
 var/
 wheels/
+external/
+bip/data/GDC/bb_GDC_*
+bip/data/dMRI/kernels.zip*
 *.egg-info/
 .installed.cfg
 *.egg
 .*.py
+fsl_sub.yml
 
 # PyInstaller
 #  Usually these files are written by a python script from a template
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..e69de29
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..cff6369
--- /dev/null
+++ b/README.md
@@ -0,0 +1,12 @@
+-------------------------------------------
+BRAIN IMAGING PIPELINE
+Fidel Alfaro Almagro, WIN-FMRIB
+June, 2022
+-------------------------------------------
+Automated tool
+
+Installation
+------------
+If you want to install everythong that is needed from scratch, run:
+```cd /path-to-lib/install_dir/
+python setup.py install```
diff --git a/bip/commands/__init__.py b/bip/commands/__init__.py
new file mode 100644
index 0000000..4cbd17a
--- /dev/null
+++ b/bip/commands/__init__.py
@@ -0,0 +1,13 @@
+import shutil
+from fsl.wrappers.wrapperutils import cmdwrapper
+
+installed_sienax = shutil.which('bb_sienax')
+
+if installed_sienax:
+    @cmdwrapper
+    def bb_sienax(input, output=None, **kwargs):
+        return ['bb_sienax', input, output]
+else:
+    def bb_sienax(input, output=None, **kwargs):
+        from . import sienax
+        sienax.bb_sienax(input, output)
diff --git a/bip/commands/bb_get_b0s.py b/bip/commands/bb_get_b0s.py
new file mode 100755
index 0000000..0d52e45
--- /dev/null
+++ b/bip/commands/bb_get_b0s.py
@@ -0,0 +1,103 @@
+#!/bin/env python
+'''
+ Authors: Fidel Alfaro Almagro
+ FMRIB, Oxford University
+ $01-May-2014 11:44:20$
+ Version $1.0
+ ProjectDir =
+ '''
+import sys
+import argparse
+import os.path
+from fsl import wrappers
+
+class MyParser(argparse.ArgumentParser):
+    def error(self, message):
+        sys.stderr.write('error: %s\n' % message)
+        self.print_help()
+        sys.exit(2)
+
+class Usage(Exception):
+    def __init__(self, msg):
+        self.msg = msg
+
+def bb_get_b0s(inputFile, bvalFilename, outputFile, outputIndFile,
+               desiredNumber, B0limit=100):
+    with open(bvalFilename, 'r', encoding="utf-8") as f:
+        line = f.readlines()
+
+    line = line[0].split()
+    indices = [i for i, x in enumerate(line) if int(x) < B0limit]
+
+    with open (outputIndFile ,'wt', encoding="utf-8") as f:
+        f.write(" ".join([str(x) for x in indices]))
+
+    indices = indices[0:desiredNumber]
+
+    wrappers.fslselectvols(src=inputFile, out=outputFile, vols=indices)
+
+
+def main():
+    parser = MyParser(description='UKB tool to get a B0 of a set of B0 images')
+    parser.add_argument('-i', dest="inputFile", type=str, nargs=1,
+                        help='Input File')
+    parser.add_argument('-o', dest="outputFile", type=str, nargs=1,
+                        help='Output File')
+    parser.add_argument('-n', dest='desiredNumber',type=int, nargs=1,
+                        help='Desired number of B0s from file. If none specified, all will be selected')
+    parser.add_argument('-l', dest='B0limit',type=int, default=[100], nargs=1,
+                        help='Limit B0 value. (Default 100)')
+    parser.add_argument('-a', dest='bvalFilename',type=str, default='', nargs=1,
+                        help='bval file. (Default: Same basename as the input file)')
+
+    argsa = parser.parse_args()
+
+    if argsa.inputFile is None:
+        parser.print_help()
+        sys.exit()
+
+    if argsa.outputFile is None:
+        parser.print_help()
+        sys.exit()
+
+    inputFile  = argsa.inputFile[0]
+    outputFile = argsa.outputFile[0]
+
+    baseDir = os.path.dirname(inputFile)
+    outDir  = os.path.dirname(outputFile)
+    baseN   = os.path.basename(inputFile).split('.')[0]
+    outN    = os.path.basename(outputFile).split('.')[0]
+
+    if argsa.bvalFilename == '':
+        bvalFilename = baseDir + "/" + baseN+".bval"
+    else:
+        bvalFilename = argsa.bvalFilename[0]
+
+
+    with open(bvalFilename, 'r', encoding="utf-8") as f:
+        line = f.readlines()
+
+    line = line[0].split()
+    B0limit = int(argsa.B0limit[0])
+    indices = [i for i, x in enumerate(line) if int(x) < B0limit]
+
+    if argsa.desiredNumber is None:
+        desiredNumber = len(indices)
+    else:
+        desiredNumber = argsa.desiredNumber[0]
+
+    if desiredNumber > len(indices):
+        print(("There are only %i B0. It is not possible to have %i" % (len(indices), desiredNumber)))
+        sys.exit()
+
+    if desiredNumber <= 0:
+        print("The number of B0 must be positive")
+        sys.exit()
+
+    outputIndFile = outDir + '/' + outN +'_indices.txt'
+
+    bb_get_b0s(inputFile, bvalFilename, outputFile, outputIndFile,
+               desiredNumber, B0limit)
+
+if __name__ == "__main__":
+    main()
diff --git a/bip/commands/bb_read_json_field.py b/bip/commands/bb_read_json_field.py
new file mode 100755
index 0000000..161b458
--- /dev/null
+++ b/bip/commands/bb_read_json_field.py
@@ -0,0 +1,77 @@
+#!/bin/env python
+'''
+ Authors: Fidel Alfaro Almagro
+ FMRIB, Oxford University
+ $15-Dec-2014 10:41:10$
+ Version $1.0
+ ProjectDir =
+ '''
+import sys
+import json
+import numbers
+import argparse
+
+
+class MyParser(argparse.ArgumentParser):
+    def error(self, message):
+        sys.stderr.write('error: %s\n' % message)
+        self.print_help()
+        sys.exit(2)
+
+class Usage(Exception):
+    def __init__(self, msg):
+        self.msg = msg
+
+def bb_read_json_field(fileName, fieldName, rounding=0, multFactor=1):
+
+    result=[]
+    with open(fileName, 'r', encoding="utf-8") as data_file:
+        data=json.load(data_file)
+
+    if fieldName in data.keys():
+        value=data[fieldName]
+        if isinstance(value, numbers.Number):
+            if rounding !=0:
+                result=round(data[fieldName]*multFactor,rounding)
+            else:
+                result=data[fieldName]*multFactor
+        else:
+            result=str(data[fieldName])
+
+    return result
+
+
+def main():
+
+    parser = MyParser(description='BioBank Dicom Header Reader')
+    parser.add_argument('-F', dest="file", type=str, nargs=1,
+                        help='Read json file')
+    parser.add_argument('-f', dest="field", type=str, nargs=1, default="NONE",
+                        help='Read field')
+    parser.add_argument('-r', dest="rounding", type=int, default=0,
+                        help='Round the value the selected number of decimals (Default: No rounding')
+    parser.add_argument('-m', dest="multFactor",  type=float, default=1,
+                help='Multiplication factor for the selected value (Default 1)')
+
+    argsa = parser.parse_args()
+
+    if argsa.file is None:
+        parser.print_help()
+        sys.exit()
+
+    if argsa.field is None:
+        parser.print_help()
+        sys.exit()
+
+    rounding=argsa.rounding
+    multFactor=argsa.multFactor
+
+    fileName = argsa.file[0]
+    fieldName = argsa.field[0]
+
+    res=bb_read_json_field(fileName, fieldName, rounding, multFactor)
+
+    print(str(res))
+
+if __name__ == "__main__":
+    main()
diff --git a/bip/commands/get_dwell_time.py b/bip/commands/get_dwell_time.py
new file mode 100755
index 0000000..9b5edcd
--- /dev/null
+++ b/bip/commands/get_dwell_time.py
@@ -0,0 +1,28 @@
+import os
+import nibabel as nib
+from bip.commands.bb_read_json_field import bb_read_json_field
+
+def get_dt(img, json):
+    if os.path.exists(json):
+        t = bb_read_json_field(fileName=json, fieldName="EffectiveEchoSpacing",
+                             rounding=4,  multFactor=1000)
+        if t in ["[]", ""]:
+            t = bb_read_json_field(fileName=json,
+                                   fieldName="EstimatedEffectiveEchoSpacing",
+                                   rounding=4,  multFactor=1000)
+        return t
+
+    im = nib.load(img)
+    descrip = str(im.header['descrip'])
+
+    fields = descrip.split(";")
+
+    for field in fields:
+        t = field.split("=")
+
+        fieldName  = t[0]
+        fieldValue = t[1]
+
+        if fieldName == "dwell":
+            return fieldValue
+    return 0
diff --git a/bip/data/FileTree.tree b/bip/data/FileTree.tree
new file mode 100644
index 0000000..a698b9d
--- /dev/null
+++ b/bip/data/FileTree.tree
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:52f28bc678b0b136720d8eb04d6f8e4d56840e08de11c12fad48330e59418e63
+size 19808
diff --git a/bip/data/GDC/UKB.txt b/bip/data/GDC/UKB.txt
new file mode 100644
index 0000000..45367c8
--- /dev/null
+++ b/bip/data/GDC/UKB.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:636a635e4a5c1c6812a3f6f25f94fcfa3bd1df28a867670ce3de45a4366cc1de
+size 9533
diff --git a/bip/data/MNI/MNI152_T1_1mm_BigFoV_facemask.nii.gz b/bip/data/MNI/MNI152_T1_1mm_BigFoV_facemask.nii.gz
new file mode 100644
index 0000000..7e5d30c
--- /dev/null
+++ b/bip/data/MNI/MNI152_T1_1mm_BigFoV_facemask.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:585f51705db68122e622f5f49bef18ad0ebe014ff27bb843a4f6ea6794eae4a4
+size 234059
diff --git a/bip/data/MNI/MNI152_T1_1mm_brain_mask.nii.gz b/bip/data/MNI/MNI152_T1_1mm_brain_mask.nii.gz
new file mode 100755
index 0000000..a957e96
--- /dev/null
+++ b/bip/data/MNI/MNI152_T1_1mm_brain_mask.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4e599d7d0bd843251bb24391b0ddc636b73216f12a9ccc017a34cb0d17e287e4
+size 125920
diff --git a/bip/data/MNI/MNI152_T1_1mm_brain_mask_dil_GD7.nii.gz b/bip/data/MNI/MNI152_T1_1mm_brain_mask_dil_GD7.nii.gz
new file mode 100644
index 0000000..3ed103e
--- /dev/null
+++ b/bip/data/MNI/MNI152_T1_1mm_brain_mask_dil_GD7.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1365d6747d6878501f97551ce44f143f1662b9dce3ab3f362243e5a456c5725d
+size 130104
diff --git a/bip/data/MNI/MNI152_T1_1mm_left_eye_dil.nii.gz b/bip/data/MNI/MNI152_T1_1mm_left_eye_dil.nii.gz
new file mode 100755
index 0000000..72c4181
--- /dev/null
+++ b/bip/data/MNI/MNI152_T1_1mm_left_eye_dil.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:983fd02c8234c4d6ab8fcd272da30b3b327234b884e6d920726b844452e13634
+size 29692
diff --git a/bip/data/MNI/MNI152_T1_1mm_right_eye_dil.nii.gz b/bip/data/MNI/MNI152_T1_1mm_right_eye_dil.nii.gz
new file mode 100755
index 0000000..ff8ff07
--- /dev/null
+++ b/bip/data/MNI/MNI152_T1_1mm_right_eye_dil.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f60c0488df754f5cff7facfe3ccfe52038a381ad9b46c148b6100d87f5e595de
+size 29751
diff --git a/bip/data/MNI/MNI152_T1_2mm_brain_mask_bin.nii.gz b/bip/data/MNI/MNI152_T1_2mm_brain_mask_bin.nii.gz
new file mode 100755
index 0000000..7d64307
--- /dev/null
+++ b/bip/data/MNI/MNI152_T1_2mm_brain_mask_bin.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:df7bef6bcf9edc78f217413e3cc1e63d56efb9a25a54b18dcf8e86e63f04c82c
+size 11492
diff --git a/bip/data/MNI/MNI_to_MNI_BigFoV_facemask.mat b/bip/data/MNI/MNI_to_MNI_BigFoV_facemask.mat
new file mode 100644
index 0000000..628e3d0
--- /dev/null
+++ b/bip/data/MNI/MNI_to_MNI_BigFoV_facemask.mat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aa99e49fd9c6776f9c917674715c115c527b7e8c7fcef69458b9fd89bad69868
+size 36
diff --git a/bip/data/asl/asl_format.txt b/bip/data/asl/asl_format.txt
new file mode 100755
index 0000000..8793903
--- /dev/null
+++ b/bip/data/asl/asl_format.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a4492907e2292356cfbe0c446374c835da7ca40ccd4055903df16e09cd872f78
+size 2014
diff --git a/bip/data/asl/ukb_rois/._HO_L_Cerebral_WM_thr80.nii.gz b/bip/data/asl/ukb_rois/._HO_L_Cerebral_WM_thr80.nii.gz
new file mode 100755
index 0000000..1c826ea
--- /dev/null
+++ b/bip/data/asl/ukb_rois/._HO_L_Cerebral_WM_thr80.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dcc55e3f8a58b6710ce968d060f59827bc6500dafa42e8668baefc4d381e0436
+size 2257
diff --git a/bip/data/asl/ukb_rois/._HO_R_Cerebral_WM_thr80.nii.gz b/bip/data/asl/ukb_rois/._HO_R_Cerebral_WM_thr80.nii.gz
new file mode 100755
index 0000000..5f911e8
--- /dev/null
+++ b/bip/data/asl/ukb_rois/._HO_R_Cerebral_WM_thr80.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:37d571003fddc5e052c99b2be835e679bec48ff731d37e3ba16fa9f94328bff6
+size 2255
diff --git a/bip/data/asl/ukb_rois/._MNI_seg_max_prob_masked_RandL.nii.gz b/bip/data/asl/ukb_rois/._MNI_seg_max_prob_masked_RandL.nii.gz
new file mode 100755
index 0000000..a3f961f
--- /dev/null
+++ b/bip/data/asl/ukb_rois/._MNI_seg_max_prob_masked_RandL.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cd0658eced8124ef8de90c4e2061ecadd37bdfafdd3d4edfaf295625fc08db16
+size 2257
diff --git a/bip/data/asl/ukb_rois/._MostProbableSupplier_sm3.nii.gz b/bip/data/asl/ukb_rois/._MostProbableSupplier_sm3.nii.gz
new file mode 100755
index 0000000..d685ab0
--- /dev/null
+++ b/bip/data/asl/ukb_rois/._MostProbableSupplier_sm3.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0c571f0251c68bc7dfcc25c7bcff2cac6c59f57a94a1ad11d6fff0c49ccac476
+size 2257
diff --git a/bip/data/asl/ukb_rois/._VesMasks_sm3Thr80.nii.gz b/bip/data/asl/ukb_rois/._VesMasks_sm3Thr80.nii.gz
new file mode 100755
index 0000000..11a5d8e
--- /dev/null
+++ b/bip/data/asl/ukb_rois/._VesMasks_sm3Thr80.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3a2a0e7b56c0b5416214a7c1d61753d05550ffea85a6d656c27bd5bf2914e79a
+size 2255
diff --git a/bip/data/asl/ukb_rois/._create_biobank_ASL_ROIs.sh b/bip/data/asl/ukb_rois/._create_biobank_ASL_ROIs.sh
new file mode 100755
index 0000000..18396b1
--- /dev/null
+++ b/bip/data/asl/ukb_rois/._create_biobank_ASL_ROIs.sh
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6f0250503831376372d6f38f206809712dc7b003281013c098c0d74e08709697
+size 2255
diff --git a/bip/data/asl/ukb_rois/HO_L_Cerebral_WM_thr80.nii.gz b/bip/data/asl/ukb_rois/HO_L_Cerebral_WM_thr80.nii.gz
new file mode 100755
index 0000000..8aba077
--- /dev/null
+++ b/bip/data/asl/ukb_rois/HO_L_Cerebral_WM_thr80.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7e2ae9ea1ef3eade4f785a586b0e264dc2974e9bc6d4bd17838b3f477429184c
+size 9641
diff --git a/bip/data/asl/ukb_rois/HO_L_Cerebral_WM_thr80.txt b/bip/data/asl/ukb_rois/HO_L_Cerebral_WM_thr80.txt
new file mode 100755
index 0000000..625bde2
--- /dev/null
+++ b/bip/data/asl/ukb_rois/HO_L_Cerebral_WM_thr80.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8dfc3e5eae87ebd06cb363c4ffa7da1c50f2e8d5f9c3ad6e782c42b9e38a29e0
+size 33
diff --git a/bip/data/asl/ukb_rois/HO_R_Cerebral_WM_thr80.nii.gz b/bip/data/asl/ukb_rois/HO_R_Cerebral_WM_thr80.nii.gz
new file mode 100755
index 0000000..9444a36
--- /dev/null
+++ b/bip/data/asl/ukb_rois/HO_R_Cerebral_WM_thr80.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:72d4b53129d286f5cb96a6625a6d1ba05517752f9d941b2ae811e5db57e175af
+size 9538
diff --git a/bip/data/asl/ukb_rois/HO_R_Cerebral_WM_thr80.txt b/bip/data/asl/ukb_rois/HO_R_Cerebral_WM_thr80.txt
new file mode 100755
index 0000000..dbd54e6
--- /dev/null
+++ b/bip/data/asl/ukb_rois/HO_R_Cerebral_WM_thr80.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:acbeefef069316bea9cdd855099491dce0e2dc5567c5e6a4fc724b7281d304de
+size 34
diff --git a/bip/data/asl/ukb_rois/MNI_seg_max_prob_masked_RandL.nii.gz b/bip/data/asl/ukb_rois/MNI_seg_max_prob_masked_RandL.nii.gz
new file mode 100755
index 0000000..6eb801b
--- /dev/null
+++ b/bip/data/asl/ukb_rois/MNI_seg_max_prob_masked_RandL.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a5736bf9ded3528f612825d56e6b3782cb1a038f0c460eb9a4588e7937b3a62e
+size 44264
diff --git a/bip/data/asl/ukb_rois/MNI_seg_max_prob_masked_RandL.txt b/bip/data/asl/ukb_rois/MNI_seg_max_prob_masked_RandL.txt
new file mode 100755
index 0000000..915feb5
--- /dev/null
+++ b/bip/data/asl/ukb_rois/MNI_seg_max_prob_masked_RandL.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4ca01c9abc3839cf000a127f8ae5e254669b32e6e55ec536892c2cc62b18ec2e
+size 297
diff --git a/bip/data/asl/ukb_rois/VascularTerritories_ero.nii.gz b/bip/data/asl/ukb_rois/VascularTerritories_ero.nii.gz
new file mode 100755
index 0000000..1b5ff3e
--- /dev/null
+++ b/bip/data/asl/ukb_rois/VascularTerritories_ero.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a4626feabdda2e7ef9f4ed204465e3d1dc5382c5965dc4705e37d9afc8542536
+size 35063
diff --git a/bip/data/asl/ukb_rois/VascularTerritories_ero.txt b/bip/data/asl/ukb_rois/VascularTerritories_ero.txt
new file mode 100755
index 0000000..e853e8d
--- /dev/null
+++ b/bip/data/asl/ukb_rois/VascularTerritories_ero.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d402ef625fd1bd90d08ff20e36125144c046a692789cc9132845c7ea780c8373
+size 17
diff --git a/bip/data/asl/ukb_rois/create_biobank_ASL_ROIs.sh b/bip/data/asl/ukb_rois/create_biobank_ASL_ROIs.sh
new file mode 100755
index 0000000..91fa2ed
--- /dev/null
+++ b/bip/data/asl/ukb_rois/create_biobank_ASL_ROIs.sh
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f96e50fba8f0f47cf56d7d1c6e2156c00bf6e9b2939087b418e093ddd1807690
+size 3097
diff --git a/bip/data/config/ideal_config_sizes.json b/bip/data/config/ideal_config_sizes.json
new file mode 100644
index 0000000..52f94f7
--- /dev/null
+++ b/bip/data/config/ideal_config_sizes.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2c062adcefd96d5f3b3ed65d911a2138d82050b3caf2071d80e45bbf6a455a8b
+size 8136
diff --git a/bip/data/config/ideal_config_sizes_CNS_KCL.json b/bip/data/config/ideal_config_sizes_CNS_KCL.json
new file mode 100755
index 0000000..47cb851
--- /dev/null
+++ b/bip/data/config/ideal_config_sizes_CNS_KCL.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:582d7c2e1fbe6a8fb66f0b5caab8ba79fc9d07b25234502c1c8b897a2e66adc6
+size 7578
diff --git a/bip/data/config/ideal_config_sizes_CNS_LIV.json b/bip/data/config/ideal_config_sizes_CNS_LIV.json
new file mode 100755
index 0000000..4a1d51c
--- /dev/null
+++ b/bip/data/config/ideal_config_sizes_CNS_LIV.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3a2bb23fb231e9cede9fa886d818dd9daa399720f80b4c05e09b79bd6e430b5c
+size 4567
diff --git a/bip/data/config/ideal_config_sizes_UKBB.json b/bip/data/config/ideal_config_sizes_UKBB.json
new file mode 100755
index 0000000..8d7ecc8
--- /dev/null
+++ b/bip/data/config/ideal_config_sizes_UKBB.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:de7d3b098fa1a1cfaaee8664a760769b427b505aa1cada8ef2b194852d05391d
+size 8064
diff --git a/bip/data/config/naming_pattern_CNS_KCL.json b/bip/data/config/naming_pattern_CNS_KCL.json
new file mode 100755
index 0000000..ae053e6
--- /dev/null
+++ b/bip/data/config/naming_pattern_CNS_KCL.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c9c1aa8ef69b21ca6bdb62999f53bec6f415e5e351b1a04ab490e1c588049687
+size 1199
diff --git a/bip/data/config/naming_pattern_CNS_LIV.json b/bip/data/config/naming_pattern_CNS_LIV.json
new file mode 100755
index 0000000..53df84a
--- /dev/null
+++ b/bip/data/config/naming_pattern_CNS_LIV.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b95ea37930281d7285c1e23c5cc0057815373e4ebfd172d8633367501d02c9a0
+size 1137
diff --git a/bip/data/config/naming_pattern_UKBB.json b/bip/data/config/naming_pattern_UKBB.json
new file mode 100755
index 0000000..9f5bf55
--- /dev/null
+++ b/bip/data/config/naming_pattern_UKBB.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5eda27a4ab6f47731ef68982fa40c4c6ebf346845c01b8c8c5de7dc4132ae294
+size 1889
diff --git a/bip/data/dMRI/autoptx/luts/._c1.lut b/bip/data/dMRI/autoptx/luts/._c1.lut
new file mode 100755
index 0000000..90ba946
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c1.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f785eb749fe6599f99bd9f553ce9414d1106cb2a6ec0f05ae448b37426755116
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c10.lut b/bip/data/dMRI/autoptx/luts/._c10.lut
new file mode 100755
index 0000000..a6217ed
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c10.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1036de1a48fc87958e448abd5c94083b7c1c816941f20a26d576dc34c1204189
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c11.lut b/bip/data/dMRI/autoptx/luts/._c11.lut
new file mode 100755
index 0000000..c0fe576
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c11.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c4ed2271c4769d4d207985d4e34f10a1f72efcb9c2e1ecf79dec252e547abe09
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c12.lut b/bip/data/dMRI/autoptx/luts/._c12.lut
new file mode 100755
index 0000000..52c74d8
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c12.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f799b74fcd68ae72be7b40679ea90f88333ce1402de8802d9d86796ec6a45f64
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c13.lut b/bip/data/dMRI/autoptx/luts/._c13.lut
new file mode 100755
index 0000000..eed27dc
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c13.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2ce0dff315457c678dbd809d8f5ecdf92c6764b277b20ff8801e0cc505e92a5e
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c14.lut b/bip/data/dMRI/autoptx/luts/._c14.lut
new file mode 100755
index 0000000..bec28b2
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c14.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4940b562dc7d6ca95ae29d4c3a6d325c110d6ba9fa8240b7895166a62c804756
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c15.lut b/bip/data/dMRI/autoptx/luts/._c15.lut
new file mode 100755
index 0000000..fe43e3d
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c15.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fdd98552d4b613dbda65a7c0963f723f22cb6ed26c1cb7edd02c16fe4318f022
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c16.lut b/bip/data/dMRI/autoptx/luts/._c16.lut
new file mode 100755
index 0000000..5dc05c6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c16.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:32b160f0a2254544673a66fc604b314ca5609c304e0b5ad78e898f081de08473
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c17.lut b/bip/data/dMRI/autoptx/luts/._c17.lut
new file mode 100755
index 0000000..addb85e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c17.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9d64aa05ac74f9efe23bd9f6f4ce097bf51083ffa9e9cf5e7431c75125cd9e71
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c18.lut b/bip/data/dMRI/autoptx/luts/._c18.lut
new file mode 100755
index 0000000..3f40df8
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c18.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a3a59013cbd0787766216b79baa809cd09d0e5e7899404b3a2d0d0a3ac65fdee
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c19.lut b/bip/data/dMRI/autoptx/luts/._c19.lut
new file mode 100755
index 0000000..2d1588d
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c19.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c6a8fc3766285023673cc4995d6f26812ca0e5e2d53c55b1fa5909b7ca6a5ea9
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c2.lut b/bip/data/dMRI/autoptx/luts/._c2.lut
new file mode 100755
index 0000000..dff7053
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c2.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e0ccd7c2f28440181bdb0380c1e711b8b88e1716917e598e9ae14c89c7d5478a
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c20.lut b/bip/data/dMRI/autoptx/luts/._c20.lut
new file mode 100755
index 0000000..e1c221f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c20.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ad4701b5e58402f0e9596470d78a57a96f4e79589d147694edeb5215436bcdc6
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c21.lut b/bip/data/dMRI/autoptx/luts/._c21.lut
new file mode 100755
index 0000000..b46285c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c21.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:67b4800b4b49dbf1de7bde8ac7d15d6f78ace92b36e874cbd3b2c440504ee16a
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c22.lut b/bip/data/dMRI/autoptx/luts/._c22.lut
new file mode 100755
index 0000000..159f341
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c22.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e98389d37d0f5ddb65a183f916d364473761a223bef96f5e6f338bcf1425c3e1
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c23.lut b/bip/data/dMRI/autoptx/luts/._c23.lut
new file mode 100755
index 0000000..583e865
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c23.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fe1342f7261efa10b3622a7ae417c56818255a44b5a12f3397048566cc3f6fc3
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c24.lut b/bip/data/dMRI/autoptx/luts/._c24.lut
new file mode 100755
index 0000000..16959f9
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c24.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bb2c8ab06056d1150e0c06f56ecedf6124e4a330fd6f61029a40cc50d0b10156
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c25.lut b/bip/data/dMRI/autoptx/luts/._c25.lut
new file mode 100755
index 0000000..10adc99
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c25.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:89afd6084472fdce11a3c523c7467bf6b938589f4cb446decf76f537c2ea3684
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c26.lut b/bip/data/dMRI/autoptx/luts/._c26.lut
new file mode 100755
index 0000000..ce73d12
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c26.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9708cb5b58c641866c1ddcbfcff519a096ac26a6f8df7d52e5d95995974479b4
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c27.lut b/bip/data/dMRI/autoptx/luts/._c27.lut
new file mode 100755
index 0000000..a265cd4
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c27.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3626e673d584d9db78ab081177d4896901ca5b098eecd456f91a6e345f63b78e
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c28.lut b/bip/data/dMRI/autoptx/luts/._c28.lut
new file mode 100755
index 0000000..cefac96
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c28.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:71dd79e1ce8fcdc49d21aebc9227418898599507373b591adc902d38fb99259a
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c29.lut b/bip/data/dMRI/autoptx/luts/._c29.lut
new file mode 100755
index 0000000..11fcb1f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c29.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1bdf7b20a7ba287e14e6105ad5a67e4cfb628f7fb6ca64e21d1f086d0396fb0a
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c3.lut b/bip/data/dMRI/autoptx/luts/._c3.lut
new file mode 100755
index 0000000..e011a16
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c3.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cac398a39af33268cfbdd6d76de61959de889474cf71a97d73c6c85c16a0bc92
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c30.lut b/bip/data/dMRI/autoptx/luts/._c30.lut
new file mode 100755
index 0000000..b2d1515
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c30.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6595579a0258a42bcdafda6b94606d2416a360c0d0907ce1b63eb598add6e652
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c4.lut b/bip/data/dMRI/autoptx/luts/._c4.lut
new file mode 100755
index 0000000..62caae0
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c4.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dae71c31506bb017cb89dfa8227c82a69f1273901f9d67d91bedf95ebc1063e8
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c5.lut b/bip/data/dMRI/autoptx/luts/._c5.lut
new file mode 100755
index 0000000..a32725f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c5.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b294026300621d6a34f72662244d9df68a3a264413e5f95541667f07d3ceb796
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c6.lut b/bip/data/dMRI/autoptx/luts/._c6.lut
new file mode 100755
index 0000000..b924e63
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c6.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d30543a9bac3f2c9f7bfa2c29bbbc0d8dd3eee416fe423e2985888faa2b212e6
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c7.lut b/bip/data/dMRI/autoptx/luts/._c7.lut
new file mode 100755
index 0000000..759ee83
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c7.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:22b55a02d6167f4ae76d9194e81caa7999a651ba5db78ddfd90391070baeb68e
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c8.lut b/bip/data/dMRI/autoptx/luts/._c8.lut
new file mode 100755
index 0000000..2281d97
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c8.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3b4034a10cec75b3957658d74c4910ae473ac18c65b49869daabb4ebc84d973e
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/._c9.lut b/bip/data/dMRI/autoptx/luts/._c9.lut
new file mode 100755
index 0000000..28e85eb
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/._c9.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:20aa49c65635f043ee2964c6a97a1bcc85e6fa14449a45c0ddcd88532744e872
+size 4096
diff --git a/bip/data/dMRI/autoptx/luts/c1.lut b/bip/data/dMRI/autoptx/luts/c1.lut
new file mode 100755
index 0000000..bce74f9
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c1.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:520790a042ebf6e37ca92009717dd0e9d4ca0a6738950abd770786350fec8c57
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c10.lut b/bip/data/dMRI/autoptx/luts/c10.lut
new file mode 100755
index 0000000..08685ef
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c10.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e8a63985c549723bc8fd3bea0d93700d9cdd25f556dd407f6495ad66b006bb5b
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c11.lut b/bip/data/dMRI/autoptx/luts/c11.lut
new file mode 100755
index 0000000..cc4d813
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c11.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7e538b55be949b89537a8ee3f7e11b10d27c2883a43378d1b2164a1187206101
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c12.lut b/bip/data/dMRI/autoptx/luts/c12.lut
new file mode 100755
index 0000000..d95fccc
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c12.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1bd770ce23639fad31549693f1716c1529751e5fbdae5854d51623f0eea12e3f
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c13.lut b/bip/data/dMRI/autoptx/luts/c13.lut
new file mode 100755
index 0000000..f75bfd5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c13.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:64fb7b5c682a9a52cb06be8b788e6ea40b5a60a653fde8be1c49ec80df6e890c
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c14.lut b/bip/data/dMRI/autoptx/luts/c14.lut
new file mode 100755
index 0000000..d95f776
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c14.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:703580ad91430772e03fedacf6bc53f2a5d9561abc8d45ecceb68e28dd5b59ad
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c15.lut b/bip/data/dMRI/autoptx/luts/c15.lut
new file mode 100755
index 0000000..d2f1570
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c15.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:67d3070b26a24c9579491dd578e3392628ea4abb78349d88ca5489107919361a
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c16.lut b/bip/data/dMRI/autoptx/luts/c16.lut
new file mode 100755
index 0000000..a3d7c12
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c16.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ce5cb969c5bbfedb3e38959c6a1e40abbe42f9570aa77dda41506d125dc92869
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c17.lut b/bip/data/dMRI/autoptx/luts/c17.lut
new file mode 100755
index 0000000..7c55880
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c17.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:89e9e2ca1c17e4b5da88b8b87d8e5f753c6b5710659ab0be094382b2456ceea9
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c18.lut b/bip/data/dMRI/autoptx/luts/c18.lut
new file mode 100755
index 0000000..de71e08
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c18.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1a4ca7a24a2eebb2e120ac8acc93a6c8e6c6caf24fffb9204ad4b8fc103f0bfb
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c19.lut b/bip/data/dMRI/autoptx/luts/c19.lut
new file mode 100755
index 0000000..6dc0a61
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c19.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f1e2cb49237b308aadfbc09506eb2836e5165c68561724f721325e93969ce6a9
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c2.lut b/bip/data/dMRI/autoptx/luts/c2.lut
new file mode 100755
index 0000000..af268c7
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c2.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b68b8e4629c6a2c318ffb21abbad510247ac0b95b5081d2cd66db59eda911872
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c20.lut b/bip/data/dMRI/autoptx/luts/c20.lut
new file mode 100755
index 0000000..959dd40
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c20.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8f823772aa103d175504fb39d8eec68cfef0ba2b0e6f2a26604246f72f2b66d1
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c21.lut b/bip/data/dMRI/autoptx/luts/c21.lut
new file mode 100755
index 0000000..5c1ad05
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c21.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e9e160008f5e1241340b609922fe8913230c55aac1ec4a337c8e3af1292588c8
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c22.lut b/bip/data/dMRI/autoptx/luts/c22.lut
new file mode 100755
index 0000000..aa73964
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c22.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9b1f19353881d4aef18e1e048a63e0d8e116b5ebe5a76d2cf2393d3fe25a976a
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c23.lut b/bip/data/dMRI/autoptx/luts/c23.lut
new file mode 100755
index 0000000..aa483ed
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c23.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3308490ea0cc0e4f5f30090ebe079fc567d78a077891f4c229a1749b6e240c94
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c24.lut b/bip/data/dMRI/autoptx/luts/c24.lut
new file mode 100755
index 0000000..df037d6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c24.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:79220e380c34653cd443d07f1ad935d14cd46bf15145442d4244a123769489c9
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c25.lut b/bip/data/dMRI/autoptx/luts/c25.lut
new file mode 100755
index 0000000..9603066
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c25.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d84158583e508b2b7ecaa676114e6a52d4fee3dfa694e4c4b8efe9e6a486c24e
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c26.lut b/bip/data/dMRI/autoptx/luts/c26.lut
new file mode 100755
index 0000000..c8eb0c0
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c26.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6973d25d122fcd124d6e797de4c0b79660cab4727e52d4fae2dece1ae86b416f
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c27.lut b/bip/data/dMRI/autoptx/luts/c27.lut
new file mode 100755
index 0000000..e32c8c5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c27.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6b71c0a1c7766d2a3368e85c8146c4aae5b0d6343bc57b9c5a9423829b9ac4bb
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c28.lut b/bip/data/dMRI/autoptx/luts/c28.lut
new file mode 100755
index 0000000..e4fd916
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c28.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:368cf962e98b065bbdf5f3929cccbec1147098d1612b3e96441a9edff6f66e6e
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c29.lut b/bip/data/dMRI/autoptx/luts/c29.lut
new file mode 100755
index 0000000..ef964d9
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c29.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5aa208015d2b28e3ce222170f4be985c886883e81125ec363929c866a2e1e6cd
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c3.lut b/bip/data/dMRI/autoptx/luts/c3.lut
new file mode 100755
index 0000000..e12f640
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c3.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0d6ffa0941dc19e2be88ab9025e507a46c72656298ffa5559dcb696a7eba9da5
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c30.lut b/bip/data/dMRI/autoptx/luts/c30.lut
new file mode 100755
index 0000000..143762f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c30.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:98737cab2f345b2de4f7a0225eaf086fb2fc35e004f35979ab50f1bbb718ad73
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c4.lut b/bip/data/dMRI/autoptx/luts/c4.lut
new file mode 100755
index 0000000..ffb6a3e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c4.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7717cc8764adaa0f1269ffc305f353fc2934502ee94c99400d401e33b436acb1
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c5.lut b/bip/data/dMRI/autoptx/luts/c5.lut
new file mode 100755
index 0000000..62f2639
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c5.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ca04ce6711bff3ec05e6f4a1a9142a2847dbdeea470361b3b91b40061dccfade
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c6.lut b/bip/data/dMRI/autoptx/luts/c6.lut
new file mode 100755
index 0000000..eda5894
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c6.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0589d8056a44d8c39037b95eb993c18dde83675083401e3af04e01030aa75221
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c7.lut b/bip/data/dMRI/autoptx/luts/c7.lut
new file mode 100755
index 0000000..f6de3f6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c7.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:34ac2d277a8c642a154c6aaca8a99f8daef0c409976cf99c0c4f905a0bfed1dc
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c8.lut b/bip/data/dMRI/autoptx/luts/c8.lut
new file mode 100755
index 0000000..0ba9cb7
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c8.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91fd5b9af30df53484c84753ac69d1ccc22d6924bb67899166b135a533c131de
+size 290
diff --git a/bip/data/dMRI/autoptx/luts/c9.lut b/bip/data/dMRI/autoptx/luts/c9.lut
new file mode 100755
index 0000000..0300df2
--- /dev/null
+++ b/bip/data/dMRI/autoptx/luts/c9.lut
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:464aec4d5fd0fb43603eae4e8ae60da495d7cfe4443c42a5a2dc3c94bbabd77f
+size 290
diff --git a/bip/data/dMRI/autoptx/protocols/._ar_l b/bip/data/dMRI/autoptx/protocols/._ar_l
new file mode 100755
index 0000000..dea7b64
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ar_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:daefe022f2e1f035a24203b209dd43b650ddac8833545e094d965877760985ab
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._ar_r b/bip/data/dMRI/autoptx/protocols/._ar_r
new file mode 100755
index 0000000..c7c6168
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ar_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41eb6300d60e5587d268a4513af37d4f3095aed8eec9716de2476b7d59927ff6
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._atr_l b/bip/data/dMRI/autoptx/protocols/._atr_l
new file mode 100755
index 0000000..82068f2
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._atr_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d14b9040d09984373814e94cf86746bef6f5d8dd9c12e147e1b40c67d6e8690c
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._atr_r b/bip/data/dMRI/autoptx/protocols/._atr_r
new file mode 100755
index 0000000..7d842e8
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._atr_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b85772c0168297a46fe7bd5cf37bd911995c5556ad1753b673789e9adc5e0048
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._cgc_l b/bip/data/dMRI/autoptx/protocols/._cgc_l
new file mode 100755
index 0000000..01f75d1
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._cgc_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:964c485ff2ff1f1c7398c47e0001d181621ce29809b9c5e6f8b2251cd9bd1f70
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._cgc_r b/bip/data/dMRI/autoptx/protocols/._cgc_r
new file mode 100755
index 0000000..d94944a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._cgc_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:922ede1bb891e30a5b13e35d0b7918d7b77ec47ebba26b7c589e75a11ede30e6
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._cgh_l b/bip/data/dMRI/autoptx/protocols/._cgh_l
new file mode 100755
index 0000000..7d57b1b
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._cgh_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a44a25fda58ad18810b341e817c117cef558c8214b92d7092a2fa294af46f49f
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._cgh_r b/bip/data/dMRI/autoptx/protocols/._cgh_r
new file mode 100755
index 0000000..59cb603
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._cgh_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9dfa0f2c98ee2f18bf79037f072085578cd14097811145f8e36e9d17e75a81b9
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._cst_l b/bip/data/dMRI/autoptx/protocols/._cst_l
new file mode 100755
index 0000000..854ed15
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._cst_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:40dbd0150a110e764748e5aed43fb543b131cb548627a832a06c4d7a22721422
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._cst_r b/bip/data/dMRI/autoptx/protocols/._cst_r
new file mode 100755
index 0000000..79779d3
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._cst_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:71d2fc11166540cf88827a090b47da9c22a9c01958c06ae3324346ffded1732f
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._fma b/bip/data/dMRI/autoptx/protocols/._fma
new file mode 100755
index 0000000..e239ce3
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._fma
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2569ab7b57a22cfacf1e7e84ca490634d385b2e321def3ab35372d479bc31d6d
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._fmi b/bip/data/dMRI/autoptx/protocols/._fmi
new file mode 100755
index 0000000..033539a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._fmi
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ccd11dfc73e7e1a5184686b6579a47e67ae2074e2c93159af39aff25d2d4ac01
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._ifo_l b/bip/data/dMRI/autoptx/protocols/._ifo_l
new file mode 100755
index 0000000..4bd8188
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ifo_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a32e2c8831b9916b4fd1b83b14527e625f97e8a12ee1a1c85a6623faf401938d
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._ifo_r b/bip/data/dMRI/autoptx/protocols/._ifo_r
new file mode 100755
index 0000000..d7084bb
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ifo_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:498510c656f541446e518353bdd0d9106f42484915e5058dead2fe922d642d66
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._ilf_l b/bip/data/dMRI/autoptx/protocols/._ilf_l
new file mode 100755
index 0000000..71fda0b
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ilf_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:730986dba3c1cb3f8152c7a5b5b949f1a9db7a64dd9b32131956c5dc3ceb6e20
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._ilf_r b/bip/data/dMRI/autoptx/protocols/._ilf_r
new file mode 100755
index 0000000..dfd3014
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ilf_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9145c4442d1720d53e21c8d436842c046a0667e787352200f746fc3ca2ef0c73
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._mcp b/bip/data/dMRI/autoptx/protocols/._mcp
new file mode 100755
index 0000000..a2d1418
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._mcp
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:caac1370422d9426c2beeb2407d784b780e7105cae7b4ffb52e3b4eb433c17fa
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._ml_l b/bip/data/dMRI/autoptx/protocols/._ml_l
new file mode 100755
index 0000000..aa1eee2
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ml_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:be5e15c03b57677e5785b3410c27f7a84ec02c86e697d47785028e12e65bb5c2
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._ml_r b/bip/data/dMRI/autoptx/protocols/._ml_r
new file mode 100755
index 0000000..cedfd6a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ml_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fecacf88ba97cd7c892186154d502c4e55720b35c925c107fa663322f3b4abbf
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._ptr_l b/bip/data/dMRI/autoptx/protocols/._ptr_l
new file mode 100755
index 0000000..0f058cf
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ptr_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:77469537872bce45609551bb51335c5257d7c92ea2a9f3cc54255c9a8a17ac62
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._ptr_r b/bip/data/dMRI/autoptx/protocols/._ptr_r
new file mode 100755
index 0000000..deccc18
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._ptr_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5b853ec443cdafe0b2781b8976c29cbb490651494d0e9b053cb9f0e98c7406e3
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._slf_l b/bip/data/dMRI/autoptx/protocols/._slf_l
new file mode 100755
index 0000000..f2742d4
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._slf_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:487056cc787bd01ac5c6027d827bacf03377061cfe6ed49da6e5922be36fa11d
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._slf_r b/bip/data/dMRI/autoptx/protocols/._slf_r
new file mode 100755
index 0000000..f0dd291
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._slf_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fc9a5e2b1438cffdb0d282869a7b28b8e957578b8c3d8c100130b933597b1c1b
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._str_l b/bip/data/dMRI/autoptx/protocols/._str_l
new file mode 100755
index 0000000..b68393c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._str_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c52e4edc4dd1462b1c68fe6f730f178fea0d5d4b8ea796df7d46eaa1d342d577
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._str_r b/bip/data/dMRI/autoptx/protocols/._str_r
new file mode 100755
index 0000000..10c4ff1
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._str_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dd4f52b8387e21edc15ae423d2adbaa604a3ee3c69cc18ba3c6a5a67706300d0
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._unc_l b/bip/data/dMRI/autoptx/protocols/._unc_l
new file mode 100755
index 0000000..6eeae23
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._unc_l
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:993418e84dab90334158ba52ee2c81bd93ee28b268ac580a8108cffd96db4531
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/._unc_r b/bip/data/dMRI/autoptx/protocols/._unc_r
new file mode 100755
index 0000000..55426a6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/._unc_r
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:98c52bf9329422ef6faf0ae5a3b2cc9f0b126923b378b15f4c7a2632a2c77795
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_l/._exclude.nii.gz
new file mode 100755
index 0000000..b4b848c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44541bda35c0f559e0511a3465f1013817999adbab3c4fdea60238cd2f9f01fe
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/._invert b/bip/data/dMRI/autoptx/protocols/ar_l/._invert
new file mode 100755
index 0000000..2eaf0da
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_l/._invert
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a3f9c455cc0b4de91ce06858aeabfe7ce8878b3171532185f1dfd9e4a78bf94d
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_l/._seed.nii.gz
new file mode 100755
index 0000000..cceaf6c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ac43f7b0a837e51fc5aafc1d41283f3d257a7d7a8049a5732fcbd925c7cb024c
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_l/._stop.nii.gz
new file mode 100755
index 0000000..774c7c9
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_l/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7bc82adf3e1130ec17689dc73efb6074e74eed6c7d0e3b215beb4584b2e6854e
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_l/._target.nii.gz
new file mode 100755
index 0000000..9e3536d
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c50b680c736dfd96db1259345f13b0338ec68b1d71bebe9d8ad202e2f4d5fcb3
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_l/exclude.nii.gz
new file mode 100755
index 0000000..e9e348a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f494e5a1b4a83de88e1117dc137d5835aa83fa5b252a1c5047304704fdb86c88
+size 46991
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/invert b/bip/data/dMRI/autoptx/protocols/ar_l/invert
new file mode 100755
index 0000000..e69de29
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_l/seed.nii.gz
new file mode 100755
index 0000000..d29c07a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:27825a0a211c7b328947bd5122587732046ac4c003c93bf8a55fb6e927b897ea
+size 14433
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_l/stop.nii.gz
new file mode 100755
index 0000000..4ce1d0c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_l/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b18e206d464f14d6455faf3889ac468315835a2b6ee9a335270b021ddd89ecc1
+size 17078
diff --git a/bip/data/dMRI/autoptx/protocols/ar_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_l/target.nii.gz
new file mode 100755
index 0000000..8cdb662
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7e5df6c3d188afa5dbfec8cb885136d2d269ebdf43994eaa7599c9d0c77d83cf
+size 16067
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_r/._exclude.nii.gz
new file mode 100755
index 0000000..b95fa3d
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7b7f5ada5c2eb4334a95cd02e70bc12ee950007d1aad7a27fdb785e795108023
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/._invert b/bip/data/dMRI/autoptx/protocols/ar_r/._invert
new file mode 100755
index 0000000..284b96c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_r/._invert
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fe192ae4159e21e1cde845bbfa3858cdc4ac8c5ec8c576a286952b96a6ffe29e
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_r/._seed.nii.gz
new file mode 100755
index 0000000..a10cfde
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3efd47052d570e056b6f2e34e6a0255ccc1794f4c4121f861429d78fc38a6339
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_r/._stop.nii.gz
new file mode 100755
index 0000000..f327583
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_r/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1be7dfefa8567461ca3fb52ca28c5a4ec203742e8afa2efbe80e20da2456d364
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_r/._target.nii.gz
new file mode 100755
index 0000000..d4a6862
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f0a55df2e0e9ab82432caeab3c572c331a23e38b517c06f3c7e07267e558e36d
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_r/exclude.nii.gz
new file mode 100755
index 0000000..d5b0804
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9ebd43c5835393fe5d7e33cab2bdfc43fb5aa3f7c124aa56aefa35feb6583945
+size 46991
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/invert b/bip/data/dMRI/autoptx/protocols/ar_r/invert
new file mode 100755
index 0000000..e69de29
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_r/seed.nii.gz
new file mode 100755
index 0000000..a4b4fef
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b57dad7335cc50056104e0f442cb38d4c5cba31f063290945628b1d68789017f
+size 14491
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_r/stop.nii.gz
new file mode 100755
index 0000000..03e9a23
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_r/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7ea209e5d7b59361d67c8e361d07dbe4b08a96005c23ea79ed0e249446757e80
+size 17078
diff --git a/bip/data/dMRI/autoptx/protocols/ar_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ar_r/target.nii.gz
new file mode 100755
index 0000000..6c3c3a1
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ar_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:09e41d214ff66d6e577942ec1d56b271abc4227b0330fe0b94381f8d88a8881f
+size 16025
diff --git a/bip/data/dMRI/autoptx/protocols/atr_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_l/._exclude.nii.gz
new file mode 100755
index 0000000..b25b295
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3935dbf3120a96f259d3500212c62021ad8b9d736a1bd515d8a5e980f015fb97
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/atr_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_l/._seed.nii.gz
new file mode 100755
index 0000000..1127209
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9b594bd6a1b879f4c6e8a0317cec3f92695ad6e28f00b133b38b80d82db22cbd
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/atr_l/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_l/._stop.nii.gz
new file mode 100755
index 0000000..839564a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_l/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44eaf300da84f00a9df80deb7fe07568fd07f49fae5807d6aa2d7c990101cb5c
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/atr_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_l/._target.nii.gz
new file mode 100755
index 0000000..d769a47
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b47c6c91bc42188ad0fc312ec4c6820a0eb2ec3b0cb5766c61c1e43258d78ce7
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/atr_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_l/exclude.nii.gz
new file mode 100755
index 0000000..6a276bc
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1aada262a35da5362a2c7de5af5d66771ed8a3c46528905e43aa1adbedd234cb
+size 45382
diff --git a/bip/data/dMRI/autoptx/protocols/atr_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_l/seed.nii.gz
new file mode 100755
index 0000000..4fce3db
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8ea041ef3f3251f0452276375d2c3fd1606cf99532d51ebaafd9bc0371781043
+size 14544
diff --git a/bip/data/dMRI/autoptx/protocols/atr_l/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_l/stop.nii.gz
new file mode 100755
index 0000000..65bf846
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_l/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:56f2082d178c5851977285859fa1841115e1a75dfd4168a4f1d0c5474a4ec0dd
+size 14717
diff --git a/bip/data/dMRI/autoptx/protocols/atr_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_l/target.nii.gz
new file mode 100755
index 0000000..6f309a5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c3425ebc0f56e4186ce64378681ef4180e2bbc9d025ea572f533163dd1721cd
+size 14581
diff --git a/bip/data/dMRI/autoptx/protocols/atr_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_r/._exclude.nii.gz
new file mode 100755
index 0000000..beef323
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cc225a54c8d107fa81f10694f10c8a2a1c56ba4d803e0150b2cd5bdb1ae0cad0
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/atr_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_r/._seed.nii.gz
new file mode 100755
index 0000000..5e3a5ab
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:105d0b8d0814c6a5dbd7f817642c8b9be731184296e521693c64114c90c71eb3
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/atr_r/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_r/._stop.nii.gz
new file mode 100755
index 0000000..a1b73db
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_r/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f96251474eb87aae8c5824b7e5a889441774f77ba44010b550a6b9483ab924fb
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/atr_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_r/._target.nii.gz
new file mode 100755
index 0000000..6e1435c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8a43e2ec4f5d1357e016ac9253574fe62055d34c7c37dc0adbcacca013243bfe
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/atr_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_r/exclude.nii.gz
new file mode 100755
index 0000000..46a0bdd
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0e96bc824652f3791b0ac420dc5feb2039acd80fd708c8804af8a94d566f761c
+size 45382
diff --git a/bip/data/dMRI/autoptx/protocols/atr_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_r/seed.nii.gz
new file mode 100755
index 0000000..6b0c0dd
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6eea2cd59621b763eb304da17c7d46821579b1cec217034a4efc5712f81b8ee8
+size 14577
diff --git a/bip/data/dMRI/autoptx/protocols/atr_r/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_r/stop.nii.gz
new file mode 100755
index 0000000..17e5966
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_r/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9f9ff27ba6ee8a0d341c805e4c2db9408ac8f45c814da00f05ae1b81ccbe802a
+size 14717
diff --git a/bip/data/dMRI/autoptx/protocols/atr_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/atr_r/target.nii.gz
new file mode 100755
index 0000000..0d9111b
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/atr_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ecdf5405cee18a231774ae3e3dfcc66fcb8624640ba1218e9ee58c674b29c593
+size 14560
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_l/._exclude.nii.gz
new file mode 100755
index 0000000..657d48f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7e65f9e454020c67ddf0f6c9203a8bfef54c8d59df87b543580cf3ba2d71bb54
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_l/._seed.nii.gz
new file mode 100755
index 0000000..195b032
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:424bc52dd4ed446b7c2437bc6601227071d207165c2700e1d0c1ad4b4b442ed1
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_l/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_l/._stop.nii.gz
new file mode 100755
index 0000000..4e60715
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_l/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4d56b6d32749ee9389027704d06a0fd783eabfe995be249e0158c6999ff718e1
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_l/._target.nii.gz
new file mode 100755
index 0000000..03e7d7e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5debbd202d712986f7c0a439c8c7eda6bd4a8d9d782eef33f3630a2b7de221e7
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_l/exclude.nii.gz
new file mode 100755
index 0000000..848d7bb
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:acff3f8fec21e117af2c03f18f80454e745b139a04c5a0bba5c011a628951d1c
+size 43849
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_l/seed.nii.gz
new file mode 100755
index 0000000..0583d49
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:329308faed75b44f6daccbfed87e9b33f3df7d06751bdeaacf04477746f3d948
+size 14358
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_l/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_l/stop.nii.gz
new file mode 100755
index 0000000..ba762c0
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_l/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7a3a0996a387e9788d7868db3fc6c4a2e5abf6224e54a10fd099bb98cc9d6a7a
+size 20911
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_l/target.nii.gz
new file mode 100755
index 0000000..618a3ba
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9430d889fb2ba128c06de6c232797471865ad6156284708c677dfc58beb505ca
+size 14334
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_r/._exclude.nii.gz
new file mode 100755
index 0000000..00ce7b8
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:165da827b0d188c8eea98baf8178ea81cc2eb38f705855fe53ea983de2df43b3
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_r/._seed.nii.gz
new file mode 100755
index 0000000..0581aec
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:96254a9d1d8bd233c89c52cbc43dec96c83f2d01addcc4b01aecaf5f3b68d18f
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_r/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_r/._stop.nii.gz
new file mode 100755
index 0000000..af47336
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_r/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e029772e56572a8b63a0ffa26f24bb888dacfb68663659a2796bcde4e1bfd781
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_r/._target.nii.gz
new file mode 100755
index 0000000..915aa55
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:28272bc696bd4da1e92f7ce95fc50436c17632414247649f1470772fd56ae2e0
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_r/exclude.nii.gz
new file mode 100755
index 0000000..ace6264
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6d7d9db7548a49a760c17f501df5e7c382a4faa335b562f3487b4f58fcad7a53
+size 43849
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_r/seed.nii.gz
new file mode 100755
index 0000000..a41098e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:301c5a192d0dd3d2c0c3f8bdd8c603a85dd6833398289f69d1ee41a4cf7eaceb
+size 14346
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_r/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_r/stop.nii.gz
new file mode 100755
index 0000000..80876eb
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_r/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bc23ad1ec0b37644b846a468bf27c82e2a6bc28a18ab9b72f5188ec69f1e2b3a
+size 20911
diff --git a/bip/data/dMRI/autoptx/protocols/cgc_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/cgc_r/target.nii.gz
new file mode 100755
index 0000000..41bb6b4
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgc_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b104d6d4918f15f9aa589fa922dbaed063e683a2ef97a50c5ad74dc7da85fc26
+size 14361
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_l/._exclude.nii.gz
new file mode 100755
index 0000000..d91775a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9e100d938cadc1cc8ae93b891aa2dc68c6f2120231f2769414b32a67d110ce2a
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_l/._seed.nii.gz
new file mode 100755
index 0000000..1d23b56
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41af82bb28d06aa947a296bd0d5bd85e734875f65d89a9a81bd9c43439436a3d
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_l/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_l/._stop.nii.gz
new file mode 100755
index 0000000..18e5894
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_l/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:074e39679706bb04d9a4e071d4ad524cfa24e1ae670ee6d786d41dcd2e3fe378
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_l/._target.nii.gz
new file mode 100755
index 0000000..b04fa7f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:48eac08f123a66d706e13c75268636fcd117614bc7ad70bb10cce97eb65c3702
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_l/exclude.nii.gz
new file mode 100755
index 0000000..1bea302
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9c411ba80ee5b54023898551f2f99564b21337c81de4928f677a6e44d0efd031
+size 43849
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_l/seed.nii.gz
new file mode 100755
index 0000000..8f0c476
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a175a5a477ebd394d9a5c74da57b3aa1379548ce48329ca2314e2f4470ac6c0f
+size 14377
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_l/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_l/stop.nii.gz
new file mode 100755
index 0000000..c5fa1d3
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_l/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:425bb96bb5c6d79a91eff92847f67f92dc2c1c1485c1d247943347ae0dee9d07
+size 15572
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_l/target.nii.gz
new file mode 100755
index 0000000..50e686e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4f3a6ef8144e617d68febd3049ea97a5eb0571c00b793c5a7442af56c56903a7
+size 14367
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_r/._exclude.nii.gz
new file mode 100755
index 0000000..97a0d45
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1287187a34131a8e7100b466298eba8a245ca18ec39b5c6aed4327f634cd52ec
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_r/._seed.nii.gz
new file mode 100755
index 0000000..0c3808a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5afb59de5d193b7557ea85bdedef400a1710fcee86fa43f7f4fbd1ff0b72b773
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_r/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_r/._stop.nii.gz
new file mode 100755
index 0000000..712d282
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_r/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0b66bf1fe287b94c0003af23b9c88aac0f8314e771e4dc7fd6c9509ed63b8fea
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_r/._target.nii.gz
new file mode 100755
index 0000000..5881a3e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:22115ce1f5197bc7fdebafb2eea2126ce3d7001a0ed8624740d57d33ac5b23cc
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_r/exclude.nii.gz
new file mode 100755
index 0000000..16f65d5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f2ce3730dd5856f263ee0b8f3271d227b95b385c462caeffdaa2e00e49d666f8
+size 43849
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_r/seed.nii.gz
new file mode 100755
index 0000000..4d897d9
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:923f66d8cb5af096851464cde1018bda30fd7798bd47a41117049f5dc7be2a66
+size 14421
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_r/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_r/stop.nii.gz
new file mode 100755
index 0000000..d2cbe9a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_r/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:130e8177263a9344ba660f286ab11c1777718d1ab9b9751e8fccb8733bba2305
+size 15572
diff --git a/bip/data/dMRI/autoptx/protocols/cgh_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/cgh_r/target.nii.gz
new file mode 100755
index 0000000..9e5c8b8
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cgh_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4603630319cbc84bf0c7b46bce9d1b3e4b8ec4d42127d681b9dcecd1a10c1820
+size 14361
diff --git a/bip/data/dMRI/autoptx/protocols/cst_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_l/._exclude.nii.gz
new file mode 100755
index 0000000..1ef6c6d
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1c57b68377218594fe28f85aac1d3ebfcda36af32fde15b058983dc3bfb41726
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cst_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_l/._seed.nii.gz
new file mode 100755
index 0000000..6d5d72e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:265e5809d33626fe826b88f1b9558db5531b8234f7304fd72cadc27a85685d6e
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cst_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_l/._target.nii.gz
new file mode 100755
index 0000000..bf3a398
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:436b0982be18217a60005903cc2533631e9017ce7acef8aa258ee65593347e2b
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cst_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_l/exclude.nii.gz
new file mode 100755
index 0000000..fe98b44
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1c50697e99aeaa5f0d7f312dd55e92f5113d3e194fe6b10f65dbbbabf4fe6799
+size 45427
diff --git a/bip/data/dMRI/autoptx/protocols/cst_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_l/seed.nii.gz
new file mode 100755
index 0000000..4f777e5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9b5e3845d1fecd64ab6e4d5ce855427fd4fe00656083cf8f92911608054e5bf3
+size 14320
diff --git a/bip/data/dMRI/autoptx/protocols/cst_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_l/target.nii.gz
new file mode 100755
index 0000000..e44ebbe
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:933c0042f5052b555f1f8331e0c2b30589c2de482ec13b75f0ba9afce041c133
+size 14522
diff --git a/bip/data/dMRI/autoptx/protocols/cst_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_r/._exclude.nii.gz
new file mode 100755
index 0000000..5dcc5bc
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:27947252b090a82a6282a11236b5871056b8d20ed45ffe45aa554b6587d514a4
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cst_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_r/._seed.nii.gz
new file mode 100755
index 0000000..89b2605
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bff6bbf8ee547ec1e89d928fe4594d3d63119abf25523e8e8a199f9a95117c3d
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cst_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_r/._target.nii.gz
new file mode 100755
index 0000000..fd8205e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:be5798e3c0e5f67aea8ba1e2599bad1fd1179d063ed58a5be668ea06b29c0358
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/cst_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_r/exclude.nii.gz
new file mode 100755
index 0000000..15d5c8f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:753f21020e8ab5d111b323c96f8f55324cc0bc50fd5d7ad98c3c43e4f5bb1299
+size 45427
diff --git a/bip/data/dMRI/autoptx/protocols/cst_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_r/seed.nii.gz
new file mode 100755
index 0000000..a0e6d85
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5e7d6d6a7f7ef064aca349fc3fbed606aeb8f33e94d190421d4ffb2057741ae5
+size 14331
diff --git a/bip/data/dMRI/autoptx/protocols/cst_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/cst_r/target.nii.gz
new file mode 100755
index 0000000..9462d1e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/cst_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b2e4e4d93d9dbe2aa890e9acc766c16d52b09981662d0381927982e240df73aa
+size 14517
diff --git a/bip/data/dMRI/autoptx/protocols/fma/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/fma/._exclude.nii.gz
new file mode 100755
index 0000000..dd0720c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fma/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5f46bd21d23cd44ef692901b5c70e33ed95624f951edb1c31274b4e07b0c6446
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/fma/._invert b/bip/data/dMRI/autoptx/protocols/fma/._invert
new file mode 100755
index 0000000..af986e9
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fma/._invert
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3a5867f8bcab2417cb4226b6caa0de224244590f66a85d002f5bb211eac6e082
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/fma/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/fma/._seed.nii.gz
new file mode 100755
index 0000000..53635ad
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fma/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a2309d2e2bab84db7d38175bd4dc8ce364ac974419f32fbf2cf33af85a012413
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/fma/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/fma/._target.nii.gz
new file mode 100755
index 0000000..c49df3b
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fma/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4071cff6955afe931406a5a3ebb469e51be42756db20b4f6cd019fdad139777a
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/fma/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/fma/exclude.nii.gz
new file mode 100755
index 0000000..822bafb
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fma/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fec403d6dd24709243361efe3485d7396b73c7354bda1aa0f9bdd693be3d49f5
+size 36437
diff --git a/bip/data/dMRI/autoptx/protocols/fma/invert b/bip/data/dMRI/autoptx/protocols/fma/invert
new file mode 100755
index 0000000..e69de29
diff --git a/bip/data/dMRI/autoptx/protocols/fma/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/fma/seed.nii.gz
new file mode 100755
index 0000000..dfdb8db
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fma/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:616c49c8a3570ed8fcc2c205bff9463d9b9abced1c869ba232e45914d41a7c64
+size 14939
diff --git a/bip/data/dMRI/autoptx/protocols/fma/target.nii.gz b/bip/data/dMRI/autoptx/protocols/fma/target.nii.gz
new file mode 100755
index 0000000..c3f0a7a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fma/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d2584be6b056b72591e2892152d15e60c6fe22eac00a41e44d992233bfd490fb
+size 15064
diff --git a/bip/data/dMRI/autoptx/protocols/fmi/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/fmi/._exclude.nii.gz
new file mode 100755
index 0000000..0818d1f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fmi/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d89e2f245f68f173a6fdb6baaf088d7337c2165e7ddc56492c11c0d698f9b55a
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/fmi/._invert b/bip/data/dMRI/autoptx/protocols/fmi/._invert
new file mode 100755
index 0000000..2cf05bd
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fmi/._invert
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aa814cc3cdbde6b1ba23580b6ad77d11ccfd70e98c0cba0352fbeef9e3f9334c
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/fmi/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/fmi/._seed.nii.gz
new file mode 100755
index 0000000..eb482c6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fmi/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4177bd319d01ede51018af47dc3803d3e815903448689e497f79f7021183747f
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/fmi/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/fmi/._target.nii.gz
new file mode 100755
index 0000000..88ff907
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fmi/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e764543a9a2c6116d5ffffe6f24da0e099b46f93fffd8fc26ebb2991e0e5c0d2
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/fmi/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/fmi/exclude.nii.gz
new file mode 100755
index 0000000..dfcec75
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fmi/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3c4b098b6fef61806002bcad7b129433a3796cc7b3494428a1707e12c089b9e4
+size 54344
diff --git a/bip/data/dMRI/autoptx/protocols/fmi/invert b/bip/data/dMRI/autoptx/protocols/fmi/invert
new file mode 100755
index 0000000..e69de29
diff --git a/bip/data/dMRI/autoptx/protocols/fmi/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/fmi/seed.nii.gz
new file mode 100755
index 0000000..7caedd8
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fmi/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b51c1fa3acdacc3e1842fc1abbd024d23a528887ba1de7ed871f465134a5dcf5
+size 14895
diff --git a/bip/data/dMRI/autoptx/protocols/fmi/target.nii.gz b/bip/data/dMRI/autoptx/protocols/fmi/target.nii.gz
new file mode 100755
index 0000000..fd67d88
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/fmi/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b0dc487b3b3db68b0a8e2fa121b8f27fd44cb5f62d03c3ba2caeea12306902f2
+size 14957
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_l/._exclude.nii.gz
new file mode 100755
index 0000000..d9ae1e2
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fbf9d4a9a72103fcd920bd79a748a78824718912e1080f305c95cd8c9dcc4df8
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_l/._seed.nii.gz
new file mode 100755
index 0000000..2e2a0cb
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:594ed39aa5c95d93afc0871277ed9211d09c12fc6f686f67e273111ee91f1aed
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_l/._target.nii.gz
new file mode 100755
index 0000000..f4d648f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6b7319410dfc71695bb8737d88065cb931fe3b592ee5a97f2f8d86968066e962
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_l/exclude.nii.gz
new file mode 100755
index 0000000..73801c6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3b7c1def23add50074729cd5f4bb20b50014da763daf9b6d0a9d82849538bb4b
+size 45828
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_l/seed.nii.gz
new file mode 100755
index 0000000..907a014
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:654ee3e5275759ba975378a031415a61622d2d58b8f638b5560bcccba6330ee1
+size 14696
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_l/target.nii.gz
new file mode 100755
index 0000000..24b0ed2
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:231bbc706e096a4b78a78a156f22dc8ac34cf17b15bfdb0d9a005dcbe7cb1c3e
+size 15031
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_r/._exclude.nii.gz
new file mode 100755
index 0000000..2b5c2c5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:891c3f9c5a46c2ec63d0654bbc44726bc3d25876426f9f4a6c716e31625f4356
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_r/._seed.nii.gz
new file mode 100755
index 0000000..dee5424
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:90a39642e5a46c23a5849149dd99a30f221c7110f327fbc56864af0d44536c99
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_r/._target.nii.gz
new file mode 100755
index 0000000..4878927
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f6f78cd1a3d35d7b84eb8592dd510be925f642d853e81e187c031365bc32dc27
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_r/exclude.nii.gz
new file mode 100755
index 0000000..f2a9a31
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7f6f608586fbf6ca3306d4fc758c34ea58ad949f12a5ae814264430cf7b86f81
+size 45828
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_r/seed.nii.gz
new file mode 100755
index 0000000..81810e5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7f61172e93cd192b51f5749054a6764160ca5acc340e82410576ec812ad92727
+size 14681
diff --git a/bip/data/dMRI/autoptx/protocols/ifo_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ifo_r/target.nii.gz
new file mode 100755
index 0000000..fc00de5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ifo_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3d66b2d68949c710d174ed0f3cb192ea3ceac7e1968d38ea97e43608cd4c4061
+size 15136
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_l/._exclude.nii.gz
new file mode 100755
index 0000000..2b13642
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:001741ab79f3c9e2a5c81eb0e77cb580a01cb03c74476697f522610656b56998
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_l/._seed.nii.gz
new file mode 100755
index 0000000..30352d6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d4b497eedff4cb3b453d59834f3055b32ef8a018b706d99cf51405553cbd5e3f
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_l/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_l/._stop.nii.gz
new file mode 100755
index 0000000..d719cd6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_l/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ccda25c67c86b24a5c049c7b5fbadc300614dbe4e0a7f5b7561f88aec10c974b
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_l/._target.nii.gz
new file mode 100755
index 0000000..5ed8a17
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f0a1751813bf5904a9cc9f9383580ac05ade0dd73b79b6212319988db27374e1
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_l/exclude.nii.gz
new file mode 100755
index 0000000..d3093be
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c5afc02f9911dd20ed2b7152311960769ec28fcaf36972285587bae1f2bfbb62
+size 44859
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_l/seed.nii.gz
new file mode 100755
index 0000000..cd8a8f3
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c4a86f3eaf2789a9aaaaa9b0b6d3c52cca104b876f70d2f7e5bd93e841dd6e3d
+size 14644
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_l/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_l/stop.nii.gz
new file mode 100755
index 0000000..9bb058e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_l/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:090facea074673d65ca41e98068702ecc93ece532caa58c378bbaed3fb5c453d
+size 15104
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_l/target.nii.gz
new file mode 100755
index 0000000..d056ac5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:78b0f7bb78efa14e32700b7474f3016e7ced8f756a701ebb3a47b4a1ef3bf02d
+size 15494
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_r/._exclude.nii.gz
new file mode 100755
index 0000000..f293f3f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5c0b0d140887b0bb3fa026de18c888c228d75f2a762f97e889912c36f1a51a18
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_r/._seed.nii.gz
new file mode 100755
index 0000000..0a0ffe2
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9ea55cd44345652533b3fe7d877f47463ccebf6f9d628d69da3239061db7143c
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_r/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_r/._stop.nii.gz
new file mode 100755
index 0000000..2f5a57e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_r/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2786436c1323893bcb1e56f1e265967cec6a34365dd938e7f7999bdb765b620
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_r/._target.nii.gz
new file mode 100755
index 0000000..f07cd85
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4cf27422c8e380f36047aeb771d5a97278c13fcbefcfb644cecea503378a754d
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_r/exclude.nii.gz
new file mode 100755
index 0000000..5450735
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:87086a2c5c1f0d1446efd924158c4ff0783ea096f5d971e2fb958bceaca616ca
+size 44859
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_r/seed.nii.gz
new file mode 100755
index 0000000..ae7f64c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0640ea12416cb78ac4e8e4526b5a46dbdb6c1f95014196319d3a9518dee63850
+size 14666
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_r/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_r/stop.nii.gz
new file mode 100755
index 0000000..1a9310f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_r/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:72ab22069e58c2e4887d8620cdfec50ac4a47ade9b99c7c655be1ae8f10bec44
+size 15104
diff --git a/bip/data/dMRI/autoptx/protocols/ilf_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ilf_r/target.nii.gz
new file mode 100755
index 0000000..08b9e33
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ilf_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:286a50484b1653ce98678c5354189fe953b41d84be92992602ac8acad716f100
+size 15497
diff --git a/bip/data/dMRI/autoptx/protocols/mcp/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/mcp/._exclude.nii.gz
new file mode 100755
index 0000000..e8ea0c4
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/mcp/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44c306915c9c4467b9ce079c6838a8ae66f42626a754a8823af8358a8ccab3ae
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/mcp/._invert b/bip/data/dMRI/autoptx/protocols/mcp/._invert
new file mode 100755
index 0000000..ec305b1
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/mcp/._invert
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d0f1b1d827b5f1a0d18110912ce0971570112a48927c39175689d6bc5eb6d346
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/mcp/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/mcp/._seed.nii.gz
new file mode 100755
index 0000000..f2b2fb0
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/mcp/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bb2598c577896a6199b10925baf91893fd8bfc43a18ad4b596fbc1a7295fb7b8
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/mcp/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/mcp/._target.nii.gz
new file mode 100755
index 0000000..346f1ee
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/mcp/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0b1aa22480db30197f5013051ece02ecec328338f647452446217a874b9b27f7
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/mcp/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/mcp/exclude.nii.gz
new file mode 100755
index 0000000..1d54fbf
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/mcp/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eb9f521a272c79f0e5406e13c585137a3b37d40a3358a289346453d548e339f2
+size 21432
diff --git a/bip/data/dMRI/autoptx/protocols/mcp/invert b/bip/data/dMRI/autoptx/protocols/mcp/invert
new file mode 100755
index 0000000..e69de29
diff --git a/bip/data/dMRI/autoptx/protocols/mcp/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/mcp/seed.nii.gz
new file mode 100755
index 0000000..dfb3446
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/mcp/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cb9008ec00789d8f7879f796bf367b29efb30b0df63066831d06f7ea9abc2325
+size 14441
diff --git a/bip/data/dMRI/autoptx/protocols/mcp/target.nii.gz b/bip/data/dMRI/autoptx/protocols/mcp/target.nii.gz
new file mode 100755
index 0000000..4995e1f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/mcp/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3e06e3c97bd1e08f382bfebe18dcf2e69442a5bcc54f82d424e806a316fd937e
+size 14442
diff --git a/bip/data/dMRI/autoptx/protocols/ml_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_l/._exclude.nii.gz
new file mode 100755
index 0000000..0f1a6dd
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:035cb954d18ad81e6990d42942fc5c51e5b0efa7c4510e92aba3dc61cf21faa3
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ml_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_l/._seed.nii.gz
new file mode 100755
index 0000000..b11c6d5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aed6a14692139573b7b5070c1a8e0e063e0fa0007dd38ad47e9a99bcfe52ae2a
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ml_l/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_l/._stop.nii.gz
new file mode 100755
index 0000000..a78bae8
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_l/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:157668969ad89eb89af08dff0a38ac6b6c71a428f37b472a981970b58aaf4405
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ml_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_l/._target.nii.gz
new file mode 100755
index 0000000..a71b00b
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c23e373e85641271fd98c5cf0c813c96e13cd2e2a07b621a3d432a9c25f04ec
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ml_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_l/exclude.nii.gz
new file mode 100755
index 0000000..985d120
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7f7c46d430e67bb89e829c0ba793ab3f14a2f018264d554dbe9289ba22d24a31
+size 44832
diff --git a/bip/data/dMRI/autoptx/protocols/ml_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_l/seed.nii.gz
new file mode 100755
index 0000000..fbf0458
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f05692809ccece3d9ea54136fac43da1d1494417848fd6ad40ec08566912cbec
+size 14363
diff --git a/bip/data/dMRI/autoptx/protocols/ml_l/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_l/stop.nii.gz
new file mode 100755
index 0000000..b554e1c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_l/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f427f3f51266eb0ca14931560122df2ac1b9ff203d60d56e36266ea6745f67c2
+size 14604
diff --git a/bip/data/dMRI/autoptx/protocols/ml_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_l/target.nii.gz
new file mode 100755
index 0000000..9669395
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7ad97b8e656838ed57cf14d9a1c1f8d5f2a6bbdf61c05c4d74a933a6c0130950
+size 14305
diff --git a/bip/data/dMRI/autoptx/protocols/ml_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_r/._exclude.nii.gz
new file mode 100755
index 0000000..87ab0dc
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bdf07c20efd1c5c39b0f742b65c3b95f6ef0bd5bd3983cd7149027134f2f4732
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ml_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_r/._seed.nii.gz
new file mode 100755
index 0000000..dccef6e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0ad143c9d8bc32b842e6a2ee18358286cf00ca31c8a09686a9461ae1b5058dbc
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ml_r/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_r/._stop.nii.gz
new file mode 100755
index 0000000..f3467e3
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_r/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:77160479976550c4c45711fbf07e32c06665e97d8ede179b7329901029e847e1
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ml_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_r/._target.nii.gz
new file mode 100755
index 0000000..cf594b8
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5223d370629a4e87761eda9f9da320cf2a17c3ce454d5bacda43d5cbf0cc1779
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ml_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_r/exclude.nii.gz
new file mode 100755
index 0000000..f8c5b4a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:94c133a6eb5abedd01a012f46e74931692d1d5c99b62179c08084a79841fb755
+size 44832
diff --git a/bip/data/dMRI/autoptx/protocols/ml_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_r/seed.nii.gz
new file mode 100755
index 0000000..3c475ba
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9067850540436549e058d9fa61b6ec409b747f2101546f52f299bb294f69495d
+size 14363
diff --git a/bip/data/dMRI/autoptx/protocols/ml_r/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_r/stop.nii.gz
new file mode 100755
index 0000000..72a298f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_r/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a169b8d01333e5428dfdd03849312e97c3bc742aa84acdfe5e5a76c257789797
+size 14604
diff --git a/bip/data/dMRI/autoptx/protocols/ml_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ml_r/target.nii.gz
new file mode 100755
index 0000000..0c800c1
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ml_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9e0bdd51376ad9fe312fd5ba093dbbf1582fc9995f8b063c34defb5f96f6fb22
+size 14315
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_l/._exclude.nii.gz
new file mode 100755
index 0000000..909ee86
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e7c01fedca7c90f3edae81aebcd4c8777922b14214df971f19f06a2dcd9030bd
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_l/._seed.nii.gz
new file mode 100755
index 0000000..a641d1b
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:012544b2b4c6be5a510044b7f380379cc1de44d5528725d14f1a9f465b2570d8
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_l/._target.nii.gz
new file mode 100755
index 0000000..6ed50c2
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8af552a313605ba29baf22970bd645f1929860f0c141ff38fe574e6045ac6305
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_l/exclude.nii.gz
new file mode 100755
index 0000000..cc75653
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1d8330e03966b872a2caa3c3dcc04021b2ab656eed34bcedd61553701edbf72a
+size 48210
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_l/seed.nii.gz
new file mode 100755
index 0000000..d6d5c0c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:36f0804e302d082397ed015e6fe97a6f9bc36d349c3b37595539272ba8e3a20a
+size 14595
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_l/target.nii.gz
new file mode 100755
index 0000000..5daef89
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c106ac365f2627507940e54041f9f6b7a7abb7e3535c73c4c9651c1de5aad129
+size 14725
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_r/._exclude.nii.gz
new file mode 100755
index 0000000..8db5d32
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5578338a82a600265a766ed787dfba5d33146224a7d7683b5a6102d96ce4b2f7
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_r/._seed.nii.gz
new file mode 100755
index 0000000..fe24726
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a9d384b9d31d8c56fb5841e5ab31882140ab9d91c173636e8db4beb4326c3bb2
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_r/._target.nii.gz
new file mode 100755
index 0000000..512f1a6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d53c2f3b348032c732a27560955a11568dc7b7400e664af48ee83eb3cc4a163e
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_r/exclude.nii.gz
new file mode 100755
index 0000000..73deb59
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:452a281713a457db119c309ad0c5cdf1fc44bb8eef5aac535d10aa362825cdcd
+size 48210
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_r/seed.nii.gz
new file mode 100755
index 0000000..50c9c61
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f9874fd49950946a8f999ec8236b078adca956f90509e5a9902a1071db96a9d8
+size 14593
diff --git a/bip/data/dMRI/autoptx/protocols/ptr_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/ptr_r/target.nii.gz
new file mode 100755
index 0000000..cf068ef
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/ptr_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:80ba21b2a012672d4ead3765c23c66449502004f4d3168ddb8bf3d2441e06adf
+size 14703
diff --git a/bip/data/dMRI/autoptx/protocols/slf_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_l/._exclude.nii.gz
new file mode 100755
index 0000000..140a26a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ab0ba0c4aeb9bdf65d60e82999120bc39e7082b76d3473df672693eb46a5e8ab
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/slf_l/._invert b/bip/data/dMRI/autoptx/protocols/slf_l/._invert
new file mode 100755
index 0000000..421bd7a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_l/._invert
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e3bb5483527786dd8fb6d6812da7a690ada5dc67e4c5839df02e408cf28a280c
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/slf_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_l/._seed.nii.gz
new file mode 100755
index 0000000..72b816f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a2b533361aa796645869c751d197f37f9a55255ac4a513e4b3e2d53dcb2ea886
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/slf_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_l/._target.nii.gz
new file mode 100755
index 0000000..6b0c144
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5c3d0237f0b51a09432a8f2b80adcaa925bfcb565306a9134d218b308edb4d2e
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/slf_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_l/exclude.nii.gz
new file mode 100755
index 0000000..2b65d5f
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:701669b54967824d7178593916319475382eb7308776c641d5e571f44d5dbad4
+size 45095
diff --git a/bip/data/dMRI/autoptx/protocols/slf_l/invert b/bip/data/dMRI/autoptx/protocols/slf_l/invert
new file mode 100755
index 0000000..e69de29
diff --git a/bip/data/dMRI/autoptx/protocols/slf_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_l/seed.nii.gz
new file mode 100755
index 0000000..00c7b0b
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3c0c985aff8d182c7a83a3788210b57a874551561cce4077beb4345de9132f6e
+size 14948
diff --git a/bip/data/dMRI/autoptx/protocols/slf_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_l/target.nii.gz
new file mode 100755
index 0000000..17470ca
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eafb518ac3a42cd8b78ac2b90804e406b26656b86b342dfbe9e6042d091dcd1b
+size 15027
diff --git a/bip/data/dMRI/autoptx/protocols/slf_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_r/._exclude.nii.gz
new file mode 100755
index 0000000..2fe3608
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44680539099fb6792702833ebc9da47c86915f6bf47a2f335c3d944dd2755063
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/slf_r/._invert b/bip/data/dMRI/autoptx/protocols/slf_r/._invert
new file mode 100755
index 0000000..f1386cc
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_r/._invert
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:caf70eb9805d4005b6f5d41d4f74121c92678ef19e93fc07d31b7746bea2c242
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/slf_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_r/._seed.nii.gz
new file mode 100755
index 0000000..26ba294
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:248d69b56a0e1d9caf590dfcd910d15bc0b0321c142e35b7509beda6e906db1c
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/slf_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_r/._target.nii.gz
new file mode 100755
index 0000000..b9d257a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a928a23230b68587223485e4fd96bf3bc935c13a20851cb089e54cad4b60451b
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/slf_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_r/exclude.nii.gz
new file mode 100755
index 0000000..d47157a
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5bcf5f22ea7ddc4440c74317556f18e42ca450ff40b3188d84e6c3f5370265e7
+size 45095
diff --git a/bip/data/dMRI/autoptx/protocols/slf_r/invert b/bip/data/dMRI/autoptx/protocols/slf_r/invert
new file mode 100755
index 0000000..e69de29
diff --git a/bip/data/dMRI/autoptx/protocols/slf_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_r/seed.nii.gz
new file mode 100755
index 0000000..983f834
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:faabe549aeb4bbbb32c55fa327ae45d1722155bcf09c67b558fbcb47510819da
+size 14964
diff --git a/bip/data/dMRI/autoptx/protocols/slf_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/slf_r/target.nii.gz
new file mode 100755
index 0000000..7f94dd4
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/slf_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8378bd179b90c878fd4953d9176cf1e44fef4c84c67ffa6eae176cc44555c363
+size 15009
diff --git a/bip/data/dMRI/autoptx/protocols/str_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/str_l/._exclude.nii.gz
new file mode 100755
index 0000000..2b5a0ca
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9ecf7599e782d97bd4746298af15de3c0f443aabc9c52feaee7051edfb26e1bc
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/str_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/str_l/._seed.nii.gz
new file mode 100755
index 0000000..939234c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:37cab6d6bad97ecd295c125315b6cf39a52c10b2838ed460546e6684e5cb2850
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/str_l/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/str_l/._stop.nii.gz
new file mode 100755
index 0000000..1377b99
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_l/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6758ce51b9c3549c1da82c7b9688ddc1a794c8ac2ae73b584b39e886ef3d206b
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/str_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/str_l/._target.nii.gz
new file mode 100755
index 0000000..059e9b5
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6074c924c3f1c731db1de7a2a817ae55d3f7540275559d62da69c2dc15b69325
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/str_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/str_l/exclude.nii.gz
new file mode 100755
index 0000000..54d5cc1
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2ca5d59a34a2186562ba4baf01eaa88a80592b90ed93cd52e8afa523f3abb76b
+size 45296
diff --git a/bip/data/dMRI/autoptx/protocols/str_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/str_l/seed.nii.gz
new file mode 100755
index 0000000..5e378c1
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:423f5b074e54be9b838ed394ebd910d0200ecb2237c01f2a56d519f44100d092
+size 16065
diff --git a/bip/data/dMRI/autoptx/protocols/str_l/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/str_l/stop.nii.gz
new file mode 100755
index 0000000..e921f38
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_l/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2cae25cef029cfced03772bfae45e19e628513f7e47fed4470553e5f996bb58b
+size 14350
diff --git a/bip/data/dMRI/autoptx/protocols/str_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/str_l/target.nii.gz
new file mode 100755
index 0000000..8528217
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9ccc5c4458781f9d195f61a2aa4608dd1320582137b4af351d7f77bb6f73ace0
+size 14400
diff --git a/bip/data/dMRI/autoptx/protocols/str_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/str_r/._exclude.nii.gz
new file mode 100755
index 0000000..711d51d
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a0dc8c18809bf673b5cd6a6bb0b713fe86e3404c28631eb47e81bb36b82241b7
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/str_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/str_r/._seed.nii.gz
new file mode 100755
index 0000000..815aabd
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4b9add20eebccbd0b49b31d6990156c060f3bcf93151c9f2a93817691c824dd3
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/str_r/._stop.nii.gz b/bip/data/dMRI/autoptx/protocols/str_r/._stop.nii.gz
new file mode 100755
index 0000000..80a486c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_r/._stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4278b73de1b9e5f571b18a420768ad4d559babfc0452545fffa5bff83a4c8480
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/str_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/str_r/._target.nii.gz
new file mode 100755
index 0000000..426b33d
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d9553cedd15bfdd1436005568d6fa2f66bf3658040d7b56a482cb1c7bd5f06f0
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/str_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/str_r/exclude.nii.gz
new file mode 100755
index 0000000..551ecb3
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44463ff66212d1a676da369ab8591f8556c09a18dd1141b748f1e0ca629b23aa
+size 45296
diff --git a/bip/data/dMRI/autoptx/protocols/str_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/str_r/seed.nii.gz
new file mode 100755
index 0000000..4d5052c
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d4a3703fec2d183c04c3383089aa32819149598997b8a26ee8a7fef51a217e4a
+size 16023
diff --git a/bip/data/dMRI/autoptx/protocols/str_r/stop.nii.gz b/bip/data/dMRI/autoptx/protocols/str_r/stop.nii.gz
new file mode 100755
index 0000000..b781f35
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_r/stop.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0072ecc3edd292371e0e1ed5d7f0c99ab187c121fc016e43b24c4469e34a2c4b
+size 14350
diff --git a/bip/data/dMRI/autoptx/protocols/str_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/str_r/target.nii.gz
new file mode 100755
index 0000000..ac31ab1
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/str_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:66777b2d67306ebe55bf0bb1e1775c6cab0fc0e5c9f781139ab96475322aee3f
+size 14430
diff --git a/bip/data/dMRI/autoptx/protocols/unc_l/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_l/._exclude.nii.gz
new file mode 100755
index 0000000..d6e4a3d
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_l/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f490fe9b58202b069592db4a26fc5cb20d58ad7bdda182b337edc563a31f4011
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/unc_l/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_l/._seed.nii.gz
new file mode 100755
index 0000000..306cd51
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_l/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b7354c74d3b1509640008e5e873f752571686b3a71c88ecd03b857c61ece450f
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/unc_l/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_l/._target.nii.gz
new file mode 100755
index 0000000..8e049f0
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_l/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:351491adb8d12213b9ea64c0bff69e76d6017ac35366a49e315f5d4617e6ac3e
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/unc_l/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_l/exclude.nii.gz
new file mode 100755
index 0000000..f4d3bb9
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_l/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5216051de6c7a3cf3fda47b2da15f6185f08e85bcac7ee22e8fa21c423c409e9
+size 45895
diff --git a/bip/data/dMRI/autoptx/protocols/unc_l/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_l/seed.nii.gz
new file mode 100755
index 0000000..0ef04d6
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_l/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4b198ef4e766420ec0495aaafcd2112193c026e396a8068372facf54f33087f4
+size 14534
diff --git a/bip/data/dMRI/autoptx/protocols/unc_l/target.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_l/target.nii.gz
new file mode 100755
index 0000000..3981c35
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_l/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9aafc01e0ea8f12e72fec192973b7df49191078f6021bdc867465ddb5ebf91d1
+size 14354
diff --git a/bip/data/dMRI/autoptx/protocols/unc_r/._exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_r/._exclude.nii.gz
new file mode 100755
index 0000000..0fe09d4
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_r/._exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cdde93632f9c9e89941484c09d6652af10f9cc90df918294e80fae2e89ca40b8
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/unc_r/._seed.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_r/._seed.nii.gz
new file mode 100755
index 0000000..3f8e37d
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_r/._seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aa7df2c23d569f50ddae58ae1091a9fbd963d14fa7f0e1a8d16be58794c62334
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/unc_r/._target.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_r/._target.nii.gz
new file mode 100755
index 0000000..66f5971
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_r/._target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7aaba5e8710ef6a6d77e4be11ccf48f1ec252ddeb55d827b7939590db630fd2c
+size 4096
diff --git a/bip/data/dMRI/autoptx/protocols/unc_r/exclude.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_r/exclude.nii.gz
new file mode 100755
index 0000000..ec88132
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_r/exclude.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:606688b5bd669784b7bbb6ed9327f91ae1cdd151ef615582dde6202a3d4a5a97
+size 45895
diff --git a/bip/data/dMRI/autoptx/protocols/unc_r/seed.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_r/seed.nii.gz
new file mode 100755
index 0000000..8fc465e
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_r/seed.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:78985454c5bb0f2a1716fdbf1cfb5978344be4bc19d4a1d5767f83391efd9f84
+size 14541
diff --git a/bip/data/dMRI/autoptx/protocols/unc_r/target.nii.gz b/bip/data/dMRI/autoptx/protocols/unc_r/target.nii.gz
new file mode 100755
index 0000000..d2214ff
--- /dev/null
+++ b/bip/data/dMRI/autoptx/protocols/unc_r/target.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e201211ff98575f66dcbd1fb6bcd94b952ee88d9e46a82ffd0fb1e3fa34e04c8
+size 14348
diff --git a/bip/data/dMRI/autoptx/struct_list.json b/bip/data/dMRI/autoptx/struct_list.json
new file mode 100755
index 0000000..2b377d9
--- /dev/null
+++ b/bip/data/dMRI/autoptx/struct_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5d442d4f2f831629a2ce37fefaec7d5e166c9f1992b96deeefe5876d94767802
+size 1266
diff --git a/bip/data/dMRI/b0_threshold.txt b/bip/data/dMRI/b0_threshold.txt
new file mode 100755
index 0000000..e900246
--- /dev/null
+++ b/bip/data/dMRI/b0_threshold.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eea8254c7500ba3de996aa8ad6af399183f04e17d4a8102fde539dbc93a90012
+size 4
diff --git a/bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg b/bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg
new file mode 100755
index 0000000..f01d385
--- /dev/null
+++ b/bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f966f6decd421e9cbe25ffb52708acf54b9c95ccbcb47862446f6be11294b84c
+size 1156
diff --git a/bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg_2 b/bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg_2
new file mode 100755
index 0000000..aed0532
--- /dev/null
+++ b/bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg_2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d91d51129854e9532f57f3e11ed5e0e9beed7671c01e69689f7364cd68b435bb
+size 1186
diff --git a/bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg_3 b/bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg_3
new file mode 100755
index 0000000..29dea75
--- /dev/null
+++ b/bip/data/dMRI/dMRI_reg_optimal_parameters/exampleReg_3
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:af8a2f8dae679b68f25cd7f2b03631e9759677ea24d43beed58649c946596741
+size 1208
diff --git a/bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s1.cnf b/bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s1.cnf
new file mode 100755
index 0000000..149e79c
--- /dev/null
+++ b/bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s1.cnf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3df6320e97300f9cef8a77b6c7c6306b8256351d5a7022d9966c076f24747227
+size 1416
diff --git a/bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s2.cnf b/bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s2.cnf
new file mode 100755
index 0000000..d1e0b13
--- /dev/null
+++ b/bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s2.cnf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b2fe418169f8ce1dde5e277a09e8edcdb6a0dc3f3065972ae69404020ef639ec
+size 1529
diff --git a/bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s3.cnf b/bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s3.cnf
new file mode 100755
index 0000000..392194c
--- /dev/null
+++ b/bip/data/dMRI/dMRI_reg_optimal_parameters/oxford_s3.cnf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9d304dfd224b8e48f20364dcce77c7618722cf3a9bcd40d764a6d25ee8020eaf
+size 1575
diff --git a/bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s1.cnf b/bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s1.cnf
new file mode 100755
index 0000000..099e8a4
--- /dev/null
+++ b/bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s1.cnf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0232757d08542047e9914a3b3495e29c00d66f0284fc3ac57db649f4bde4f9c2
+size 1416
diff --git a/bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s2.cnf b/bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s2.cnf
new file mode 100755
index 0000000..7c021dc
--- /dev/null
+++ b/bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s2.cnf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ec9429b705cd4c82530eec368e1965078ad8e266b780f396b950119d0c33b25c
+size 1529
diff --git a/bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s3.cnf b/bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s3.cnf
new file mode 100755
index 0000000..7f83173
--- /dev/null
+++ b/bip/data/dMRI/dMRI_reg_optimal_parameters/rotterdam_s3.cnf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d6135ac7aa6b1462359b6c31d2d21a9538971865059fc1dcba0a2e595a07c3b4
+size 1575
diff --git a/bip/data/fMRI_fsf/designF.txt b/bip/data/fMRI_fsf/designF.txt
new file mode 100755
index 0000000..9ddc24f
--- /dev/null
+++ b/bip/data/fMRI_fsf/designF.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a5f92de6a9e25db90973fb900101ad77195f855981dbcf1cb02a82aea937dbc9
+size 43
diff --git a/bip/data/fMRI_fsf/designS.txt b/bip/data/fMRI_fsf/designS.txt
new file mode 100755
index 0000000..e6c785f
--- /dev/null
+++ b/bip/data/fMRI_fsf/designS.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c66d999be64fd8441138d65b865631776a888763481ba52d37d5a410919ade61
+size 42
diff --git a/bip/data/fMRI_fsf/design_ICA_nonSmoothed.fsf b/bip/data/fMRI_fsf/design_ICA_nonSmoothed.fsf
new file mode 100755
index 0000000..0dc5b2c
--- /dev/null
+++ b/bip/data/fMRI_fsf/design_ICA_nonSmoothed.fsf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:254031e430d4d087d30769147d5285dc753f7fc862bfb5ef81e7ea0a4a41fdef
+size 6531
diff --git a/bip/data/fMRI_fsf/design_TASK.fsf b/bip/data/fMRI_fsf/design_TASK.fsf
new file mode 100755
index 0000000..321ee88
--- /dev/null
+++ b/bip/data/fMRI_fsf/design_TASK.fsf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7dffc5c093a4638ed8b88520e9773ab2b9571909ab1c7e46384007e556c780ea
+size 14040
diff --git a/bip/data/fix/UKBB_model.pyfix_model b/bip/data/fix/UKBB_model.pyfix_model
new file mode 100644
index 0000000..20bc1bd
--- /dev/null
+++ b/bip/data/fix/UKBB_model.pyfix_model
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cc046bbe3d2538b755c0d18bcf5d0ebc08270626d51abff488b8197014923f1b
+size 472297
diff --git a/bip/data/fix/UKBB_model_2.pyfix_model b/bip/data/fix/UKBB_model_2.pyfix_model
new file mode 100644
index 0000000..5d0d7a2
--- /dev/null
+++ b/bip/data/fix/UKBB_model_2.pyfix_model
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2a582ac9ef9709d4c7e1d9930ec1cea38e62e786022cf59268ccaf51b26efd0e
+size 479929
diff --git a/bip/data/fnirt/bb_fnirt.cnf b/bip/data/fnirt/bb_fnirt.cnf
new file mode 100755
index 0000000..ca3b548
--- /dev/null
+++ b/bip/data/fnirt/bb_fnirt.cnf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41e2f1b068e4841c8f6d7934375651fbe2cf2e66ac40da3d21f3fbb9b9576e37
+size 2095
diff --git a/bip/data/netmats/groupMask1.nii.gz b/bip/data/netmats/groupMask1.nii.gz
new file mode 100644
index 0000000..09a1f59
--- /dev/null
+++ b/bip/data/netmats/groupMask1.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ae191189dfb9dd61c615695524b609712b891091e0bb9268627b14334bf09191
+size 12596
diff --git a/bip/data/netmats/groupMask2.nii.gz b/bip/data/netmats/groupMask2.nii.gz
new file mode 100644
index 0000000..763c578
--- /dev/null
+++ b/bip/data/netmats/groupMask2.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:67aad7cba913142158726cc90fcffda64bf5b4d50f0e87e3362a1f537ae9d6db
+size 12315
diff --git a/bip/data/netmats/groupMask5.nii.gz b/bip/data/netmats/groupMask5.nii.gz
new file mode 100644
index 0000000..dabbafd
--- /dev/null
+++ b/bip/data/netmats/groupMask5.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bad580a85019111b481be06bde3704ee8866d75dabe89ff390a65cae95ba0532
+size 5642
diff --git a/bip/data/netmats/groupMask5a.nii.gz b/bip/data/netmats/groupMask5a.nii.gz
new file mode 100644
index 0000000..610f4b8
--- /dev/null
+++ b/bip/data/netmats/groupMask5a.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eea197dc41c09f8f907b0743a6a2c13dd0e72f40d0e3a4d4a3f4ceb7ba23ba07
+size 4082
diff --git a/bip/data/netmats/melodic_IC_100.nii.gz b/bip/data/netmats/melodic_IC_100.nii.gz
new file mode 100644
index 0000000..cc13126
--- /dev/null
+++ b/bip/data/netmats/melodic_IC_100.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:84e602ee22a3ae225ad6f42b942add14ff134b181195195edd5b21f4a15d636f
+size 87745042
diff --git a/bip/data/netmats/melodic_IC_25.nii.gz b/bip/data/netmats/melodic_IC_25.nii.gz
new file mode 100644
index 0000000..0fd07cb
--- /dev/null
+++ b/bip/data/netmats/melodic_IC_25.nii.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7f78e8de6d32d622bd132a821b02b1ddb8e667e7c0832ee2a68a8acb388799ab
+size 21972882
diff --git a/bip/data/swMRI/hann_filter.txt b/bip/data/swMRI/hann_filter.txt
new file mode 100644
index 0000000..a85bf86
--- /dev/null
+++ b/bip/data/swMRI/hann_filter.txt
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:056ad1b95d3b20e68e9d81aa57a6365399c316db9dbb875941178339a8a43e15
+size 77858
diff --git a/bip/ext_wrappers/__init__.py b/bip/ext_wrappers/__init__.py
new file mode 100755
index 0000000..6f78978
--- /dev/null
+++ b/bip/ext_wrappers/__init__.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+#
+# pylint: disable=unused-import
+# flake8: noqa: F401
+#
+# __init__.py - Wrappers for external command-line tools.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+#
+"""This package contains wrappers for various command line tools, allowing
+them to be called from Python.
+"""
+
+from bip.ext_wrappers.freesurfer   import  (recon_all)
diff --git a/bip/ext_wrappers/extwrapperutils.py b/bip/ext_wrappers/extwrapperutils.py
new file mode 100644
index 0000000..31fe79b
--- /dev/null
+++ b/bip/ext_wrappers/extwrapperutils.py
@@ -0,0 +1,1297 @@
+#!/usr/bin/env python
+#
+# wrapperutils.py - Functions and decorators used by the FSL wrapper
+# functions.
+#
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Martin Craig <martin.craig@eng.ox.ac.uk>
+#
+"""This module contains functions and decorators used by the FSL wrapper
+functions.
+
+
+The :func:`cmdwrapper` and :func:`fslwrapper` functions are convenience
+decorators which allow you to write your wrapper function such that it simply
+generates the command-line needed to respectively run a standard shell
+command or a FSL command. For example::
+
+
+    @fslwrapper
+    def fslreorient2std(input, output):
+        return ['fslreorient2std', input, output]
+
+
+When this ``fslreorient2std`` function is called, the ``fslwrapper`` decorator
+will take care of invoking the command in a standardised way.
+
+
+The :func:`applyArgStyle` function can be used to automatically convert
+keyword arguments into command-line arguments, based on a set of standard
+patterns. For example::
+
+
+    @fslwrapper
+    def flirt(src, ref, **kwargs):
+        cmd  = ['flirt', '-in', src, '-ref', ref]
+        return cmd + applyArgStyle('-=', **kwargs)
+
+
+The :func:`fileOrImage` and :func:`fileOrArray` functions can be used to
+decorate a wrapper function such that in-memory ``nibabel`` images or Numpy
+arrays can be passed in as arguments - they will be automatically saved out to
+files, and then the file names passed into the wrapper function. For example::
+
+
+    @fileOrImage('src', 'ref')
+    @fslwrapper
+    def flirt(src, ref, **kwargs):
+        cmd  = ['flirt', '-in', src, '-ref', ref]
+        return cmd + applyArgStyle('-=', **kwargs)
+
+
+Now this ``flirt`` function can be called either with file names, or
+``nibabel`` images.
+
+
+.. note:: Because the :func:`fileOrImage` and :func:`fileOrArray` decorators
+          manipulate the return value of the decorated function, they should
+          be applied *after* any other decorators. Furthermore, if you need to
+          apply both a ``fileOrImage`` and ``fileOrArray`` decorator to a
+          function, they should be grouped together, e.g.::
+
+              @fileOrImage('a', 'b')
+              @fileOrArray('c', 'd')
+              @fslwrapper
+              def func(**kwargs):
+                  ...
+
+
+Command outputs can also be loaded back into memory by using the special
+:data:`LOAD` value when calling a wrapper function. For example::
+
+
+    @fileOrImage('src', 'ref', 'out')
+    @fslwrapper
+    def flirt(src, ref, **kwargs):
+        cmd  = ['flirt', '-in', src, '-ref', ref]
+        return cmd + applyArgStyle('-=', **kwargs)
+
+
+If we set the ``out`` argument to ``LOAD``, the output image will be loaded
+and returned::
+
+    src     = nib.load('src.nii')
+    ref     = nib.load('ref.nii')
+    aligned = flirt(src, ref, out=LOAD)['out']
+"""
+
+
+import itertools       as it
+import os.path         as op
+import collections.abc as abc
+import                    os
+import                    re
+import                    sys
+import                    glob
+import                    random
+import                    string
+import                    pathlib
+import                    fnmatch
+import                    inspect
+import                    logging
+import                    tempfile
+import                    warnings
+import                    functools
+import                    contextlib
+
+import nibabel as nib
+import numpy   as np
+
+import fsl.utils.run        as run
+import fsl.utils.assertions as asrt
+import fsl.utils.path       as fslpath
+import fsl.utils.tempdir    as tempdir
+import fsl.data.image       as fslimage
+
+
+log = logging.getLogger(__name__)
+
+
+def _update_wrapper(wrapper, wrapped, *args, **kwargs):
+    """Replacement for the built-in ``functools.update_wrapper``. This
+    implementation ensures that the wrapper function has an attribute
+    called ``__wrapped__``, which refers to the ``wrapped`` function.
+
+    This custom function is only needed in Python versions < 3.4.
+    """
+
+    wrapper = functools.update_wrapper(wrapper, wrapped, *args, **kwargs)
+
+    # Python >= 3.4 does things right
+    if (sys.version_info[0] * 10 + sys.version_info[1]) < 34:
+        wrapper.__wrapped__ = wrapped
+    return wrapper
+
+
+def _unwrap(func):
+    """Replacement for the built-in ``inspect.unwrap`` function, which
+    is not present in Python versions prior to 3.4.
+    """
+
+    # Python >= 3.4 has an inspect.unwrap function
+    if (sys.version_info[0] * 10 + sys.version_info[1]) >= 34:
+        return inspect.unwrap(func)
+
+    # Otherwise we follow the __wrapped__ chain ourselves
+    if hasattr(func, '__wrapped__'):
+        return _unwrap(func.__wrapped__)
+
+    return func
+
+
+def genxwrapper(func, runner):
+    """This function is used by :func:`cmdwrapper` and :func:`fslwrapper`.
+    It is not intended to be used in any other circumstances.
+
+    This function generates a wrapper function which calls ``func`` to
+    generate a command-line call, and then uses ``runner`` to invoke that
+    command.
+
+    ``func`` is assumed to be a wrapper function which generates a command-
+    line. ``runner`` is assumed to be Either :func:`.run.run` or
+    :func:`.run.runfsl`.
+
+    The generated wrapper function will pass all of its arguments to ``func``,
+    and will then pass the generated command-line to ``runner``, returning
+    whatever is returned.
+
+    The following keyword arguments will be intercepted by the wrapper
+    function, and will *not* be passed to ``func``:
+
+      - ``stdout``:   Passed to ``runner``. Defaults to ``True``.
+      - ``stderr``:   Passed to ``runner``. Defaults to ``True``.
+      - ``exitcode``: Passed to ``runner``. Defaults to ``False``.
+      - ``submit``:   Passed to ``runner``. Defaults to ``None``.
+      - ``log``:      Passed to ``runner``. Defaults to ``{'tee':True}``.
+      - ``cmdonly``:  Passed to ``runner``. Defaults to ``False``.
+
+    The default values for these arguments are stored in the
+    ``genxwrapper.run_options`` dictionary. This dictionary should not be
+    changed directly, but rather can be temporarily modified via the
+    :func:`wrapperconfig` context manager function.
+
+    :arg func:   A function which generates a command line.
+    :arg runner: Either :func:`.run.run` or :func:`.run.runfsl`.
+    """
+
+    def wrapper(*args, **kwargs):
+        opts     = genxwrapper.run_options
+        stdout   = kwargs.pop('stdout',   opts['stdout'])
+        stderr   = kwargs.pop('stderr',   opts['stderr'])
+        exitcode = kwargs.pop('exitcode', opts['exitcode'])
+        submit   = kwargs.pop('submit',   opts['submit'])
+        cmdonly  = kwargs.pop('cmdonly',  opts['cmdonly'])
+        logg     = kwargs.pop('log',      opts['log'])
+
+        # many wrapper functions use fsl.utils.assertions
+        # statements to check that input arguments are
+        # valid. Disable these if the cmdonly argument is
+        # being used to generate a command without running
+        # it.
+        with asrt.disabled(cmdonly):
+            cmd = func(*args, **kwargs)
+
+        return runner(cmd,
+                      stderr=stderr,
+                      log=logg,
+                      submit=submit,
+                      cmdonly=cmdonly,
+                      stdout=stdout,
+                      exitcode=exitcode)
+
+    return _update_wrapper(wrapper, func)
+
+
+genxwrapper.run_options = {
+    'stdout'   : True,
+    'stderr'   : True,
+    'exitcode' : False,
+    'submit'   : None,
+    'log'      : {'tee' : True},
+    'cmdonly'  : False
+}
+
+
+def cmdwrapper(func):
+    """This decorator can be used on functions which generate a command line.
+    It will pass the return value of the function to the
+    :func:`fsl.utils.run.run` function in a standardised manner.
+
+    See the :func:`genxwrapper` function for details.
+    """
+    return genxwrapper(func, run.run)
+
+
+def fslwrapper(func):
+    """This decorator can be used on functions which generate a FSL command
+    line. It will pass the return value of the function to the
+    :func:`fsl.utils.run.runfsl` function in a standardised manner.
+
+    See the :func:`genxwrapper` function for details.
+    """
+    return genxwrapper(func, run.runfsl)
+
+
+@contextlib.contextmanager
+def wrapperconfig(**kwargs):
+    """Context manager to be used when calling wrapper functions. Can modify
+    the options/arguments that are passed to :func:`fsl.utils.run.run` when
+    calling a command from a wrapper function. For example::
+
+        with wrapperconfig(stdout=False):
+            bet('struct', 'struct_brain')
+    """
+    opts = dict(genxwrapper.run_options)
+    genxwrapper.run_options.update(kwargs)
+    try:
+        yield
+    finally:
+        genxwrapper.run_options = opts
+
+
+SHOW_IF_TRUE = object()
+"""Constant to be used in the ``valmap`` passed to the :func:`applyArgStyle`
+function.
+
+When a ``SHOW_IF_TRUE`` argument is ``True``, it is added to the generated
+command line arguments.
+"""
+
+
+HIDE_IF_TRUE = object()
+"""Constant to be used in the ``valmap`` passed to the :func:`applyArgStyle`
+function.
+
+When a ``HIDE_IF_TRUE`` argument is ``True``, it is suppressed from the
+generated command line arguments.
+"""
+
+
+def applyArgStyle(style=None,
+                  valsep=None,
+                  argmap=None,
+                  valmap=None,
+                  singlechar_args=False,
+                  charstyle=None,
+                  charsep=None,
+                  **kwargs):
+    """Turns the given ``kwargs`` into command line options. This function
+    is intended to be used to automatically generate command line options
+    from arguments passed into a Python function.
+
+    The default settings will generate arguments that match typical UNIX
+    conventions, e.g. ``-a val``, ``--arg=val``, ``-a val1 val2``,
+    ``--arg=val1,val2``.
+
+    The ``style`` and ``valsep`` options (and ``charstyle`` and ``charsep``,
+    for single-character/short arguments) control how key-value pairs are
+    converted into command-line options:
+
+
+    =========  ==========  ===========================
+    ``style``  ``valsep``  Result
+    =========  ==========  ===========================
+    ``'-'``    ``' '``     ``-name val1 val2 val3``
+    ``'-'``    ``'"'``     ``-name "val1 val2 val3"``
+    ``'-'``    ``','``     ``-name val1,val2,val3``
+    ``'--'``   ``' '``     ``--name val1 val2 val3``
+    ``'--'``   ``'"'``     ``--name "val1 val2 val3"``
+    ``'--'``   ``','``     ``--name val1,val2,val3``
+    ``'-='``   ``' '``     Not supported
+    ``'-='``   ``'"'``     ``-name="val1 val2 val3"``
+    ``'-='``   ``','``     ``-name=val1,val2,val3``
+    ``'--='``  ``' '``     Not supported
+    ``'--='``  ``'"'``     ``--name="val1 val2 val3"``
+    ``'--='``  ``','``     ``--name=val1,val2,val3``
+    =========  ==========  ===========================
+
+
+    :arg style:     Controls how the ``kwargs`` are converted into command-line
+                    options - must be one of ``'-'``, ``'--'``, ``'-='``, or
+                    ``'--='`` (the default).
+
+    :arg valsep:    Controls how the values passed to command-line options
+                    which expect multiple arguments are delimited - must be
+                    one of ``' '``, ``','`` or ``'"'``. Defaults to ``' '``
+                    if ``'=' not in style``, ``','`` otherwise.
+
+    :arg argmap:    Dictionary of ``{kwarg-name : cli-name}`` mappings. This be
+                    used if you want to use different argument names in your
+                    Python function for the command-line options.
+
+    :arg valmap:    Dictionary of ``{cli-name : value}`` mappings. This can be
+                    used to define specific semantics for some command-line
+                    options. Acceptable values for ``value`` are as follows
+
+                     - :data:`SHOW_IF_TRUE` - if the argument is present, and
+                       ``True`` in ``kwargs``, the command line option
+                       will be added (without any arguments).
+
+                     - :data:`HIDE_IF_TRUE` - if the argument is present, and
+                       ``False`` in ``kwargs``, the command line option
+                       will be added (without any arguments).
+
+                     - Any other constant value. If the argument is present
+                       in ``kwargs``, its command-line option will be
+                       added, with the constant value as its argument.
+
+                    The argument for any options not specified in the
+                    ``valmap`` will be converted into strings.
+
+    :arg charstyle: Separate style specification for single-character
+                    arguments. If ``style == '--='``, defaults to ``'-'``,
+                    matching UNIX conventions. Otherwise defaults to the
+                    value of ``style``.
+
+    :arg charsep:   Controls how the values passed to command-line options
+                    which expect multiple arguments are delimited - must be
+                    one of ``' '``, ``','`` or ``'"'``. Defaults to ``' '``
+                    if ``'=' not in style``, ``','`` otherwise.
+
+    :arg singlechar_args: If ``True``, equivalent to ``charstyle='-'``. This
+                          argument remains for compatibility, but may be
+                          removed in a future version.
+
+    :arg kwargs: Arguments to be converted into command-line options.
+
+    :returns:    A sequence containing the generated command-line options, the
+                 same as what ``shlex.split`` would generate for a properly
+                 quoted string.
+    """
+
+    if style is None:
+        style = '--='
+
+    if charstyle is None:
+        if   singlechar_args: charstyle = '-'
+        elif style == '--=':  charstyle = '-'
+        else:                 charstyle = style
+
+    if valsep is None:
+        if '=' in style: valsep = ','
+        else:            valsep = ' '
+
+    if charsep is None:
+        if '=' in charstyle: charsep = ','
+        else:                charsep = ' '
+
+    if style not in ('-', '--', '-=', '--='):
+        raise ValueError(f'Invalid style: {style}')
+    if charstyle not in ('-', '--', '-=', '--='):
+        raise ValueError(f'Invalid charstyle: {charstyle}')
+    if valsep not in (' ', ',', '"'):
+        raise ValueError(f'Invalid valsep: {valsep}')
+    if charsep not in (' ', ',', '"'):
+        raise ValueError(f'Invalid charsep: {charsep}')
+
+    # It makes no sense to combine argument+value
+    # with an equals sign, but not have the value
+    # quoted (e.g "--arg=val1 val2 val3").
+    if '=' in style and valsep == ' ':
+        raise ValueError(f'Incompatible style {style} '
+                         'and valsep ({valsep})')
+    if '=' in charstyle and charsep == ' ':
+        raise ValueError(f'Incompatible style {charstyle} '
+                         'and valsep ({charsep})')
+
+    if argmap is None: argmap = {}
+    if valmap is None: valmap = {}
+
+    # Format the argument.
+    def fmtarg(arg, style):
+        if style in ('--', '--='): return f'--{arg}'
+        else:                      return f'-{arg}'
+
+    # Formt the argument value.
+    def fmtval(val, sep):
+        if isinstance(val, abc.Sequence) and (not isinstance(val, str)):
+            val = [str(v) for v in val]
+            if   sep == ' ': return val
+            elif sep == '"': return [' '.join(val)]
+            else:            return [sep.join(val)]
+        else:
+            return [str(val)]
+
+    # Combine the argument and value together.
+    # val is assumed to be a sequence.
+    def fmtargval(arg, val, style):
+        # if '=' in style, val will
+        # always be a single string
+        if '=' in style: return ['{}={}'.format(arg, val[0])]
+        else:            return [arg] + val
+
+    args = []
+
+    for k, v in kwargs.items():
+
+        if v is None: continue
+
+        if len(k) == 1: sty, sep = charstyle, charsep
+        else:           sty, sep = style,     valsep
+
+        k    = argmap.get(k, k)
+        mapv = valmap.get(k, fmtval(v, sep))
+        k    = fmtarg(k, sty)
+
+        if mapv in (SHOW_IF_TRUE, HIDE_IF_TRUE):
+            if (mapv is SHOW_IF_TRUE and     v) or \
+               (mapv is HIDE_IF_TRUE and not v):
+                args.append(k)
+        else:
+            args.extend(fmtargval(k, mapv, sty))
+
+    return args
+
+
+def namedPositionals(func, args):
+    """Given a function, and a sequence of positional arguments destined
+    for that function, identifies the name for each positional argument.
+    Variable positional arguments are given an automatic name.
+
+    :arg func: Function which will accept ``args`` as positionals.
+    :arg args: Tuple of positional arguments to be passed to ``func``.
+    """
+
+    # Remove any decorators
+    # from the function
+    func = _unwrap(func)
+
+    # getargspec is the only way to
+    # get the names of positional
+    # arguments in Python 2.x.
+    if sys.version_info[0] < 3:
+        spec     = inspect.getargspec(func)
+        argnames = spec.args
+        varargs  = spec.varargs
+
+    # But getargspec is deprecated
+    # in python 3.x
+    else:
+
+        # getfullargspec is deprecated in
+        # python 3.5, but not in python 3.6.
+        with warnings.catch_warnings():
+            warnings.filterwarnings('ignore', category=DeprecationWarning)
+            spec     = inspect.getfullargspec(func)
+            argnames = spec.args
+            varargs  = spec.varargs
+
+    # we only care about the arguments
+    # that are being passed in
+    argnames = argnames[:len(args)]
+
+    # generate names for varargs
+    nvarargs = len(args) - len(argnames)
+    suffix   = namedPositionals.varargsSuffix
+    if varargs is not None and nvarargs > 0:
+        argnames += [f'{varargs}{i}{suffix}' for i in range(nvarargs)]
+
+    return argnames
+namedPositionals.varargsSuffix = '_VARARG'
+
+
+LOAD = object()
+"""Constant used by the :class:`FileOrThing` class to indicate that an output
+file should be loaded into memory and returned as a Python object.
+"""
+
+
+class FileOrThing:
+    """Decorator which ensures that certain arguments which are passed into the
+    decorated function are always passed as file names. Both positional and
+    keyword arguments can be specified.
+
+
+    The ``FileOrThing`` class is not intended to be used directly - see the
+    :func:`fileOrImage` and :func:`fileOrArray` decorator functions for more
+    details.
+
+
+    These decorators are intended for functions which wrap a command-line tool,
+    i.e. where some inputs/outputs need to be specified as file names.
+
+
+    **Inputs**
+
+
+    Any arguments which are not of type ``Thing`` are passed through to the
+    decorated function unmodified.  Arguments which are of type ``Thing`` are
+    saved to a temporary file, and the name of that file is passed to the
+    function.
+
+
+    **Outputs**
+
+
+    If an argument is given the special :data:`LOAD` value, it is assumed
+    to be an output argument. In this case, it is replaced with a temporary
+    file name then, after the function has completed, that file is loaded
+    into memory, and the value returned (along with the function's output,
+    and any other arguments with a value of ``LOAD``).
+
+
+    **Return value**
+
+
+    Functions decorated with a ``FileOrThing`` decorator will always return a
+    ``dict``-like object, where the function's actual return value is
+    accessible via an attribute called ``stdout``. All output arguments with a
+    value of ``LOAD`` will be present as dictionary entries, with the keyword
+    argument names used as keys; these values will also be accessible as
+    attributes of the results dict, when possible. Any ``LOAD`` output
+    arguments which were not generated by the function will not be present in
+    the dictionary.
+
+
+    **Exceptions**
+
+
+    The above description holds in all situations, except when arguments called
+    ``submit`` and/or ``cmdonly`` are passed, and are set to values which
+    evaluate to ``True``. In this case, the ``FileOrThing`` decorator will pass
+    all arguments straight through to the decorated function, and will return
+    its return value unchanged.
+
+    This is because most functions that are decorated with the
+    :func:`fileOrImage` or :func:`fileOrArray` decorators will invoke a call
+    to :func:`.run.run` or :func:`.runfsl`, where:
+
+      - a value of ``submit=True`` will cause the command to be executed
+        asynchronously on a cluster platform.
+      - a value of ``cmdonly=True`` will cause the command to *not* be executed,
+        but instead the command that would have been executed is returned.
+
+    A :exc:`ValueError` will be raised if the decorated function is called
+    with ``submit=True`` and/or ``cmdonly=True``, and with any in-memory
+    objects or ``LOAD`` symbols.
+
+
+    **Example**
+
+
+    As an example of using the ``fileOrArray`` decorator on a function
+    which concatenates two files containing affine transformations, and
+    saves the output to a file::
+
+        # if atob, btoc, or output are passed
+        # in as arrays, they are converted to
+        # file names.
+        @fileOrArray('atob', 'btoc', 'output')
+        def concat(atob, btoc, output=None):
+
+            # inputs are guaranteed to be files
+            atob = np.loadtxt(atob)
+            btoc = np.loadtxt(atoc)
+
+            atoc = np.dot(btoc, atob)
+
+            if output is not None:
+                np.savetxt(output, atoc)
+
+            return 'Done'
+
+
+    Because we have decorated the ``concat`` function with :func:`fileToArray`,
+    it can be called with either file names, or Numpy arrays::
+
+
+        # All arguments are passed through
+        # unmodified - the output will be
+        # saved to a file called atoc.mat.
+        concat('atob.txt', 'btoc.txt', 'atoc.mat')
+
+        # The function's return value
+        # is accessed via an attribute called
+        # "stdout" on the dict
+        assert concat('atob.txt', 'btoc.txt', 'atoc.mat').stdout == 'Done'
+
+        # Outputs to be loaded into memory
+        # are returned in a dictionary,
+        # with argument names as keys. Values
+        # can be accessed as dict items, or
+        # as attributes.
+        atoc = concat('atob.txt', 'btoc.txt', LOAD)['atoc']
+        atoc = concat('atob.txt', 'btoc.txt', LOAD).atoc
+
+        # In-memory inputs are saved to
+        # temporary files, and those file
+        # names are passed to the concat
+        # function.
+        atoc = concat(np.diag([2, 2, 2, 0]),
+                      np.diag([3, 3, 3, 3]), LOAD).atoc
+
+
+    **Using with other decorators**
+
+
+    ``FileOrThing`` decorators can be chained with other ``FileOrThing``
+    decorators, and other decorators.  When multiple ``FileOrThing``
+    decorators are used on a single function, the outputs from each decorator
+    are merged together into a single dict-like object.
+
+
+    ``FileOrThing`` decorators can be used with any other decorators
+    **as long as** they do not manipulate the return value, and as long as
+    the ``FileOrThing`` decorators are adjacent to each other.
+    """
+
+
+    class Results(dict):
+        """A custom ``dict`` type used to return outputs from a function
+        decorated with ``FileOrThing``. All outputs are stored as dictionary
+        items, with the argument name as key, and the output object (the
+        "thing") as value.
+
+        Where possible (i.e. for outputs named with a valid Python
+        identifier), the outputs are also made accessible as attributes of
+        the ``Results`` object.
+
+        The decorated function's actual return value is accessible via the
+        :meth:`stdout` property.
+        """
+
+
+        def __init__(self, stdout):
+            """Create a ``Results`` dict.
+
+            :arg stdout: Return value of the decorated function (typically a
+                         tuple containing the standard output and error of the
+                         underlying command).
+            """
+            super().__init__()
+            self.__stdout = stdout
+
+
+        def __setitem__(self, key, val):
+            """Add an item to the dict. The item is also added as an attribute.
+            """
+            super().__setitem__(key, val)
+            setattr(self, key, val)
+
+
+        @property
+        def stdout(self):
+            """Access the return value of the decorated function. """
+            return self.__stdout
+
+
+    def __init__(self,
+                 func,
+                 prepIn,
+                 prepOut,
+                 load,
+                 removeExt,
+                 *args,
+                 **kwargs):
+        """Initialise a ``FileOrThing`` decorator.
+
+        :arg func:      The function to be decorated.
+
+        :arg prepIn:    Function which returns a file name to be used in
+                        place of an input argument.
+
+        :arg prepOut:   Function which generates a file name to use for
+                        arguments that were set to :data:`LOAD`.
+
+        :arg load:      Function which is called to load items for arguments
+                        that were set to :data:`LOAD`. Must accept the
+                        following arguments:
+
+                         - the name of the argument
+                         - path to the file to be loaded
+
+        :arg removeExt: Function which can remove a file extension from a file
+                        path.
+
+        :arg outprefix: Must be passed as a keyword argument. The name of a
+                        positional or keyword argument to the function, which
+                        specifies an output file name prefix.  All other
+                        arguments with names that begin with this prefix may
+                        be interpreted as things to ``LOAD``.
+
+        All other positional arguments are interpreted as the names of the
+        arguments to the function which will be handled by this
+        ``FileOrThing`` decorator. If not provided, *all* arguments passed to
+        the function will be handled.
+
+
+        The ``prepIn`` and ``prepOut`` functions must accept the following
+        positional arguments:
+
+          - A directory in which all temporary input/output files should be
+            stored
+
+          - The name of the keyword argument to be processed
+
+          - The argument value that was passed in
+        """
+
+        self.__func      = func
+        self.__prepIn    = prepIn
+        self.__prepOut   = prepOut
+        self.__load      = load
+        self.__removeExt = removeExt
+        self.__things    = args
+        self.__outprefix = kwargs.get('outprefix', None)
+
+
+    def __call__(self, *args, **kwargs):
+        """Function which calls ``func``, ensuring that any arguments of
+        type ``Thing`` are saved to temporary files, and any arguments
+        with the value :data:`LOAD` are loaded and returned.
+
+        All other arguments are passed through to ``func``.
+        """
+
+        func     = self.__func
+        argnames = namedPositionals(func, args)
+
+        # Special case - if fsl.utils.run[fsl] is
+        # being decorated (e.g. via cmdwrapper/
+        # fslwrapper), and submit=True or
+        # cmdonly=True, this call will ultimately
+        # submit the job to the cluster, or will
+        # return the command that would have been
+        # executed, and will return immediately.
+        #
+        # We error if we are given any in-memory
+        # things, or LOAD symbols.
+        #
+        # n.b. testing values to be strings could
+        # interfere with the fileOrText decorator.
+        # Possible solution is to use pathlib?
+        if kwargs.get('submit',  False) or \
+           kwargs.get('cmdonly', False):
+            allargs = {**dict(zip(argnames, args)), **kwargs}
+            for name, val in allargs.items():
+                if (name in self.__things) and (not isinstance(val, str)):
+                    raise ValueError('Cannot use in-memory objects '
+                                     'or LOAD with submit=True!')
+            return func(*args, **kwargs)
+
+        # If this FileOrThing is being called
+        # by another FileOrThing don't create
+        # another working directory. We do this
+        # sneakily, by setting an attribute on
+        # the wrapped function which stores the
+        # current working directory.
+        wrapped     = _unwrap(func)
+        fot_workdir = getattr(wrapped, '_fot_workdir', None)
+        parent      = fot_workdir is None
+
+        # Create a tempdir to store any temporary
+        # input/output things, but don't change
+        # into it, as file paths passed to the
+        # function may be relative.
+        with tempdir.tempdir(changeto=False, override=fot_workdir) as td:
+
+            log.debug('Redirecting LOADed outputs to %s', td)
+
+            # Replace any things with file names.
+            # Also get a list of LOAD outputs
+            args = self.__prepareArgs(parent, td, argnames, args, kwargs)
+            args, kwargs, outprefix, outfiles, prefixes = args
+
+            # The prefix/patterns may be
+            # overridden by a parent FoT
+            outprefix = getattr(wrapped, '_fot_outprefix', outprefix)
+            prefixes  = getattr(wrapped, '_fot_prefixes',  prefixes)
+
+            # if there are any other FileOrThings
+            # in the decorator chain, get them to
+            # use our working directory, and
+            # prefixes, instead of creating their
+            # own.
+            if parent:
+                setattr(wrapped, '_fot_workdir',   td)
+                setattr(wrapped, '_fot_outprefix', outprefix)
+                setattr(wrapped, '_fot_prefixes',  prefixes)
+
+            # Call the function
+            try:
+                result = func(*args, **kwargs)
+
+            finally:
+                # if we're the top-level FileOrThing
+                # decorator, remove the attributes we
+                # added above.
+                if parent:
+                    delattr(wrapped, '_fot_workdir')
+                    delattr(wrapped, '_fot_outprefix')
+                    delattr(wrapped, '_fot_prefixes')
+
+            return self.__generateResult(
+                td, result, outprefix, outfiles, prefixes)
+
+
+    def __prepareArgs(self, parent, workdir, argnames, args, kwargs):
+        """Prepares all input and output arguments to be passed to the
+        decorated function. Any arguments with a value of :data:`LOAD` are
+        passed to the ``prepOut`` function specified at :meth:`__init__`.
+        All other arguments are passed through the ``prepIn`` function.
+
+        :arg parent:   ``True`` if this ``FileOrThing`` is the first in a
+                       chain of ``FileOrThing`` decorators.
+
+        :arg workdir:  Directory in which all temporary files should be stored.
+
+        :arg argnames: Names for each positional argument.
+
+        :arg args:     Positional arguments to be passed to the decorated
+                       function.
+
+        :arg kwargs:   Keyword arguments to be passed to the decorated
+                       function.
+
+        :returns:      A tuple containing:
+
+                        - An updated copy of ``args``.
+
+                        - An updated copy of ``kwargs``.
+
+                        - The output file prefix that was actually passed in
+                          (it is subsequently modified so that prefixed outputs
+                          are redirected to a temporary location). All prefixed
+                          outputs that are not ``LOAD``ed should be moved into
+                          this directory. ``None`` if there is no output
+                          prefix.
+
+                        - A dictionary of ``{ name : filename }`` mappings,
+                          for all arguments with a value of ``LOAD``.
+
+                        - A dictionary of ``{ filepat : replstr }`` paths, for
+                          all output-prefix arguments with a value of ``LOAD``.
+        """
+
+        # These containers keep track
+        # of output files which are to
+        # be loaded into memory
+        outfiles      = dict()
+        prefixedFiles = dict()
+
+        allargs  = {k : v for k, v in zip(argnames, args)}
+        allargs.update(kwargs)
+
+        # Has an output prefix been specified?
+        prefix     = allargs.get(self.__outprefix, None)
+        realPrefix = None
+
+        # Prefixed outputs are only
+        # managed by the parent
+        # FileOrthing in a chain of
+        # FoT decorators.
+        if not parent:
+            prefix = None
+
+        # If so, replace it with a new output
+        # prefix which will redirect all output
+        # to the temp dir.
+        #
+        # Importantly, here we assume that the
+        # underlying function (and hence the
+        # underlying command-line tool) will
+        # accept an output prefix which contains
+        # a directory path.
+        if prefix is not None:
+            if isinstance(prefix, pathlib.Path):
+                prefix = op.abspath(prefix)
+
+            # If prefix is set to LOAD,
+            # all generated output files
+            # should be loaded - we use a
+            # randomly generated prefix,
+            # and add it to prefixedFiles,
+            # so that every file which
+            # starts with it will be
+            # loaded.
+            if prefix is LOAD:
+                prefix                = random.sample(string.ascii_letters, 10)
+                prefix                = ''.join(prefix)
+                prefixedFiles[prefix] = self.__outprefix
+
+            realPrefix                = prefix
+            fakePrefix                = op.join(workdir, prefix)
+            allargs[self.__outprefix] = fakePrefix
+
+            log.debug('Replacing output prefix: %s -> %s',
+                      realPrefix, fakePrefix)
+
+            # If the prefix specifies a
+            # directory, make sure it
+            # exists (remember that we're
+            # in a temporary directory)
+            pdir = op.dirname(fakePrefix)
+            if pdir != '' and not op.exists(pdir):
+                os.makedirs(pdir)
+
+        if len(self.__things) > 0: things = self.__things
+        else:                      things = allargs.keys()
+
+        for name, val in list(allargs.items()):
+
+            # don't process the
+            # outprefix argument
+            if name == self.__outprefix:
+                continue
+
+            # is this argument referring
+            # to a prefixed output?
+            isprefixed = (prefix is not None and
+                          name.startswith(prefix))
+
+            if not any((isprefixed,
+                        name in things,
+                        name.endswith(namedPositionals.varargsSuffix))):
+                continue
+
+            # Prefixed output files may only
+            # be given a value of LOAD
+            if isprefixed and val is not LOAD:
+                raise ValueError('Cannot specify name of prefixed file - the '
+                                 'name is defined by the output prefix: '
+                                 '{}'.format(name))
+
+            if val is LOAD:
+
+                # this argument refers to an output
+                # that is generated from the output
+                # prefix argument, and doesn't map
+                # directly to an argument of the
+                # function. So we don't pass it
+                # through.
+                if isprefixed:
+                    prefixedFiles[name] = name
+                    allargs.pop(name)
+
+                # regular output-file argument
+                else:
+                    outfile = self.__prepOut(workdir, name, val)
+                    outfiles[name] = outfile
+                    allargs[ name] = outfile
+
+            # Assumed to be an input file
+            else:
+                # sequences may be
+                # accepted for inputs
+                if isinstance(val, (list, tuple)):
+                    infile = list(val)
+                    for i, v in enumerate(val):
+                        v = self.__prepIn(workdir, name, v)
+                        if v is not None:
+                            infile[i] = v
+
+                else:
+                    infile = self.__prepIn(workdir, name, val)
+
+                if infile is not None:
+                    allargs[name] = infile
+
+        if realPrefix is not None and len(prefixedFiles) == 0:
+            allargs[self.__outprefix] = realPrefix
+
+        # Turn any Path objects into absolute path
+        # strings. Don't use Path.resolve(), as it
+        # returns a relative path for non-existent
+        # files/dirs on Windows/certain Python
+        # versions.
+        for k, v in allargs.items():
+            if isinstance(v, pathlib.Path):
+                allargs[k] = op.abspath(v)
+
+        args   = [allargs.pop(k) for k in argnames]
+        kwargs = allargs
+
+        return args, kwargs, realPrefix, outfiles, prefixedFiles
+
+
+    def __generateResult(
+            self, workdir, result, outprefix, outfiles, prefixes):
+        """Loads function outputs and returns a :class:`Results` object.
+
+        Called by :meth:`__call__` after the decorated function has been
+        called. Figures out what files should be loaded, and loads them into
+        a ``Results`` object.
+
+        :arg workdir:   Directory which contains the function outputs.
+        :arg result:    Function return value.
+        :arg outprefix: Original output prefix that was passed into the
+                        function (or ``None`` if one wasn't passed)
+        :arg outfiles:  Dictionary containing output files to be loaded (see
+                        :meth:`__prepareArgs`).
+        :arg prefixes:  Dictionary containing output-prefix patterns to be
+                        loaded (see :meth:`__prepareArgs`).
+
+        :returns:       A ``Results`` object containing all loaded outputs.
+        """
+
+        # make a Results object to store
+        # the output. If we are decorating
+        # another FileOrThing, the
+        # results will get merged together
+        # into a single Results dict.
+        if not isinstance(result, FileOrThing.Results):
+            result = FileOrThing.Results(result)
+
+        # Load the LOADed outputs
+        for oname, ofile in outfiles.items():
+
+            log.debug('Loading output %s: %s', oname, ofile)
+
+            if op.exists(ofile): oval = self.__load(oname, ofile)
+            else:                oval = None
+
+            result[oname] = oval
+
+        # No output prefix - we're done
+        if outprefix is None or len(prefixes) == 0:
+            return result
+
+        # Load or move output-prefixed files.
+        # Find all files with a name that
+        # matches the prefix that was passed
+        # in (recursing into matching sub-
+        # directories too).
+        allPrefixed = glob.glob(op.join(workdir, '{}*'.format(outprefix)))
+        allPrefixed = [fslpath.allFiles(f) if op.isdir(f) else [f]
+                       for f in allPrefixed]
+
+        for prefixed in it.chain(*allPrefixed):
+            fullpath = prefixed
+            prefixed = op.relpath(prefixed, workdir)
+            for prefPat, prefName in prefixes.items():
+                if not fnmatch.fnmatch(prefixed, '{}*'.format(prefPat)):
+                    continue
+
+                log.debug('Loading prefixed output %s [%s]: %s',
+                          prefPat, prefName, prefixed)
+
+                noext   = self.__removeExt(prefixed)
+                prefPat = prefPat.replace('\\', '\\\\')
+                noext   = re.sub('^' + prefPat, prefName, noext)
+                withext = re.sub('^' + prefPat, prefName, prefixed)
+
+                # if the load function returns
+                # None, this file is probably
+                # not of the correct type.
+                fval = self.__load(noext, fullpath)
+                if fval is not None:
+
+                    # If there is already an item in result with the
+                    # name (stripped of prefix), then instead store
+                    # the result with the full prefixed name
+                    if noext not in result:
+                        result[noext] = fval
+                    else:
+                        result[withext] = fval
+                    break
+
+        return result
+
+
+def fileOrImage(*args, **kwargs):
+    """Decorator which can be used to ensure that any NIfTI images are saved
+    to file, and output images can be loaded and returned as ``nibabel``
+    image objects or :class:`.Image` objects.
+    """
+
+    # keep track of the input argument
+    # types on each call, so we know
+    # whether to return a fsl.Image or
+    # a nibabel image
+    intypes = []
+
+    def prepIn(workdir, name, val):
+
+        infile = None
+
+        if isinstance(val, fslimage.Image):
+            intypes.append(fslimage.Image)
+
+        elif isinstance(val, nib.nifti1.Nifti1Image):
+            intypes.append(nib.nifti1.Nifti1Image)
+
+        if isinstance(val, fslimage.Image):
+            val = val.nibImage
+
+        if isinstance(val, nib.nifti1.Nifti1Image):
+            infile = val.get_filename()
+
+            # in-memory image - we have
+            # to save it out to a file
+            if infile is None or not op.exists(infile):
+                hd, infile = tempfile.mkstemp(fslimage.defaultExt(),
+                                              dir=workdir)
+                os.close(hd)
+
+                # Create a copy of the input image and
+                # save that, so the original doesn't
+                # get associated with the temp file
+                val = nib.nifti1.Nifti1Image(
+                    np.asanyarray(val.dataobj), None, val.header)
+                val.to_filename(infile)
+
+        return infile
+
+    def prepOut(workdir, name, val):
+        return op.join(workdir, '{}.nii.gz'.format(name))
+
+    def load(name, path):
+
+        if not fslimage.looksLikeImage(path):
+            return None
+
+        # create an independent in-memory
+        # copy of the image file
+        img  = nib.load(path, mmap=False)
+        data = np.asanyarray(img.dataobj)
+
+        # if any arguments were fsl images,
+        # that takes precedence.
+        if fslimage.Image in intypes:
+            return fslimage.Image(data, header=img.header, name=name)
+
+        # but if all inputs were file names,
+        # nibabel takes precedence
+        elif nib.nifti1.Nifti1Image in intypes or len(intypes) == 0:
+            return nib.nifti1.Nifti1Image(data, None, img.header)
+
+        # this function should not be called
+        # under any other circumstances
+        else:
+            raise RuntimeError('Cannot handle type: {}'.format(intypes))
+
+    def decorator(func):
+        fot = FileOrThing(func,
+                          prepIn,
+                          prepOut,
+                          load,
+                          fslimage.removeExt,
+                          *args,
+                          **kwargs)
+
+        def wrapper(*args, **kwargs):
+            result = fot(*args, **kwargs)
+            intypes[:] = []
+            return result
+
+        return _update_wrapper(wrapper, func)
+
+    return decorator
+
+
+def fileOrArray(*args, **kwargs):
+    """Decorator which can be used to ensure that any Numpy arrays are saved
+    to text files, and output files can be loaded and returned as Numpy arrays.
+    """
+
+    def prepIn(workdir, name, val):
+
+        infile = None
+
+        if isinstance(val, np.ndarray):
+            hd, infile = tempfile.mkstemp('.txt', dir=workdir)
+            os.close(hd)
+            np.savetxt(infile, val, fmt='%0.18f')
+
+        return infile
+
+    def prepOut(workdir, name, val):
+        return op.join(workdir, '{}.txt'.format(name))
+
+    def load(_, path):
+        try:              return np.loadtxt(path)
+        except Exception: return None
+
+    def decorator(func):
+        fot = FileOrThing(func,
+                          prepIn,
+                          prepOut,
+                          load,
+                          fslpath.removeExt,
+                          *args,
+                          **kwargs)
+
+        def wrapper(*args, **kwargs):
+            return fot(*args, **kwargs)
+
+        return _update_wrapper(wrapper, func)
+
+    return decorator
+
+
+def fileOrText(*args, **kwargs):
+    """Decorator which can be used to ensure that any text output (e.g. log
+    file) are saved to text files, and output files can be loaded and returned
+    as strings.
+
+    To be able to distinguish between input values and input file paths, the
+    ``fileOrText`` decorator requires that input and output file paths are
+    passed in as ``pathlib.Path`` objects. For example, given a function
+    like this::
+
+        @fileOrText()
+        def myfunc(infile, outfile):
+            ...
+
+    if we want to pass file paths for both ``infile`` and ``outfile``, we would
+    do this::
+
+        from pathlib import Path
+        myfunc(Path('input.txt'), Path('output.txt'))
+
+    Input values may be passed in as normal strings, e.g.::
+
+        myfunc('input data', Path('output.txt'))
+
+    Output values can be loaded as normal via the :attr:`LOAD` symbol, e.g.::
+
+        myfunc(Path('input.txt'), LOAD)
+    """
+
+    def prepIn(workdir, name, val):
+
+        infile = None
+
+        if not isinstance(val, pathlib.Path):
+            with tempfile.NamedTemporaryFile(mode='w',
+                                             suffix='.txt',
+                                             dir=workdir,
+                                             delete=False) as f:
+                f.write(val)
+                infile = f.name
+        return infile
+
+    def prepOut(workdir, name, val):
+        return op.join(workdir, '{}.txt'.format(name))
+
+    def load(_, path):
+        try:
+            with open(path, "r") as f:
+                return f.read()
+        except Exception: return None
+
+    def decorator(func):
+        fot = FileOrThing(func,
+                          prepIn,
+                          prepOut,
+                          load,
+                          fslpath.removeExt,
+                          *args,
+                          **kwargs)
+
+        def wrapper(*args, **kwargs):
+            return fot(*args, **kwargs)
+
+        return _update_wrapper(wrapper, func)
+
+    return decorator
diff --git a/bip/ext_wrappers/freesurfer.py b/bip/ext_wrappers/freesurfer.py
new file mode 100644
index 0000000..6aa8dab
--- /dev/null
+++ b/bip/ext_wrappers/freesurfer.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+#
+# freesurfer.py - Wrappers for FreeSurfer and its sub-functions
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+#
+"""This module provides wrapper functions for FreeSurfer
+
+"""
+
+
+import fsl.utils.assertions as asrt
+from fsl.utils.deprecated import deprecated
+from . import wrapperutils  as wutils
+
+
+@wutils.cmdwrapper
+def recon_all(subjid, directive, **kwargs):
+    """Wrapper for the ``xfibres_gpu`` command.
+
+"""
+
+    valmap = {
+        'FLAIRpial' : wutils.SHOW_IF_TRUE,
+    }
+
+    cmd = ['recon-all', "-"+directive] 
+
+    cmd += wutils.applyArgStyle('-', valmap=valmap, **kwargs)
+ 
+    return cmd
diff --git a/bip/main.py b/bip/main.py
new file mode 100755
index 0000000..70da130
--- /dev/null
+++ b/bip/main.py
@@ -0,0 +1,356 @@
+#!/usr/bin/env python
+'''
+ WIN-FMRIB, Oxford University
+ $28-Nov-2022 16:00:00$
+ Version $1.0
+ Authors: Fidel Alfaro-Almagro, Stephen M. Smith, Paul McCarthy, Michiel Cottaar
+ '''
+
+import os
+import os.path
+import sys
+import logging
+import argparse
+import json
+from dataclasses import dataclass, field
+from file_tree import FileTree
+from pipe_tree import Pipeline, Ref
+import bip
+from bip.utils import setup_logging
+from bip.pipelines.struct_T1       import struct_T1
+from bip.pipelines.struct_T2_FLAIR import struct_T2_FLAIR
+from bip.pipelines.struct_swMRI    import struct_swMRI
+from bip.pipelines.struct_asl      import struct_asl
+from bip.pipelines.dMRI_fieldmap   import dMRI_fieldmap
+from bip.pipelines.fMRI_task       import fMRI_task
+from bip.pipelines.fMRI_rest       import fMRI_rest
+from bip.pipelines.dMRI_diff       import dMRI_diff
+
+log = logging.getLogger('bip.main')
+
+
+class MyParser(argparse.ArgumentParser):
+    def error(self, message):
+        sys.stderr.write(f'error: {message}\n')
+        self.print_help()
+        sys.exit(2)
+
+class Usage(Exception):
+    def __init__(self, msg):
+        self.msg = msg
+
+@dataclass
+class Context:
+    BB_BIN_DIR: str = bip.__path__[0]
+    FSLDIR:     str = os.environ['FSLDIR']
+    gdc:        str = field(init=False)
+
+    with open(BB_BIN_DIR + '/data/dMRI/autoptx/struct_list.json', 'r') as f:
+        tract_struct = json.load(f)
+
+    def __post_init__(self):
+        self.gdc = self.get_data('GDC/UKB.txt')
+
+    @property
+    def MNI(self):
+        return self.FSLDIR + '/data/standard/MNI152_T1_1mm'
+
+    @property
+    def MNI_brain_mask(self):
+        return self.FSLDIR + '/data/standard/MNI152_T1_1mm_brain_mask'
+
+    def get_standard(self, fileName):
+        return self.FSLDIR + '/data/standard/' + fileName
+
+    def get_atlas(self, fileName):
+        return self.FSLDIR + '/data/atlases/' + fileName
+
+    def get_data(self, fileName):
+        return self.BB_BIN_DIR + '/data/' + fileName
+
+    #def save_context(self, file_name):
+    #    with open(file_name, "wt") as config_file:
+    #        config_file.write(self.to_json())
+
+
+def parseArguments(ctx):
+
+    #########################
+    # ARGUMENT PARSING CODE #
+    #########################
+    parser = MyParser(description='BioBank Pipeline Manager V. 2.0')
+    parser.add_argument("subjectFolder", help='Subject Folder', action="store")
+    parser.add_argument("-q", "--queue", help='Queue modifier (default: normal)',
+                        action="store", nargs="?", dest="queue", default="normal")
+    parser.add_argument("-n", "--normcheck", action="store_false", default=True,
+                        help='Do NOT check Normalisation in structural image (default if flag not used: Check normalisation)',
+                        dest="norm_check")
+    parser.add_argument("-P", "--namingPatterns", action="store", nargs="?",
+                        default=ctx.get_data("config/naming_pattern_UKBB.json"),
+                        help='File with the naming patterns coming from dcm2niix (default: UKB naming patterns)',
+                        dest="naming_patterns")
+    parser.add_argument("-c", "--coeff", action="store", nargs="?",
+                        default=ctx.get_data("GDC/UKB.txt"),
+                        help='Coefficient file for the GDC (Gradient Distiortion Correction). \n' +
+                              '   Options:  \n' +
+                              '           none--> No GDC is performed' +
+                              '           <path to file> --> Uses the user-pecified gradients file' +
+                              '            --> If this option is not used, the default is the UKB',
+                        dest="coeff")
+    parser.add_argument("-C", "--coils_SWI", action="store", nargs="?", default=32,
+                        help='Number of coils for SWI data. Default: 32. 0 means "no separate coil data"',
+                        dest="coils_SWI")
+    parser.add_argument("-E", "--echoes_SWI", action="store", nargs="?", default=2,
+                        help='Number of echo times for SWI data (default: 2)',
+                        dest="echoes_SWI")
+    parser.add_argument("-Q", "--basic_QC_file", action="store", nargs="?",
+                        default=ctx.get_data("config/ideal_config_sizes_UKBB.json"),
+                        help='File with the ideal configuration of the files (default: UKB)',
+                        dest="basic_QC_file")
+    parser.add_argument("-p", "--complex_phase", action="store_true", default=False,
+                        help='SWI phase is complex (default: False)',
+                        dest="complex_phase")
+    parser.add_argument("-i", "--inverted_PED", action="store_true", default=False,
+                        help='Use if the dMRI Phase Encoding Direction is inverted (default if flag not used: False)',
+                        dest="inverted_PED")
+    parser.add_argument("-b", "--b_value_shell", action="store", nargs="?",
+                        default=1000,
+                        help='B value for the single shell data to be used (default: 1000)',
+                        dest="b_value_shell")
+    parser.add_argument("-B", "--B_files", action="store", nargs="?",
+                        default="",
+                        help='Name of the directory with the bval and bvec files for dMRI data.\n' +
+                             'If specified, the directory needs to have these 4 files: \n' +
+                             '    - AP.bval\n ' +
+                             '    - AP.bvec\n ' +
+                             '    - PA.bval\n ' +
+                             '    - PA.bvec\n ' +
+                             'If not set, the pipeline will use the dcm2niix generated files',
+                        dest="B_files")
+    parser.add_argument("-S", "--num_shells", action="store", nargs="?", default=2,
+                        help='Number of different shells (B-values) for dMRI data.',
+                        dest="num_shells")
+    parser.add_argument("-X", "--exec_block", action="store", nargs="?", default=0,
+                        help='Pipeline block(s) to execute: Option (default 0): \n' +
+                             '  - 0: Run the whole pipeline with default parameters \n' +
+                             '  - 1: Run   (CPU) 1st block (up until eddy) \n' +
+                             '  - 2: Run   (GPU) 2nd block (eddy) \n' +
+                             '  - 3: Run   (CPU) 3rd block (after eddy, before bedpostX + probtrackX) \n' +
+                             '  - 4: Run   (GPU) 4th block (bedpostX + probtrackX) \n' +
+                             '  - 5: Run   (CPU) 5th block (everything after bedpostX + probtrackX) \n' +
+                             '  - 20: Run  (CPU) 2nd block (eddy) \n '+
+                             '  - 40: Run  (CPU) 4th block (bedpostX + probtrackX) \n ' +
+                             '  - 123: Run (CPU) 1st, 2nd, & 3rd block (up until bedpostX) \n ',
+                        dest="exec_block")
+
+    argsa = parser.parse_args()
+
+    # Subject argument
+    subject = argsa.subjectFolder
+    subject = subject.strip()
+    if subject[-1] =='/':
+        subject = subject[0:len(subject)-1]
+
+    ctx.subject = subject
+    ctx.argsa = argsa
+
+    # Setting up logging
+    # Parsing coefficient file argument
+    if not argsa.coeff:
+        coeff = "skyra"
+    else:
+        coeff = argsa.coeff
+    if coeff == "":
+        coeff = "skyra"
+    if coeff not in ["skyra", "prisma", "none"]:
+        if not os.path.exists(coeff):
+            log.error("ERROR: Subject cannot be run. Incorrect GDC file specified: " +
+                        coeff)
+            sys.exit(1)
+
+    # Deciding Grafient coefficients file
+    if coeff == "skyra":
+        coeff = ctx.get_data("GDC/bb_GDC_coeff_skyra.grad")
+    elif coeff == "prisma":
+        coeff = ctx.get_data("GDC/bb_GDC_coeff_prisma.grad")
+    if not os.path.exists(coeff):
+        coeff = "none"
+
+    # Parsing number of SWI coils argument
+    if not argsa.coils_SWI:
+        coils_SWI = 32
+    elif argsa.coils_SWI == "":
+        coils_SWI = 32
+    else:
+        try:
+            coils_SWI = int(argsa.coils_SWI)
+        except ValueError:
+            log.warning("ERROR in the specified number of SWI coils: " +
+                            coils_SWI + '. Will use default: 32')
+            coils_SWI = 32
+
+    # Parsing number of SWI echo times argument
+    if not argsa.echoes_SWI:
+        echoes_SWI = 2
+    elif argsa.echoes_SWI == "":
+        echoes_SWI = 2
+    else:
+        try:
+            echoes_SWI = int(argsa.echoes_SWI)
+        except ValueError:
+            log.warning("ERROR in the specified number of shells: " +
+                            echoes_SWI + '. Will use default: 2')
+            echoes_SWI = 2
+
+    # Parsing number of dMRI shells argument
+    if not argsa.num_shells:
+        num_shells = 2
+    elif argsa.num_shells == "":
+        num_shells = 2
+    else:
+        try:
+            num_shells = int(argsa.num_shells)
+        except ValueError:
+            log.warning("ERROR in the specified number of SWI echo times: " +
+                            num_shells + '. Will use default: 2')
+            num_shells = 2
+
+
+    # Parsing single-shell dMRI B-value argument
+    if not argsa.b_value_shell:
+        b_value_shell = 1000
+    elif argsa.b_value_shell == "":
+        b_value_shell = 1000
+    else:
+        try:
+            b_value_shell = int(argsa.b_value_shell)
+        except ValueError:
+            log.warning("ERROR in the specified b value for single-shell dMRI: " +
+                            b_value_shell + '. Will use default: 1000')
+            b_value_shell = 1000
+
+    # Parsing queue argument
+    if argsa.queue == []:
+        queue = "normal"
+    elif argsa.queue == 'normal':
+        queue = "normal"
+    else:
+        queue = argsa.queue.split(",")
+
+    # Check normalisation argument
+    norm_check = argsa.norm_check
+
+    # Check complex phase
+    complex_phase = argsa.complex_phase
+
+    # Check inverted Phase Encoding Direction for dMRI
+    inverted_PED = argsa.inverted_PED
+
+    # Parsing naming pattern argument
+    naming_patterns = argsa.naming_patterns
+    naming_patterns = naming_patterns.strip()
+
+    if not os.path.exists(naming_patterns):
+        log.error("ERROR: Subject cannot be run. Incorrect naming pattern file specified: " +
+                     naming_patterns)
+        sys.exit(1)
+    ctx.naming_patterns = naming_patterns
+
+    # Parsing B files argument
+    B_files = argsa.B_files
+    B_files = B_files.strip()
+
+    if B_files != "":
+        if not os.path.exists(B_files):
+            log.error("ERROR: Subject cannot be run. Incorrect B-files directory specified: " +
+                         B_files)
+            sys.exit(1)
+        else:
+            for fil in ["AP.bval", "AP.bvec" , "PA.bval", "PA.bvec"]:
+                if not os.path.exists(B_files + '/' + fil ):
+                    log.error("ERROR: Subject cannot be run. Non-existent B-file: " +
+                                 B_files + '/' + fil )
+                    sys.exit(1)
+        if not os.path.isabs(B_files):
+            B_files = os.path.abspath(B_files)
+
+    # Parsing basic QC file argument
+    basic_QC_file = argsa.basic_QC_file
+    basic_QC_file = basic_QC_file.strip()
+    if not os.path.exists(basic_QC_file):
+        log.error("ERROR: Subject cannot be run. Incorrect basic QC file specified: " +
+                     basic_QC_file)
+        sys.exit(1)
+
+    # Parsing execute block argument
+    exec_block = argsa.exec_block
+    if not argsa.exec_block:
+        exec_block = 0
+    elif argsa.exec_block == "":
+        exec_block = 0
+    else:
+        try:
+            exec_block = int(argsa.exec_block)
+            allowed_values = [0, 1, 2, 3, 4, 5, 20, 40, 123]
+
+            if exec_block not in allowed_values:
+                log.warning("ERROR in the eXecute block: " +  exec_block +
+                               ': Value not allowed. \nAllowed values: ' +
+                               str(allowed_values) + '\nWill use default: 0')
+                exec_block = 0
+
+        except ValueError:
+            log.warning("ERROR in the eXecute block: " +
+                            exec_block + ': Will use default: 0')
+            exec_block = 0
+
+    ################################
+    # END OF ARGUMENT PARSING CODE #
+    ################################
+
+def main():
+
+    #ctx = Context(gdc=)
+    ctx = Context()
+
+    parseArguments(ctx)
+
+    setup_logging(ctx.subject + '/logs/main.log')
+
+    tree = FileTree.read(ctx.get_data('FileTree'), 
+                         subject=ctx.subject,
+                         autoptx_tract=list(ctx.tract_struct.keys()),
+                         netmats_dim=["25", "100"])
+
+    # add submit parameters here that should 
+    # be applied to all jobs in the pipeline
+    pipe = Pipeline(default_submit=dict(logdir=Ref("logs_dir"),
+                    export_vars=list(os.environ.keys())))
+
+    #pipe = Pipeline(default_submit=dict(logdir=Ref("logs_dir")))
+    #ctx.save_context(tree.get('config_file'))
+
+    # This list will be filled with all desired outputs
+    targets = []
+
+    pipe, targets = struct_T1.add_to_pipeline(ctx, pipe, tree, targets)
+    pipe, targets = struct_T2_FLAIR.add_to_pipeline(ctx, pipe, tree, targets)
+    pipe, targets = struct_swMRI.add_to_pipeline(ctx, pipe, tree, targets)
+    pipe, targets = struct_asl.add_to_pipeline(ctx, pipe, tree, targets)
+    pipe, targets = dMRI_fieldmap.add_to_pipeline(ctx, pipe, tree, targets)
+    pipe, targets = fMRI_task.add_to_pipeline(ctx, pipe, tree, targets)
+    pipe, targets = fMRI_rest.add_to_pipeline(ctx, pipe, tree, targets)
+    pipe, targets = dMRI_diff.add_to_pipeline(ctx, pipe, tree, targets)
+
+    # The skip-missing flag deals with cases where the subject is missing
+    # the data of some modalities. For more details, check:
+    # https://open.win.ox.ac.uk/pages/ndcn0236/pipe-tree/tutorial.html#dealing-with-missing-data 
+    jobs = pipe.generate_jobs(tree).filter(targets, skip_missing=True)
+
+    jobs.report()
+
+    jobs.run("submit")
+    #jobs.run("local")
+
+if __name__ == "__main__":
+    main()
diff --git a/bip/pipelines/__init__.py b/bip/pipelines/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/bip/pipelines/dMRI_diff/__init__.py b/bip/pipelines/dMRI_diff/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/bip/pipelines/dMRI_diff/dMRI_diff.py b/bip/pipelines/dMRI_diff/dMRI_diff.py
new file mode 100755
index 0000000..4863366
--- /dev/null
+++ b/bip/pipelines/dMRI_diff/dMRI_diff.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+#
+# dMRI_diff.py - Pipeline with the dfMRI processing.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from bip.utils import redirect_logging
+from bip.pipelines.dMRI_diff import diff_eddy
+from bip.pipelines.dMRI_diff import diff_dtifit
+from bip.pipelines.dMRI_diff import diff_noddi
+from bip.pipelines.dMRI_diff import diff_tbss
+from bip.pipelines.dMRI_diff import diff_bedpostx
+from bip.pipelines.dMRI_diff import diff_autoptx
+
+log = logging.getLogger(__name__)
+
+def add_to_pipeline(ctx, pipe, tree, targets):
+
+    logs_dir=tree.get('logs_dir')
+
+    with redirect_logging('pipe_dMRI_fieldmap', outdir=logs_dir):
+
+        # TODO: Make this configurable
+        cuda_dict_1 = dict(queue="short.qg@@win-uk-biobank-gpu",
+                         coprocessor="cuda",
+                         coprocessor_class="P",
+                         coprocessor_toolkit="8.0")
+        cuda_dict_2 = dict(queue="short.qg@@win-uk-biobank-gpu",
+                         coprocessor="cuda",
+                         coprocessor_class="P",
+                         coprocessor_toolkit="6.5")
+        #pipe(diff_eddy.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        pipe(diff_eddy.run, submit=cuda_dict_1, kwargs={'ctx' : ctx})
+        targets.append('eddy_data')
+        pipe(diff_dtifit.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('FA')
+        pipe(diff_noddi.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('ISOVF')
+        pipe(diff_tbss.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('JHUrois_FA')
+        pipe(diff_bedpostx.run, submit=cuda_dict_2, kwargs={'ctx' : ctx})
+        targets.append('bedpostx_eye')
+        pipe(diff_autoptx.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('tractsNorm')
+
+    return pipe, targets
diff --git a/bip/pipelines/dMRI_diff/diff_autoptx.py b/bip/pipelines/dMRI_diff/diff_autoptx.py
new file mode 100755
index 0000000..1255756
--- /dev/null
+++ b/bip/pipelines/dMRI_diff/diff_autoptx.py
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+#
+# diff_autoptx.py - Sub-pipeline with FSL's autoPtx processing of the dMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import os
+import random
+import logging
+from shutil import copyfile
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pipe_tree import In, Out, Ref, Var
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        autoptx_tract:             Var,
+        bedpostx_eye:              In,
+        TBSS_FA_to_MNI_warp:       In,
+        TBSS_MNI_to_dti_FA_warp:   In,
+        bedpostx_nodif_brain_mask: In,
+        logs_dir:                  Ref,
+        aptx_stop:                 Ref,
+        bedpostx_merged:           Ref,
+        aptx_tracts_sub_dir:       Ref,
+        aptx_tractsinv_sub_dir:    Ref,
+        density_inv:               Ref,
+        waytotal_inv:              Ref,
+        fwdensity:                 Ref,
+        aptx_seed:                 Out,
+        aptx_target:               Out,
+        aptx_exclude:              Out,
+        density:                   Out,
+        waytotal:                  Out,
+        tractsNorm:                Out):
+
+    with redirect_logging('diff_autoptx_' + autoptx_tract.value,
+                          outdir=logs_dir):
+
+        t_name  = autoptx_tract.value
+        #TODO: Allow for customization for this multiplication factor
+        t_seeds = int(ctx.tract_struct[t_name]["num_seeds"] * 300)
+
+        orig_tract_dir = ctx.get_data('dMRI/autoptx/protocols/' + t_name + '/')
+
+        # Does the protocol defines a second
+        # run with inverted seed / target masks?
+        if os.path.exists(orig_tract_dir + 'invert'):
+            symtrack=True
+            if os.path.exists(waytotal):
+                os.remove(waytotal)
+        else:
+            symtrack=False
+
+        # Copy the seed, target and exclude files for the tract
+        copyfile(orig_tract_dir + 'seed.nii.gz',    aptx_seed)
+        copyfile(orig_tract_dir + 'target.nii.gz',  aptx_target)
+        copyfile(orig_tract_dir + 'exclude.nii.gz', aptx_exclude)
+
+        if os.path.exists(waytotal):
+            os.remove(waytotal)
+
+        # Building arguments dictionary for probtrackx
+        kwargs = {
+            'samples' :   bedpostx_merged,
+            'mask' :      bedpostx_nodif_brain_mask,
+            'out' :       'density',
+            'nsamples' :  t_seeds,
+            'avoid' :     aptx_exclude,
+            'opd' :       True,
+            'loopcheck' : True,
+            'forcedir' :  True,
+            'sampvox' :   True,
+            'xfm' :       TBSS_MNI_to_dti_FA_warp,
+            'invxfm' :    TBSS_FA_to_MNI_warp,
+            'rseed' :     int(random.randrange(32767))
+        }
+
+        # Is there a stop criterion defined
+        # in the protocol for this struct?
+        if os.path.exists(orig_tract_dir + 'stop.nii.gz'):
+            kwargs['stop'] = aptx_stop
+            copyfile(orig_tract_dir + 'stop.nii.gz', aptx_stop)
+
+        # Process structure
+        wrappers.probtrackx(seed=aptx_seed,
+                            waypoints=aptx_target,
+                            dir=aptx_tracts_sub_dir,
+                            **kwargs)
+
+        with open(waytotal, 'r', encoding="utf-8") as f:
+            way = int(f.read())
+
+        # Calculate inverse tractography for this tract and
+        # merge runs for forward and inverted tractographies
+        if symtrack:
+            wrappers.probtrackx(seed=aptx_target,
+                                waypoints=aptx_seed,
+                                dir=aptx_tractsinv_sub_dir,
+                                **kwargs)
+
+            copyfile(density, fwdensity)
+            wrappers.fslmaths(density).add(density_inv).run(density)
+
+            with open(waytotal, 'r', encoding="utf-8") as f:
+                way1 = int(f.read())
+            with open(waytotal_inv, 'r', encoding="utf-8") as f:
+                way2 = int(f.read())
+            if os.path.exists(waytotal):
+                os.remove(waytotal)
+            with open(waytotal, 'wt', encoding="utf-8") as f:
+                way = way1 + way2
+                f.write(f'{way}\n')
+
+        wrappers.fslmaths(density).div(way).range().run(tractsNorm)
diff --git a/bip/pipelines/dMRI_diff/diff_bedpostx.py b/bip/pipelines/dMRI_diff/diff_bedpostx.py
new file mode 100755
index 0000000..d8e5acd
--- /dev/null
+++ b/bip/pipelines/dMRI_diff/diff_bedpostx.py
@@ -0,0 +1,85 @@
+#!/usr/bin/env python
+#
+# diff_bedpostx.py - Sub-pipeline with FSL's bedpostx processing of the dMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import os
+import logging
+from shutil import copyfile
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pipe_tree import In, Out, Ref
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        AP_bval:                   In,
+        AP_bvec:                   In,
+        eddy_data_ud:              In,
+        eddy_nodif:                In,
+        eddy_nodif_brain_mask:     In,
+        logs_dir:                  Ref,
+        eddy_dir:                  Ref,
+        bedpostx_dir:              Ref,
+        bedpostx_log_part:         Ref,
+        bedpostx_data_0:           Ref,
+        bedpostx_bvals:            Out,
+        bedpostx_bvecs:            Out,
+        bedpostx_nodif_brain:      Out,
+        bedpostx_nodif_brain_mask: Out,
+        bedpostx_nvox:             Out,
+        bedpostx_eye:              Out,
+        bp_logs_gpu_dir:           Out):
+
+    with redirect_logging('diff_bedpostx', outdir=logs_dir):
+
+        w = os.getcwd() + "/"
+
+        # Copy of bvals and bvecs
+        copyfile(src=AP_bval, dst=bedpostx_bvals)
+        copyfile(src=AP_bvec, dst=bedpostx_bvecs)
+        copyfile(src=eddy_nodif_brain_mask, dst=bedpostx_nodif_brain_mask)
+
+        wrappers.fslmaths(eddy_nodif).mas(eddy_nodif_brain_mask).run(bedpostx_nodif_brain)
+
+        nvox=wrappers.fslstats(bedpostx_nodif_brain_mask).V.run()[0]
+        with open(bedpostx_nvox, 'wt', encoding="utf-8") as f:
+            f.write(str(nvox))
+
+        wrappers.split_parts_gpu(Datafile=w + eddy_data_ud,
+                                 Maskfile=w + eddy_nodif_brain_mask,
+                                 Bvalsfile=w + bedpostx_bvals,
+                                 Bvecsfile=w + bedpostx_bvecs,
+                                 TotalNumParts="1",
+                                 OutputDirectory=w + bedpostx_dir)
+
+        wrappers.xfibres_gpu(data=w + bedpostx_data_0,
+                             mask=w + bedpostx_nodif_brain_mask,
+                             bvals=w + bedpostx_bvals, bvecs=w + bedpostx_bvecs,
+                             forcedir=True, logdir=w + bedpostx_log_part,
+                             nfibres="3", fudge="1", burnin="3000",
+                             njumps="1250", sampleevery="25", model="2",
+                             cnonlinear=True, subjdir=w + eddy_dir,
+                             idpart="0", nparts="1",
+                             numvoxels=str(nvox))
+
+        wrappers.bedpostx_postproc_gpu(data=w + bedpostx_data_0,
+                                       mask=w + bedpostx_nodif_brain_mask,
+                                       bvals=w + bedpostx_bvals,
+                                       bvecs=w + bedpostx_bvecs, forcedir=True,
+                                       logdir=w + bedpostx_log_part, nf="3",
+                                       fudge="1", bi="3000", nj="1250", se="25",
+                                       model="2", cnonlinear=True,
+                                       TotalNumVoxels=str(nvox),
+                                       SubjectDir=w + eddy_dir,
+                                       TotalNumParts="1", bindir=ctx.FSLDIR)
+
+        if os.path.exists(bedpostx_data_0):
+            os.remove(bedpostx_data_0)
diff --git a/bip/pipelines/dMRI_diff/diff_dtifit.py b/bip/pipelines/dMRI_diff/diff_dtifit.py
new file mode 100755
index 0000000..1b7b8c6
--- /dev/null
+++ b/bip/pipelines/dMRI_diff/diff_dtifit.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+#
+# diff_dtifit.py - Sub-pipeline with FSL's dtifit processing of the dMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import logging
+from shutil import copyfile
+import numpy as np
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pipe_tree import In, Out, Ref
+from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        eddy_data:                 In,
+        eddy_bvals:                In,
+        eddy_bvecs:                In,
+        eddy_nodif_brain_mask_ud:  In,
+        logs_dir:                  Ref,
+        eddy_data_GDC:             Ref,
+        dtifit_output_prefix:      Ref,
+        eddy_data_ud:              Out,
+        eddy_data_ud_warp:         Out,
+        eddy_data_ud_1_shell:      Out,
+        eddy_data_ud_1_shell_bval: Out,
+        eddy_data_ud_1_shell_bvec: Out,
+        FA:                        Out):
+
+    with redirect_logging('diff_dtifit', outdir=logs_dir):
+
+
+        if ctx.gdc != '':
+            #Calculate and apply the Gradient Distortion Unwarp
+            # TODO: Review the "half=True" in next version
+            gradient_unwarp_apply(WD=eddy_data_GDC,
+                                  infile=eddy_data,
+                                  outfile=eddy_data_ud,
+                                  owarp=eddy_data_ud_warp,
+                                  gradcoeff=ctx.gdc,
+                                  vendor='siemens', nojac=True, half=True)
+        else:
+            copyfile(src=eddy_data, dst=eddy_data_ud)
+
+
+        #Correct input for dtifit using one shell
+        list_vals = []
+        b_vals = np.loadtxt(eddy_bvals)
+        b_vecs = np.loadtxt(eddy_bvecs)
+        lim_file = ctx.get_data('dMRI/b0_threshold.txt')
+
+        lim = int(np.loadtxt(lim_file))
+
+        # TODO: This can be modifiable by the user
+        b_value_shell_to_keep = 1000
+
+        for count, b_val in enumerate(b_vals):
+            # These are the b0 images: They are automatically included
+            if b_val < lim:
+                list_vals.append(count)
+            else:
+                if abs(b_val - b_value_shell_to_keep) < lim:
+                    list_vals.append(count)
+
+        new_b_vals = b_vals[list_vals]
+        new_b_vecs = b_vecs[:,list_vals]
+
+        np.savetxt(eddy_data_ud_1_shell_bval, new_b_vals, newline=" ", fmt='%.1f')
+        np.savetxt(eddy_data_ud_1_shell_bvec, new_b_vecs, fmt='%.6f')
+
+        wrappers.fslselectvols(src=eddy_data_ud, out=eddy_data_ud_1_shell,
+                               vols=list_vals)
+
+        wrappers.dtifit(data  = eddy_data_ud_1_shell,
+                        bvecs = eddy_data_ud_1_shell_bvec,
+                        bvals = eddy_data_ud_1_shell_bval,
+                        mask  = eddy_nodif_brain_mask_ud,
+                        out   = dtifit_output_prefix,
+                        save_tensor = True)
diff --git a/bip/pipelines/dMRI_diff/diff_eddy.py b/bip/pipelines/dMRI_diff/diff_eddy.py
new file mode 100755
index 0000000..9c710b2
--- /dev/null
+++ b/bip/pipelines/dMRI_diff/diff_eddy.py
@@ -0,0 +1,91 @@
+#!/usr/bin/env python
+#
+# diff_eddy.py - Sub-pipeline with FSL's eddy processing of the dMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import os
+import logging
+from shutil import copyfile
+import nibabel as nib
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pipe_tree import In, Out, Ref
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        AP:                             In,
+        AP_bval:                        In,
+        AP_bvec:                        In,
+        AP_best_index:                  In,
+        fieldmap_iout_mean:             In,
+        fieldmap_mask:                  In,
+        fieldmap_mask_ud:               In,
+        acqparams:                      In,
+        logs_dir:                       Ref,
+        eddy_data_prefix:               Ref,
+        fieldmap_out_prefix:            Ref,
+        eddy_AP:                        Out,
+        eddy_nodif:                     Out,
+        eddy_nodif_brain_mask:          Out,
+        eddy_nodif_brain_mask_ud:       Out,
+        eddy_bvals:                     Out,
+        eddy_bvecs:                     Out,
+        eddy_index:                     Out,
+        eddy_data:                      Out):
+
+    with redirect_logging('diff_eddy', outdir=logs_dir):
+
+        # Creates links
+        # TODO: These links are NOT relative. This may cause future problems.
+        if not os.path.exists(eddy_AP):
+            os.symlink(src="../../../" + AP, dst=eddy_AP)
+        if not os.path.exists(eddy_nodif):
+            os.symlink(src="../../../" + fieldmap_iout_mean, dst=eddy_nodif)
+        if not os.path.exists(eddy_nodif_brain_mask):
+            os.symlink(src="../../../" + fieldmap_mask, dst=eddy_nodif_brain_mask)
+        if not os.path.exists(eddy_nodif_brain_mask_ud):
+            os.symlink(src="../../../" + fieldmap_mask_ud, dst=eddy_nodif_brain_mask_ud)
+
+        # Generation of FSF file
+        copyfile(src=AP_bval, dst=eddy_bvals)
+        copyfile(src=AP_bvec, dst=eddy_bvecs)
+
+        AP_img    = nib.load(eddy_AP)
+        AP_numvol = AP_img.header['dim'][4]
+
+        indices = ("1 " * AP_numvol).strip() + "\n"
+
+        with open(AP_best_index, 'r', encoding="utf-8") as f:
+            AP_index = int(f.read())
+
+        with open(eddy_index, 'wt', encoding="utf-8") as f:
+            f.write(indices)
+
+        wrappers.eddy(imain=eddy_AP,
+                      mask=eddy_nodif_brain_mask,
+                      topup=fieldmap_out_prefix,
+                      acqp=acqparams,
+                      index=eddy_index,
+                      bvecs=eddy_bvecs,
+                      bvals=eddy_bvals,
+                      out=eddy_data_prefix,
+                      ref_scan_no=AP_index,
+                      flm="quadratic",
+                      resamp="jac",
+                      slm="linear",
+                      niter=8,
+                      fwhm=[10,8,4,2,0,0,0,0],
+                      ff=10,
+                      sep_offs_move=True,
+                      nvoxhp=1000,
+                      very_verbose=True,
+                      repol=True,
+                      rms=True)
diff --git a/bip/pipelines/dMRI_diff/diff_noddi.py b/bip/pipelines/dMRI_diff/diff_noddi.py
new file mode 100755
index 0000000..a7252ec
--- /dev/null
+++ b/bip/pipelines/dMRI_diff/diff_noddi.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+#
+# diff_noddi.py - Sub-pipeline with AMICO processing of the dMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import os
+import logging
+from shutil import move, rmtree
+import zipfile
+import gzip
+import shutil
+import amico
+from bip.utils import redirect_logging, tempdir
+from pipe_tree import In, Out, Ref
+
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        eddy_data_ud:              In,
+        eddy_nodif_brain_mask_ud:  In,
+        eddy_bvals:                In,
+        eddy_bvecs:                In,
+        logs_dir:                  Ref,
+        tmp_dir:                   Ref,
+        NODDI_dir:                 Ref,
+        AMICO_dir:                 Ref,
+        NODDI_kernels_dir:         Ref,
+        NODDI_scheme:              Out,
+        ICVF:                      Out,
+        ISOVF:                     Out,
+        OD:                        Out,
+        NODDI_dir_file:            Out):
+
+    with redirect_logging('diff_noddi', outdir=logs_dir),\
+         tempdir(tmp_dir):
+        amtmp      = tmp_dir + '/amtmp.nii'
+        amtmp_mask = tmp_dir + '/amtmp_mask.nii'
+
+        # In case the kernels were already calculated for this study:
+        # TODO: Verify that this is regular UKB data.
+        # Otherwise, this should not be done
+        if not os.path.exists('./kernels/'):
+            if os.path.exists(ctx.get_data('dMRI/kernels.zip')):
+                with zipfile.ZipFile(ctx.get_data('dMRI/kernels.zip'), 'r') as zip_ref:
+                    zip_ref.extractall("./")
+
+        with gzip.open(eddy_data_ud, 'rb') as f_in:
+            with open(amtmp, 'wb') as f_out:
+                shutil.copyfileobj(f_in, f_out)
+
+        with gzip.open(eddy_nodif_brain_mask_ud, 'rb') as f_in:
+            with open(amtmp_mask , 'wb') as f_out:
+                shutil.copyfileobj(f_in, f_out)
+
+        amico.setup()
+        amico.util.fsl2scheme(bvalsFilename=eddy_bvals,
+                              bvecsFilename=eddy_bvecs,
+                              schemeFilename=NODDI_scheme,
+                              bStep=50)
+
+        ae = amico.Evaluation("./", "./", output_path=NODDI_dir)
+        ae.load_data(amtmp, NODDI_scheme, mask_filename=amtmp_mask,
+                     b0_min_signal=1e-4)
+        ae.set_model("NODDI")
+        ae.generate_kernels(ndirs=500,regenerate=True)
+        ae.load_kernels()
+        ae.fit()
+        ae.save_results()
+
+        files = [ICVF, ISOVF, OD, NODDI_dir_file]
+
+        # Move files to proper place
+        for file_n in files:
+            old_name = file_n.replace("/NODDI_","/FIT_")
+            move(old_name, file_n)
+
+        # Delete created folders
+        for dir_to_delete in [AMICO_dir, NODDI_kernels_dir]:
+            if os.path.exists(dir_to_delete):
+                rmtree(dir_to_delete)
diff --git a/bip/pipelines/dMRI_diff/diff_tbss.py b/bip/pipelines/dMRI_diff/diff_tbss.py
new file mode 100755
index 0000000..f490e92
--- /dev/null
+++ b/bip/pipelines/dMRI_diff/diff_tbss.py
@@ -0,0 +1,161 @@
+#!/usr/bin/env python
+#
+# diff_tbss.py - Sub-pipeline with FSL's TBSS processing of the dMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613,C0206
+#
+
+import os
+import logging
+from shutil import copyfile
+import nibabel as nib
+from fsl import wrappers
+from bip.utils import redirect_logging, tempdir
+from pipe_tree import In, Out, Ref
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        FA:                          In,
+        ISOVF:                       In(optional=True),
+        logs_dir:                    Ref,
+        tmp_dir:                     Ref,
+        TBSS_MNI_to_dti_FA_warp_msf: Ref,
+        dtifit_prefix:               Ref,
+        NODDI_prefix:                Ref,
+        TBSS_prefix:                 Ref,
+        JHUrois_prefix:              Ref,
+        TBSS_FA_to_MNI_int:          Ref,
+        TBSS_FA_dir_FA:              Out,
+        TBSS_FA_dir_FA_mask:         Out,
+        TBSS_FA:                     Out,
+        TBSS_MNI:                    Out,
+        TBSS_FA_to_MNI_affine_mat:   Out,
+        TBSS_FA_to_MNI_warp:         Out,
+        TBSS_FA_to_MNI_int_txt:      Out,
+        TBSS_log_1:                  Out,
+        TBSS_log_2:                  Out,
+        TBSS_log_3:                  Out,
+        TBSS_dti_FA_to_MNI:          Out,
+        TBSS_MNI_to_dti_FA_warp:     Out,
+        TBSS_all_FA:                 Out,
+        TBSS_mean_FA_mask:           Out,
+        TBSS_mean_FA:                Out,
+        TBSS_mean_FA_skeleton:       Out,
+        TBSS_mean_FA_skeleton_mask:  Out,
+        TBSS_all_FA_skeletonised:    Out,
+        JHUrois_FA:                  Out):
+
+    with redirect_logging('diff_tbss', outdir=logs_dir),\
+         tempdir(tmp_dir):
+
+        TBSS_FA_tmp = tmp_dir + '/TBSS_FA_tmp.nii.gz'
+        TBSS_FA_to_MNI_warp_s1 = tmp_dir + '/FA_to_MNI_warp_s1.nii.gz'
+        TBSS_FA_to_MNI_warp_s2 = tmp_dir + '/FA_to_MNI_warp_s2.nii.gz'
+
+        # Creates links
+        # TODO: These links are NOT relative. This may cause future problems.
+        if not os.path.exists(TBSS_FA):
+            os.symlink(src="../../../" + FA, dst=TBSS_FA)
+        if not os.path.exists(TBSS_MNI):
+            os.symlink(src=ctx.get_standard('FMRIB58_FA_1mm.nii.gz'), dst=TBSS_MNI)
+        FA_img     = nib.load(TBSS_FA)
+        x, y, z = FA_img.header['dim'][1:4]
+
+        # erode a little and zero end slices
+        wrappers.fslmaths(FA).min(1).ero().roi(1,x,1,y,1,z,0,1).run(TBSS_FA_dir_FA)
+
+        # create mask (for use in FLIRT & FNIRT)
+        wrappers.fslmaths(TBSS_FA_dir_FA).bin().run(TBSS_FA_dir_FA_mask)
+        #TODO: investigate how to add the -odt=char option
+        wrappers.fslmaths(TBSS_FA_dir_FA_mask).dilD(2).sub(1).abs().add(TBSS_FA_dir_FA_mask).run(TBSS_FA_dir_FA_mask)
+
+        if not os.path.exists(TBSS_MNI_to_dti_FA_warp_msf):
+            #New Optimal Registration
+            wrappers.flirt(ref=TBSS_MNI,
+                           src=TBSS_FA_dir_FA,
+                           inweight=TBSS_FA_dir_FA_mask,
+                           omat=TBSS_FA_to_MNI_affine_mat)
+
+            # perform FNIRT cascade of registrations
+            wc1 = ctx.get_data('dMRI/dMRI_reg_optimal_parameters/oxford_s1.cnf')
+            wc2 = ctx.get_data('dMRI/dMRI_reg_optimal_parameters/oxford_s2.cnf')
+            wc3 = ctx.get_data('dMRI/dMRI_reg_optimal_parameters/oxford_s3.cnf')
+
+            wrappers.fnirt(ref=TBSS_MNI, src=TBSS_FA_dir_FA,
+                           cout=TBSS_FA_to_MNI_warp_s1, config=wc1,
+                           aff=TBSS_FA_to_MNI_affine_mat,
+                           intout=TBSS_FA_to_MNI_int, logout=TBSS_log_1)
+            wrappers.fnirt(ref=TBSS_MNI, src=TBSS_FA_dir_FA,
+                           cout=TBSS_FA_to_MNI_warp_s2, config=wc2,
+                           inwarp=TBSS_FA_to_MNI_warp_s1,
+                           intin=TBSS_FA_to_MNI_int_txt, logout=TBSS_log_2)
+            wrappers.fnirt(ref=TBSS_MNI, src=TBSS_FA_dir_FA,
+                           cout=TBSS_FA_to_MNI_warp, config=wc3,
+                           iout=TBSS_dti_FA_to_MNI,
+                           inwarp=TBSS_FA_to_MNI_warp_s2,
+                           intin=TBSS_FA_to_MNI_int_txt, logout=TBSS_log_3)
+            wrappers.invwarp(ref=TBSS_FA_dir_FA, warp=TBSS_FA_to_MNI_warp,
+                             out=TBSS_MNI_to_dti_FA_warp)
+
+
+            # now estimate the mean deformation
+            wrappers.fslmaths(TBSS_FA_to_MNI_warp).sqr().Tmean().run(TBSS_FA_tmp)
+            mean    = wrappers.fslstats(TBSS_FA_tmp).M.run()
+            median  = wrappers.fslstats(TBSS_FA_tmp).P(50).run()
+
+            with open(TBSS_MNI_to_dti_FA_warp_msf, 'wt', encoding="utf-8") as f:
+                f.write(f'{mean} {median}')
+
+        wrappers.applywarp(src=TBSS_FA_dir_FA, out=TBSS_dti_FA_to_MNI,
+                           ref=TBSS_MNI, warp=TBSS_FA_to_MNI_warp,
+                           rel=True, interp='trilinear')
+
+        copyfile(src=TBSS_dti_FA_to_MNI, dst=TBSS_all_FA)
+
+        # Create mean FA
+        skel = ctx.get_standard('FMRIB58_FA-skeleton_1mm.nii.gz')
+        wrappers.fslmaths(TBSS_all_FA).bin().mul(TBSS_MNI).bin().run(TBSS_mean_FA_mask)
+        wrappers.fslmaths(TBSS_all_FA).mas(TBSS_mean_FA_mask).run(TBSS_all_FA)
+        wrappers.fslmaths(TBSS_MNI).mas(TBSS_mean_FA_mask).run(TBSS_mean_FA)
+        wrappers.fslmaths(skel).mas(TBSS_mean_FA_mask).run(TBSS_mean_FA_skeleton)
+
+        # Create Skeleton mask
+        # TODO: This threshold could be configurable by user
+        thresh = 2000
+        wrappers.fslmaths(TBSS_mean_FA_skeleton).thr(thresh).bin().run(TBSS_mean_FA_skeleton_mask)
+        wrappers.fslmaths(TBSS_all_FA).mas(TBSS_mean_FA_skeleton_mask).run(TBSS_all_FA_skeletonised)
+
+        atlas = ctx.get_atlas('JHU/JHU-ICBM-labels-1mm.nii.gz')
+        mean = wrappers.fslstats(TBSS_all_FA_skeletonised, K=atlas).M.run()
+
+        with open(JHUrois_FA, 'wt', encoding="utf-8") as f:
+            f.write(f'{mean}')
+
+        # Applying to the outputs of both dtifit and noddi
+        dict_suffix={dtifit_prefix: ['L1', 'L2', 'L3', 'MO', 'MD'],
+                     NODDI_prefix: ['ICVF', 'OD', 'ISOVF']}
+
+        for prefix in dict_suffix:
+
+            for suffix in dict_suffix[prefix]:
+
+                d_input = prefix + suffix + ".nii.gz"
+
+                if os.path.exists(d_input):
+                    d_output      = TBSS_prefix + suffix +".nii.gz"
+                    d_output_skel = TBSS_prefix + suffix +"_skeletonised.nii.gz"
+                    d_output_txt  = JHUrois_prefix + suffix + '.txt'
+                    wrappers.applywarp(src=d_input, out=d_output, ref=TBSS_MNI,
+                                       warp=TBSS_FA_to_MNI_warp, rel=True,
+                                       interp='trilinear')
+                    wrappers.fslmaths(d_output).mas(TBSS_mean_FA_skeleton_mask).run(d_output_skel)
+                    mean = wrappers.fslstats( d_output_skel, K=atlas).M.run()
+
+                    with open(d_output_txt, 'wt', encoding="utf-8") as f:
+                        f.write(f'{mean}')
diff --git a/bip/pipelines/dMRI_fieldmap/__init__.py b/bip/pipelines/dMRI_fieldmap/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/bip/pipelines/dMRI_fieldmap/dMRI_fieldmap.py b/bip/pipelines/dMRI_fieldmap/dMRI_fieldmap.py
new file mode 100644
index 0000000..d320f01
--- /dev/null
+++ b/bip/pipelines/dMRI_fieldmap/dMRI_fieldmap.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+#
+# dMRI_fieldmap.py - Pipeline with the fieldmap processing.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from bip.utils import redirect_logging
+from bip.pipelines.dMRI_fieldmap import fieldmap_pre_topup
+from bip.pipelines.dMRI_fieldmap import fieldmap_topup
+from bip.pipelines.dMRI_fieldmap import fieldmap_post_topup
+
+log = logging.getLogger(__name__)
+
+def add_to_pipeline(ctx, pipe, tree, targets):
+
+    logs_dir=tree.get('logs_dir')
+
+    with redirect_logging('pipe_dMRI_fieldmap', outdir=logs_dir):
+        pipe(fieldmap_pre_topup.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('total_B0_PA')
+        pipe(fieldmap_topup.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('fieldmap_fout')
+        pipe(fieldmap_post_topup.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('fieldmap_mask')
+
+    return pipe, targets
diff --git a/bip/pipelines/dMRI_fieldmap/fieldmap_post_topup.py b/bip/pipelines/dMRI_fieldmap/fieldmap_post_topup.py
new file mode 100755
index 0000000..4e1bfdb
--- /dev/null
+++ b/bip/pipelines/dMRI_fieldmap/fieldmap_post_topup.py
@@ -0,0 +1,148 @@
+#!/usr/bin/env python
+#
+# fieldmap_post_topup.py - Sub-pipeline with the fieldmap processing after topup
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from shutil import copyfile
+import numpy as np
+import nibabel as nib
+from fsl import wrappers
+from bip.utils import redirect_logging, tempdir
+from pipe_tree import In, Out, Ref
+from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1:                             In,
+        T1_brain:                       In,
+        T1_brain_mask:                  In,
+        T1_fast_WM_mask:                In,
+        T1_brain_mask_dil:              Out,
+        B0_AP:                          In,
+        B0_PA:                          In,
+        acqparams:                      In,
+        logs_dir:                       Ref,
+        tmp_dir:                        Ref,
+        fieldmap_out_prefix:            Ref,
+        fieldmap_GDC:                   Ref,
+        fieldmap_fout:                  Ref,
+        T1_to_fieldmap_iout_mat:        Out,
+        fieldmap_iout:                  Out,
+        fieldmap_iout_mean:             Out,
+        fieldmap_iout_mean_ud:          Out,
+        fieldmap_iout_mean_ud_warp:     Out,
+        fieldmap_iout_to_T1:            Out,
+        fieldmap_fout_to_T1:            Out,
+        fieldmap_fout_to_T1_brain:      Out,
+        fieldmap_fout_to_T1_brain_rad:  Out,
+        fieldmap_iout_to_T1_mat:        Out,
+        fieldmap_mask:                  Out,
+        fieldmap_mask_ud:               Out,
+        fieldmap_iout_mean_ud_inv_warp: Out):
+
+    with redirect_logging('fieldmap_post_topup', outdir=logs_dir),\
+               tempdir(tmp_dir):
+
+        B0_AP_corr_tmp  = tmp_dir + '/B0_AP_corr_tmp.nii.gz'
+        B0_PA_corr_tmp  = tmp_dir + '/B0_PA_corr_tmp.nii.gz'
+        B0_AP_fixed_tmp = tmp_dir + '/B0_AP_fixed_tmp.nii.gz'
+        B0_PA_fixed_tmp = tmp_dir + '/B0_PA_fixed_tmp.nii.gz'
+        fieldmap_tmp    = tmp_dir + '/fieldmap_tmp.nii.gz'
+
+        #Get corrected B=0 for AP and PA and average them avoiding zero values
+        wrappers.applytopup(imain=B0_AP, datain=acqparams, index=1,
+                            topup=fieldmap_out_prefix,
+                            out=B0_AP_corr_tmp, method="jac")
+        wrappers.applytopup(imain=B0_PA, datain=acqparams, index=2,
+                            topup=fieldmap_out_prefix,
+                            out=B0_PA_corr_tmp, method="jac")
+
+        B0_AP_corr_tmp_img = nib.load(B0_AP_corr_tmp)
+        B0_PA_corr_tmp_img = nib.load(B0_PA_corr_tmp)
+
+        B0_AP_corr_tmp_imgf = B0_AP_corr_tmp_img.get_fdata()
+        B0_PA_corr_tmp_imgf = B0_PA_corr_tmp_img.get_fdata()
+
+        #Get a list of indices the zero-valued voxels for AP and PA
+        x1,y1,z1 = np.where(B0_AP_corr_tmp_imgf==0)
+        x2,y2,z2 = np.where(B0_PA_corr_tmp_imgf==0)
+
+        #For AP voxels with 0 value,, get the values in PA  (And viceversa)
+        B0_AP_fixed_tmp_imgf = B0_AP_corr_tmp_imgf
+        B0_PA_fixed_tmp_imgf = B0_PA_corr_tmp_imgf
+        B0_AP_fixed_tmp_imgf[x1,y1,z1] = B0_PA_corr_tmp_imgf[x1,y1,z1]
+        B0_PA_fixed_tmp_imgf[x2,y2,z2] = B0_AP_corr_tmp_imgf[x2,y2,z2]
+
+        B0_AP_fixed_tmp_img = nib.Nifti1Image(B0_AP_fixed_tmp_imgf,
+                                              B0_AP_corr_tmp_img.affine,
+                                              B0_AP_corr_tmp_img.header)
+
+        B0_PA_fixed_tmp_img = nib.Nifti1Image(B0_PA_fixed_tmp_imgf,
+                                              B0_PA_corr_tmp_img.affine,
+                                              B0_PA_corr_tmp_img.header)
+
+        nib.save(B0_AP_fixed_tmp_img, B0_AP_fixed_tmp)
+        nib.save(B0_PA_fixed_tmp_img, B0_PA_fixed_tmp)
+
+        #Merge and average them
+        wrappers.fslmerge("t", fieldmap_iout, B0_AP_fixed_tmp, B0_PA_fixed_tmp)
+        wrappers.fslmaths(fieldmap_iout).Tmean().run(fieldmap_iout_mean)
+
+
+        if ctx.gdc != '':
+            #Calculate and apply the Gradient Distortion Unwarp
+            # TODO: Review the "half=True" in next version
+            gradient_unwarp_apply(WD=fieldmap_GDC, infile=fieldmap_iout_mean,
+                                  outfile=fieldmap_iout_mean_ud,
+                                  owarp=fieldmap_iout_mean_ud_warp,
+                                  gradcoeff=ctx.gdc,
+                                  vendor='siemens', nojac=True, half=True)
+        else:
+            copyfile(src=fieldmap_iout_mean, dst=fieldmap_iout_mean_ud)
+
+        wrappers.fslcpgeom(B0_AP,fieldmap_fout)
+
+        # Get the topup iout (magnitude) to struct space and
+        # apply the transformation to fout (fieldmap)
+        wrappers.epi_reg(epi=fieldmap_iout_mean_ud, t1=T1, t1brain=T1_brain,
+                         out=fieldmap_iout_to_T1, wmseg=T1_fast_WM_mask)
+        wrappers.applywarp(src=fieldmap_fout, ref=T1,
+                           out=fieldmap_fout_to_T1,
+                           w=fieldmap_iout_mean_ud_warp,
+                           postmat=fieldmap_iout_to_T1_mat,
+                           rel=True, interp='spline')
+
+        # Mask the warped fout (fieldmap) using T1 brain mask
+        wrappers.fslmaths(fieldmap_fout_to_T1).mul(T1_brain_mask).run(fieldmap_fout_to_T1_brain)
+
+        # Multiply the warped & masked fout (fieldmap) by 2*Pi to have it in radians
+        wrappers.fslmaths(fieldmap_fout_to_T1_brain).mul(2*np.pi).run(fieldmap_fout_to_T1_brain_rad)
+
+        # Generate a mask for topup output by inverting the
+        # previous registration and applying it to T1 brain mask
+        wrappers.invxfm(inmat=fieldmap_iout_to_T1_mat, omat=T1_to_fieldmap_iout_mat)
+        wrappers.fslmaths(T1_brain_mask).thr(0.1).run(fieldmap_tmp)
+        wrappers.fslmaths(fieldmap_tmp).kernel("sphere",1.1).dilF().run(fieldmap_tmp)
+        wrappers.fslmaths(fieldmap_tmp).bin().fillh().run(T1_brain_mask_dil)
+        wrappers.applyxfm(src=T1_brain_mask_dil, ref=fieldmap_iout_mean,
+                          mat=T1_to_fieldmap_iout_mat, out=fieldmap_mask_ud,
+                          interp="trilinear")
+        wrappers.fslmaths(fieldmap_mask_ud).thr(0.25).bin().run(fieldmap_mask_ud)
+
+        #Warp the dilated T1 brain mask to the Gradient Distorted space by inverting
+        wrappers.invwarp(ref=fieldmap_iout_mean, warp=fieldmap_iout_mean_ud_warp,
+                         out=fieldmap_iout_mean_ud_inv_warp)
+        wrappers.applywarp(src=T1_brain_mask_dil, ref=fieldmap_iout_mean,
+                           out=fieldmap_mask,
+                           premat=T1_to_fieldmap_iout_mat,
+                           w=fieldmap_iout_mean_ud_inv_warp,
+                           rel=True, interp='trilinear')
+        wrappers.fslmaths(fieldmap_mask).thr(0.25).bin().fillh().run(fieldmap_mask)
diff --git a/bip/pipelines/dMRI_fieldmap/fieldmap_pre_topup.py b/bip/pipelines/dMRI_fieldmap/fieldmap_pre_topup.py
new file mode 100755
index 0000000..b75956c
--- /dev/null
+++ b/bip/pipelines/dMRI_fieldmap/fieldmap_pre_topup.py
@@ -0,0 +1,202 @@
+#!/usr/bin/env python
+#
+# fieldmap_pre_topup.py - Sub-pipeline with the fieldmap processing before topup
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613,R0912
+#
+
+import glob
+import logging
+from shutil import copyfile
+import numpy as np
+import nibabel as nib
+from fsl import wrappers
+from bip.utils import redirect_logging, tempdir
+from bip.commands import bb_get_b0s, get_dwell_time
+from bip.commands.bb_read_json_field import bb_read_json_field
+from pipe_tree import In, Out, Ref
+
+
+log = logging.getLogger(__name__)
+
+def choose_best_B0(ctx, img, bval, total_B0, indices, tmp, best_index, B0,
+                   fieldmap_flag, tmp_dir):
+
+    blah     = tmp_dir + '/blah.nii.gz'
+    blah_mat = tmp_dir + '/blah.mat'
+
+    b0_threshold=int(np.loadtxt(ctx.get_data('dMRI/b0_threshold.txt')))
+
+    bvals = np.loadtxt(bval)
+
+    if type(bvals) is not np.ndarray:
+        num_vols = 1
+    else:
+        num_vols = len(np.where(bvals <= b0_threshold)[0])
+
+    bb_get_b0s.bb_get_b0s(img, bval, total_B0, indices, num_vols,  b0_threshold)
+    ind_values = [int(x) for x in np.loadtxt(indices)]
+
+    wrappers.fslsplit(total_B0, tmp)
+
+    files = glob.glob(tmp + '*')
+    files.sort()
+
+    N = len(files)
+
+    if N == 1:
+        with open(best_index, 'wt', encoding="utf-8") as f:
+            f.write('0\n')
+        copyfile(src=total_B0, dst=B0)
+    else:
+        scores= np.zeros([N,N])
+        for i in range(N):
+            for j in range(N):
+                if j > i:
+                    wrappers.flirt(src=files[i], ref=files[j], nosearch=True,
+                                   dof=6, out=blah, omat=blah_mat)
+                    im1  = nib.load(blah)
+                    im2  = nib.load(files[j])
+                    im1f = im1.get_fdata().flatten()
+                    im2f = im2.get_fdata().flatten()
+                    corr = np.corrcoef(im1f,im2f)[0,1]
+                    scores[i,j] = corr
+                    scores[j,i] = corr
+
+        final_scores = np.zeros(N)
+        for i in range(N):
+            final_scores[i]=np.sum(scores[:,i]) / (N - 1)
+
+        best_ind = final_scores.argmax()
+        best_score = final_scores[best_ind]
+
+        if final_scores[0] > 0.98:
+            best_ind = 0
+            best_score = final_scores[best_ind]
+        if best_score < 0.95:
+            with open(fieldmap_flag, 'wt', encoding="utf-8") as f:
+                f.write(f'The best score was {best_score}.' +
+                 'The subject will probably have problems with this DWI data\n')
+        with open(best_index, 'wt', encoding="utf-8") as f:
+            f.write(f'{ind_values[best_ind]}\n')
+            copyfile(src=files[best_ind], dst=B0)
+
+
+def generate_acqparams(AP, PA, AP_json, PA_json, numAP, numPA, acqparams):
+
+    enc_dir_AP = bb_read_json_field(fileName=AP_json,
+                                 fieldName="PhaseEncodingDirection")
+    enc_dir_PA = bb_read_json_field(fileName=PA_json,
+                                 fieldName="PhaseEncodingDirection")
+
+    # TODO: Write a way to evaluate that they are indeed opposite directions
+
+    # Generating the specific strings for the acqparams file for AP
+    # according to the Phase Encoding Direction in the AP json file
+    if enc_dir_AP == "j-":
+        dim_AP = 2
+        values_AP = "0 -1 0"
+    elif enc_dir_AP == "j":
+        dim_AP = 2
+        values_AP = "0 1 0"
+    elif enc_dir_AP == "i-":
+        dim_AP = 1
+        values_AP = "-1 0 0"
+    elif enc_dir_AP == "i":
+        dim_AP = 1
+        values_AP = "1 0 0"
+    elif enc_dir_AP == "k-":
+        dim_AP = 3
+        values_AP = "0 0 -1"
+    else:
+        dim_AP = 3
+        values_AP = "0 0 1"
+
+    # Generating the specific strings for the acqparams file for PA
+    # according to the Phase Encoding Direction in the PA json file
+    if enc_dir_PA == "j-":
+        #dim_PA = 2
+        values_PA = "0 -1 0"
+    elif enc_dir_PA == "j":
+        #dim_PA = 2
+        values_PA = "0 1 0"
+    elif enc_dir_PA == "i-":
+        #dim_PA = 1
+        values_PA = "-1 0 0"
+    elif enc_dir_PA == "i":
+        #dim_PA = 1
+        values_PA = "1 0 0"
+    elif enc_dir_PA == "k-":
+        #dim_PA = 3
+        values_PA = "0 0 -1"
+    else:
+        #dim_PA = 3
+        values_PA = "0 0 1"
+
+
+    imAP = nib.load(AP)
+    numlines = imAP.header['dim'][dim_AP]
+
+    dtiDwell = get_dwell_time.get_dt(AP, AP_json)
+
+    topupValue = (dtiDwell * (numlines -1)) / 1000.0
+
+    values_AP = values_AP + " " + str(topupValue) + "\n"
+    values_PA = values_PA + " " + str(topupValue) + "\n"
+
+    with open(acqparams, 'wt', encoding="utf-8") as f:
+        for i in range(numAP):
+            f.write(values_AP)
+        for i in range(numPA):
+            f.write(values_PA)
+
+
+def run(ctx,
+        AP:               In,
+        PA:               In,
+        AP_bval:          In,
+        PA_bval:          In,
+        AP_json:          In,
+        PA_json:          In,
+        AP_indices:       Out,
+        PA_indices:       Out,
+        total_B0_AP:      Out,
+        total_B0_PA:      Out,
+        B0_AP:            Out,
+        B0_PA:            Out,
+        AP_best_index:    Out,
+        PA_best_index:    Out,
+        B0_AP_PA:         Out,
+        acqparams:        Out,
+        AP_fieldmap_flag: Ref,
+        PA_fieldmap_flag: Ref,
+        logs_dir:         Ref,
+        tmp_dir:          Ref):
+
+    with redirect_logging('fieldmap_pre_topup', outdir=logs_dir),\
+         tempdir(tmp_dir):
+
+        AP_tmp = tmp_dir + '/AP_tmp_'
+        PA_tmp = tmp_dir + '/PA_tmp_'
+
+        choose_best_B0(ctx, AP, AP_bval, total_B0_AP, AP_indices, AP_tmp,
+                       AP_best_index, B0_AP, AP_fieldmap_flag, tmp_dir)
+        choose_best_B0(ctx, PA, PA_bval, total_B0_PA, PA_indices, PA_tmp,
+                       PA_best_index, B0_PA, PA_fieldmap_flag, tmp_dir)
+
+        wrappers.fslmerge("t", B0_AP_PA, B0_AP, B0_PA)
+
+        generate_acqparams(AP, PA, AP_json, PA_json, 1, 1, acqparams)
+
+        # Improvement by Kevin Anderson on 20/12/2017
+        # This guarantees that the number of slices is even
+        im_AP_PA = nib.load(B0_AP_PA)
+        Zslices=im_AP_PA.header['dim'][3]
+
+        if (Zslices % 2) != 0:
+            wrappers.fslroi(B0_AP_PA, B0_AP_PA, 0, -1, 0, -1, 0, Zslices -1)
diff --git a/bip/pipelines/dMRI_fieldmap/fieldmap_topup.py b/bip/pipelines/dMRI_fieldmap/fieldmap_topup.py
new file mode 100755
index 0000000..15bf030
--- /dev/null
+++ b/bip/pipelines/dMRI_fieldmap/fieldmap_topup.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+#
+# fieldmap_topup.py - Sub-pipeline with the fieldmap generation with topup
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import logging
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pipe_tree import In, Out, Ref
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        B0_AP_PA:            In,
+        acqparams:           In,
+        logs_dir:            Ref,
+        fieldmap_out_prefix: Ref,
+        fieldmap_jacout:     Ref,
+        fieldmap_fout:       Out):
+
+    with redirect_logging('fieldmap_topup', outdir=logs_dir):
+        wrappers.topup(imain=B0_AP_PA,
+                       datain=acqparams,
+                       config="b02b0.cnf",
+                       out=fieldmap_out_prefix,
+                       fout=fieldmap_fout,
+                       jacout=fieldmap_jacout,
+                       verbose=True)
diff --git a/bip/pipelines/fMRI_rest/__init__.py b/bip/pipelines/fMRI_rest/__init__.py
new file mode 100755
index 0000000..e69de29
diff --git a/bip/pipelines/fMRI_rest/fMRI_rest.py b/bip/pipelines/fMRI_rest/fMRI_rest.py
new file mode 100755
index 0000000..3c1238e
--- /dev/null
+++ b/bip/pipelines/fMRI_rest/fMRI_rest.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+#
+# fMRI_rest.py - Pipeline with the resting state fMRI processing.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from bip.utils import redirect_logging
+from bip.pipelines.fMRI_rest import rfMRI_prepare
+from bip.pipelines.fMRI_rest import rfMRI_melodic
+from bip.pipelines.fMRI_rest import rfMRI_fix
+from bip.pipelines.fMRI_rest import rfMRI_netmats
+
+log = logging.getLogger(__name__)
+
+def add_to_pipeline(ctx, pipe, tree, targets):
+
+    logs_dir=tree.get('logs_dir')
+
+    with redirect_logging('pipe_fMRI_task', outdir=logs_dir):
+        pipe(rfMRI_prepare.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('rfMRI_fsf')
+        pipe(rfMRI_melodic.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('rfMRI_ica')
+        pipe(rfMRI_fix.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('filtered_func_data_clean_stdmask')
+        pipe(rfMRI_netmats.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('node_amplitudes')
+
+    return pipe, targets
diff --git a/bip/pipelines/fMRI_rest/rfMRI_fix.py b/bip/pipelines/fMRI_rest/rfMRI_fix.py
new file mode 100755
index 0000000..9899d50
--- /dev/null
+++ b/bip/pipelines/fMRI_rest/rfMRI_fix.py
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+#
+# rfMRI_fix.py - Sub-pipeline with the FIX processing of the rest fMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import os
+import logging
+from shutil import copyfile
+from pipe_tree import In, Out, Ref
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pyfix import extract, legacy, io, clean, classify
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1_fast_pveseg: In,
+        rfMRI_ica:                        In,
+        rfMRI_example_func2standard_warp: In,
+        rfMRI_example_func:               In,
+        rfMRI_standard:                   In,
+        filtered_func_data:               In,
+        melodic_mix:                      In,
+        rfMRI_mc_parameters:              In,
+        logs_dir:                         Ref,
+        rfMRI_reg_standard_dir:           Ref,
+        rfMRI_highres_pveseg:             Out,
+        rfMRI_standard2example_func_warp: Out,
+        fix_dir:                          Out,
+        fix_features:                     Out,
+        filtered_func_data_clean:         Out,
+        filtered_func_data_clean_std:     Out,
+        filtered_func_data_clean_stdmask: Out,
+        fix4melview:                      Out):
+
+    with redirect_logging('rfMRI_fix', outdir=logs_dir):
+
+        # Generate files needed to extract features
+        if not os.path.exists(rfMRI_highres_pveseg):
+            copyfile(T1_fast_pveseg, rfMRI_highres_pveseg)
+        if not os.path.exists(rfMRI_standard2example_func_warp):
+            wrappers.invwarp(ref=rfMRI_example_func,
+                             warp=rfMRI_example_func2standard_warp,
+                             out=rfMRI_standard2example_func_warp)
+
+        # FIX: Extract features for subject
+        if not os.path.exists(fix_features):
+            d = extract.FixData.from_melodic_dir(rfMRI_ica, fixdir = fix_dir)
+
+            f = extract.extract_features(data=d,
+                                      features=legacy.LEGACY_FEATURE_EXTRACTORS)
+            io.save_features(os.path.join(fix_dir, 'features'), f)
+        else:
+            f = io.read_features(os.path.join(fix_dir, 'features'))
+
+        # FIX: Classify components for subject
+        clf = io.load_model(ctx.get_data('/fix/UKBB_model_2.pyfix_model'))
+        y_pred_pb = classify.classify(f, clf)[1]
+        y_pred = legacy.prob_threshold(y_pred_pb, threshold=0.2)
+
+        fin_list=[]
+        with open(fix4melview, 'wt', encoding="utf-8") as f:
+            for ind, pred in enumerate(y_pred):
+                # Opposite of the convention in MelView
+                if not pred:
+                    f.write(str(ind + 1) + ", Unclassified Noise, True\n")
+                    fin_list.append(ind + 1)
+                else:
+                    f.write(str(ind + 1) + ", Signal, False\n")
+            f.write(f'{fin_list}\n')
+
+        # FIX: Clean
+        clean.apply(func_fname=filtered_func_data,
+                    icamix=melodic_mix,
+                    noise_idx=y_pred,
+                    func_clean_fname=filtered_func_data_clean,
+                    do_motion_regression=True,
+                    motion_parameters=rfMRI_mc_parameters)
+
+        # Create this directory in case it does not exist. This may
+        # happen due to the overwrite function issue in Melodic
+        if not os.path.exists(rfMRI_reg_standard_dir):
+            os.mkdir(rfMRI_reg_standard_dir)
+
+        # Generate the data in standard space
+        wrappers.applywarp(ref=rfMRI_standard, src=filtered_func_data_clean,
+                           out=filtered_func_data_clean_std,
+                           warp=rfMRI_example_func2standard_warp,
+                           interp="spline")
+        mask = ctx.get_data('MNI/MNI152_T1_2mm_brain_mask_bin.nii.gz')
+        wrappers.fslmaths(filtered_func_data_clean_std).mas(mask).run(filtered_func_data_clean_std)
+        wrappers.fslmaths(filtered_func_data_clean_std).Tstd().bin().run(filtered_func_data_clean_stdmask)
diff --git a/bip/pipelines/fMRI_rest/rfMRI_melodic.py b/bip/pipelines/fMRI_rest/rfMRI_melodic.py
new file mode 100755
index 0000000..b38b69d
--- /dev/null
+++ b/bip/pipelines/fMRI_rest/rfMRI_melodic.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+#
+# rfMRI_melodic.py - Sub-pipeline with FSL's MELODIC tool
+#                    applied to the rest fMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import os
+import shutil
+import logging
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pipe_tree import In, Out, Ref
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        rfMRI_fsf:                        In,
+        logs_dir:                         Ref,
+        rfMRI_ica:                        Out,
+        rfMRI_example_func2standard_warp: Out,
+        rfMRI_example_func:               Out,
+        rfMRI_standard:                   Out,
+        filtered_func_data:               Out,
+        melodic_mix:                      Out,
+        rfMRI_mc_parameters:              Out):
+
+    with redirect_logging('rfMRI_melodic', outdir=logs_dir):
+        wrappers.feat(fsf=rfMRI_fsf)
+
+    # The ending of this script is needed because the overwrite output
+    # function in MELODIC is not working, and therefore, the output is
+    # generated in a folder called "rfMI+.ica". Once this function works,
+    # we can remove these last 8 lines
+    name_dir_alt = rfMRI_ica.split(".")
+    name_dir_alt[-2] = name_dir_alt[-2] + "+"
+    name_dir_alt = ".".join(name_dir_alt)
+
+    if os.path.exists(name_dir_alt):
+        if os.path.exists(rfMRI_ica):
+            shutil.rmtree(rfMRI_ica)
+        os.rename(name_dir_alt, rfMRI_ica)
diff --git a/bip/pipelines/fMRI_rest/rfMRI_netmats.py b/bip/pipelines/fMRI_rest/rfMRI_netmats.py
new file mode 100755
index 0000000..9419385
--- /dev/null
+++ b/bip/pipelines/fMRI_rest/rfMRI_netmats.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+#
+# rfMRI_netmats.py - Sub-pipeline with the netmats processing of the rest fMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import os
+import logging
+from fsl import wrappers
+from pipe_tree import In, Out, Ref, Var
+from bip.utils import redirect_logging
+from bip.pipelines.fMRI_rest.rfMRI_netmats_fnc import ICA_dr
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        netmats_dim:                  Var,
+        filtered_func_data:           In,
+        filtered_func_data_clean_std: In,
+        logs_dir:                     Ref,
+        netmats_dir:                  Out,
+        dr_stage1:                    Out,
+        full_corr:                    Out,
+        partial_corr:                 Out,
+        node_amplitudes:              Out):
+
+    D = netmats_dim.value
+
+    with redirect_logging('rfMRI_netmats_d' + D, outdir=logs_dir):
+
+        MNI_2mm_mask = ctx.get_standard("MNI152_T1_2mm_brain_mask.nii.gz")
+        group_IC = ctx.get_data("/netmats/melodic_IC_" + D + ".nii.gz")
+
+
+        # Create this directory in case it does not exist. This may
+        # happen due to the overwrite function issue in Melodic
+        if not os.path.exists(netmats_dir):
+            os.mkdir(netmats_dir)
+
+
+        wrappers.fsl_glm(input=filtered_func_data_clean_std,
+                         design=group_IC, out=dr_stage1, demean=True,
+                         mask = MNI_2mm_mask)
+
+        # Implement in python
+        ICA_dr(filtered_func_data, dr_stage1, D, full_corr, partial_corr,
+               node_amplitudes)
diff --git a/bip/pipelines/fMRI_rest/rfMRI_netmats_fnc.py b/bip/pipelines/fMRI_rest/rfMRI_netmats_fnc.py
new file mode 100644
index 0000000..dcc4d5e
--- /dev/null
+++ b/bip/pipelines/fMRI_rest/rfMRI_netmats_fnc.py
@@ -0,0 +1,139 @@
+#!/usr/bin/env python
+#
+# rfMRI_netmats_fnc.py - Functions for the netmats processing of the rest fMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=E1130
+#
+
+import numpy as np
+import nibabel as nib
+
+def nets_load(timeseries_name,tr,varnorm,numvols=0):
+
+    timeseries = np.loadtxt(timeseries_name)
+    gn = timeseries.shape[0]
+    gd = timeseries.shape[1]
+
+    ts={}
+
+    ts['NtimepointsPerSubject'] = numvols
+
+    if ts['NtimepointsPerSubject'] == 0:
+        ts["NtimepointsPerSubject"] = gn
+        TS=np.full(timeseries.shape, np.nan)
+
+    TS = timeseries
+    TS = TS - np.nanmean(TS)
+
+    if varnorm == 1:
+        TS = TS / np.nanstd(TS)
+
+    ts["ts"]          = TS
+    ts["tr"]          = tr
+    ts["Nsubjects"]   = 1
+    ts["Nnodes"]      = gd
+    ts["NnodesOrig"]  = ts["Nnodes"]
+    ts["Ntimepoints"] = gn
+    ts["DD"]          = [*range(ts["Nnodes"])]
+    ts["UNK"]         = []
+
+    return ts
+
+def nets_tsclean(ts,aggressive):
+    ts["NnodesOrig"]=ts["Nnodes"]
+
+    nongood = [x for x in range(ts["Nnodes"]) if x not in ts["DD"]]
+    bad = [x for x in nongood if x not in ts["UNK"]] # Only bad components
+
+    # Good components
+    goodTS=ts["ts"][:,ts["DD"]]
+
+    # Bad components
+    badTS=ts["ts"][:,bad]
+
+    if aggressive == 1:
+        ts["ts"] = goodTS - np.dot(badTS, np.dot(np.linalg.pinv(badTS),goodTS))
+    else:
+        ts["ts"] = goodTS
+
+    ts["Nnodes"] = ts["ts"].shape[1]
+
+    return ts
+
+#netmats2 = nets_netmats(ts, -r2zPARTIAL, 'ridgep', 0.5)
+def nets_netmats(ts, do_rtoz, method, arg_method=None):
+
+    N=ts["Nnodes"]
+    netmats=[]
+    grot=ts["ts"]
+
+    # We are keeping just the amplitudes
+    if method.lower() in ['corr','correlation']:
+        grot=np.corrcoef(grot,rowvar=False)
+        np.fill_diagonal(grot, 0)
+
+    elif method.lower() in ['ridgep']:
+        grot=np.cov(grot, rowvar=False)
+        grot=grot/np.sqrt(np.nanmean(np.diag(grot) * np.diag(grot)))
+        if not arg_method:
+            rho=0.1
+        else:
+            rho=arg_method
+            if rho<0:
+                rho = -(rho)
+
+        grot=-(np.linalg.inv(grot+rho*np.eye(N)))
+        val0 = np.sqrt(np.abs(np.diag(grot)))
+        val2 = np.tile(val0, (N,1))
+        val1 = np.transpose(val2)
+        grot = (grot / val1) / val2
+
+        np.fill_diagonal(grot, 0)
+
+    netmats=grot.reshape(1,N*N, order='F').copy()
+    netmats=0.5*np.log((1+netmats)/(1-netmats))* (-do_rtoz)
+
+    return netmats
+
+def ICA_dr(func, timeseries, D, full_corr, partial_corr, node_amplitudes):
+    im_func = nib.load(func)
+    tr      = im_func.header['pixdim'][4]
+    numvols = im_func.header['dim'][4]
+
+    ts = nets_load(timeseries, tr, 0, numvols)
+
+    if D == "25":
+        good_components = [3, 22,23,24]
+        ts["DD"] = [x for x in ts["DD"] if x not in good_components]
+        r2zFULL=10.6484
+        r2zPARTIAL=10.6707
+    else:
+        good_components =  [0, 43, 46, 50, 53, 54, 55, 58, 60, 61]
+        good_components += [*range(64,92)] + [*range(93,100)]
+        ts["DD"] = [x for x in ts["DD"] if x not in good_components]
+        r2zFULL    = 19.7177
+        r2zPARTIAL = 18.8310
+
+    ts = nets_tsclean(ts,1)
+
+    netmats1 = nets_netmats(ts, -r2zFULL,    'corr')
+    netmats2 = nets_netmats(ts, -r2zPARTIAL, 'ridgep', 0.5)
+
+    tmp = np.reshape(netmats1,(ts["Nnodes"],ts["Nnodes"]), order="F")
+    data = tmp[np.where(np.triu(np.ones([ts["Nnodes"],ts["Nnodes"]]),k=1) ==1)]
+    with open(full_corr, 'wt', encoding="utf-8") as f:
+        np.savetxt(f, data, fmt="%14.8f", newline=" ")
+
+    tmp = np.reshape(netmats2,(ts["Nnodes"],ts["Nnodes"]), order="F")
+    data = tmp[np.where(np.triu(np.ones([ts["Nnodes"],ts["Nnodes"]]),k=1) ==1)]
+    with open(partial_corr, 'wt', encoding="utf-8") as f:
+        np.savetxt(f, data, fmt="%14.8f", newline=" ")
+
+    data = np.nanstd(ts["ts"], axis=0)
+    with open(node_amplitudes, 'wt', encoding="utf-8") as f:
+        np.savetxt(f, data, fmt="%14.8f", newline=" ")
diff --git a/bip/pipelines/fMRI_rest/rfMRI_prepare.py b/bip/pipelines/fMRI_rest/rfMRI_prepare.py
new file mode 100755
index 0000000..f496829
--- /dev/null
+++ b/bip/pipelines/fMRI_rest/rfMRI_prepare.py
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+#
+# rfMRI_prepare.py - Sub-pipeline with the processing previous to Melodic rfMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import os
+import logging
+from shutil import copyfile
+import nibabel as nib
+from pipe_tree import In, Out, Ref
+from fsl import wrappers
+from bip.commands import get_dwell_time
+from bip.utils import redirect_logging
+from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1:                                      In,
+        T1_brain:                                In,
+        T1_to_MNI_warp:                          In,
+        T1_to_MNI_linear_mat:                    In,
+        T1_fast_pve_2:                           In,
+        rfMRI:                                   In,
+        rfMRI_SBREF:                             In,
+        rfMRI_json:                              In,
+        fieldmap_fout_to_T1_brain_rad:           In,
+        logs_dir:                                Ref,
+        rfMRI_ica:                               Ref,
+        rfMRI_SBREF_GDC:                         Out,
+        rfMRI_T1:                                Out,
+        rfMRI_T1_brain:                          Out,
+        rfMRI_T1_brain2MNI152_T1_2mm_brain_warp: Out,
+        rfMRI_T1_brain2MNI152_T1_2mm_brain_mat:  Out,
+        rfMRI_T1_brain_wmseg:                    Out,
+        rfMRI_SBREF_ud:                          Out,
+        rfMRI_SBREF_ud_warp:                     Out,
+        rfMRI_fsf:                               Out):
+
+    with redirect_logging('rfMRI_prepare', outdir=logs_dir):
+
+        # Creates links
+        # TODO: These links ARE hard-coded. This may cause future problems.
+        if not os.path.exists(rfMRI_T1):
+            os.symlink(src="../../T1/T1.nii.gz",
+                       dst=rfMRI_T1)
+        if not os.path.exists(rfMRI_T1_brain):
+            os.symlink(src="../../T1/T1_brain.nii.gz",
+                       dst=rfMRI_T1_brain)
+        if not os.path.exists(rfMRI_T1_brain2MNI152_T1_2mm_brain_warp):
+            os.symlink(src="../../T1/transforms/T1_to_MNI_warp.nii.gz",
+                       dst=rfMRI_T1_brain2MNI152_T1_2mm_brain_warp)
+        if not os.path.exists(rfMRI_T1_brain2MNI152_T1_2mm_brain_mat):
+            os.symlink(src="../../T1/transforms/T1_to_MNI_linear.mat",
+                       dst=rfMRI_T1_brain2MNI152_T1_2mm_brain_mat)
+
+        wrappers.fslmaths(T1_fast_pve_2).thr(0.5).bin().run(rfMRI_T1_brain_wmseg)
+
+        # Generation of FSF file
+        copyfile(src=ctx.get_data('fMRI_fsf/design_ICA_nonSmoothed.fsf'),
+                                  dst=rfMRI_fsf)
+
+        fMRI_img   = nib.load(rfMRI)
+        fmriNumVol = fMRI_img.header['dim'][4]
+        fmriTR     = fMRI_img.header['pixdim'][4]
+        fmriDwell  = get_dwell_time.get_dt(rfMRI, rfMRI_json)
+        fmriTE     = 39 # Default value for task fMRI TE
+        descrip    = str(fMRI_img.header['descrip'])
+
+        fields = descrip.split(";")
+
+        for field in fields:
+            t = field.split("=")
+
+            fieldName  = t[0]
+            fieldValue = t[1]
+
+            if fieldName == "TE":
+                fmriTE = fieldValue
+
+        if ctx.gdc != '':
+            #Calculate and apply the Gradient Distortion Unwarp
+            # TODO: Review the "half=True" in next version
+            gradient_unwarp_apply(WD=rfMRI_SBREF_GDC,
+                                  infile=rfMRI_SBREF,
+                                  outfile=rfMRI_SBREF_ud,
+                                  owarp=rfMRI_SBREF_ud_warp,
+                                  gradcoeff=ctx.gdc,
+                                  vendor='siemens', nojac=True, half=False)
+        else:
+            copyfile(src=rfMRI_SBREF, dst=rfMRI_SBREF_ud)
+
+        with open(rfMRI_fsf, 'a', encoding="utf-8") as f:
+            f.write('set fmri(regstandard) "' + ctx.FSLDIR + \
+                    '/data/standard/MNI152_T1_2mm_brain"\n')
+            f.write('set fmri(outputdir) "' + os.getcwd() + "/" + rfMRI_ica + '"\n')
+            f.write('set feat_files(1) "' + os.getcwd() + "/" + rfMRI + '"\n')
+            f.write('set alt_ex_func(1) "' + os.getcwd() + "/" + rfMRI_SBREF + '"\n')
+            f.write('set unwarp_files(1) "' + os.getcwd() + "/" + fieldmap_fout_to_T1_brain_rad + '"\n')
+            f.write('set unwarp_files_mag(1) "' + os.getcwd() + "/" + rfMRI_T1_brain + '"\n')
+            f.write('set highres_files(1) "' + os.getcwd() + "/" + rfMRI_T1_brain + '"\n')
+            if ctx.gdc != '':
+                f.write('set fmri(gdc) "' + os.getcwd() + "/" + rfMRI_SBREF_ud_warp + '"\n')
+            f.write('set fmri(tr) ' + str(fmriTR) + '\n')
+            f.write('set fmri(npts) ' + str(fmriNumVol) + '\n')
+            f.write('set fmri(dwell) ' + str(fmriDwell) + '\n')
+            f.write('set fmri(te) ' + str(fmriTE) + '\n')
+            
\ No newline at end of file
diff --git a/bip/pipelines/fMRI_task/__init__.py b/bip/pipelines/fMRI_task/__init__.py
new file mode 100755
index 0000000..e69de29
diff --git a/bip/pipelines/fMRI_task/fMRI_task.py b/bip/pipelines/fMRI_task/fMRI_task.py
new file mode 100755
index 0000000..f30fd94
--- /dev/null
+++ b/bip/pipelines/fMRI_task/fMRI_task.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+#
+# fMRI_task.py - Pipeline with the task fMRI processing.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from bip.utils import redirect_logging
+from bip.pipelines.fMRI_task import tfMRI_prepare
+from bip.pipelines.fMRI_task import tfMRI_feat
+
+log = logging.getLogger(__name__)
+
+def add_to_pipeline(ctx, pipe, tree, targets):
+
+    logs_dir=tree.get('logs_dir')
+
+    with redirect_logging('pipe_fMRI_task', outdir=logs_dir):
+        pipe(tfMRI_prepare.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('tfMRI_fsf')
+        pipe(tfMRI_feat.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('tfMRI_feat')
+
+    return pipe, targets
diff --git a/bip/pipelines/fMRI_task/tfMRI_feat.py b/bip/pipelines/fMRI_task/tfMRI_feat.py
new file mode 100755
index 0000000..54706af
--- /dev/null
+++ b/bip/pipelines/fMRI_task/tfMRI_feat.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+#
+# tfMRI_feat.py - Sub-pipeline with FSL's FEAT tool applied to the task fMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import logging
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pipe_tree import In, Out, Ref
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        tfMRI_fsf:                               In,
+        logs_dir:                                Ref,
+        tfMRI_feat:                              Out):
+
+    with redirect_logging('tfMRI_feat', outdir=logs_dir):
+        wrappers.feat(fsf=tfMRI_fsf)
diff --git a/bip/pipelines/fMRI_task/tfMRI_prepare.py b/bip/pipelines/fMRI_task/tfMRI_prepare.py
new file mode 100755
index 0000000..3eef64b
--- /dev/null
+++ b/bip/pipelines/fMRI_task/tfMRI_prepare.py
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+#
+# tfMRI_prepare.py - Sub-pipeline with the processing previous to feat tfMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import os
+import logging
+from shutil import copyfile
+import nibabel as nib
+from pipe_tree import In, Out, Ref
+from fsl import wrappers
+from bip.commands import get_dwell_time
+from bip.utils import redirect_logging
+from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1:                                      In,
+        T1_brain:                                In,
+        T1_to_MNI_warp:                          In,
+        T1_to_MNI_linear_mat:                    In,
+        T1_fast_pve_2:                           In,
+        tfMRI:                                   In,
+        tfMRI_SBREF:                             In,
+        tfMRI_json:                              In,
+        fieldmap_fout_to_T1_brain_rad:           In,
+        logs_dir:                                Ref,
+        tfMRI_feat:                              Ref,
+        tfMRI_SBREF_GDC:                         Out,
+        tfMRI_T1:                                Out,
+        tfMRI_T1_brain:                          Out,
+        tfMRI_T1_brain2MNI152_T1_2mm_brain_warp: Out,
+        tfMRI_T1_brain2MNI152_T1_2mm_brain_mat:  Out,
+        tfMRI_T1_brain_wmseg:                    Out,
+        tfMRI_SBREF_ud:                          Out,
+        tfMRI_SBREF_ud_warp:                     Out,
+        tfMRI_fsf:                               Out):
+
+    with redirect_logging('tfMRI_prepare', outdir=logs_dir):
+
+        # Creates links
+        # TODO: These links ARE hard-coded. This may cause future problems.
+        if not os.path.exists(tfMRI_T1):
+            os.symlink(src="../../T1/T1.nii.gz",
+                       dst=tfMRI_T1)
+        if not os.path.exists(tfMRI_T1_brain):
+            os.symlink(src="../../T1/T1_brain.nii.gz",
+                       dst=tfMRI_T1_brain)
+        if not os.path.exists(tfMRI_T1_brain2MNI152_T1_2mm_brain_warp):
+            os.symlink(src="../../T1/transforms/T1_to_MNI_warp.nii.gz",
+                       dst=tfMRI_T1_brain2MNI152_T1_2mm_brain_warp)
+        if not os.path.exists(tfMRI_T1_brain2MNI152_T1_2mm_brain_mat):
+            os.symlink(src="../../T1/transforms/T1_to_MNI_linear.mat",
+                       dst=tfMRI_T1_brain2MNI152_T1_2mm_brain_mat)
+
+        wrappers.fslmaths(T1_fast_pve_2).thr(0.5).bin().run(tfMRI_T1_brain_wmseg)
+
+        # Generation of FSF file
+        copyfile(src=ctx.get_data('fMRI_fsf/design_TASK.fsf'), dst=tfMRI_fsf)
+
+        fMRI_img   = nib.load(tfMRI)
+        fmriNumVol = fMRI_img.header['dim'][4]
+        fmriTR     = fMRI_img.header['pixdim'][4]
+        fmriDwell  = get_dwell_time.get_dt(tfMRI, tfMRI_json)
+        fmriTE     = 39 # Default value for task fMRI TE
+        descrip    = str(fMRI_img.header['descrip'])
+
+        fields = descrip.split(";")
+
+        for field in fields:
+            t = field.split("=")
+
+            fieldName  = t[0]
+            fieldValue = t[1]
+
+            if fieldName == "TE":
+                fmriTE = fieldValue
+
+        if ctx.gdc != '':
+            #Calculate and apply the Gradient Distortion Unwarp
+            # TODO: Review the "half=True" in next version
+            gradient_unwarp_apply(WD=tfMRI_SBREF_GDC,
+                                  infile=tfMRI_SBREF,
+                                  outfile=tfMRI_SBREF_ud,
+                                  owarp=tfMRI_SBREF_ud_warp,
+                                  gradcoeff=ctx.gdc,
+                                  vendor='siemens', nojac=True, half=False)
+        else:
+            copyfile(src=tfMRI_SBREF, dst=tfMRI_SBREF_ud)
+
+        with open(tfMRI_fsf, 'a', encoding="utf-8") as f:
+            f.write('set fmri(regstandard) "' + ctx.FSLDIR + \
+                    '/data/standard/MNI152_T1_2mm_brain"\n')
+            f.write('set fmri(custom1) "' + ctx.get_data('fMRI_fsf/designS.txt') + '"\n')
+            f.write('set fmri(custom2) "' + ctx.get_data('fMRI_fsf/designF.txt') + '"\n')
+            f.write('set fmri(outputdir) "' + os.getcwd() + "/" + tfMRI_feat + '"\n')
+            f.write('set feat_files(1) "' + os.getcwd() + "/" + tfMRI + '"\n')
+            f.write('set alt_ex_func(1) "' + os.getcwd() + "/" + tfMRI_SBREF + '"\n')
+            f.write('set unwarp_files(1) "' + os.getcwd() + "/" + fieldmap_fout_to_T1_brain_rad + '"\n')
+            f.write('set unwarp_files_mag(1) "' + os.getcwd() + "/" + tfMRI_T1_brain + '"\n')
+            f.write('set highres_files(1) "' + os.getcwd() + "/" + tfMRI_T1_brain + '"\n')
+            if ctx.gdc != '':
+                f.write('set fmri(gdc) "' + os.getcwd() + "/" + tfMRI_SBREF_ud_warp + '"\n')
+            f.write('set fmri(tr) ' + str(fmriTR) + '\n')
+            f.write('set fmri(npts) ' + str(fmriNumVol) + '\n')
+            f.write('set fmri(dwell) ' + str(fmriDwell) + '\n')
+            f.write('set fmri(te) ' + str(fmriTE) + '\n')
diff --git a/bip/pipelines/struct_T1/T1_QC_CNR_corners.py b/bip/pipelines/struct_T1/T1_QC_CNR_corners.py
new file mode 100755
index 0000000..fee0701
--- /dev/null
+++ b/bip/pipelines/struct_T1/T1_QC_CNR_corners.py
@@ -0,0 +1,89 @@
+#!/usr/bin/env python
+#
+# T1_QC_CNR_corners.py - Sub-pipeline with the QC (CNR in the corners) of T1w.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import logging
+from fsl import wrappers
+from pipe_tree import In, Out, Ref
+from bip.utils import redirect_logging, tempdir
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1:                      In,
+        T1_orig:                 In,
+        T1_notNorm:              In,
+        T1_fast_GM_mask:         In,
+        T1_fast_WM_mask:         In,
+        T1_orig_QC_CNR_lower:    Out,
+        T1_orig_QC_CNR_upper:    Out,
+        T1_notNorm_QC_CNR_lower: Out,
+        T1_notNorm_QC_CNR_upper: Out,
+        logs_dir:                Ref,
+        tmp_dir:                 Ref):
+
+    with redirect_logging('T1_QC_CNR_corners', outdir=logs_dir),\
+         tempdir(tmp_dir):
+
+        roi_1_1     = tmp_dir + '/roi_1_1.nii.gz'
+        roi_1_245   = tmp_dir + '/roi_1_245.nii.gz'
+        roi_197_1   = tmp_dir + '/roi_197_1.nii.gz'
+        roi_197_245 = tmp_dir + '/roi_197_245.nii.gz'
+        roi_x_1     = tmp_dir + '/roi_x_1.nii.gz'
+        roi_x_245   = tmp_dir + '/roi_x_245.nii.gz'
+        roi_lower   = tmp_dir + '/roi_lower.nii.gz'
+        roi_upper   = tmp_dir + '/roi_upper.nii.gz'
+
+
+        in_files   = [T1_orig, T1_notNorm]
+        out_files_lo = [T1_orig_QC_CNR_lower, T1_notNorm_QC_CNR_lower]
+        out_files_up = [T1_orig_QC_CNR_upper, T1_notNorm_QC_CNR_upper]
+
+        for i in [0,1]:
+            # Lower corners
+            wrappers.fslroi(in_files[i], roi_1_1,       1, 10, 1,   10, 0, 10)
+            wrappers.fslroi(in_files[i], roi_1_245,     1, 10, 245, 10, 0, 10)
+            wrappers.fslroi(in_files[i], roi_197_1,   197, 10, 1,   10, 0, 10)
+            wrappers.fslroi(in_files[i], roi_197_245, 197, 10, 245, 10, 0, 10)
+
+            wrappers.fslmerge("x", roi_x_1,   roi_1_1,   roi_197_1)
+            wrappers.fslmerge("x", roi_x_245, roi_1_245, roi_197_245)
+            wrappers.fslmerge("y", roi_lower, roi_x_1,   roi_x_245)
+
+            # Upper corners
+            wrappers.fslroi(in_files[i], roi_1_1,       1, 10, 1,   10, 245, 10)
+            wrappers.fslroi(in_files[i], roi_1_245,     1, 10, 245, 10, 245, 10)
+            wrappers.fslroi(in_files[i], roi_197_1,   197, 10, 1,   10, 245, 10)
+            wrappers.fslroi(in_files[i], roi_197_245, 197, 10, 245, 10, 245, 10)
+
+            wrappers.fslmerge("x", roi_x_1,   roi_1_1,   roi_197_1)
+            wrappers.fslmerge("x", roi_x_245, roi_1_245, roi_197_245)
+            wrappers.fslmerge("y", roi_upper, roi_x_1,   roi_x_245)
+
+            grey   = wrappers.fslstats(T1).k(T1_fast_GM_mask).m.run()
+            white  = wrappers.fslstats(T1).k(T1_fast_WM_mask).m.run()
+            threshold = wrappers.fslstats(T1).k(T1_fast_GM_mask).P(1).run() / 2
+
+            wrappers.fslmaths(roi_lower).uthr(threshold).run(roi_lower)
+            wrappers.fslmaths(roi_upper).uthr(threshold).run(roi_upper)
+
+            noise_lower = wrappers.fslstats(roi_lower).S.run()
+            noise_upper = wrappers.fslstats(roi_upper).S.run()
+
+            brain = (grey + white) / 2
+
+            result_lower = noise_lower / brain
+            result_upper = noise_upper / brain
+
+            with open(out_files_lo[i], 'wt', encoding="utf-8") as f:
+                f.write(f'{result_lower}\n')
+            with open(out_files_up[i], 'wt', encoding="utf-8") as f:
+                f.write(f'{result_upper}\n')
diff --git a/bip/pipelines/struct_T1/T1_QC_CNR_eyes.py b/bip/pipelines/struct_T1/T1_QC_CNR_eyes.py
new file mode 100755
index 0000000..5bc8dfb
--- /dev/null
+++ b/bip/pipelines/struct_T1/T1_QC_CNR_eyes.py
@@ -0,0 +1,109 @@
+#!/usr/bin/env python
+#
+# T1_QC_CNR_eyes.py - Sub-pipeline with the QC (CNR in front of eyes) of T1w.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+
+import os
+import logging
+import nibabel as nib
+from fsl import wrappers
+from pipe_tree import In, Out, Ref
+from bip.utils import redirect_logging, tempdir
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1_brain_mask:         In,
+        T1_orig:               In,
+        T1_notNorm:            In,
+        T1_fast_GM_mask:       In,
+        T1_fast_WM_mask:       In,
+        T1_orig_ud_warp:       In,
+        T1_orig_ud_to_T1_mat:  In,
+        T1_to_MNI_linear_mat:  In,
+        T1_to_T1_orig_ud_mat:  In,
+        T1_eyes_cuboid_mask:   Out,
+        MNI_to_T1_orig_ud_mat: Out,
+        T1_orig_ud_to_MNI_mat: Out,
+        left_eye_flirted:      Out,
+        right_eye_flirted:     Out,
+        T1_QC_CNR_eyes:        Out,
+        T1_orig_ud_warp_inv:   Ref,
+        logs_dir:              Ref,
+        tmp_dir:               Ref):
+
+    with redirect_logging('T1_QC_CNR_eyes', outdir=logs_dir),\
+        tempdir(tmp_dir):
+
+        T1_brain_GM_mask_orig = tmp_dir + '/T1_brain_GM_mask_orig.nii.gz'
+        T1_brain_WM_mask_orig = tmp_dir + '/T1_brain_WM_mask_orig.nii.gz'
+        lmask                 = tmp_dir + '/lmask.nii.gz'
+        rmask                 = tmp_dir + '/rmask.nii.gz'
+        T1_tmp_7              = tmp_dir + '/T1_tmp_7.nii.gz'
+
+        if not os.path.exists(T1_orig_ud_warp_inv):
+            wrappers.invwarp(ref=T1_orig, warp=T1_orig_ud_warp,
+                             out=T1_orig_ud_warp_inv)
+
+        wrappers.applywarp(src=T1_fast_GM_mask, ref=T1_orig,
+                           w=T1_orig_ud_warp_inv, premat=T1_to_T1_orig_ud_mat,
+                           out=T1_brain_GM_mask_orig, rel=True, interp='nn')
+        wrappers.applywarp(src=T1_fast_WM_mask, ref=T1_orig,
+                           w=T1_orig_ud_warp_inv, premat=T1_to_T1_orig_ud_mat,
+                           out=T1_brain_WM_mask_orig, rel=True, interp='nn')
+
+        wrappers.concatxfm(atob=T1_orig_ud_to_T1_mat, btoc=T1_to_MNI_linear_mat,
+                           atoc=T1_orig_ud_to_MNI_mat)
+        wrappers.invxfm(inmat=T1_orig_ud_to_MNI_mat, omat=MNI_to_T1_orig_ud_mat)
+        wrappers.applyxfm(src=ctx.get_data('MNI/MNI152_T1_1mm_left_eye_dil.nii.gz'),
+                          ref=T1_orig, mat=MNI_to_T1_orig_ud_mat,
+                          out=left_eye_flirted, interp="nearestneighbour")
+        wrappers.applyxfm(src=ctx.get_data('MNI/MNI152_T1_1mm_right_eye_dil.nii.gz'),
+                          ref=T1_orig, mat=MNI_to_T1_orig_ud_mat,
+                          out=right_eye_flirted, interp="nearestneighbour")
+
+        lx, _, lz  = wrappers.fslstats(left_eye_flirted).C.run()
+        rx, _, rz = wrappers.fslstats(right_eye_flirted).C.run()
+
+        size = 40
+        half_size = size / 2
+
+        T1_orig_img = nib.load(T1_orig)
+        dimY = int(round(T1_orig_img.header['dim'][2] - size))
+
+        lDimX = int(round(lx - half_size))
+        lDimZ = int(round(lz - half_size))
+        rDimX = int(round(rx - half_size))
+        rDimZ = int(round(rz - half_size))
+
+        wrappers.fslmaths(T1_orig).mul(0).add(1).roi(lDimX, size, dimY, size,
+                                                  lDimZ, size, 0, 1).run(lmask)
+        wrappers.fslmaths(T1_orig).mul(0).add(1).roi(rDimX, size, dimY, size,
+                                                  rDimZ, size, 0, 1).run(rmask)
+        wrappers.fslmaths(rmask).add(lmask).run(T1_eyes_cuboid_mask)
+        wrappers.fslmaths(T1_eyes_cuboid_mask).mul(T1_notNorm).run(T1_tmp_7)
+
+        grey   = wrappers.fslstats(T1_notNorm).k(T1_brain_GM_mask_orig).m.run()
+        white  = wrappers.fslstats(T1_notNorm).k(T1_brain_WM_mask_orig).m.run()
+        threshold = wrappers.fslstats(T1_notNorm).k(T1_brain_GM_mask_orig).P(3).run()
+
+        wrappers.fslmaths(T1_tmp_7).uthr(threshold).bin().run(T1_tmp_7)
+        wrappers.fslmaths(T1_tmp_7).dilM(2).ero(4).mul(T1_notNorm).run(T1_tmp_7)
+
+        noise = wrappers.fslstats(T1_tmp_7).S.run()
+        brain = int(round((grey + white) / 2))
+        #TODO: The roundings are only there to mimic the behaviour of
+        #      previous version. We do not have to do it in next version
+
+        result = noise / brain
+
+        with open(T1_QC_CNR_eyes, 'wt', encoding="utf-8") as f:
+            f.write(f'{result}\n')
diff --git a/bip/pipelines/struct_T1/T1_QC_COG.py b/bip/pipelines/struct_T1/T1_QC_COG.py
new file mode 100755
index 0000000..5d4ea84
--- /dev/null
+++ b/bip/pipelines/struct_T1/T1_QC_COG.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+#
+# T1_QC_COG.py - Sub-pipeline with the QC (Calculate Center of Gravity) of T1w.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+import numpy as np
+import nibabel as nib
+from fsl import wrappers
+from bip.utils import redirect_logging, tempdir
+from pipe_tree import In, Out, Ref
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1_brain_mask: In,
+        T1_QC_COG:     Out,
+        logs_dir:      Ref,
+        tmp_dir:       Ref):
+
+    with redirect_logging('T1_QC_COG', outdir=logs_dir),\
+         tempdir(tmp_dir):
+
+        T1_tmp_5 = tmp_dir + '/T1_tmp_5.nii.gz'
+        T1_tmp_6 = tmp_dir + '/T1_tmp_6.nii.gz'
+
+        refSubj = ctx.get_data('MNI/MNI152_T1_1mm_BigFoV_facemask.nii.gz')
+
+        COG_coord = wrappers.fslstats(T1_brain_mask).C.run()
+        T1_brain_mask_img = nib.load(T1_brain_mask)
+
+        qform = T1_brain_mask_img.get_qform()
+
+        new_coord = qform.dot(np.append(COG_coord,1))
+        new_x = new_coord[0]
+        new_z = new_coord[2]
+
+        wrappers.fslmaths(T1_brain_mask).thr(0.5).bin().run(T1_tmp_5)
+        wrappers.flirt(src=T1_tmp_5, ref=refSubj, out=T1_tmp_6, applyxfm=True,
+                       usesqform=True, interp='nearestneighbour')
+
+        new_y = wrappers.fslstats(T1_tmp_6).w.run()[2]
+
+        np.savetxt(T1_QC_COG, [new_x, new_y, new_z], fmt='%.6f', newline=' ')
diff --git a/bip/pipelines/struct_T1/T1_brain_extract.py b/bip/pipelines/struct_T1/T1_brain_extract.py
new file mode 100755
index 0000000..221507a
--- /dev/null
+++ b/bip/pipelines/struct_T1/T1_brain_extract.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+#
+# T1_brain_extract.py - Sub-pipeline with the brain extraction of T1w.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+
+import logging
+from shutil import copyfile
+from fsl import wrappers
+from bip.utils import redirect_logging, tempdir
+from pipe_tree import In, Out, Ref, update_closure
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1_orig:                 In,
+        T1_orig_ud:              In,
+        T1_orig_ud_warp:         In,
+        T1_brain:                Out,
+        T1_brain_mask:           Out,
+        T1_brain_to_MNI:         Out,
+        T1_to_MNI_linear_mat:    Out,
+        T1_orig_ud_to_T1_mat:    Out,
+        T1_to_MNI_warp:          Out,
+        T1_to_MNI_warp_coef_inv: Out,
+        T1_to_T1_orig_ud_mat:    Out,
+        logs_dir:                Ref,
+        T1:                      Ref,
+        tmp_dir:                 Ref,
+        tmp_T1_prefix:           Ref,
+        transform_outputs:       Ref("T1*_to_*")):
+
+    with redirect_logging('T1_brain_extract', outdir=logs_dir),\
+         tempdir(tmp_dir),\
+         update_closure(transform_outputs):
+
+        T1_tmp_1                  = tmp_dir + '/T1_tmp_1.nii.gz'
+        T1_tmp_2                  = tmp_dir + '/T1_tmp_2.nii.gz'
+        T1_tmp_1_brain            = tmp_dir + '/T1_tmp_1_brain.nii.gz'
+        T1_tmp_orig_ud_to_std_mat = tmp_dir + '/T1_tmp_to_std.mat'
+        T1_tmp                    = tmp_dir + '/T1.nii.gz'
+
+        #Calculate where does the brain start in the z dimension and extract the roi
+        head_top=int(round(float(wrappers.robustfov(T1_orig_ud).stdout[0].split()[7])))
+        wrappers.fslmaths(T1_orig_ud).roi(0,-1,0,-1,head_top,170,0,1,).run(T1_tmp_1)
+
+        #Run a (Recursive) brain extraction on the roi
+        wrappers.bet(T1_tmp_1, T1_tmp_1_brain, robust=True)
+
+        #Reduce the FOV of T1_orig_ud by calculating a registration
+        #from T1_tmp_brain to ssref and apply it to T1_orig_ud
+        wrappers.standard_space_roi(T1_tmp_1_brain, tmp_T1_prefix, maskNONE=True,
+                                    ssref = ctx.MNI + '_brain',
+                                    altinput=T1_orig_ud, d=True)
+        copyfile(src=T1_tmp, dst=T1)
+        copyfile(src=T1_tmp_orig_ud_to_std_mat, dst=T1_orig_ud_to_std_mat)
+
+        #Generate the actual affine from the orig_ud volume to the cut version
+        #we haveand combine it to have an affine matrix from orig_ud to MNI
+        wrappers.flirt(src=T1, ref=T1_orig_ud, omat=T1_to_T1_orig_ud_mat,
+                 schedule = ctx.FSLDIR + '/etc/flirtsch/xyztrans.sch')
+        wrappers.invxfm(inmat=T1_to_T1_orig_ud_mat, omat=T1_orig_ud_to_T1_mat)
+        wrappers.concatxfm(atob=T1_to_T1_orig_ud_mat, btoc=T1_orig_ud_to_std_mat,
+                           atoc=T1_to_MNI_linear_mat)
+
+        #Non-linear registration to MNI using the previously calculated alignment
+        wrappers.fnirt(src = T1, ref = ctx.MNI, aff = T1_to_MNI_linear_mat,
+              config = ctx.get_data('fnirt/bb_fnirt.cnf'),
+              refmask = ctx.get_data('MNI/MNI152_T1_1mm_brain_mask_dil_GD7.nii.gz'),
+              logout = logs_dir + '/bb_T1_to_MNI_fnirt.log',
+              cout = T1_to_MNI_warp_coef, fout = T1_to_MNI_warp,
+              jout = T1_to_MNI_warp_jac, iout = T1_tmp_2,
+              interp = 'spline')
+
+        #Combine all transforms (Gradient Distortion Unwarp and T1 to ctx.MNI) into one
+        if ctx.gdc != '' :
+            wrappers.convertwarp(ref=ctx.MNI, warp1=T1_orig_ud_warp,
+                                 midmat=T1_orig_ud_to_T1_mat, warp2=T1_to_MNI_warp,
+                                 out=T1_orig_to_MNI_warp)
+        else:
+            wrappers.convertwarp(ref=ctx.MNI, premat=T1_orig_ud_to_T1_mat,
+                                 warp1=T1_orig_ud_warp, out=T1_orig_to_MNI_warp)
+
+        # Apply the previously generated transformation
+        wrappers.applywarp(src=T1_orig, ref=ctx.MNI, w=T1_orig_to_MNI_warp,
+                           out=T1_brain_to_MNI, rel=True, interp='spline')
+
+        #Create brain mask
+        wrappers.invwarp(ref=T1, warp=T1_to_MNI_warp_coef,
+                         out=T1_to_MNI_warp_coef_inv)
+        MNI_var_name = 'MNI/MNI152_T1_1mm_brain_mask.nii.gz'
+        wrappers.applywarp(src=ctx.get_data(MNI_var_name), ref=T1,
+                           w=T1_to_MNI_warp_coef_inv, out=T1_brain_mask,
+                           rel=True, interp='trilinear')
+        wrappers.fslmaths(T1).mul(T1_brain_mask).run(T1_brain)
+        wrappers.fslmaths(T1_brain_to_MNI).mul(ctx.get_data(MNI_var_name)).run(T1_brain_to_MNI)
diff --git a/bip/pipelines/struct_T1/T1_defacing.py b/bip/pipelines/struct_T1/T1_defacing.py
new file mode 100755
index 0000000..ff1ff7f
--- /dev/null
+++ b/bip/pipelines/struct_T1/T1_defacing.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+#
+# T1_defacing.py - Sub-pipeline with the defacing processing of the T1w.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from fsl import wrappers
+from pipe_tree import In, Out, Ref
+from bip.utils import redirect_logging, tempdir
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1_orig:                           In,
+        T1_brain_mask:                     In,
+        T1_to_MNI_linear_mat:              In,
+        T1_orig_ud_to_T1_mat:              In,
+        T1:                                Out,
+        T1_orig_defaced:                   Out,
+        T1_defacing_mask:                  Out,
+        T1_QC_face_mask_inside_brain_mask: Out,
+        logs_dir:                          Ref,
+        tmp_dir:                           Ref):
+
+    with redirect_logging('T1_defacing', outdir=logs_dir),\
+         tempdir(tmp_dir):
+
+        T1_tmp_4                  = tmp_dir + '/T1_tmp_4.nii.gz'
+        T1_tmp_mat                = tmp_dir + '/T1_tmp.mat'
+
+        #TODO: Replace this part with proper call to fsl_deface
+        #Defacing T1_orig
+        wrappers.concatxfm(atob=T1_orig_ud_to_T1_mat, btoc=T1_to_MNI_linear_mat,
+                           atoc=T1_tmp_mat)
+        wrappers.concatxfm(atob=T1_tmp_mat,
+                           btoc=ctx.get_data('MNI/MNI_to_MNI_BigFoV_facemask.mat'),
+                           atoc=T1_tmp_mat)
+        wrappers.invxfm(inmat=T1_tmp_mat, omat=T1_tmp_mat)
+        wrappers.applyxfm(src=ctx.get_data('MNI/MNI152_T1_1mm_BigFoV_facemask'),
+                          ref=T1_orig, mat=T1_tmp_mat, out=T1_defacing_mask,
+                          interp="trilinear")
+        wrappers.fslmaths(T1_defacing_mask).binv().mul(T1_orig).run(T1_orig_defaced)
+
+        #Defacing T1
+        wrappers.concatxfm(atob=T1_to_MNI_linear_mat,
+                           btoc = ctx.get_data('MNI/MNI_to_MNI_BigFoV_facemask.mat'),
+                           atoc = T1_tmp_mat)
+        wrappers.invxfm(inmat=T1_tmp_mat, omat=T1_tmp_mat)
+        wrappers.applyxfm(src=ctx.get_data('MNI/MNI152_T1_1mm_BigFoV_facemask'),
+                          ref=T1, mat=T1_tmp_mat, out=T1_defacing_mask,
+                          interp="trilinear")
+        wrappers.fslmaths(T1_defacing_mask).binv().mul(T1).run(T1)
+
+        #Generation of QC value: Number of voxels in which
+        #the defacing mask goes into the brain mask
+        wrappers.fslmaths(T1_brain_mask).thr(0.5).bin().run(T1_tmp_4)
+        wrappers.fslmaths(T1_defacing_mask).thr(0.5).bin().add(T1_tmp_4).run(T1_tmp_4)
+        vals = wrappers.fslstats(T1_tmp_4).V.run()[0]
+        with open(T1_QC_face_mask_inside_brain_mask, 'wt', encoding="utf-8") as f:
+            f.write(str(vals))
diff --git a/bip/pipelines/struct_T1/T1_fast.py b/bip/pipelines/struct_T1/T1_fast.py
new file mode 100755
index 0000000..c912330
--- /dev/null
+++ b/bip/pipelines/struct_T1/T1_fast.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+#
+# T1_fast.py -  Sub-pipeline with FSL's FAST processing of T1w.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import logging
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pipe_tree import In, Out, Ref, update_closure
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1:                In,
+        T1_brain:          In,
+        logs_dir:          Ref,
+        T1_unbiased:       Out,
+        T1_unbiased_brain: Out,
+        T1_fast_pve_0:     Out,
+        T1_fast_pve_1:     Out,
+        T1_fast_pve_2:     Out,
+        fast_outputs:      Out("T1_fast_*")):
+
+    with redirect_logging('T1_fast', outdir=logs_dir),\
+         update_closure(fast_outputs):
+
+        #Run fast
+        wrappers.fast(T1_brain, out = T1_fast_dir + '/T1_brain', b=True)
+
+        #Binarize PVE masks
+        wrappers.fslmaths(T1_fast_pve_0).thr(0.5).bin().run(T1_fast_CSF_mask)
+        wrappers.fslmaths(T1_fast_pve_1).thr(0.5).bin().run(T1_fast_GM_mask)
+        wrappers.fslmaths(T1_fast_pve_2).thr(0.5).bin().run(T1_fast_WM_mask)
+
+        #Apply bias field correction to T1
+        wrappers.fslmaths(T1).div(T1_fast_brain_bias).run(T1_unbiased)
+        wrappers.fslmaths(T1_brain).div(T1_fast_brain_bias).run(T1_unbiased_brain)
diff --git a/bip/pipelines/struct_T1/T1_first.py b/bip/pipelines/struct_T1/T1_first.py
new file mode 100755
index 0000000..02729a4
--- /dev/null
+++ b/bip/pipelines/struct_T1/T1_first.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+#
+# T1_first.py - Sub-pipeline with FSL's FIRST processing of T1w.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import os
+import glob
+import logging
+from pipe_tree import In, Out, Ref
+from fsl import wrappers
+from bip.utils import redirect_logging
+
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1_unbiased_brain:          In,
+        T1_first_unbiased_brain:    Ref,
+        T1_first_prefix:            Ref,
+        logs_dir:                   Ref,
+        T1_first_all_fast_firstseg: Out):
+
+    with redirect_logging('T1_first', outdir=logs_dir):
+
+        # Creates a link inside T1_first to T1_unbiased_brain.nii.gz
+        if not os.path.exists(T1_first_unbiased_brain):
+            os.symlink(src="../T1_unbiased_brain.nii.gz",
+                       dst=T1_first_unbiased_brain)
+        wrappers.run_first_all(input=T1_first_unbiased_brain,
+                               output=T1_first_prefix, b=True)
+
+        for f in glob.glob(T1_first_prefix + "-*_first*.nii.gz"):
+            os.remove(f)
+        for f in glob.glob(T1_first_prefix + "-*_corr*.nii.gz"):
+            os.remove(f)
diff --git a/bip/pipelines/struct_T1/T1_gdc.py b/bip/pipelines/struct_T1/T1_gdc.py
new file mode 100755
index 0000000..bf8f7e4
--- /dev/null
+++ b/bip/pipelines/struct_T1/T1_gdc.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+#
+# T1_gdc.py - Sub-pipeline with the Gradient Distortion Correction of the T1w.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from shutil import copyfile
+from pipe_tree import In, Out, Ref
+from bip.utils import redirect_logging
+from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1_orig:                 In,
+        T1_orig_ud:              Out,
+        T1_orig_ud_warp:         Out,
+        logs_dir:                Ref,
+        T1_GDC:                  Ref):
+
+    with redirect_logging('T1_gdc', outdir=logs_dir):
+
+        if ctx.gdc != '':
+            #Calculate and apply the Gradient Distortion Unwarp
+            # TODO: Review the "half=True" in next version
+            gradient_unwarp_apply(WD=T1_GDC, infile=T1_orig, outfile=T1_orig_ud,
+                                  owarp=T1_orig_ud_warp,gradcoeff=ctx.gdc,
+                                  vendor='siemens', nojac=True, half=True)
+        else:
+            copyfile(src=T1_orig, dst=T1_orig_ud)
diff --git a/bip/pipelines/struct_T1/T1_sienax.py b/bip/pipelines/struct_T1/T1_sienax.py
new file mode 100755
index 0000000..e875933
--- /dev/null
+++ b/bip/pipelines/struct_T1/T1_sienax.py
@@ -0,0 +1,145 @@
+#!/usr/bin/env python
+#
+# T1_sienax.py - Sub-pipeline with the SienaX processing of the T1w.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import os
+import logging
+from fsl import wrappers
+from fsl.transform import affine, flirt
+from bip.utils import redirect_logging, tempdir
+from pipe_tree import In, Out, Ref
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1:                                  In,
+        T1_brain:                            In,
+        T1_fast_pve_0:                       In,
+        T1_fast_pve_1:                       In,
+        T1_fast_pve_2:                       In,
+        T1_to_MNI_linear_mat:                In,
+        T1_to_MNI_warp_coef_inv:             In,
+        T1_sienax_brain_skull:               Out,
+        T1_sienax_to_MNI_linear:             Out,
+        T1_sienax_to_MNI_linear_mat:         Out,
+        T1_sienax_brain_skull_to_MNI_linear: Out,
+        T1_sienax_segperiph:                 Out,
+        T1_sienax_segvent:                   Out,
+        T1_sienax_pve_0_segperiph:           Out,
+        T1_sienax_pve_1_segperiph:           Out,
+        T1_sienax_report:                    Out,
+        T1_sienax_brain:                     Ref,
+        logs_dir:                            Ref,
+        tmp_dir:                             Ref):
+
+    with redirect_logging('T1_sienax', outdir=logs_dir),\
+         tempdir(tmp_dir):
+
+        T1_tmp_mat_1 = tmp_dir + '/tmp_mat_1.mat'
+        T1_tmp_mat_2 = tmp_dir + '/tmp_mat_2.mat'
+        T1_tmp_mat_3 = tmp_dir + '/tmp_mat_3.mat'
+
+        FSLDIR  = ctx.FSLDIR
+        FSLDATA = FSLDIR + '/data'
+        FSLMNI  = FSLDATA + '/standard'
+
+        MNI               = FSLMNI + '/MNI152_T1_1mm.nii.gz'
+        MNI_2mm_brain     = FSLMNI + '/MNI152_T1_2mm_brain.nii.gz'
+        MNI_2mm_skull     = FSLMNI + '/MNI152_T1_2mm_skull.nii.gz'
+        MNI_2mm_structseg = FSLMNI + '/MNI152_T1_2mm_strucseg.nii.gz'
+        MNI_2mm_segperiph = FSLMNI + '/MNI152_T1_2mm_strucseg_periph.nii.gz'
+
+        report = []
+
+        wrappers.bet(T1, T1_sienax_brain, s=True)
+        os.remove(T1_sienax_brain)
+
+        # These 4 lines are equivalent to sienax's pairreg command:
+        #     pairreg ${FSLDIR}/data/standard/MNI152_T1_2mm_brain T1_brain
+        #             ${FSLDIR}/data/standard/MNI152_T1_2mm_skull T1_brain_skull
+        #             T1_to_MNI_linear.mat
+        wrappers.flirt(src=T1_brain, ref=MNI_2mm_brain, omat=T1_tmp_mat_1,
+                       schedule = ctx.FSLDIR + '/etc/flirtsch/pairreg1.sch',
+                       interp="trilinear")
+        wrappers.flirt(src=T1_sienax_brain_skull, ref=MNI_2mm_skull,
+                      omat=T1_tmp_mat_2, init=T1_tmp_mat_1, interp="trilinear",
+                      schedule = ctx.FSLDIR + '/etc/flirtsch/pairreg2.sch')
+        wrappers.fixscaleskew(inmat1=T1_tmp_mat_1, inmat2=T1_tmp_mat_2,
+                             omat=T1_tmp_mat_3)
+        wrappers.flirt(src=T1_brain, ref=MNI_2mm_brain,
+                       omat=T1_sienax_to_MNI_linear_mat, init=T1_tmp_mat_3,
+                       schedule = ctx.FSLDIR + '/etc/flirtsch/pairreg3.sch',
+                       interp="trilinear")
+
+        matrix = flirt.readFlirt(T1_to_MNI_linear_mat)
+        scales = affine.decompose(matrix)[0]
+
+        vscale = float(scales[0]) * float(scales[1]) * float(scales[2])
+
+        wrappers.applyxfm(src=T1, ref=MNI, out=T1_sienax_to_MNI_linear,
+                          mat=T1_sienax_to_MNI_linear_mat, interp="spline")
+        wrappers.applyxfm(src=T1_sienax_brain_skull, ref=MNI,
+                          out=T1_sienax_brain_skull_to_MNI_linear,
+                          mat=T1_sienax_to_MNI_linear_mat, interp="trilinear")
+
+        wrappers.applywarp(src=MNI_2mm_segperiph, ref=T1,
+                           w=T1_to_MNI_warp_coef_inv, out=T1_sienax_segperiph,
+                           rel=True, interp='trilinear')
+        wrappers.fslmaths(T1_sienax_segperiph).thr(0.5).bin().run(T1_sienax_segperiph)
+
+        wrappers.fslmaths(MNI_2mm_structseg).thr(4.5).bin().run(T1_sienax_segvent)
+        wrappers.applywarp(src=T1_sienax_segvent, ref=T1,
+                           w=T1_to_MNI_warp_coef_inv, out=T1_sienax_segvent,
+                           rel=True, interp='nn')
+
+
+        wrappers.fslmaths(T1_fast_pve_1).mas(T1_sienax_segperiph).run(T1_sienax_pve_1_segperiph)
+        V   = wrappers.fslstats(T1_sienax_pve_1_segperiph).m.v.run()
+        xa  = float(V[0])
+        xb  = float(V[2])
+        uxg = xa * xb
+        xg  = xa * xb * vscale
+
+        report.append(f'VSCALING {vscale}')
+        report.append('tissue             volume    unnormalised-volume')
+        report.append(f'pgrey              {xg} {uxg} (peripheral grey)')
+
+
+        wrappers.fslmaths(T1_fast_pve_0).mas(T1_sienax_segperiph).run(T1_sienax_pve_0_segperiph)
+        V   = wrappers.fslstats(T1_sienax_pve_0_segperiph).m.v.run()
+        xa  = float(V[0])
+        xb  = float(V[2])
+        uxg = xa * xb
+        xg  = xa * xb * vscale
+        report.append(f'vcsf               {xg} {uxg} (ventricular CSF)')
+
+
+        V     = wrappers.fslstats(T1_fast_pve_1).m.v.run()
+        xa    = float(V[0])
+        xb    = float(V[2])
+        ugrey = xa * xb
+        ngrey = xa * xb * vscale
+        report.append(f'GREY               {ngrey} {ugrey}')
+
+
+        V      = wrappers.fslstats(T1_fast_pve_2).m.v.run()
+        xa     = float(V[0])
+        xb     = float(V[2])
+        uwhite = xa * xb
+        nwhite = xa * xb * vscale
+        report.append(f'WHITE              {nwhite} {uwhite}')
+
+        ubrain = ugrey + uwhite
+        nbrain = ngrey + nwhite
+        report.append(f'BRAIN              {nbrain} {ubrain}')
+
+        with open(T1_sienax_report, 'wt', encoding="utf-8") as f:
+            for line in report:
+                f.write(f'{line}\n')
diff --git a/bip/pipelines/struct_T1/__init__.py b/bip/pipelines/struct_T1/__init__.py
new file mode 100755
index 0000000..e69de29
diff --git a/bip/pipelines/struct_T1/struct_T1.py b/bip/pipelines/struct_T1/struct_T1.py
new file mode 100755
index 0000000..c9138cc
--- /dev/null
+++ b/bip/pipelines/struct_T1/struct_T1.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+#
+# struct_T1.py - Pipeline with the T1w processing.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from bip.utils import redirect_logging
+from bip.pipelines.struct_T1 import T1_gdc, T1_brain_extract, T1_defacing
+from bip.pipelines.struct_T1 import T1_fast, T1_first, T1_sienax, T1_QC_COG
+from bip.pipelines.struct_T1 import T1_QC_CNR_corners, T1_QC_CNR_eyes
+
+log = logging.getLogger(__name__)
+
+def add_to_pipeline(ctx, pipe, tree, targets):
+
+    logs_dir=tree.get('logs_dir')
+
+    with redirect_logging('pipe_struct_T1', outdir=logs_dir):
+        pipe(T1_gdc.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T1_orig_ud_warp')
+        pipe(T1_brain_extract.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T1_brain')
+        pipe(T1_defacing.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T1_QC_face_mask_inside_brain_mask')
+        pipe(T1_fast.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T1_unbiased_brain')
+        pipe(T1_first.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T1_first_all_fast_firstseg')
+        pipe(T1_sienax.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T1_sienax_report')
+        pipe(T1_QC_COG.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T1_QC_COG')
+        pipe(T1_QC_CNR_corners.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T1_notNorm_QC_CNR_upper')
+        pipe(T1_QC_CNR_eyes.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T1_QC_CNR_eyes')
+
+    return pipe, targets
diff --git a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_apply_bfc.py b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_apply_bfc.py
new file mode 100755
index 0000000..c9509a9
--- /dev/null
+++ b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_apply_bfc.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+#
+# T2_FLAIR_apply_bfc.py - Sub-pipeline applying the Bias Field Correction
+#                         to T2 FLAIR
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import os
+import logging
+from fsl import wrappers
+from bip.utils import redirect_logging
+from pipe_tree import In, Out, Ref
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T2_FLAIR:                In,
+        T2_FLAIR_brain:          In,
+        T1_fast_brain_bias:      In,
+        logs_dir:                Ref,
+        T2_FLAIR_unbiased:       Out,
+        T2_FLAIR_unbiased_brain: Out):
+
+    with redirect_logging('T2_FLAIR_apply_bfc', outdir=logs_dir):
+
+        #Apply bias field correction to T2_FLAIR warped
+        if os.path.isfile(T1_fast_brain_bias):
+            wrappers.fslmaths(T2_FLAIR).div(T1_fast_brain_bias).run(T2_FLAIR_unbiased)
+            wrappers.fslmaths(T2_FLAIR_brain).div(T1_fast_brain_bias).run(T2_FLAIR_unbiased_brain)
+        else:
+            print("WARNING: There was no bias field estimation. " +
+                  "Bias field correction cannot be applied to T2.")
diff --git a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_brain_extract.py b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_brain_extract.py
new file mode 100755
index 0000000..2264699
--- /dev/null
+++ b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_brain_extract.py
@@ -0,0 +1,91 @@
+#!/usr/bin/env python
+#
+# T2_FLAIR_brain_extract.py - Sub-pipeline with the brain extraction of T2 FLAIR
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from shutil import copyfile
+from fsl import wrappers
+from bip.utils import redirect_logging, tempdir
+from pipe_tree import In, Out, Ref, update_closure
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1_brain:                         In,
+        T1_brain_mask:                    In,
+        T1_orig_ud:                       In,
+        T1_orig_ud_to_T1_mat:             In,
+        T1_to_MNI_linear_mat:             In,
+        T1_to_MNI_warp:                   In,
+        T2_FLAIR_orig:                    In,
+        T2_FLAIR_orig_ud:                 In,
+        T2_FLAIR_orig_ud_warp:            In,
+        T2_FLAIR_brain:                   Out,
+        T2_FLAIR_brain_mask:              Out,
+        T2_FLAIR_brain_to_MNI:            Out,
+        T2_FLAIR_to_MNI_linear_mat:       Out,
+        T2_FLAIR_orig_ud_to_T2_FLAIR_mat: Out,
+        T2_FLAIR:                         Ref,
+        logs_dir:                         Ref,
+        tmp_dir:                          Ref,
+        transform_outputs:                Ref("T2_FLAIR*_to_*")):
+
+    with redirect_logging('T2_FLAIR_brain_extract', outdir=logs_dir),\
+         tempdir(tmp_dir),\
+         update_closure(transform_outputs):
+
+        T2_FLAIR_tmp_1_mat = tmp_dir + '/T2_FLAIR_tmp_1.mat'
+        T2_FLAIR_tmp_2_mat = tmp_dir + '/T2_FLAIR_tmp_2.mat'
+
+        #Take T2 to T1 and also the brain mask
+        wrappers.flirt(src=T2_FLAIR_orig_ud, ref=T1_orig_ud,
+                       omat=T2_FLAIR_tmp_1_mat, dof = 6)
+        wrappers.concatxfm(atob=T2_FLAIR_tmp_1_mat, btoc=T1_orig_ud_to_T1_mat,
+                           atoc=T2_FLAIR_tmp_2_mat)
+
+        #The T2_FLAIR.nii.gz in the output of this
+        #flirt will be overwritten in case of GDC
+        wrappers.flirt(src=T2_FLAIR_orig_ud, ref=T1_brain,
+                       refweight=T1_brain_mask, nosearch=True,
+                       init=T2_FLAIR_tmp_2_mat, out=T2_FLAIR,
+                       omat=T2_FLAIR_orig_ud_to_T2_FLAIR_mat, dof = 6)
+
+        if ctx.gdc != '' :
+            wrappers.applywarp(src=T2_FLAIR_orig, ref=T1_brain, out=T2_FLAIR,
+                               w=T2_FLAIR_orig_ud_warp,
+                               postmat=T2_FLAIR_orig_ud_to_T2_FLAIR_mat,
+                               rel=True, interp='spline')
+
+        copyfile(src=T1_brain_mask, dst=T2_FLAIR_brain_mask)
+        wrappers.fslmaths(T2_FLAIR).mul(T2_FLAIR_brain_mask).run(T2_FLAIR_brain)
+
+        #Generate the linear matrix from T2 to MNI (Needed for defacing)
+        wrappers.concatxfm(atob=T2_FLAIR_orig_ud_to_T2_FLAIR_mat,
+                           btoc=T2_FLAIR_tmp_1_mat,
+                           atoc=T2_FLAIR_orig_ud_to_MNI_linear_mat)
+        copyfile(src=T1_to_MNI_linear_mat, dst=T2_FLAIR_to_MNI_linear_mat)
+
+        #Generate the non-linearly warped T2 in MNI
+        #(Needed for post-freesurfer processing)
+        if ctx.gdc != '' :
+            wrappers.convertwarp(ref=ctx.MNI, warp1=T2_FLAIR_orig_ud_warp,
+                                midmat=T2_FLAIR_orig_ud_to_T2_FLAIR_mat,
+                                warp2=T1_to_MNI_warp,
+                                out=T2_FLAIR_orig_to_MNI_warp)
+        else:
+            wrappers.convertwrap(ref=ctx.MNI,
+                                 premat=T2_FLAIR_orig_ud_to_T2_FLAIR_mat,
+                                 warp1=T1_to_MNI_warp,
+                                 out=T2_FLAIR_orig_to_MNI_warp)
+        wrappers.applywarp(src=T2_FLAIR_orig, ref=ctx.MNI,
+                           out=T2_FLAIR_brain_to_MNI,
+                           w=T2_FLAIR_orig_to_MNI_warp,
+                           rel=True, interp='spline')
+        wrappers.fslmaths(T2_FLAIR_brain_to_MNI).mul(ctx.MNI_brain_mask).run(T2_FLAIR_brain_to_MNI)
diff --git a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_defacing.py b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_defacing.py
new file mode 100755
index 0000000..bd4d8ed
--- /dev/null
+++ b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_defacing.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+#
+# T2_FLAIR_defacing.py -  Sub-pipeline with defacing of the of T2 FLAIR.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+
+import logging
+from shutil import copyfile
+from fsl import wrappers
+from pipe_tree import In, Out, Ref
+from bip.utils import redirect_logging, tempdir
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T2_FLAIR_orig:                    In,
+        T2_FLAIR_brain_mask:              In,
+        T2_FLAIR_to_MNI_linear_mat:       In,
+        T2_FLAIR_orig_ud_to_T2_FLAIR_mat: In,
+        T2_FLAIR_orig_defaced:            Out,
+        T2_FLAIR_defacing_mask:           Out,
+        T2_FLAIR_orig_defacing_mask:      Out,
+        T2_FLAIR:                         Out,
+        logs_dir:                         Ref,
+        tmp_dir:                          Ref):
+
+    with redirect_logging('T2_FLAIR_defacing', outdir=logs_dir),\
+         tempdir(tmp_dir):
+
+        T2_FLAIR_tmp_1    = tmp_dir + '/T2_FLAIR_tmp_1nii.gz'
+        T2_FLAIR_tmp_3_mat = tmp_dir + '/T2_FLAIR_tmp_3.mat'
+
+        BigFoV_mask_mat = 'MNI/MNI_to_MNI_BigFoV_facemask.mat'
+        BigFoV_mask     = 'MNI/MNI152_T1_1mm_BigFoV_facemask'
+
+        #TODO: Replace this part with proper call to fsl_deface
+        #Defacing T2_FLAIR_orig
+        wrappers.concatxfm(atob=T2_FLAIR_orig_ud_to_T2_FLAIR_mat,
+                           btoc=T2_FLAIR_to_MNI_linear_mat,
+                           atoc=T2_FLAIR_tmp_3_mat)
+        wrappers.concatxfm(atob=T2_FLAIR_tmp_3_mat,
+                           btoc=ctx.get_data(BigFoV_mask_mat),
+                           atoc=T2_FLAIR_tmp_3_mat)
+        wrappers.invxfm(inmat=T2_FLAIR_tmp_3_mat, omat=T2_FLAIR_tmp_3_mat)
+        wrappers.applyxfm(src=ctx.get_data(BigFoV_mask),
+                          ref=T2_FLAIR_orig, mat=T2_FLAIR_tmp_3_mat,
+                          out=T2_FLAIR_orig_defacing_mask,
+                          interp="trilinear")
+        wrappers.fslmaths(T2_FLAIR_orig_defacing_mask).binv().mul(T2_FLAIR_orig).run(T2_FLAIR_orig_defaced)
+
+        #Defacing T2_FLAIR
+        copyfile(src=T2_FLAIR, dst=T2_FLAIR_tmp_1)
+        wrappers.concatxfm(atob=T2_FLAIR_to_MNI_linear_mat,
+                           btoc=ctx.get_data(BigFoV_mask_mat),
+                           atoc=T2_FLAIR_tmp_3_mat)
+        wrappers.invxfm(inmat=T2_FLAIR_tmp_3_mat, omat=T2_FLAIR_tmp_3_mat)
+        wrappers.applyxfm(src=ctx.get_data(BigFoV_mask),
+                          ref=T2_FLAIR, mat=T2_FLAIR_tmp_3_mat,
+                          out=T2_FLAIR_defacing_mask, interp="trilinear")
+        wrappers.fslmaths(T2_FLAIR_defacing_mask).binv().mul(T2_FLAIR).run(T2_FLAIR)
diff --git a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_gdc.py b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_gdc.py
new file mode 100755
index 0000000..b3f00d7
--- /dev/null
+++ b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_gdc.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+#
+# T2_FLAIR_gdc.py - Sub-pipeline with the Gradient Distortion Correction
+#                   of the T2 FLAIR.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from shutil import copyfile
+from pipe_tree import In, Out, Ref
+from bip.utils import redirect_logging
+from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T2_FLAIR_orig:         In,
+        T2_FLAIR_orig_ud:      Out,
+        T2_FLAIR_orig_ud_warp: Out,
+        logs_dir:              Ref,
+        T2_FLAIR_GDC:          Ref):
+
+    with redirect_logging('T2_FLAIR_gdc', outdir=logs_dir):
+
+        if ctx.gdc != '':
+            #Calculate and apply the Gradient Distortion Unwarp
+            # TODO: Review the "half=True" in next version
+            gradient_unwarp_apply(WD=T2_FLAIR_GDC, infile=T2_FLAIR_orig,
+                                  outfile=T2_FLAIR_orig_ud,
+                                  owarp=T2_FLAIR_orig_ud_warp,gradcoeff=ctx.gdc,
+                                  vendor='siemens', nojac=True, half=True)
+        else:
+            copyfile(src=T2_FLAIR_orig, dst=T2_FLAIR_orig_ud)
diff --git a/bip/pipelines/struct_T2_FLAIR/__init__.py b/bip/pipelines/struct_T2_FLAIR/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/bip/pipelines/struct_T2_FLAIR/struct_T2_FLAIR.py b/bip/pipelines/struct_T2_FLAIR/struct_T2_FLAIR.py
new file mode 100755
index 0000000..2c08a11
--- /dev/null
+++ b/bip/pipelines/struct_T2_FLAIR/struct_T2_FLAIR.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+#
+# struct_T2_FLAIR.py - Pipeline with the T2 FLAIR processing.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from bip.utils import redirect_logging
+from bip.pipelines.struct_T2_FLAIR import T2_FLAIR_gdc, T2_FLAIR_brain_extract
+from bip.pipelines.struct_T2_FLAIR import T2_FLAIR_defacing, T2_FLAIR_apply_bfc
+
+log = logging.getLogger(__name__)
+
+def add_to_pipeline(ctx, pipe, tree, targets):
+
+    logs_dir=tree.get('logs_dir')
+
+    with redirect_logging('pipe_struct_T2_FLAIR', outdir=logs_dir):
+        pipe(T2_FLAIR_gdc.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T2_FLAIR_orig_ud_warp')
+        pipe(T2_FLAIR_brain_extract.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T2_FLAIR_brain')
+        pipe(T2_FLAIR_defacing.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T2_FLAIR_defacing_mask')
+        pipe(T2_FLAIR_apply_bfc.run, submit=dict(jobtime=200),
+             kwargs={'ctx' : ctx})
+        targets.append('T2_FLAIR_unbiased_brain')
+
+    return pipe, targets
diff --git a/bip/pipelines/struct_asl/asl_get_IDPs.py b/bip/pipelines/struct_asl/asl_get_IDPs.py
new file mode 100755
index 0000000..4d19117
--- /dev/null
+++ b/bip/pipelines/struct_asl/asl_get_IDPs.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+#
+# asl_get_IDPs.py - Sub-pipeline generating the IDPs of the ASL pipeline.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613,R1718
+#
+
+import logging
+from pipe_tree import In, Out, Ref
+from bip.utils import redirect_logging
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        region_analysis_gm_csv:  In,
+        logs_dir:                Ref,
+        ASL_region_analysis_dir: Ref,
+        ASL_IDPs:                Out):
+
+    with redirect_logging('asl_get_IDPs', outdir=logs_dir):
+
+        result = ctx.subject
+
+        asl_format_file = ctx.get_data("asl/asl_format.txt")
+
+        with open(asl_format_file, 'rt', encoding="utf-8") as f:
+            asl_format = [x.strip().split() for x in f.readlines()]
+
+        regions = set([x[0] for x in asl_format])
+
+        for region in regions:
+            file_name_1 = ASL_region_analysis_dir + "/" + region + ".csv"
+            file_name_2 = ASL_region_analysis_dir + "/" + region + ".txt"
+
+            with open(file_name_1, 'rt', encoding="utf-8") as f:
+                file_data = f.read()
+
+            file_data = file_data.replace(", ", "_-_")
+            file_data = file_data.replace('"', "")
+            file_data = file_data.replace(" ", "_")
+
+            with open(file_name_2, 'wt', encoding="utf-8") as f:
+                f.write(file_data)
+
+
+        for elem in asl_format:
+
+            fil    = elem[0]
+            row    = elem[1]
+            column = elem[2]
+
+            file_name = ASL_region_analysis_dir + "/" + fil + ".txt"
+
+            with open(file_name, 'rt', encoding="utf-8") as f:
+                file_data = [x.strip().split(",") for x in f.readlines()]
+
+            for line in file_data:
+                if line[0] == row:
+                    val = line[int(column)]
+            if val == "":
+                val = "NaN"
+
+            result += " " + val
+
+        with open(ASL_IDPs, 'wt', encoding="utf-8") as f:
+            f.write(result + "\n")
+           
\ No newline at end of file
diff --git a/bip/pipelines/struct_asl/asl_proc.py b/bip/pipelines/struct_asl/asl_proc.py
new file mode 100755
index 0000000..94d3361
--- /dev/null
+++ b/bip/pipelines/struct_asl/asl_proc.py
@@ -0,0 +1,167 @@
+#!/usr/bin/env python
+#
+# asl_proc.py - Sub-pipeline with the ASL main processing.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613
+#
+
+import os
+import glob
+import logging
+from shutil import copyfile
+from fsl import wrappers
+from pipe_tree import In, Out, Ref
+from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
+from bip.utils import redirect_logging
+from bip.commands.bb_read_json_field import bb_read_json_field
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1:                            In,
+        T1_brain:                      In,
+        T1_to_MNI_warp:                In,
+        fieldmap_fout_to_T1_brain_rad: In,
+        ASL_M0:                        In,
+        ASL_M0_json:                   In,
+        logs_dir:                      Ref,
+        ASL_GDC:                       Ref,
+        OXASL_ra_dir:                  Ref,
+        T1_fast_prefix:                Ref,
+        ASL_PLD_prefix:                Ref,
+        ASL_raw_dir:                   Ref,
+        ASL_M0_ud:                     Out,
+        ASL_M0_ud_warp:                Out,
+        ASL_DATA_wrongorder:           Out,
+        ASL_DATA:                      Out,
+        ASL_DATA_diff:                 Out,
+        ASL_DATA_diff_mean:            Out,
+        ASL_control:                   Out,
+        ASL_label:                     Out,
+        CALIB:                         Out,
+        CALIB_json:                    Out,
+        ASL_qc_modelfit:               Out,
+        ASL_mni_right_amygdala:        Out,
+        ASL_masks_right_amygdala:      Out,
+        ASL_native_right_amygdala:     Out,
+        ASL_struct_90_wm:              Out,
+        ASL_calib_M0:                  Out,
+        ASL_struct_ACBV_calib:         Out,
+        ASL_std_ACBV_calib:            Out,
+        region_analysis_gm_csv:        Out):
+
+    with redirect_logging('asl_proc', outdir=logs_dir):
+
+        BBASL_ROI_DIR = ctx.get_data("asl/ukb_rois/")
+
+        ###############################################
+        # Initial check for Phase Encoding Directions #
+        ###############################################
+        list_PEDs = []
+
+        for fil in glob.glob(ASL_raw_dir + "/*.json"):
+            list_PEDs.append(bb_read_json_field(fileName=fil,
+                                fieldName="PhaseEncodingDirection"))
+
+        if len(list_PEDs) != 12:
+            error_msg =  "ERROR: Wrong phase-encoding-direction in some of the "
+            error_msg += "files (or wrong number of files). "
+            error_msg += "ASL will not be processed."
+            print(error_msg)
+            # TODO: Make unusable this modality
+            # bb_make_unusable ASL $src "2 Wrong_acquisition"
+
+        ##################
+        # Pre-processing #
+        ##################
+        list_fils_control = glob.glob(ASL_PLD_prefix + "*_control.nii.gz")
+        list_fils_control.sort()
+        list_fils_label = glob.glob(ASL_PLD_prefix + "*_label.nii.gz")
+        list_fils_label.sort()
+
+        wrappers.fslmerge("t", ASL_control, *list_fils_control)
+        wrappers.fslmerge("t", ASL_label, *list_fils_label)
+        wrappers.fslmerge("t", ASL_DATA_wrongorder, ASL_label, ASL_control)
+
+        os.symlink("../raw/ASL_M0.nii.gz", CALIB)
+        os.symlink("../raw/ASL_M0.json",   CALIB_json)
+
+        TE = bb_read_json_field(fileName=CALIB_json, fieldName="EchoTime",
+                                rounding = 3, multFactor=1000)
+
+        #Gradient distortion correction applied to the M0
+        if ctx.gdc != '':
+            #Calculate and apply the Gradient Distortion Unwarp
+            # TODO: Review the "half=True" in next version
+            gradient_unwarp_apply(WD=ASL_GDC, infile=CALIB, outfile=ASL_M0_ud,
+                                  owarp=ASL_M0_ud_warp,gradcoeff=ctx.gdc,
+                                  vendor='siemens', nojac=True, half=False)
+        else:
+            copyfile(src=CALIB, dst=ASL_M0_ud)
+
+
+        ##############
+        # Processing #
+        ##############
+        # Use asl_file to get into alternating tag-control
+        wrappers.asl_file(data=ASL_DATA_wrongorder, out=ASL_DATA, ntis=5,
+                          iaf="tcb")
+
+        # PWI generation - this is more of a sanity check than anything else
+        # now use ASL file to get difference images
+        wrappers.asl_file(data=ASL_DATA, out=ASL_DATA_diff,
+                          mean=ASL_DATA_diff_mean, ntis=5, iaf="tc", diff=True)
+
+
+        #######################
+        # PERFUSION ANALSYSIS #
+        #######################
+
+        raa_list = [BBASL_ROI_DIR + "MNI_seg_max_prob_masked_RandL.nii.gz",
+                    BBASL_ROI_DIR + "HO_L_Cerebral_WM_thr80.nii.gz",
+                    BBASL_ROI_DIR + "HO_R_Cerebral_WM_thr80.nii.gz",
+                    BBASL_ROI_DIR + "VascularTerritories_ero.nii.gz"]
+        raa_labels_list = [BBASL_ROI_DIR + "MNI_seg_max_prob_masked_RandL.txt",
+                           BBASL_ROI_DIR + "HO_L_Cerebral_WM_thr80.txt",
+                           BBASL_ROI_DIR + "HO_R_Cerebral_WM_thr80.txt",
+                           BBASL_ROI_DIR + "VascularTerritories_ero.txt"]
+
+        wrappers.oxford_asl(data=ASL_DATA,
+                            out=OXASL_ra_dir,
+                            c=CALIB,
+                            s=T1,
+                            regfrom_method="pwi",
+                            reg_init_bbr=True,
+                            sbrain=T1_brain,
+                            fastsrc=T1_fast_prefix,
+                            warp=T1_to_MNI_warp,
+                            fmap=fieldmap_fout_to_T1_brain_rad,
+                            fmapmag=T1,
+                            fmapmagbrain=T1_brain,
+                            gdcwarp=ASL_M0_ud_warp,
+                            iaf="tc",
+                            ibf="rpt",
+                            mc="on",
+                            tis=[2.2, 2.6, 3.0, 3.4, 3.8],
+                            casl=True,
+                            bolus=1.8,
+                            fixbolus=True,
+                            cgain=10,
+                            spatial=True,
+                            tr=5,
+                            te=TE,
+                            echospacing=0.0005,
+                            pedir="x",
+                            gm_thresh=0.7,
+                            cmethod="voxel",
+                            nofmapreg=True,
+                            region_analysis=True,
+                            region_analysis_atlas= raa_list,
+                            region_analysis_atlas_labels= raa_labels_list,
+                            region_analysis_save_rois=True,
+                            qc_output=True)
diff --git a/bip/pipelines/struct_asl/struct_asl.py b/bip/pipelines/struct_asl/struct_asl.py
new file mode 100755
index 0000000..2f172e0
--- /dev/null
+++ b/bip/pipelines/struct_asl/struct_asl.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+#
+# struct_asl.py - Pipeline with the ASL processing.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from bip.utils import redirect_logging
+from bip.pipelines.struct_asl import asl_proc
+from bip.pipelines.struct_asl import asl_get_IDPs
+
+log = logging.getLogger(__name__)
+
+def add_to_pipeline(ctx, pipe, tree, targets):
+
+    logs_dir=tree.get('logs_dir')
+
+    with redirect_logging('pipe_struct_asl', outdir=logs_dir):
+        pipe(asl_proc.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('region_analysis_gm_csv')
+        pipe(asl_get_IDPs.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('ASL_IDPs')
+
+    return pipe, targets
diff --git a/bip/pipelines/struct_swMRI/struct_swMRI.py b/bip/pipelines/struct_swMRI/struct_swMRI.py
new file mode 100755
index 0000000..6bb4c65
--- /dev/null
+++ b/bip/pipelines/struct_swMRI/struct_swMRI.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+#
+# struct_swMRI.py - Pipeline with the swMRI processing.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from bip.utils import redirect_logging
+from bip.pipelines.struct_swMRI import swMRI_proc
+
+log = logging.getLogger(__name__)
+
+def add_to_pipeline(ctx, pipe, tree, targets):
+
+    logs_dir=tree.get('logs_dir')
+
+    with redirect_logging('pipe_struct_swMRI', outdir=logs_dir):
+        pipe(swMRI_proc.run, submit=dict(jobtime=200), kwargs={'ctx' : ctx})
+        targets.append('SWI')
+
+    return pipe, targets
diff --git a/bip/pipelines/struct_swMRI/swMRI_gdc.py b/bip/pipelines/struct_swMRI/swMRI_gdc.py
new file mode 100755
index 0000000..d9c2880
--- /dev/null
+++ b/bip/pipelines/struct_swMRI/swMRI_gdc.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+#
+# swMRI_gdc.py - Sub-pipeline with Gradient Distortion Correction of the swMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import logging
+from shutil import copyfile
+from pipe_tree import In, Out, Ref
+from bip.utils import redirect_logging
+from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1_orig:                 In,
+        T1_orig_ud:              Out,
+        T1_orig_ud_warp:         Out,
+        logs_dir:                Ref,
+        T1_GDC:                  Ref):
+
+    with redirect_logging('T1_gdc', outdir=logs_dir):
+
+        if ctx.gdc != '':
+            #Calculate and apply the Gradient Distortion Unwarp
+            # TODO: Review the "half=True" in next version
+            gradient_unwarp_apply(WD=T1_GDC, infile=T1_orig, outfile=T1_orig_ud,
+                                  owarp=T1_orig_ud_warp,gradcoeff=ctx.gdc,
+                                  vendor='siemens', nojac=True, half=True)
+        else:
+            copyfile(src=T1_orig, dst=T1_orig_ud)
diff --git a/bip/pipelines/struct_swMRI/swMRI_proc.py b/bip/pipelines/struct_swMRI/swMRI_proc.py
new file mode 100755
index 0000000..86c5cd3
--- /dev/null
+++ b/bip/pipelines/struct_swMRI/swMRI_proc.py
@@ -0,0 +1,121 @@
+#!/usr/bin/env python
+#
+# swMRI_proc.py - Sub-pipeline with the main processing of swMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+# pylint: disable=W0613,R0912
+#
+
+import os
+import logging
+from shutil import copyfile
+from fsl import wrappers
+from pipe_tree import In, Out, Ref
+from bip.utils import redirect_logging
+from bip.pipelines.struct_swMRI.swMRI_proc_fnc import combine_magnitude_coils
+from bip.pipelines.struct_swMRI.swMRI_proc_fnc import gen_filtered_phase
+from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
+
+log = logging.getLogger(__name__)
+
+def run(ctx,
+        T1:                         In,
+        T1_brain_mask:              In,
+        SWI_MAG_TE1_orig:           In,
+        SWI_MAG_TE2_orig:           In,
+        SWI_num_coils:              In,
+        SWI_complex_phase:          In,
+        logs_dir:                   Ref,
+        SWI_MAG_TE1_C01:            Ref,
+        SOS:                        Ref,
+        MAG_TE1_dir:                Ref,
+        MAG_TE2_dir:                Ref,
+        PHA_TE2_dir:                Ref,
+        R2star:                     Out,
+        T2star:                     Out,
+        T2star_to_T1:               Out,
+        SOS_TE1:                    Out,
+        SOS_TE2:                    Out,
+        SOS_ratio:                  Out,
+        SWI:                        Out,
+        SWI_brain_mask:             Out,
+        SWI_GDC:                    Out,
+        SWI_MAG_TE1:                Out,
+        SWI_TOTAL_MAG_orig_ud_warp: Out,
+        SWI_to_T1:                  Out,
+        SWI_to_T1_mat:              Out,
+        T1_to_SWI_mat:              Out,
+        filtered_phase:             Out):
+
+    with redirect_logging('swMRI_proc', outdir=logs_dir):
+
+        with open(SWI_num_coils, 'r', encoding="utf-8") as f:
+            num_coils = int(f.read())
+        with open(SWI_complex_phase, 'r', encoding="utf-8") as f:
+            complex_phase = int(f.read())
+            if complex_phase == 0:
+                complex_phase = False
+            else:
+                complex_phase = True
+
+        MAG_TE1 = SWI_MAG_TE1_orig
+        if os.path.exists(SWI_MAG_TE2_orig):
+            MAG_TE2 = SWI_MAG_TE2_orig
+        else:
+            MAG_TE2 = ""
+
+        if num_coils > 0:
+            if os.path.exists(SWI_MAG_TE1_C01):
+                combine_magnitude_coils(MAG_TE1, MAG_TE2, MAG_TE1_dir,
+                                        MAG_TE2_dir, num_coils, SOS_TE1,
+                                        SOS_TE2, SOS_ratio, R2star, T2star)
+
+            # Generate filtered_phase and SWI
+            gen_filtered_phase(ctx, MAG_TE2_dir, PHA_TE2_dir, SWI_MAG_TE2_orig,
+                               filtered_phase, SWI)
+
+        if ctx.gdc != '':
+            #Calculate and apply the Gradient Distortion Unwarp
+            # TODO: Review the "half=True" in next version
+            gradient_unwarp_apply(WD=SWI_GDC, infile=SWI_MAG_TE1_orig,
+                                  outfile=SWI_MAG_TE1,
+                                  owarp=SWI_TOTAL_MAG_orig_ud_warp,
+                                  gradcoeff=ctx.gdc,
+                                  vendor='siemens', nojac=True, half=False)
+        else:
+            copyfile(src=SWI_MAG_TE1_orig, dst=SWI_MAG_TE1)
+
+        wrappers.flirt(src=SWI_MAG_TE1, ref=T1, omat=SWI_to_T1_mat, dof=6,
+                       out=SWI_to_T1, interp="trilinear")
+
+        wrappers.invxfm(inmat=SWI_to_T1_mat, omat=T1_to_SWI_mat)
+
+        #TODO: BINARISE BRAIN MASK?
+        wrappers.applyxfm(src=T1_brain_mask, ref=SWI_MAG_TE1,
+                          mat=T1_to_SWI_mat, out=SWI_brain_mask,
+                          interp="trilinear")
+
+        if ctx.gdc != '':
+            wrappers.applywarp(src=T2star, ref=T1, w=SWI_TOTAL_MAG_orig_ud_warp,
+                               out=T2star_to_T1, postmat=SWI_to_T1_mat,
+                               rel=True, interp='trilinear')
+        else:
+            wrappers.applyxfm(src=T2star, ref=T1, mat=SWI_to_T1_mat,
+                              out=T2star_to_T1, interp="trilinear")
+
+        wrappers.fslmaths(T2star_to_T1).mul(T1_brain_mask).run(T2star_to_T1)
+
+        #TODO: Change name of SWI to venogram?
+        for fil in [R2star, T2star, SOS_TE1, SOS_TE2, SOS_ratio, filtered_phase,
+                    SWI]:
+            if os.path.exists(fil):
+                if ctx.gdc != '':
+                    wrappers.applywarp(src=fil, ref=fil, out=fil, rel=True,
+                                       w=SWI_TOTAL_MAG_orig_ud_warp,
+                                       interp='trilinear')
+
+                wrappers.fslmaths(fil).mul(SWI_brain_mask).run(fil)
diff --git a/bip/pipelines/struct_swMRI/swMRI_proc_fnc.py b/bip/pipelines/struct_swMRI/swMRI_proc_fnc.py
new file mode 100755
index 0000000..141b89c
--- /dev/null
+++ b/bip/pipelines/struct_swMRI/swMRI_proc_fnc.py
@@ -0,0 +1,121 @@
+#!/usr/bin/env python
+#
+# swMRI_proc_fnc.py - Functions used by the main processing of swMRI.
+#
+# Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk>
+# Author: Paul McCarthy <pauldmccarthy@gmail.com>
+# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
+#
+# pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915
+#
+
+import glob
+import nibabel as nib
+from fsl import wrappers
+import numpy as np
+import numpy.fft as ft
+from bip.commands.bb_read_json_field import bb_read_json_field
+
+def combine_magnitude_coils(MAG_TE1, MAG_TE2, MAG_TE1_dir, MAG_TE2_dir,
+                            num_coils, SOS_TE1, SOS_TE2, SOS_ratio, R2star,
+                            T2star):
+
+    MAG_TE1_J = MAG_TE1.replace('.nii.gz', '.json')
+    MAG_TE2_J = MAG_TE2.replace('.nii.gz', '.json')
+
+    TE1 = bb_read_json_field(fileName=MAG_TE1_J,
+                             fieldName="EchoTime",
+                             rounding = 3, multFactor=1000)
+    TE2 = bb_read_json_field(fileName=MAG_TE2_J,
+                             fieldName="EchoTime",
+                             rounding = 3, multFactor=1000)
+
+    TE_DIFF = TE2 - TE1
+
+    if not num_coils == 0:
+
+        files_TE1 = glob.glob(MAG_TE1_dir + '/*.nii.gz')
+        wrappers.fslmaths(files_TE1[0]).mul(0).run(SOS_TE1)
+        for file_TE1 in files_TE1:
+            wrappers.fslmaths(file_TE1).sqr().add(SOS_TE1).run(SOS_TE1)
+        wrappers.fslmaths(SOS_TE1).sqrt().run(SOS_TE1)
+
+        files_TE2 = glob.glob(MAG_TE2_dir + '/*.nii.gz')
+        wrappers.fslmaths(files_TE2[0]).mul(0).run(SOS_TE2)
+        for file_TE2 in files_TE2:
+            wrappers.fslmaths(file_TE2).sqr().add(SOS_TE2).run(SOS_TE2)
+        wrappers.fslmaths(SOS_TE2).sqrt().run(SOS_TE2)
+
+        wrappers.fslmaths(SOS_TE1).div(SOS_TE2).run(SOS_ratio)
+
+    else:
+        wrappers.fslmaths(MAG_TE1).div(MAG_TE2).run(SOS_ratio)
+
+    wrappers.fslmaths(SOS_ratio).log().div(TE_DIFF).run(R2star)
+    wrappers.fslmaths(R2star).recip().uthr(80).thr(5).kernel("2D").fmedian().kernel("sphere", "3").dilM().run(T2star)
+
+
+def gen_filtered_phase(ctx, magImgDir, phaImgDir, magImgFileName, fp_fn,SWI_fn):
+
+    magImgFiles=glob.glob(magImgDir + '/*.nii.gz')
+    phaImgFiles=glob.glob(phaImgDir + '/*.nii.gz')
+    magImgFiles.sort()
+    phaImgFiles.sort()
+
+    chaDim = len(magImgFiles)
+
+    # read one data set for getting the header
+    magImg = nib.load(magImgFileName)
+    magImgNOBIAS = magImg
+    [xDim, yDim, zDim] = magImg.header['dim'][1:4]
+
+    # Loading Hanning filter of 96 dim  (actually, 97 dim because of symmetry)
+    w = np.loadtxt(ctx.get_data('swMRI/hann_filter.txt'), delimiter=",")
+    filterLP = np.zeros((xDim,yDim))
+    indX = slice(int(xDim/2+1-96/2)-1, int(xDim/2+1+96/2),1)
+    indY = slice(int(yDim/2+1-96/2)-1, int(yDim/2+1+96/2),1)
+    filterLP[indX, indY] = w
+
+    SOSImg = np.zeros((xDim,yDim,zDim))
+    complexAvg = np.zeros((xDim,yDim,zDim))
+
+    # Loop over channels
+    for chaInd in range(chaDim):
+        magImgFileName = magImgFiles[chaInd]
+        phaImgFileName = phaImgFiles[chaInd]
+
+        magImg_nib = nib.load(magImgFileName)
+        phaImg_nib = nib.load(phaImgFileName)
+
+        magImg = magImg_nib.get_fdata()
+        phaImg = phaImg_nib.get_fdata()
+
+        phaImg = -np.pi * (phaImg - 2048) / 2048
+
+        complexImg = magImg * np.exp(1j * phaImg)
+        phaseHP = np.zeros((xDim,yDim,zDim))
+
+        for zInd in range(zDim):
+            complexFFT = ft.fftshift(ft.fft2(ft.ifftshift(complexImg[:,:,zInd])))
+            complexFFT = complexFFT * filterLP
+            complexImgLP = ft.fftshift(ft.ifft2(ft.ifftshift(complexFFT)))
+            phaseHP[:,:,zInd] = np.angle(complexImg[:,:,zInd] * np.conj(complexImgLP))
+
+        complexAvg = complexAvg + magImg * np.exp(1j * phaseHP)
+        SOSImg = SOSImg + (magImg * magImg)
+
+    SOSImg = np.power(SOSImg, 0.5)
+    fp = np.angle(complexAvg)
+
+    maskSWI = np.zeros((xDim,yDim,zDim))
+    maskSWI[np.where(fp>0)] = 1
+    maskSWI[np.where(fp<=0)] = 1 + fp[np.where(fp<=0)] / np.pi
+    maskSWI = maskSWI * maskSWI * maskSWI * maskSWI
+
+    # Using prescan-normalised mag image instead of bias-fielded SOS
+    SWI = magImgNOBIAS.get_fdata() * maskSWI
+
+    fp_tmp  = nib.Nifti1Image(fp,  magImgNOBIAS.affine, magImgNOBIAS.header)
+    SWI_tmp = nib.Nifti1Image(SWI, magImgNOBIAS.affine, magImgNOBIAS.header)
+    nib.save(fp_tmp,  fp_fn)
+    nib.save(SWI_tmp, SWI_fn)
diff --git a/bip/utils.py b/bip/utils.py
new file mode 100755
index 0000000..adf57f1
--- /dev/null
+++ b/bip/utils.py
@@ -0,0 +1,116 @@
+import os
+import os.path as op
+import socket
+import shutil
+import inspect
+import logging
+import traceback
+import contextlib
+import functools as ft
+from fsl import wrappers
+
+
+def create_formatter():
+    """Create a logging.Formatter. """
+    return logging.Formatter('%(asctime)s '
+                             '%(filename)s '
+                             '%(lineno)4d: '
+                             '%(funcName)s - '
+                             '%(message)s',
+                             datefmt='%m/%d/%Y %H:%M:%S')
+
+
+def setup_logging(fname, level=logging.INFO):
+    """Set up BIP logging. Intended to be called once from main
+    at application startup.
+    """
+
+    log       = logging.getLogger('bip')
+    handler   = logging.FileHandler(fname)
+    formatter = create_formatter()
+
+    # Add handler/formatter references
+    # to the top level logger so the
+    # redirect_logging function can
+    # manipulate them.
+    log.formatter = formatter
+    log.handler   = handler
+
+    handler.setFormatter(formatter)
+    log.addHandler(handler)
+    log.setLevel(level)
+
+
+def log_bip(logobj, level, msg):
+    """Log a message, associating it with the nearest line in the
+    bip python codebase in the call stack.
+    """
+    frames = inspect.stack()[1:]
+    for i, frame in enumerate(frames):
+        if 'bip' in frame[1]:
+            break
+    logobj.log(level, msg.strip(), stacklevel=i + 2)
+
+
+@contextlib.contextmanager
+def redirect_logging(name, outdir='.', level=logging.INFO):
+    """Context manager which temporarily redirects logging. The following log
+    files are created:
+
+       - outdir/name.log: contains log messages, commands that are executed
+         through fsl.wrappers functions, and standard output/error of those
+         commands.
+    """
+
+    fname = op.join(outdir, name)
+
+    with open(f'{fname}.log', 'wt', buffering=1,
+              encoding="utf-8") as stdout:
+        log     = logging.getLogger('bip')
+        handler = logging.StreamHandler(stdout)
+        handler.setFormatter(create_formatter())
+        log.addHandler(handler)
+        log.setLevel(level)
+
+        # If running within a single process, we
+        # want to temporarily suppress log messages
+        # from the main log file (assumed to have
+        # been configured with setup_logging).
+        if getattr(log, 'handler', None):
+            log.removeHandler(log.handler)
+
+        # Log all fsl.wrappers calls via log_bip
+        logcmd = ft.partial(log_bip, log, level)
+
+        # Redirect fsl.wrappers stdout/stderr to
+        # the same
+        with wrappers.wrapperconfig(log={'tee'    : False,
+                                         'stdout' : stdout,
+                                         'stderr' : stdout,
+                                         'cmd'    : logcmd}):
+            try:
+                log.info(f'Started {name}')
+                log.info(f'Host {socket.gethostname()}')
+                yield
+            except Exception as e:
+                traceback.print_exception(type(e), e, e.__traceback__,
+                                          file=stdout)
+                raise e
+            finally:
+                log.info(f'Finished {name}')
+                log.removeHandler(handler)
+                # Restore main log handler
+                if getattr(log, 'handler', None):
+                    log.addHandler(log.handler)
+
+
+@contextlib.contextmanager
+def tempdir(dirName):
+    os.makedirs(dirName, exist_ok=True)
+    yield dirName
+    for fileName in os.listdir(dirName):
+        filePath = os.path.join(dirName, fileName)
+        try:
+            shutil.rmtree(filePath)
+        except OSError:
+            os.remove(filePath)
diff --git a/init_vars b/init_vars
new file mode 100755
index 0000000..28f0319
--- /dev/null
+++ b/init_vars
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+export BB_BIN_DIR="$SWdir/bip"
+export FSLDIR="$SWdir/fsl"
+
+source $FSLDIR/etc/fslconf/fsl.sh
+source $FSLDIR/bin/activate ukb
+
+export FSLOUTPUTTYPE="NIFTI_GZ"
+export FSLSUB_CONF="$SWdir/bip/fsl_sub.yml"
+
+unset PYTHONPATH
+unset LC_ALL
+unset LC_CTYPE
+
+alias runbip="$BB_BIN_DIR/bip/main.py"
+PS1="(ukb) \! "`whoami`@`hostname|cut -d. -f1`@$(basename $(tty))" | \t | \w $ " ; 
+export PS1
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..35dd721
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,12 @@
+oxasl
+oxasl-deblur
+pickle-mixin
+pickleshare
+niicat
+ipython
+jinja2
+seaborn
+jsonschema
+python-utils
+scikit-image
+scikit-learn
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..8bc548e
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,11 @@
+from setuptools import setup,find_packages
+with open('requirements.txt', 'rt') as f:
+    install_requires = [l.strip() for l in f.readlines()]
+
+setup(name='bip',
+	version='1.0.0',
+	description='Brain Imaging Pipeline',
+	author='Fidel Alfaro Almagro',
+	install_requires=install_requires,
+	packages=find_packages(),
+	include_package_data=True)
-- 
GitLab