Skip to content

Instantly share code, notes, and snippets.

View Lestropie's full-sized avatar

Robert Smith Lestropie

View GitHub Profile
@Lestropie
Lestropie / 5ttregrid.cpp
Created May 28, 2019 19:25
5ttregrid: Re-grids a five-tissue-type (5TT) image suitable for Anatomically-Constrained Tractography (ACT) using oversampling
#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 / mrcentre.cpp
Created May 24, 2018 00:17
MRtrix3 stand-alone command for calculating the centre of mass of an image
/* 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.
*
@Lestropie
Lestropie / dvsgen
Last active June 30, 2020 10:04
Script for generating multi-shell diffusion gradient tables for Siemens platforms (Note: executes against MRtrix3 >= 3.0.0 version)
#!/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 / maskconnectivity
Last active April 7, 2023 16:26
MRtrix3 stand-alone Python script for generating connectivity fingerprints within a ROI
#!/usr/bin/env python
# Works using MRtrix version 3.0.0 or later
# For linking against MRtrix3 Python API:
# https://mrtrix.readthedocs.io/en/3.0.0/tips_and_tricks/external_modules.html
# Typical pre-processing required before running this script:
# 1. FOD: Standard DWI pre-processing
# 2. 5TT: e.g. 5ttgen fsl