Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Smith Lestropie

View GitHub Profile
@Lestropie
Lestropie / dvsgen
Last active Jun 30, 2020
Script for generating multi-shell diffusion gradient tables for Siemens platforms (Note: executes against MRtrix3 >= 3.0.0 version)
View dvsgen
#!/usr/bin/env python
import math, os, sys
def usage(cmdline): #pylint: disable=unused-variable
cmdline.set_author('Robert E. Smith (robert.smith@florey.edu.au)')
cmdline.set_synopsis('Generate diffusion gradient tables in the DVS format for Siemens scanners')
cmdline.add_argument('sets', type=int, help='The number of sets into which to break the scheme')
cmdline.add_argument('bzeros', type=int, help='Total number of b=0 images')
@Lestropie
Lestropie / 5ttregrid.cpp
Created May 28, 2019
5ttregrid: Re-grids a five-tissue-type (5TT) image suitable for Anatomically-Constrained Tractography (ACT) using oversampling
View 5ttregrid.cpp
#include "command.h"
#include "image.h"
#include "dwi/directions/set.h"
#include "dwi/tractography/SIFT/model_base.h"
using namespace MR;
using namespace App;
@Lestropie
Lestropie / maskconnectivity
Created Nov 25, 2018
MRtrix3 stand-alone Python script for generating connectivity fingerprints within a ROI
View maskconnectivity
#!/usr/bin/env python
# NOTE: It is recommended to set the MRtrix config file entry TckgenEarlyExit to true
# before running this script: This should prevent the script from hanging on
# voxels where it is too difficult to generate streamlines.
# Typical pre-processing required before running this script:
# 1. FOD: Standard DWI pre-processing
# 2. 5TT: e.g. 5ttgen fsl
# 3. Parcellation:
@Lestropie
Lestropie / mrcentre.cpp
Created May 24, 2018
MRtrix3 stand-alone command for calculating the centre of mass of an image
View mrcentre.cpp
/* Copyright (c) 2008-2017 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at http://mozilla.org/MPL/2.0/.
*
* MRtrix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
You can’t perform that action at this time.