From f1612edd1bd8c207d59ec616d9ab1ff523e92b57 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 19 Feb 2024 12:33:13 +1100 Subject: [PATCH 1/5] Python API: Fix __print_full_usage__ for algorithm wrappers --- lib/mrtrix3/app.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index f6580cec5c..970969e588 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -1212,9 +1212,12 @@ def arg2str(arg): def allow_multiple(nargs): return '1' if nargs in ('*', '+') else '0' - for arg in self._positionals._group_actions: - sys.stdout.write(f'ARGUMENT {arg.dest} 0 {allow_multiple(arg.nargs)} {arg2str(arg)}\n') - sys.stdout.write(f'{arg.help}\n') + if self._subparsers: + sys.stdout.write(f'ARGUMENT algorithm CHOICE {" ".join(self._subparsers._group_actions[0].choices)}\n') + else: + for arg in self._positionals._group_actions: + sys.stdout.write(f'ARGUMENT {arg.dest} 0 {allow_multiple(arg.nargs)} {arg2str(arg)}\n') + sys.stdout.write(f'{arg.help}\n') def print_group_options(group): for option in group._group_actions: From 774fcd8950f198aca40eb81c585a2b9fb909438e Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 19 Feb 2024 12:35:33 +1100 Subject: [PATCH 2/5] Generate interfaces New script interfaces/generate_interfaces.sh executes the secret command-line option __print_full_usage__ for all commands, and saves them in interfaces/legacy/. Consistency of these contents with that generated by compiled commands is verified by CI. --- .github/workflows/checks.yml | 3 ++ interfaces/generate_interfaces.sh | 50 +++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 interfaces/generate_interfaces.sh diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e552cb11f1..0b5fa5112b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -214,3 +214,6 @@ jobs: - name: check building of documentation run: python3 -m sphinx -n -N -W -w sphinx.log docs/ tmp/ + + - name: check interface documentation + run: ./interfaces/generate_interfaces.sh && git diff --exit-code diff --git a/interfaces/generate_interfaces.sh b/interfaces/generate_interfaces.sh new file mode 100755 index 0000000000..2b894edd5a --- /dev/null +++ b/interfaces/generate_interfaces.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Copyright (c) 2008-2023 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/. +# +# Covered Software is provided under this License on an "as is" +# basis, without warranty of any kind, either expressed, implied, or +# statutory, including, without limitation, warranties that the +# Covered Software is free of defects, merchantable, fit for a +# particular purpose or non-infringing. +# See the Mozilla Public License v. 2.0 for more details. +# +# For more details, see http://www.mrtrix.org/. + + +mrtrix_root=$( cd "$(dirname "${BASH_SOURCE}")"/../ ; pwd -P ) +export PATH=$mrtrix_root/bin:"$PATH" +export LC_ALL=C + +cmdlist="" +for n in `find "${mrtrix_root}"/cmd/ -name "*.cpp"`; do + cmdlist=$cmdlist$'\n'`basename $n` +done +for n in `find "${mrtrix_root}"/bin/ -type f -print0 | xargs -0 grep -l "import mrtrix3"`; do + cmdlist=$cmdlist$'\n'`basename $n` +done + +legacy_root="${mrtrix_root}/interfaces/legacy" +rm -rf "${legacy_root}" +mkdir "${legacy_root}" +for n in `echo "$cmdlist" | sort`; do + cmdname=${n%".cpp"} + cmdpath=$cmdname + case $n in *.cpp) + if [ "$OSTYPE" == "cygwin" ] || [ "$OSTYPE" == "msys" ] || [ "$OSTYPE" == "win32" ]; then + cmdpath=${cmdpath}'.exe' + fi + esac + $cmdpath __print_full_usage__ > $legacy_root/$cmdname.txt + if `grep -q "algorithm\.get_module" "${mrtrix_root}/bin/${cmdpath}"`; then + mkdir $legacy_root/$cmdname + algorithms=`grep "ARGUMENT algorithm CHOICE" $legacy_root/$cmdname.txt | cut -d" " -f 4-` + for a in $algorithms; do + $cmdpath $a __print_full_usage__ > $legacy_root/$cmdname/$a.txt + done + fi +done From 53549bdd5587e769b8f46931898d49fe67b55aad Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 19 Feb 2024 12:40:27 +1100 Subject: [PATCH 3/5] generate_interfaces.sh: Remove legacy .txt file extension Files ending with .txt are ignored by git due to the contents of .gitignore. To get around this, interface text files are written with no file extension. This however would have resulted in a collision between the interface files generated for Python script algorithm interfaces, and the sub-directories for the algorithms contained within. To get around thhis, files for the former are written into their own sub-directories. --- interfaces/generate_interfaces.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/interfaces/generate_interfaces.sh b/interfaces/generate_interfaces.sh index 2b894edd5a..0de0858bb4 100755 --- a/interfaces/generate_interfaces.sh +++ b/interfaces/generate_interfaces.sh @@ -39,12 +39,14 @@ for n in `echo "$cmdlist" | sort`; do cmdpath=${cmdpath}'.exe' fi esac - $cmdpath __print_full_usage__ > $legacy_root/$cmdname.txt if `grep -q "algorithm\.get_module" "${mrtrix_root}/bin/${cmdpath}"`; then mkdir $legacy_root/$cmdname - algorithms=`grep "ARGUMENT algorithm CHOICE" $legacy_root/$cmdname.txt | cut -d" " -f 4-` + $cmdpath __print_full_usage__ > $legacy_root/$cmdname/$cmdname + algorithms=`grep "ARGUMENT algorithm CHOICE" $legacy_root/$cmdname/$cmdname | cut -d" " -f 4-` for a in $algorithms; do - $cmdpath $a __print_full_usage__ > $legacy_root/$cmdname/$a.txt + $cmdpath $a __print_full_usage__ > $legacy_root/$cmdname/$a done + else + $cmdpath __print_full_usage__ > $legacy_root/$cmdname fi done From 10d2ab017a53e0816afbbb9155681d8ca83b6f83 Mon Sep 17 00:00:00 2001 From: MRtrixBot Date: Mon, 19 Feb 2024 12:41:11 +1100 Subject: [PATCH 4/5] Initial save of legacy command interfaces --- interfaces/legacy/5tt2gmwmi | 28 +++ interfaces/legacy/5tt2vis | 42 ++++ interfaces/legacy/5ttcheck | 25 +++ interfaces/legacy/5ttedit | 42 ++++ interfaces/legacy/5ttgen/5ttgen | 36 +++ interfaces/legacy/5ttgen/freesurfer | 40 ++++ interfaces/legacy/5ttgen/fsl | 45 ++++ interfaces/legacy/5ttgen/gif | 37 ++++ interfaces/legacy/5ttgen/hsvs | 48 ++++ interfaces/legacy/afdconnectivity | 38 ++++ interfaces/legacy/amp2response | 44 ++++ interfaces/legacy/amp2sh | 53 +++++ interfaces/legacy/connectome2tck | 54 +++++ interfaces/legacy/connectomeedit | 26 +++ interfaces/legacy/connectomestats | 89 ++++++++ interfaces/legacy/dcmedit | 37 ++++ interfaces/legacy/dcminfo | 32 +++ interfaces/legacy/dirflip | 30 +++ interfaces/legacy/dirgen | 38 ++++ interfaces/legacy/dirmerge | 29 +++ interfaces/legacy/dirorder | 27 +++ interfaces/legacy/dirsplit | 29 +++ interfaces/legacy/dirstat | 53 +++++ interfaces/legacy/dwi2adc | 31 +++ interfaces/legacy/dwi2fod | 77 +++++++ interfaces/legacy/dwi2mask/3dautomask | 68 ++++++ interfaces/legacy/dwi2mask/ants | 44 ++++ interfaces/legacy/dwi2mask/b02template | 58 +++++ interfaces/legacy/dwi2mask/consensus | 53 +++++ interfaces/legacy/dwi2mask/dwi2mask | 40 ++++ interfaces/legacy/dwi2mask/fslbet | 54 +++++ interfaces/legacy/dwi2mask/hdbet | 42 ++++ interfaces/legacy/dwi2mask/legacy | 43 ++++ interfaces/legacy/dwi2mask/mean | 46 ++++ interfaces/legacy/dwi2mask/mtnorm | 55 +++++ interfaces/legacy/dwi2mask/synthstrip | 54 +++++ interfaces/legacy/dwi2mask/trace | 51 +++++ interfaces/legacy/dwi2response/dhollander | 75 +++++++ interfaces/legacy/dwi2response/dwi2response | 54 +++++ interfaces/legacy/dwi2response/fa | 61 +++++ interfaces/legacy/dwi2response/manual | 57 +++++ interfaces/legacy/dwi2response/msmt_5tt | 73 ++++++ interfaces/legacy/dwi2response/tax | 61 +++++ interfaces/legacy/dwi2response/tournier | 64 ++++++ interfaces/legacy/dwi2tensor | 67 ++++++ interfaces/legacy/dwibiascorrect/ants | 55 +++++ .../legacy/dwibiascorrect/dwibiascorrect | 45 ++++ interfaces/legacy/dwibiascorrect/fsl | 47 ++++ interfaces/legacy/dwibiascorrect/mtnorm | 52 +++++ interfaces/legacy/dwibiasnormmask | 75 +++++++ interfaces/legacy/dwicat | 37 ++++ interfaces/legacy/dwidenoise | 47 ++++ interfaces/legacy/dwiextract | 62 ++++++ interfaces/legacy/dwifslpreproc | 101 +++++++++ interfaces/legacy/dwigradcheck | 54 +++++ interfaces/legacy/dwinormalise/dwinormalise | 31 +++ interfaces/legacy/dwinormalise/group | 44 ++++ interfaces/legacy/dwinormalise/manual | 48 ++++ interfaces/legacy/dwinormalise/mtnorm | 55 +++++ interfaces/legacy/dwishellmath | 44 ++++ interfaces/legacy/fixel2peaks | 32 +++ interfaces/legacy/fixel2sh | 32 +++ interfaces/legacy/fixel2tsf | 32 +++ interfaces/legacy/fixel2voxel | 44 ++++ interfaces/legacy/fixelcfestats | 95 ++++++++ interfaces/legacy/fixelconnectivity | 47 ++++ interfaces/legacy/fixelconvert | 45 ++++ interfaces/legacy/fixelcorrespondence | 34 +++ interfaces/legacy/fixelcrop | 29 +++ interfaces/legacy/fixelfilter | 47 ++++ interfaces/legacy/fixelreorient | 29 +++ interfaces/legacy/fod2dec | 47 ++++ interfaces/legacy/fod2fixel | 56 +++++ interfaces/legacy/for_each | 54 +++++ interfaces/legacy/label2colour | 28 +++ interfaces/legacy/label2mesh | 26 +++ interfaces/legacy/labelconvert | 35 +++ interfaces/legacy/labelsgmfix | 41 ++++ interfaces/legacy/labelstats | 27 +++ interfaces/legacy/mask2glass | 44 ++++ interfaces/legacy/maskdump | 25 +++ interfaces/legacy/maskfilter | 54 +++++ interfaces/legacy/mesh2voxel | 26 +++ interfaces/legacy/meshconvert | 30 +++ interfaces/legacy/meshfilter | 34 +++ interfaces/legacy/mraverageheader | 35 +++ interfaces/legacy/mrcalc | 134 +++++++++++ interfaces/legacy/mrcat | 33 +++ interfaces/legacy/mrcentroid | 27 +++ interfaces/legacy/mrcheckerboardmask | 31 +++ interfaces/legacy/mrclusterstats | 86 +++++++ interfaces/legacy/mrcolour | 37 ++++ interfaces/legacy/mrconvert | 109 +++++++++ interfaces/legacy/mrdegibbs | 45 ++++ interfaces/legacy/mrdump | 28 +++ interfaces/legacy/mredit | 41 ++++ interfaces/legacy/mrfilter | 80 +++++++ interfaces/legacy/mrgrid | 78 +++++++ interfaces/legacy/mrhistmatch | 37 ++++ interfaces/legacy/mrhistogram | 37 ++++ interfaces/legacy/mrinfo | 94 ++++++++ interfaces/legacy/mrmath | 39 ++++ interfaces/legacy/mrmetric | 44 ++++ interfaces/legacy/mrregister | 209 ++++++++++++++++++ interfaces/legacy/mrstats | 32 +++ interfaces/legacy/mrthreshold | 59 +++++ interfaces/legacy/mrtransform | 100 +++++++++ interfaces/legacy/mrtrix_cleanup | 39 ++++ interfaces/legacy/mrview | 200 +++++++++++++++++ interfaces/legacy/mtnormalise | 48 ++++ interfaces/legacy/peaks2amp | 24 ++ interfaces/legacy/peaks2fixel | 29 +++ interfaces/legacy/population_template | 131 +++++++++++ interfaces/legacy/responsemean | 40 ++++ interfaces/legacy/sh2amp | 51 +++++ interfaces/legacy/sh2peaks | 48 ++++ interfaces/legacy/sh2power | 29 +++ interfaces/legacy/sh2response | 36 +++ interfaces/legacy/shbasis | 30 +++ interfaces/legacy/shconv | 37 ++++ interfaces/legacy/shview | 24 ++ interfaces/legacy/tck2connectome | 69 ++++++ interfaces/legacy/tck2fixel | 33 +++ interfaces/legacy/tckconvert | 53 +++++ interfaces/legacy/tckdfc | 52 +++++ interfaces/legacy/tckedit | 69 ++++++ interfaces/legacy/tckgen | 140 ++++++++++++ interfaces/legacy/tckglobal | 96 ++++++++ interfaces/legacy/tckinfo | 24 ++ interfaces/legacy/tckmap | 89 ++++++++ interfaces/legacy/tckresample | 51 +++++ interfaces/legacy/tcksample | 36 +++ interfaces/legacy/tcksift | 70 ++++++ interfaces/legacy/tcksift2 | 90 ++++++++ interfaces/legacy/tckstats | 36 +++ interfaces/legacy/tcktransform | 26 +++ interfaces/legacy/tensor2metric | 76 +++++++ interfaces/legacy/transformcalc | 34 +++ interfaces/legacy/transformcompose | 30 +++ interfaces/legacy/transformconvert | 30 +++ interfaces/legacy/tsfdivide | 26 +++ interfaces/legacy/tsfinfo | 27 +++ interfaces/legacy/tsfmult | 26 +++ interfaces/legacy/tsfsmooth | 27 +++ interfaces/legacy/tsfthreshold | 28 +++ interfaces/legacy/tsfvalidate | 24 ++ interfaces/legacy/vectorstats | 60 +++++ interfaces/legacy/voxel2fixel | 31 +++ interfaces/legacy/voxel2mesh | 31 +++ interfaces/legacy/warp2metric | 35 +++ interfaces/legacy/warpconvert | 35 +++ interfaces/legacy/warpcorrect | 31 +++ interfaces/legacy/warpinit | 28 +++ interfaces/legacy/warpinvert | 30 +++ 154 files changed, 7664 insertions(+) create mode 100644 interfaces/legacy/5tt2gmwmi create mode 100644 interfaces/legacy/5tt2vis create mode 100644 interfaces/legacy/5ttcheck create mode 100644 interfaces/legacy/5ttedit create mode 100644 interfaces/legacy/5ttgen/5ttgen create mode 100644 interfaces/legacy/5ttgen/freesurfer create mode 100644 interfaces/legacy/5ttgen/fsl create mode 100644 interfaces/legacy/5ttgen/gif create mode 100644 interfaces/legacy/5ttgen/hsvs create mode 100644 interfaces/legacy/afdconnectivity create mode 100644 interfaces/legacy/amp2response create mode 100644 interfaces/legacy/amp2sh create mode 100644 interfaces/legacy/connectome2tck create mode 100644 interfaces/legacy/connectomeedit create mode 100644 interfaces/legacy/connectomestats create mode 100644 interfaces/legacy/dcmedit create mode 100644 interfaces/legacy/dcminfo create mode 100644 interfaces/legacy/dirflip create mode 100644 interfaces/legacy/dirgen create mode 100644 interfaces/legacy/dirmerge create mode 100644 interfaces/legacy/dirorder create mode 100644 interfaces/legacy/dirsplit create mode 100644 interfaces/legacy/dirstat create mode 100644 interfaces/legacy/dwi2adc create mode 100644 interfaces/legacy/dwi2fod create mode 100644 interfaces/legacy/dwi2mask/3dautomask create mode 100644 interfaces/legacy/dwi2mask/ants create mode 100644 interfaces/legacy/dwi2mask/b02template create mode 100644 interfaces/legacy/dwi2mask/consensus create mode 100644 interfaces/legacy/dwi2mask/dwi2mask create mode 100644 interfaces/legacy/dwi2mask/fslbet create mode 100644 interfaces/legacy/dwi2mask/hdbet create mode 100644 interfaces/legacy/dwi2mask/legacy create mode 100644 interfaces/legacy/dwi2mask/mean create mode 100644 interfaces/legacy/dwi2mask/mtnorm create mode 100644 interfaces/legacy/dwi2mask/synthstrip create mode 100644 interfaces/legacy/dwi2mask/trace create mode 100644 interfaces/legacy/dwi2response/dhollander create mode 100644 interfaces/legacy/dwi2response/dwi2response create mode 100644 interfaces/legacy/dwi2response/fa create mode 100644 interfaces/legacy/dwi2response/manual create mode 100644 interfaces/legacy/dwi2response/msmt_5tt create mode 100644 interfaces/legacy/dwi2response/tax create mode 100644 interfaces/legacy/dwi2response/tournier create mode 100644 interfaces/legacy/dwi2tensor create mode 100644 interfaces/legacy/dwibiascorrect/ants create mode 100644 interfaces/legacy/dwibiascorrect/dwibiascorrect create mode 100644 interfaces/legacy/dwibiascorrect/fsl create mode 100644 interfaces/legacy/dwibiascorrect/mtnorm create mode 100644 interfaces/legacy/dwibiasnormmask create mode 100644 interfaces/legacy/dwicat create mode 100644 interfaces/legacy/dwidenoise create mode 100644 interfaces/legacy/dwiextract create mode 100644 interfaces/legacy/dwifslpreproc create mode 100644 interfaces/legacy/dwigradcheck create mode 100644 interfaces/legacy/dwinormalise/dwinormalise create mode 100644 interfaces/legacy/dwinormalise/group create mode 100644 interfaces/legacy/dwinormalise/manual create mode 100644 interfaces/legacy/dwinormalise/mtnorm create mode 100644 interfaces/legacy/dwishellmath create mode 100644 interfaces/legacy/fixel2peaks create mode 100644 interfaces/legacy/fixel2sh create mode 100644 interfaces/legacy/fixel2tsf create mode 100644 interfaces/legacy/fixel2voxel create mode 100644 interfaces/legacy/fixelcfestats create mode 100644 interfaces/legacy/fixelconnectivity create mode 100644 interfaces/legacy/fixelconvert create mode 100644 interfaces/legacy/fixelcorrespondence create mode 100644 interfaces/legacy/fixelcrop create mode 100644 interfaces/legacy/fixelfilter create mode 100644 interfaces/legacy/fixelreorient create mode 100644 interfaces/legacy/fod2dec create mode 100644 interfaces/legacy/fod2fixel create mode 100644 interfaces/legacy/for_each create mode 100644 interfaces/legacy/label2colour create mode 100644 interfaces/legacy/label2mesh create mode 100644 interfaces/legacy/labelconvert create mode 100644 interfaces/legacy/labelsgmfix create mode 100644 interfaces/legacy/labelstats create mode 100644 interfaces/legacy/mask2glass create mode 100644 interfaces/legacy/maskdump create mode 100644 interfaces/legacy/maskfilter create mode 100644 interfaces/legacy/mesh2voxel create mode 100644 interfaces/legacy/meshconvert create mode 100644 interfaces/legacy/meshfilter create mode 100644 interfaces/legacy/mraverageheader create mode 100644 interfaces/legacy/mrcalc create mode 100644 interfaces/legacy/mrcat create mode 100644 interfaces/legacy/mrcentroid create mode 100644 interfaces/legacy/mrcheckerboardmask create mode 100644 interfaces/legacy/mrclusterstats create mode 100644 interfaces/legacy/mrcolour create mode 100644 interfaces/legacy/mrconvert create mode 100644 interfaces/legacy/mrdegibbs create mode 100644 interfaces/legacy/mrdump create mode 100644 interfaces/legacy/mredit create mode 100644 interfaces/legacy/mrfilter create mode 100644 interfaces/legacy/mrgrid create mode 100644 interfaces/legacy/mrhistmatch create mode 100644 interfaces/legacy/mrhistogram create mode 100644 interfaces/legacy/mrinfo create mode 100644 interfaces/legacy/mrmath create mode 100644 interfaces/legacy/mrmetric create mode 100644 interfaces/legacy/mrregister create mode 100644 interfaces/legacy/mrstats create mode 100644 interfaces/legacy/mrthreshold create mode 100644 interfaces/legacy/mrtransform create mode 100644 interfaces/legacy/mrtrix_cleanup create mode 100644 interfaces/legacy/mrview create mode 100644 interfaces/legacy/mtnormalise create mode 100644 interfaces/legacy/peaks2amp create mode 100644 interfaces/legacy/peaks2fixel create mode 100644 interfaces/legacy/population_template create mode 100644 interfaces/legacy/responsemean create mode 100644 interfaces/legacy/sh2amp create mode 100644 interfaces/legacy/sh2peaks create mode 100644 interfaces/legacy/sh2power create mode 100644 interfaces/legacy/sh2response create mode 100644 interfaces/legacy/shbasis create mode 100644 interfaces/legacy/shconv create mode 100644 interfaces/legacy/shview create mode 100644 interfaces/legacy/tck2connectome create mode 100644 interfaces/legacy/tck2fixel create mode 100644 interfaces/legacy/tckconvert create mode 100644 interfaces/legacy/tckdfc create mode 100644 interfaces/legacy/tckedit create mode 100644 interfaces/legacy/tckgen create mode 100644 interfaces/legacy/tckglobal create mode 100644 interfaces/legacy/tckinfo create mode 100644 interfaces/legacy/tckmap create mode 100644 interfaces/legacy/tckresample create mode 100644 interfaces/legacy/tcksample create mode 100644 interfaces/legacy/tcksift create mode 100644 interfaces/legacy/tcksift2 create mode 100644 interfaces/legacy/tckstats create mode 100644 interfaces/legacy/tcktransform create mode 100644 interfaces/legacy/tensor2metric create mode 100644 interfaces/legacy/transformcalc create mode 100644 interfaces/legacy/transformcompose create mode 100644 interfaces/legacy/transformconvert create mode 100644 interfaces/legacy/tsfdivide create mode 100644 interfaces/legacy/tsfinfo create mode 100644 interfaces/legacy/tsfmult create mode 100644 interfaces/legacy/tsfsmooth create mode 100644 interfaces/legacy/tsfthreshold create mode 100644 interfaces/legacy/tsfvalidate create mode 100644 interfaces/legacy/vectorstats create mode 100644 interfaces/legacy/voxel2fixel create mode 100644 interfaces/legacy/voxel2mesh create mode 100644 interfaces/legacy/warp2metric create mode 100644 interfaces/legacy/warpconvert create mode 100644 interfaces/legacy/warpcorrect create mode 100644 interfaces/legacy/warpinit create mode 100644 interfaces/legacy/warpinvert diff --git a/interfaces/legacy/5tt2gmwmi b/interfaces/legacy/5tt2gmwmi new file mode 100644 index 0000000000..59d33274a1 --- /dev/null +++ b/interfaces/legacy/5tt2gmwmi @@ -0,0 +1,28 @@ +Generate a mask image appropriate for seeding streamlines on the grey matter-white matter interface +ARGUMENT 5tt_in 0 0 IMAGEIN +the input 5TT segmented anatomical image +ARGUMENT mask_out 0 0 IMAGEOUT +the output mask image +OPTION mask_in 1 0 +Filter an input mask image according to those voxels that lie upon the grey matter - white matter boundary. If no input mask is provided, the output will be a whole-brain mask image calculated using the anatomical image only. +ARGUMENT image 0 0 IMAGEIN +the input mask image +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/5tt2vis b/interfaces/legacy/5tt2vis new file mode 100644 index 0000000000..2893d68d9b --- /dev/null +++ b/interfaces/legacy/5tt2vis @@ -0,0 +1,42 @@ +Generate an image for visualisation purposes from an ACT 5TT segmented anatomical image +ARGUMENT input 0 0 IMAGEIN +the input 4D tissue-segmented image +ARGUMENT output 0 0 IMAGEOUT +the output 3D image for visualisation +OPTION bg 1 0 +image intensity of background (default: 0) +ARGUMENT value 0 0 FLOAT 0 1 +OPTION cgm 1 0 +image intensity of cortical grey matter (default: 0.5) +ARGUMENT value 0 0 FLOAT 0 1 +OPTION sgm 1 0 +image intensity of sub-cortical grey matter (default: 0.75) +ARGUMENT value 0 0 FLOAT 0 1 +OPTION wm 1 0 +image intensity of white matter (default: 1) +ARGUMENT value 0 0 FLOAT 0 1 +OPTION csf 1 0 +image intensity of CSF (default: 0.15) +ARGUMENT value 0 0 FLOAT 0 1 +OPTION path 1 0 +image intensity of pathological tissue (default: 2) +ARGUMENT value 0 0 FLOAT 0 10 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/5ttcheck b/interfaces/legacy/5ttcheck new file mode 100644 index 0000000000..746c7e74e0 --- /dev/null +++ b/interfaces/legacy/5ttcheck @@ -0,0 +1,25 @@ +Thoroughly check that one or more images conform to the expected ACT five-tissue-type (5TT) format +ARGUMENT input 0 1 IMAGEIN +the 5TT image(s) to be tested +OPTION voxels 1 0 +output mask images highlighting voxels where the input does not conform to 5TT requirements +ARGUMENT prefix 0 0 TEXT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/5ttedit b/interfaces/legacy/5ttedit new file mode 100644 index 0000000000..8a7d5250f0 --- /dev/null +++ b/interfaces/legacy/5ttedit @@ -0,0 +1,42 @@ +Manually set the partial volume fractions in an ACT five-tissue-type (5TT) image using mask images +ARGUMENT input 0 0 IMAGEIN +the 5TT image to be modified +ARGUMENT output 0 0 IMAGEOUT +the output modified 5TT image +OPTION cgm 1 0 +provide a mask of voxels that should be set to cortical grey matter +ARGUMENT image 0 0 IMAGEIN +OPTION sgm 1 0 +provide a mask of voxels that should be set to sub-cortical grey matter +ARGUMENT image 0 0 IMAGEIN +OPTION wm 1 0 +provide a mask of voxels that should be set to white matter +ARGUMENT image 0 0 IMAGEIN +OPTION csf 1 0 +provide a mask of voxels that should be set to CSF +ARGUMENT image 0 0 IMAGEIN +OPTION path 1 0 +provide a mask of voxels that should be set to pathological tissue +ARGUMENT image 0 0 IMAGEIN +OPTION none 1 0 +provide a mask of voxels that should be cleared (i.e. are non-brain); note that this will supersede all other provided masks +ARGUMENT image 0 0 IMAGEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/5ttgen/5ttgen b/interfaces/legacy/5ttgen/5ttgen new file mode 100644 index 0000000000..b47e383ff6 --- /dev/null +++ b/interfaces/legacy/5ttgen/5ttgen @@ -0,0 +1,36 @@ +Generate a 5TT image suitable for ACT +5ttgen acts as a "master" script for generating a five-tissue-type (5TT) segmented tissue image suitable for use in Anatomically-Constrained Tractography (ACT). A range of different algorithms are available for completing this task. When using this script, the name of the algorithm to be used must appear as the first argument on the command-line after "5ttgen". The subsequent compulsory arguments and options available depend on the particular algorithm being invoked. +Each algorithm available also has its own help page, including necessary references; e.g. to see the help page of the "fsl" algorithm, type "5ttgen fsl". +ARGUMENT algorithm CHOICE freesurfer fsl gif hsvs +OPTION -nocrop 1 0 +Do NOT crop the resulting 5TT image to reduce its size (keep the same dimensions as the input image) +OPTION -sgm_amyg_hipp 1 0 +Represent the amygdalae and hippocampi as sub-cortical grey matter in the 5TT image +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/5ttgen/freesurfer b/interfaces/legacy/5ttgen/freesurfer new file mode 100644 index 0000000000..dc5d2e386b --- /dev/null +++ b/interfaces/legacy/5ttgen/freesurfer @@ -0,0 +1,40 @@ +Generate the 5TT image based on a FreeSurfer parcellation image +ARGUMENT input 0 0 IMAGEIN +The input FreeSurfer parcellation image (any image containing "aseg" in its name) +ARGUMENT output 0 0 IMAGEOUT +The output 5TT image +OPTION -lut 1 0 +Manually provide path to the lookup table on which the input parcellation image is based (e.g. FreeSurferColorLUT.txt) +ARGUMENT file 0 0 FILEIN +OPTION -nocrop 1 0 +Do NOT crop the resulting 5TT image to reduce its size (keep the same dimensions as the input image) +OPTION -sgm_amyg_hipp 1 0 +Represent the amygdalae and hippocampi as sub-cortical grey matter in the 5TT image +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/5ttgen/fsl b/interfaces/legacy/5ttgen/fsl new file mode 100644 index 0000000000..ac6fc7e2c7 --- /dev/null +++ b/interfaces/legacy/5ttgen/fsl @@ -0,0 +1,45 @@ +Use FSL commands to generate the 5TT image based on a T1-weighted image +ARGUMENT input 0 0 IMAGEIN +The input T1-weighted image +ARGUMENT output 0 0 IMAGEOUT +The output 5TT image +OPTION -t2 1 0 +Provide a T2-weighted image in addition to the default T1-weighted image; this will be used as a second input to FSL FAST +ARGUMENT image 0 0 IMAGEIN +OPTION -mask 1 0 +Manually provide a brain mask, rather than deriving one in the script +ARGUMENT image 0 0 IMAGEIN +OPTION -premasked 1 0 +Indicate that brain masking has already been applied to the input image +OPTION -nocrop 1 0 +Do NOT crop the resulting 5TT image to reduce its size (keep the same dimensions as the input image) +OPTION -sgm_amyg_hipp 1 0 +Represent the amygdalae and hippocampi as sub-cortical grey matter in the 5TT image +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/5ttgen/gif b/interfaces/legacy/5ttgen/gif new file mode 100644 index 0000000000..4a76460fc3 --- /dev/null +++ b/interfaces/legacy/5ttgen/gif @@ -0,0 +1,37 @@ +Generate the 5TT image based on a Geodesic Information Flow (GIF) segmentation image +ARGUMENT input 0 0 IMAGEIN +The input Geodesic Information Flow (GIF) segmentation image +ARGUMENT output 0 0 IMAGEOUT +The output 5TT image +OPTION -nocrop 1 0 +Do NOT crop the resulting 5TT image to reduce its size (keep the same dimensions as the input image) +OPTION -sgm_amyg_hipp 1 0 +Represent the amygdalae and hippocampi as sub-cortical grey matter in the 5TT image +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/5ttgen/hsvs b/interfaces/legacy/5ttgen/hsvs new file mode 100644 index 0000000000..ddd7851e08 --- /dev/null +++ b/interfaces/legacy/5ttgen/hsvs @@ -0,0 +1,48 @@ +Generate a 5TT image based on Hybrid Surface and Volume Segmentation (HSVS), using FreeSurfer and FSL tools +ARGUMENT input 0 0 DIRIN +The input FreeSurfer subject directory +ARGUMENT output 0 0 IMAGEOUT +The output 5TT image +OPTION -template 1 0 +Provide an image that will form the template for the generated 5TT image +ARGUMENT image 0 0 IMAGEIN +OPTION -hippocampi 1 0 +Select method to be used for hippocampi (& amygdalae) segmentation; options are: subfields,first,aseg +ARGUMENT hippocampi 0 0 CHOICE subfields first aseg +OPTION -thalami 1 0 +Select method to be used for thalamic segmentation; options are: nuclei,first,aseg +ARGUMENT thalami 0 0 CHOICE nuclei first aseg +OPTION -white_stem 1 0 +Classify the brainstem as white matter +OPTION -nocrop 1 0 +Do NOT crop the resulting 5TT image to reduce its size (keep the same dimensions as the input image) +OPTION -sgm_amyg_hipp 1 0 +Represent the amygdalae and hippocampi as sub-cortical grey matter in the 5TT image +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/afdconnectivity b/interfaces/legacy/afdconnectivity new file mode 100644 index 0000000000..c881d44fd4 --- /dev/null +++ b/interfaces/legacy/afdconnectivity @@ -0,0 +1,38 @@ +Obtain an estimate of fibre connectivity between two regions using AFD and streamlines tractography +This estimate is obtained by determining a fibre volume (AFD) occupied by the pathway of interest, and dividing by the streamline length. +If only the streamlines belonging to the pathway of interest are provided, then ALL of the fibre volume within each fixel selected will contribute to the result. If the -wbft option is used to provide whole-brain fibre-tracking (of which the pathway of interest should contain a subset), only the fraction of the fibre volume in each fixel estimated to belong to the pathway of interest will contribute to the result. +Use -quiet to suppress progress messages and output fibre connectivity value only. +For valid comparisons of AFD connectivity across scans, images MUST be intensity normalised and bias field corrected, and a common response function for all subjects must be used. +Note that the sum of the AFD is normalised by streamline length to account for subject differences in fibre bundle length. This normalisation results in a measure that is more related to the cross-sectional volume of the tract (and therefore 'connectivity'). Note that SIFT-ed tract count is a superior measure because it is unaffected by tangential yet unrelated fibres. However, AFD connectivity may be used as a substitute when Anatomically Constrained Tractography is not possible due to uncorrectable EPI distortions, and SIFT may therefore not be as effective. +Longer discussion regarding this command can additionally be found at: https://mrtrix.readthedocs.io/en/3.0.4/concepts/afd_connectivity.html (as well as in the relevant reference). +ARGUMENT image 0 0 IMAGEIN +the input FOD image. +ARGUMENT tracks 0 0 TRACKSIN +the input track file defining the bundle of interest. +OPTION wbft 1 0 +provide a whole-brain fibre-tracking data set (of which the input track file should be a subset), to improve the estimate of fibre bundle volume in the presence of partial volume +ARGUMENT tracks 0 0 TRACKSIN +OPTION afd_map 1 0 +output a 3D image containing the AFD estimated for each voxel. +ARGUMENT image 0 0 IMAGEOUT +OPTION all_fixels 1 0 +if whole-brain fibre-tracking is NOT provided, then if multiple fixels within a voxel are traversed by the pathway of interest, by default the fixel with the greatest streamlines density is selected to contribute to the AFD in that voxel. If this option is provided, then ALL fixels with non-zero streamlines density will contribute to the result, even if multiple fixels per voxel are selected. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/amp2response b/interfaces/legacy/amp2response new file mode 100644 index 0000000000..823ce273a7 --- /dev/null +++ b/interfaces/legacy/amp2response @@ -0,0 +1,44 @@ +Estimate response function coefficients based on the DWI signal in single-fibre voxels +This command uses the image data from all selected single-fibre voxels concurrently, rather than simply averaging their individual spherical harmonic coefficients. It also ensures that the response function is non-negative, and monotonic (i.e. its amplitude must increase from the fibre direction out to the orthogonal plane). +If multi-shell data are provided, and one or more b-value shells are not explicitly requested, the command will generate a response function for every b-value shell (including b=0 if present). +ARGUMENT amps 0 0 IMAGEIN +the amplitudes image +ARGUMENT mask 0 0 IMAGEIN +the mask containing the voxels from which to estimate the response function +ARGUMENT directions 0 0 IMAGEIN +a 4D image containing the estimated fibre directions +ARGUMENT response 0 0 FILEOUT +the output zonal spherical harmonic coefficients +OPTION isotropic 1 0 +estimate an isotropic response function (lmax=0 for all shells) +OPTION noconstraint 1 0 +disable the non-negativity and monotonicity constraints +OPTION directions 1 0 +provide an external text file containing the directions along which the amplitudes are sampled +ARGUMENT path 0 0 FILEIN +OPTION shells 1 0 +specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. +WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. +ARGUMENT b-values 0 0 FSEQ +OPTION lmax 1 0 +specify the maximum harmonic degree of the response function to estimate (can be a comma-separated list for multi-shell data) +ARGUMENT values 0 0 ISEQ +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/amp2sh b/interfaces/legacy/amp2sh new file mode 100644 index 0000000000..309b37e421 --- /dev/null +++ b/interfaces/legacy/amp2sh @@ -0,0 +1,53 @@ +Convert a set of amplitudes (defined along a set of corresponding directions) to their spherical harmonic representation +The spherical harmonic decomposition is calculated by least-squares linear fitting to the amplitude data. +The directions can be defined either as a DW gradient scheme (for example to compute the SH representation of the DW signal), a set of [az el] pairs as output by the dirgen command, or a set of [ x y z ] directions in Cartesian coordinates. The DW gradient scheme or direction set can be supplied within the input image header or using the -gradient or -directions option. Note that if a direction set and DW gradient scheme can be found, the direction set will be used by default. +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +ARGUMENT amp 0 0 IMAGEIN +the input amplitude image. +ARGUMENT SH 0 0 IMAGEOUT +the output spherical harmonics coefficients image. +OPTION lmax 1 0 +set the maximum harmonic order for the output series. By default, the program will use the highest possible lmax given the number of diffusion-weighted images, up to a maximum of 8. +ARGUMENT order 0 0 INT 0 30 +OPTION normalise 1 0 +normalise the DW signal to the b=0 image +OPTION directions 1 0 +the directions corresponding to the input amplitude image used to sample AFD. By default this option is not required providing the direction set is supplied in the amplitude image. This should be supplied as a list of directions [az el], as generated using the dirgen command, or as a list of [ x y z ] Cartesian coordinates. +ARGUMENT file 0 0 FILEIN +OPTION rician 1 0 +correct for Rician noise induced bias, using noise map supplied +ARGUMENT noise 0 0 IMAGEIN +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION shells 1 0 +specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. +WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. +ARGUMENT b-values 0 0 FSEQ +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/connectome2tck b/interfaces/legacy/connectome2tck new file mode 100644 index 0000000000..9ab887ba9e --- /dev/null +++ b/interfaces/legacy/connectome2tck @@ -0,0 +1,54 @@ +Extract streamlines from a tractogram based on their assignment to parcellated nodes +The compulsory input file "assignments_in" should contain a text file where there is one row for each streamline, and each row contains a list of numbers corresponding to the parcels to which that streamline was assigned (most typically there will be two entries per streamline, one for each endpoint; but this is not strictly a requirement). This file will most typically be generated using the tck2connectome command with the -out_assignments option. +Default usage: $ connectome2tck tracks.tck assignments.txt edge- The command will generate one track file for every edge in the connectome, with the name of each file indicating the nodes connected via that edge; for instance, all streamlines connecting nodes 23 and 49 will be written to file "edge-23-49.tck". +Extract only the streamlines between nodes 1 and 2: $ connectome2tck tracks.tck assignments.txt tracks_1_2.tck -nodes 1,2 -exclusive -files single Since only a single edge is of interest, this example provides only the two nodes involved in that edge to the -nodes option, adds the -exclusive option so that only streamlines for which both assigned nodes are in the list of nodes of interest are extracted (i.e. only streamlines connecting nodes 1 and 2 in this example), and writes the result to a single output track file. +Extract the streamlines connecting node 15 to all other nodes in the parcellation, with one track file for each edge: $ connectome2tck tracks.tck assignments.txt from_15_to_ -nodes 15 -keep_self The command will generate the same number of track files as there are nodes in the parcellation: one each for the streamlines connecting node 15 to every other node; i.e. "from_15_to_1.tck", "from_15_to_2.tck", "from_15_to_3.tck", etc.. Because the -keep_self option is specified, file "from_15_to_15.tck" will also be generated, containing those streamlines that connect to node 15 at both endpoints. +For every node, generate a file containing all streamlines connected to that node: $ connectome2tck tracks.tck assignments.txt node -files per_node Here the command will generate one track file for every node in the connectome: "node1.tck", "node2.tck", "node3.tck", etc.. Each of these files will contain all streamlines that connect the node of that index to another node in the connectome (it does not select all tracks connecting a particular node, since the -keep_self option was omitted and therefore e.g. a streamline that is assigned to node 41 will not be present in file "node41.tck"). Each streamline in the input tractogram will in fact appear in two different output track files; e.g. a streamline connecting nodes 8 and 56 will be present both in file "node8.tck" and file "node56.tck". +Get all streamlines that were not successfully assigned to a node pair: $ connectome2tck tracks.tck assignments.txt unassigned.tck -nodes 0 -keep_self -files single Node index 0 corresponds to streamline endpoints that were not successfully assigned to a node. As such, by selecting all streamlines that are assigned to "node 0" (including those streamlines for which neither endpoint is assigned to a node due to use of the -keep_self option), the single output track file will contain all streamlines for which at least one of the two endpoints was not successfully assigned to a node. +Generate a single track file containing edge exemplar trajectories: $ connectome2tck tracks.tck assignments.txt exemplars.tck -files single -exemplars nodes.mif This produces the track file that is required as input when attempting to display connectome edges using the streamlines or streamtubes geometries within the meview connectome tool. +ARGUMENT tracks_in 0 0 FILEIN +the input track file +ARGUMENT assignments_in 0 0 FILEIN +input text file containing the node assignments for each streamline +ARGUMENT prefix_out 0 0 TEXT +the output file / prefix +OPTION nodes 1 0 +only select tracks that involve a set of nodes of interest (provide as a comma-separated list of integers) +ARGUMENT list 0 0 ISEQ +OPTION exclusive 1 0 +only select tracks that exclusively connect nodes from within the list of nodes of interest +OPTION files 1 0 +select how the resulting streamlines will be grouped in output files. Options are: per_edge, per_node, single (default: per_edge) +ARGUMENT option 0 0 CHOICE per_edge per_node single +OPTION exemplars 1 0 +generate a mean connection exemplar per edge, rather than keeping all streamlines (the parcellation node image must be provided in order to constrain the exemplar endpoints) +ARGUMENT image 0 0 IMAGEIN +OPTION keep_unassigned 1 0 +by default, the program discards those streamlines that are not successfully assigned to a node. Set this option to generate corresponding outputs containing these streamlines (labelled as node index 0) +OPTION keep_self 1 0 +by default, the program will not output streamlines that connect to the same node at both ends. Set this option to instead keep these self-connections. +OPTION tck_weights_in 1 0 +specify a text scalar file containing the streamline weights +ARGUMENT path 0 0 FILEIN +OPTION prefix_tck_weights_out 1 0 +provide a prefix for outputting a text file corresponding to each output file, each containing only the streamline weights relevant for that track file +ARGUMENT prefix 0 0 TEXT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/connectomeedit b/interfaces/legacy/connectomeedit new file mode 100644 index 0000000000..e4ea742516 --- /dev/null +++ b/interfaces/legacy/connectomeedit @@ -0,0 +1,26 @@ +Perform basic operations on a connectome +ARGUMENT input 0 0 TEXT +the input connectome. +ARGUMENT operation 0 0 CHOICE to_symmetric upper_triangular lower_triangular transpose zero_diagonal +the operation to apply, one of: to_symmetric, upper_triangular, lower_triangular, transpose, zero_diagonal. +ARGUMENT output 0 0 TEXT +the output connectome. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/connectomestats b/interfaces/legacy/connectomestats new file mode 100644 index 0000000000..53a3d768b1 --- /dev/null +++ b/interfaces/legacy/connectomestats @@ -0,0 +1,89 @@ +Connectome group-wise statistics at the edge level using non-parametric permutation testing +For the TFNBS algorithm, default parameters for statistical enhancement have been set based on the work in: +Vinokur, L.; Zalesky, A.; Raffelt, D.; Smith, R.E. & Connelly, A. A Novel Threshold-Free Network-Based Statistics Method: Demonstration using Simulated Pathology. OHBM, 2015, 4144; +and: +Vinokur, L.; Zalesky, A.; Raffelt, D.; Smith, R.E. & Connelly, A. A novel threshold-free network-based statistical method: Demonstration and parameter optimisation using in vivo simulated pathology. In Proc ISMRM, 2015, 2846. +Note however that not only was the optimisation of these parameters not very precise, but the outcomes of statistical inference (for both this algorithm and the NBS method) can vary markedly for even small changes to enhancement parameters. Therefore the specificity of results obtained using either of these methods should be interpreted with caution. +In some software packages, a column of ones is automatically added to the GLM design matrix; the purpose of this column is to estimate the "global intercept", which is the predicted value of the observed variable if all explanatory variables were to be zero. However there are rare situations where including such a column would not be appropriate for a particular experimental design. Hence, in MRtrix3 statistical inference commands, it is up to the user to determine whether or not this column of ones should be included in their design matrix, and add it explicitly if necessary. The contrast matrix must also reflect the presence of this additional column. +ARGUMENT input 0 0 FILEIN +a text file listing the file names of the input connectomes +ARGUMENT algorithm 0 0 CHOICE nbs tfnbs none +the algorithm to use in network-based clustering/enhancement. Options are: nbs, tfnbs, none +ARGUMENT design 0 0 FILEIN +the design matrix +ARGUMENT contrast 0 0 FILEIN +the contrast matrix +ARGUMENT output 0 0 TEXT +the filename prefix for all output. +OPTION notest 1 0 +don't perform statistical inference; only output population statistics (effect size, stdev etc) +OPTION errors 1 0 +specify nature of errors for shuffling; options are: ee,ise,both (default: ee) +ARGUMENT spec 0 0 CHOICE ee ise both +OPTION exchange_within 1 0 +specify blocks of observations within each of which data may undergo restricted exchange +ARGUMENT file 0 0 FILEIN +OPTION exchange_whole 1 0 +specify blocks of observations that may be exchanged with one another (for independent and symmetric errors, sign-flipping will occur block-wise) +ARGUMENT file 0 0 FILEIN +OPTION strong 1 0 +use strong familywise error control across multiple hypotheses +OPTION nshuffles 1 0 +the number of shuffles (default: 5000) +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION permutations 1 0 +manually define the permutations (relabelling). The input should be a text file defining a m x n matrix, where each relabelling is defined as a column vector of size m, and the number of columns, n, defines the number of permutations. Can be generated with the palm_quickperms function in PALM (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM). Overrides the -nshuffles option. +ARGUMENT file 0 0 FILEIN +OPTION nonstationarity 1 0 +perform non-stationarity correction +OPTION skew_nonstationarity 1 0 +specify the skew parameter for empirical statistic calculation (default for this command is 1) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION nshuffles_nonstationarity 1 0 +the number of shuffles to use when precomputing the empirical statistic image for non-stationarity correction (default: 5000) +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION permutations_nonstationarity 1 0 +manually define the permutations (relabelling) for computing the emprical statistics for non-stationarity correction. The input should be a text file defining a m x n matrix, where each relabelling is defined as a column vector of size m, and the number of columns, n, defines the number of permutations. Can be generated with the palm_quickperms function in PALM (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM) Overrides the -nshuffles_nonstationarity option. +ARGUMENT file 0 0 FILEIN +OPTION tfce_dh 1 0 +the height increment used in the tfce integration (default: 0.1) +ARGUMENT value 0 0 FLOAT 1e-06 inf +OPTION tfce_e 1 0 +tfce extent exponent (default: 0.4) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION tfce_h 1 0 +tfce height exponent (default: 3) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION variance 1 0 +define variance groups for the G-statistic; measurements for which the expected variance is equivalent should contain the same index +ARGUMENT file 0 0 FILEIN +OPTION ftests 1 0 +perform F-tests; input text file should contain, for each F-test, a row containing ones and zeros, where ones indicate the rows of the contrast matrix to be included in the F-test. +ARGUMENT path 0 0 FILEIN +OPTION fonly 1 0 +only assess F-tests; do not perform statistical inference on entries in the contrast matrix +OPTION column 1 1 +add a column to the design matrix corresponding to subject edge-wise values (note that the contrast matrix must include an additional column for each use of this option); the text file provided via this option should contain a file name for each subject +ARGUMENT path 0 0 FILEIN +OPTION threshold 1 0 +the t-statistic value to use in threshold-based clustering algorithms +ARGUMENT value 0 0 FLOAT 0 inf +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dcmedit b/interfaces/legacy/dcmedit new file mode 100644 index 0000000000..aa12ac8e76 --- /dev/null +++ b/interfaces/legacy/dcmedit @@ -0,0 +1,37 @@ +Edit DICOM file in-place +Note that this command simply replaces the existing values without modifying the DICOM structure in any way. Replacement text will be truncated if it is too long to fit inside the existing tag. +WARNING: this command will modify existing data! It is recommended to run this command on a copy of the original data set to avoid loss of data. +ARGUMENT file 0 0 FILEIN +the DICOM file to be edited. +OPTION anonymise 1 0 +remove any identifiable information, by replacing the following tags: +- any tag with Value Representation PN will be replaced with 'anonymous' +- tag (0010,0030) PatientBirthDate will be replaced with an empty string +WARNING: there is no guarantee that this command will remove all identiable information, since such information may be contained in any number of private vendor-specific tags. You will need to double-check the results independently if you need to ensure anonymity. +OPTION id 1 0 +replace all ID tags with string supplied. This consists of tags (0010, 0020) PatientID and (0010, 1000) OtherPatientIDs +ARGUMENT text 0 0 TEXT +OPTION tag 1 1 +replace specific tag. +ARGUMENT group 0 0 +ARGUMENT element 0 0 +ARGUMENT newvalue 0 0 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dcminfo b/interfaces/legacy/dcminfo new file mode 100644 index 0000000000..a25a81d5f9 --- /dev/null +++ b/interfaces/legacy/dcminfo @@ -0,0 +1,32 @@ +Output DICOM fields in human-readable format +ARGUMENT file 0 0 FILEIN +the DICOM file to be scanned. +OPTION all 1 0 +print all DICOM fields. +OPTION csa 1 0 +print all Siemens CSA fields (excluding Phoenix unless requested) +OPTION phoenix 1 0 +print Siemens Phoenix protocol information +OPTION tag 1 1 +print field specified by the group & element tags supplied. Tags should be supplied as Hexadecimal (i.e. as they appear in the -all listing). +ARGUMENT group 0 0 TEXT +ARGUMENT element 0 0 TEXT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dirflip b/interfaces/legacy/dirflip new file mode 100644 index 0000000000..1372680da4 --- /dev/null +++ b/interfaces/legacy/dirflip @@ -0,0 +1,30 @@ +Invert the polarity of individual directions so as to optimise a unipolar electrostatic repulsion model +The orientations themselves are not affected, only their polarity; this is necessary to ensure near-optimal distribution of DW directions for eddy-current correction. +ARGUMENT in 0 0 FILEIN +the input files for the directions. +ARGUMENT out 0 0 FILEOUT +the output files for the directions. +OPTION permutations 1 0 +number of permutations to try (default: 100000000) +ARGUMENT num 0 0 INT 1 9223372036854775807 +OPTION cartesian 1 0 +Output the directions in Cartesian coordinates [x y z] instead of [az el]. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dirgen b/interfaces/legacy/dirgen new file mode 100644 index 0000000000..42c1920222 --- /dev/null +++ b/interfaces/legacy/dirgen @@ -0,0 +1,38 @@ +Generate a set of uniformly distributed directions using a bipolar electrostatic repulsion model +Directions are distributed by analogy to an electrostatic repulsion system, with each direction corresponding to a single electrostatic charge (for -unipolar), or a pair of diametrically opposed charges (for the default bipolar case). The energy of the system is determined based on the Coulomb repulsion, which assumes the form 1/r^power, where r is the distance between any pair of charges, and p is the power assumed for the repulsion law (default: 1). The minimum energy state is obtained by gradient descent. +ARGUMENT ndir 0 0 INT 6 2147483647 +the number of directions to generate. +ARGUMENT dirs 0 0 FILEOUT +the text file to write the directions to, as [ az el ] pairs. +OPTION power 1 0 +specify exponent to use for repulsion power law (default: 1). This must be a power of 2 (i.e. 1, 2, 4, 8, 16, ...). +ARGUMENT exp 0 0 INT 1 2147483647 +OPTION niter 1 0 +specify the maximum number of iterations to perform (default: 10000). +ARGUMENT num 0 0 INT 1 2147483647 +OPTION restarts 1 0 +specify the number of restarts to perform (default: 10). +ARGUMENT num 0 0 INT 1 2147483647 +OPTION unipolar 1 0 +optimise assuming a unipolar electrostatic repulsion model rather than the bipolar model normally assumed in DWI +OPTION cartesian 1 0 +Output the directions in Cartesian coordinates [x y z] instead of [az el]. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dirmerge b/interfaces/legacy/dirmerge new file mode 100644 index 0000000000..6de876c3af --- /dev/null +++ b/interfaces/legacy/dirmerge @@ -0,0 +1,29 @@ +Splice / merge multiple sets of directions in such a way as to maintain near-optimality upon truncation +ARGUMENT subsets 0 0 INT 1 10000 +the number of subsets (eg. phase encoding directions) per b-value +ARGUMENT bvalue files 0 1 TEXT +the b-value and sets of corresponding files, in order +ARGUMENT out 0 0 FILEOUT +the output directions file, with each row listing the X Y Z gradient directions, the b-value, and an index representing the phase encode direction +OPTION unipolar_weight 1 0 +set the weight given to the unipolar electrostatic repulsion model compared to the bipolar model (default: 0.2). +ARGUMENT value 0 0 FLOAT 0 1 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dirorder b/interfaces/legacy/dirorder new file mode 100644 index 0000000000..473856db42 --- /dev/null +++ b/interfaces/legacy/dirorder @@ -0,0 +1,27 @@ +Reorder a set of directions to ensure near-uniformity upon truncation +The intent of this command is to reorder a set of gradient directions such that if a scan is terminated prematurely, at any point, the acquired directions will still be close to optimally distributed on the half-sphere. +ARGUMENT input 0 0 FILEIN +the input directions file +ARGUMENT output 0 0 FILEOUT +the output directions file +OPTION cartesian 1 0 +Output the directions in Cartesian coordinates [x y z] instead of [az el]. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dirsplit b/interfaces/legacy/dirsplit new file mode 100644 index 0000000000..7b44a1ba3f --- /dev/null +++ b/interfaces/legacy/dirsplit @@ -0,0 +1,29 @@ +Split a set of evenly distributed directions (as generated by dirgen) into approximately uniformly distributed subsets +ARGUMENT dirs 0 0 FILEIN +the text file containing the directions. +ARGUMENT out 0 1 FILEOUT +the output partitioned directions +OPTION permutations 1 0 +number of permutations to try (default: 100000000) +ARGUMENT num 0 0 INT 1 9223372036854775807 +OPTION cartesian 1 0 +Output the directions in Cartesian coordinates [x y z] instead of [az el]. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dirstat b/interfaces/legacy/dirstat new file mode 100644 index 0000000000..4b56990413 --- /dev/null +++ b/interfaces/legacy/dirstat @@ -0,0 +1,53 @@ +Report statistics on a direction set +This command will accept as inputs: +- directions file in spherical coordinates (ASCII text, [ az el ] space-separated values, one per line); +- directions file in Cartesian coordinates (ASCII text, [ x y z ] space-separated values, one per line); +- DW gradient files (MRtrix format: ASCII text, [ x y z b ] space-separated values, one per line); +- image files, using the DW gradient scheme found in the header (or provided using the appropriate command line options below). +By default, this produces all relevant metrics for the direction set provided. If the direction set contains multiple shells, metrics are provided for each shell separately. +Metrics are produced assuming a unipolar or bipolar electrostatic repulsion model, producing the potential energy (total, mean, min & max), and the nearest-neighbour angles (mean, min & max). The condition number is also produced for the spherical harmonic fits up to the highest harmonic order supported by the number of volumes. Finally, the norm of the mean direction vector is provided as a measure of the overall symmetry of the direction set (important with respect to eddy-current resilience). +Specific metrics can also be queried independently via the "-output" option, using these shorthands: +U/B for unipolar/bipolar model, +E/N for energy and nearest-neighbour respectively, +t/-/+ for total/min/max respectively (mean implied otherwise); +SHn for condition number of SH fit at order n (with n an even integer); +ASYM for asymmetry index (norm of mean direction vector); +N for the number of directions. +Default usage: $ dirstat directions.txt This provides a pretty-printed list of all metrics available. +Write a single metric of interest to standard output: $ dirstat grad.b -shell 3000 -output SH8 requests the condition number of SH fit of b=3000 shell directions at SH order 8 +Write multiple metrics of interest to standard output: $ dirstat dwi.mif -output BN,BN-,BN+ requests the mean, min and max nearest-neighour angles assuming a bipolar model. +ARGUMENT dirs 0 0 FILEIN +the text file or image containing the directions. +OPTION output 1 0 +output selected metrics as a space-delimited list, suitable for use in scripts. This will produce one line of values per selected shell. Valid metrics are as specified in the description above. +ARGUMENT list 0 0 +OPTION shells 1 0 +specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. +WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. +ARGUMENT b-values 0 0 FSEQ +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2adc b/interfaces/legacy/dwi2adc new file mode 100644 index 0000000000..52afbd12ad --- /dev/null +++ b/interfaces/legacy/dwi2adc @@ -0,0 +1,31 @@ +Convert mean dwi (trace-weighted) images to mean ADC maps +ARGUMENT input 0 0 IMAGEIN +the input image. +ARGUMENT output 0 0 IMAGEOUT +the output image. +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2fod b/interfaces/legacy/dwi2fod new file mode 100644 index 0000000000..4b70955776 --- /dev/null +++ b/interfaces/legacy/dwi2fod @@ -0,0 +1,77 @@ +Estimate fibre orientation distributions from diffusion data using spherical deconvolution +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +Perform single-shell single-tissue CSD: $ dwi2fod csd dwi.mif response_wm.txt wmfod.mif This algorithm is designed for single-shell data and only uses a single b-value. The response function text file provided should only contain a a single row, corresponding to the b-value used for CSD. +Perform multi-shell multi-tissue CSD: $ dwi2fod msmt_csd dwi.mif response_wm.txt wmfod.mif response_gm.txt gm.mif response_csf.txt csf.mif This example is the most common use case of multi-tissue CSD, estimating a white matter FOD, and grey matter and CSF compartments. This algorithm requires at least three unique b-values to estimate three tissue compartments. Each response function text file should have a number of rows equal to the number of b-values used. If only two unique b-values are available, it's also possible to estimate only two tissue compartments, e.g., white matter and CSF. +ARGUMENT algorithm 0 0 CHOICE csd msmt_csd +the algorithm to use for FOD estimation. (options are: csd,msmt_csd) +ARGUMENT dwi 0 0 IMAGEIN +the input diffusion-weighted image +ARGUMENT response odf 0 1 +pairs of input tissue response and output ODF images +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION shells 1 0 +specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. +WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. +ARGUMENT b-values 0 0 FSEQ +OPTION directions 1 0 +specify the directions over which to apply the non-negativity constraint (by default, the built-in 300 direction set is used). These should be supplied as a text file containing [ az el ] pairs for the directions. +ARGUMENT file 0 0 FILEIN +OPTION lmax 1 0 +the maximum spherical harmonic order for the output FOD(s).For algorithms with multiple outputs, this should be provided as a comma-separated list of integers, one for each output image; for single-output algorithms, only a single integer should be provided. If omitted, the command will use the lmax of the corresponding response function (i.e based on its number of coefficients), up to a maximum of 8. +ARGUMENT order 0 0 ISEQ +OPTION mask 1 0 +only perform computation within the specified binary brain mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION filter 1 0 +the linear frequency filtering parameters used for the initial linear spherical deconvolution step (default = [ 1 1 1 0 0 ]). These should be supplied as a text file containing the filtering coefficients for each even harmonic order. +ARGUMENT spec 0 0 FILEIN +OPTION neg_lambda 1 0 +the regularisation parameter lambda that controls the strength of the non-negativity constraint (default = 1). +ARGUMENT value 0 0 FLOAT 0 inf +OPTION norm_lambda 1 0 +the regularisation parameter lambda that controls the strength of the constraint on the norm of the solution (default = 1). +ARGUMENT value 0 0 FLOAT 0 inf +OPTION threshold 1 0 +the threshold below which the amplitude of the FOD is assumed to be zero, expressed as an absolute amplitude (default = 0). +ARGUMENT value 0 0 FLOAT -1 10 +OPTION niter 1 0 +the maximum number of iterations to perform for each voxel (default = 50). Use '-niter 0' for a linear unconstrained spherical deconvolution. +ARGUMENT number 0 0 INT 0 1000 +OPTION norm_lambda 1 0 +the regularisation parameter lambda that controls the strength of the constraint on the norm of the solution (default = 1e-10). +ARGUMENT value 0 0 FLOAT 0 inf +OPTION neg_lambda 1 0 +the regularisation parameter lambda that controls the strength of the non-negativity constraint (default = 1e-10). +ARGUMENT value 0 0 FLOAT 0 inf +OPTION predicted_signal 1 0 +output the predicted dwi image. +ARGUMENT image 0 0 IMAGEOUT +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/3dautomask b/interfaces/legacy/dwi2mask/3dautomask new file mode 100644 index 0000000000..4d762e4eb9 --- /dev/null +++ b/interfaces/legacy/dwi2mask/3dautomask @@ -0,0 +1,68 @@ +Use AFNI 3dAutomask to derive a brain mask from the DWI mean b=0 image +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -clfrac 1 0 +Set the "clip level fraction"; must be a number between 0.1 and 0.9. A small value means to make the initial threshold for clipping smaller, which will tend to make the mask larger. +ARGUMENT clfrac 0 0 FLOAT 0.1 0.9 +OPTION -nograd 1 0 +The program uses a "gradual" clip level by default. Add this option to use a fixed clip level. +OPTION -peels 1 0 +Peel (erode) the mask n times, then unpeel (dilate). +ARGUMENT peels 0 0 INT 0 9223372036854775807 +OPTION -nbhrs 1 0 +Define the number of neighbors needed for a voxel NOT to be eroded. It should be between 6 and 26. +ARGUMENT nbhrs 0 0 INT 6 26 +OPTION -eclip 1 0 +After creating the mask, remove exterior voxels below the clip threshold. +OPTION -SI 1 0 +After creating the mask, find the most superior voxel, then zero out everything more than SI millimeters inferior to that. 130 seems to be decent (i.e., for Homo Sapiens brains). +ARGUMENT SI 0 0 FLOAT 0.0 inf +OPTION -dilate 1 0 +Dilate the mask outwards n times +ARGUMENT dilate 0 0 INT 0 9223372036854775807 +OPTION -erode 1 0 +Erode the mask outwards n times +ARGUMENT erode 0 0 INT 0 9223372036854775807 +OPTION -NN1 1 0 +Erode and dilate based on mask faces +OPTION -NN2 1 0 +Erode and dilate based on mask edges +OPTION -NN3 1 0 +Erode and dilate based on mask corners +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/ants b/interfaces/legacy/dwi2mask/ants new file mode 100644 index 0000000000..57814c257c --- /dev/null +++ b/interfaces/legacy/dwi2mask/ants @@ -0,0 +1,44 @@ +Use ANTs Brain Extraction to derive a DWI brain mask +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -template 1 0 +Provide the template image and corresponding mask for antsBrainExtraction.sh to use; the template image should be T2-weighted. +ARGUMENT TemplateImage 0 0 IMAGEIN +ARGUMENT MaskImage 0 0 IMAGEIN +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/b02template b/interfaces/legacy/dwi2mask/b02template new file mode 100644 index 0000000000..2d7773f1f5 --- /dev/null +++ b/interfaces/legacy/dwi2mask/b02template @@ -0,0 +1,58 @@ +Register the mean b=0 image to a T2-weighted template to back-propagate a brain mask +This script currently assumes that the template image provided via the first input to the -template option is T2-weighted, and can therefore be trivially registered to a mean b=0 image. +Command-line option -ants_options can be used with either the "antsquick" or "antsfull" software options. In both cases, image dimensionality is assumed to be 3, and so this should be omitted from the user-specified options.The input can be either a string (encased in double-quotes if more than one option is specified), or a path to a text file containing the requested options. In the case of the "antsfull" software option, one will require the names of the fixed and moving images that are provided to the antsRegistration command: these are "template_image.nii" and "bzero.nii" respectively. +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -flirt_options 1 0 +Command-line options to pass to the FSL flirt command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to flirt) +ARGUMENT " FlirtOptions" 0 0 TEXT +OPTION -fnirt_config 1 0 +Specify a FNIRT configuration file for registration +ARGUMENT file 0 0 FILEIN +OPTION -ants_options 1 0 +Provide options to be passed to the ANTs registration command (see Description) +ARGUMENT " ANTsOptions" 0 0 TEXT +OPTION -software 1 0 +The software to use for template registration; options are: antsfull,antsquick,fsl; default is antsquick +ARGUMENT software 0 0 CHOICE antsfull antsquick fsl +OPTION -template 1 0 +Provide the template image to which the input data will be registered, and the mask to be projected to the input image. The template image should be T2-weighted. +ARGUMENT TemplateImage 0 0 IMAGEIN +ARGUMENT MaskImage 0 0 IMAGEIN +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/consensus b/interfaces/legacy/dwi2mask/consensus new file mode 100644 index 0000000000..23c9a237a6 --- /dev/null +++ b/interfaces/legacy/dwi2mask/consensus @@ -0,0 +1,53 @@ +Generate a brain mask based on the consensus of all dwi2mask algorithms +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -algorithms 1 1 +Provide a (space- or comma-separated) list of dwi2mask algorithms that are to be utilised +ARGUMENT algorithms 0 1 TEXT +OPTION -masks 1 0 +Export a 4D image containing the individual algorithm masks +ARGUMENT image 0 0 IMAGEOUT +OPTION -template 1 0 +Provide a template image and corresponding mask for those algorithms requiring such +ARGUMENT TemplateImage 0 0 IMAGEIN +ARGUMENT MaskImage 0 0 IMAGEIN +OPTION -threshold 1 0 +The fraction of algorithms that must include a voxel for that voxel to be present in the final mask (default: 0.501) +ARGUMENT threshold 0 0 FLOAT 0.0 1.0 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/dwi2mask b/interfaces/legacy/dwi2mask/dwi2mask new file mode 100644 index 0000000000..9157275f70 --- /dev/null +++ b/interfaces/legacy/dwi2mask/dwi2mask @@ -0,0 +1,40 @@ +Generate a binary mask from DWI data +This script serves as an interface for many different algorithms that generate a binary mask from DWI data in different ways. Each algorithm available has its own help page, including necessary references; e.g. to see the help page of the "fslbet" algorithm, type "dwi2mask fslbet". +More information on mask derivation from DWI data can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/dwi_preprocessing/masking.html +ARGUMENT algorithm CHOICE 3dautomask ants b02template consensus fslbet hdbet legacy mean mtnorm synthstrip trace +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/fslbet b/interfaces/legacy/dwi2mask/fslbet new file mode 100644 index 0000000000..5bd6610821 --- /dev/null +++ b/interfaces/legacy/dwi2mask/fslbet @@ -0,0 +1,54 @@ +Use the FSL Brain Extraction Tool (bet) to generate a brain mask +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -bet_f 1 0 +Fractional intensity threshold (0->1); smaller values give larger brain outline estimates +ARGUMENT bet_f 0 0 FLOAT 0.0 1.0 +OPTION -bet_g 1 0 +Vertical gradient in fractional intensity threshold (-1->1); positive values give larger brain outline at bottom, smaller at top +ARGUMENT bet_g 0 0 FLOAT -1.0 1.0 +OPTION -bet_c 1 0 +Centre-of-gravity (voxels not mm) of initial mesh surface +ARGUMENT i,j,k 0 0 FSEQ +OPTION -bet_r 1 0 +Head radius (mm not voxels); initial surface sphere is set to half of this +ARGUMENT bet_r 0 0 FLOAT 0.0 inf +OPTION -rescale 1 0 +Rescale voxel size provided to BET to 1mm isotropic; can improve results for rodent data +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/hdbet b/interfaces/legacy/dwi2mask/hdbet new file mode 100644 index 0000000000..c27cba506b --- /dev/null +++ b/interfaces/legacy/dwi2mask/hdbet @@ -0,0 +1,42 @@ +Use HD-BET to derive a brain mask from the DWI mean b=0 image +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -nogpu 1 0 +Do not attempt to run on the GPU +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/legacy b/interfaces/legacy/dwi2mask/legacy new file mode 100644 index 0000000000..4a34cf1ddb --- /dev/null +++ b/interfaces/legacy/dwi2mask/legacy @@ -0,0 +1,43 @@ +Use the legacy MRtrix3 dwi2mask heuristic (based on thresholded trace images) +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -clean_scale 1 0 +the maximum scale used to cut bridges. A certain maximum scale cuts bridges up to a width (in voxels) of 2x the provided scale. Setting this to 0 disables the mask cleaning step. (Default: 2) +ARGUMENT clean_scale 0 0 INT 0 9223372036854775807 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/mean b/interfaces/legacy/dwi2mask/mean new file mode 100644 index 0000000000..d8be1d4d07 --- /dev/null +++ b/interfaces/legacy/dwi2mask/mean @@ -0,0 +1,46 @@ +Generate a mask based on simply averaging all volumes in the DWI series +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -shells 1 0 +Comma separated list of shells to be included in the volume averaging +ARGUMENT bvalues 0 0 FSEQ +OPTION -clean_scale 1 0 +the maximum scale used to cut bridges. A certain maximum scale cuts bridges up to a width (in voxels) of 2x the provided scale. Setting this to 0 disables the mask cleaning step. (Default: 2) +ARGUMENT clean_scale 0 0 INT 0 9223372036854775807 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/mtnorm b/interfaces/legacy/dwi2mask/mtnorm new file mode 100644 index 0000000000..b7940b323e --- /dev/null +++ b/interfaces/legacy/dwi2mask/mtnorm @@ -0,0 +1,55 @@ +Derives a DWI brain mask by calculating and then thresholding a sum-of-tissue-densities image +This script attempts to identify brain voxels based on the total density of macroscopic tissues as estimated through multi-tissue deconvolution. Following response function estimation and multi-tissue deconvolution, the sum of tissue densities is thresholded at a fixed value (default is 0.5), and subsequent mask image cleaning operations are performed. +The operation of this script is a subset of that performed by the script "dwibiasnormmask". Many users may find that comprehensive solution preferable; this dwi2mask algorithm is nevertheless provided to demonstrate specifically the mask estimation portion of that command. +The ODFs estimated within this optimisation procedure are by default of lower maximal spherical harmonic degree than what would be advised for analysis. This is done for computational efficiency. This behaviour can be modified through the -lmax command-line option. +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -init_mask 1 0 +Provide an initial brain mask, which will constrain the response function estimation (if omitted, the default dwi2mask algorithm will be used) +ARGUMENT image 0 0 IMAGEIN +OPTION -lmax 1 0 +The maximum spherical harmonic degree for the estimated FODs (see Description); defaults are "4,0,0" for multi-shell and "4,0" for single-shell data +ARGUMENT values 0 0 ISEQ +OPTION -threshold 1 0 +the threshold on the total tissue density sum image used to derive the brain mask; default is 0.5 +ARGUMENT value 0 0 FLOAT 0.0 1.0 +OPTION -tissuesum 1 0 +Export the tissue sum image that was used to generate the mask +ARGUMENT image 0 0 IMAGEOUT +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/synthstrip b/interfaces/legacy/dwi2mask/synthstrip new file mode 100644 index 0000000000..88109134f8 --- /dev/null +++ b/interfaces/legacy/dwi2mask/synthstrip @@ -0,0 +1,54 @@ +Use the FreeSurfer Synthstrip method on the mean b=0 image +This algorithm requires that the SynthStrip method be installed and available via PATH; this could be via Freesufer 7.3.0 or later, or the dedicated Singularity container. +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -stripped 1 0 +The output stripped image +ARGUMENT stripped 0 0 IMAGEOUT +OPTION -gpu 1 0 +Use the GPU +OPTION -model 1 0 +Alternative model weights +ARGUMENT file 0 0 FILEIN +OPTION -nocsf 1 0 +Compute the immediate boundary of brain matter excluding surrounding CSF +OPTION -border 1 0 +Control the boundary distance from the brain +ARGUMENT border 0 0 INT -9223372036854775808 9223372036854775807 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2mask/trace b/interfaces/legacy/dwi2mask/trace new file mode 100644 index 0000000000..a0a62e161b --- /dev/null +++ b/interfaces/legacy/dwi2mask/trace @@ -0,0 +1,51 @@ +A method to generate a brain mask from trace images of b-value shells +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The output mask image +OPTION -iterative 1 0 +(EXPERIMENTAL) Iteratively refine the weights for combination of per-shell trace-weighted images prior to thresholding +OPTION -max_iters 1 0 +Set the maximum number of iterations for the algorithm (default: 10) +ARGUMENT max_iters 0 0 INT 1 9223372036854775807 +OPTION -shells 1 0 +Comma-separated list of shells used to generate trace-weighted images for masking +ARGUMENT bvalues 0 0 FSEQ +OPTION -clean_scale 1 0 +the maximum scale used to cut bridges. A certain maximum scale cuts bridges up to a width (in voxels) of 2x the provided scale. Setting this to 0 disables the mask cleaning step. (Default: 2) +ARGUMENT clean_scale 0 0 INT 0 9223372036854775807 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2response/dhollander b/interfaces/legacy/dwi2response/dhollander new file mode 100644 index 0000000000..6ee40c716b --- /dev/null +++ b/interfaces/legacy/dwi2response/dhollander @@ -0,0 +1,75 @@ +Unsupervised estimation of WM, GM and CSF response functions that does not require a T1 image (or segmentation thereof) +This is an improved version of the Dhollander et al. (2016) algorithm for unsupervised estimation of WM, GM and CSF response functions, which includes the Dhollander et al. (2019) improvements for single-fibre WM response function estimation (prior to this update, the "dwi2response tournier" algorithm had been utilised specifically for the single-fibre WM response function estimation step). +ARGUMENT input 0 0 IMAGEIN +Input DWI dataset +ARGUMENT out_sfwm 0 0 FILEOUT +Output single-fibre WM response function text file +ARGUMENT out_gm 0 0 FILEOUT +Output GM response function text file +ARGUMENT out_csf 0 0 FILEOUT +Output CSF response function text file +OPTION -erode 1 0 +Number of erosion passes to apply to initial (whole brain) mask. Set to 0 to not erode the brain mask. (default: 3) +ARGUMENT passes 0 0 INT 0 9223372036854775807 +OPTION -fa 1 0 +FA threshold for crude WM versus GM-CSF separation. (default: 0.2) +ARGUMENT threshold 0 0 FLOAT 0.0 1.0 +OPTION -sfwm 1 0 +Final number of single-fibre WM voxels to select, as a percentage of refined WM. (default: 0.5 per cent) +ARGUMENT percentage 0 0 FLOAT 0.0 100.0 +OPTION -gm 1 0 +Final number of GM voxels to select, as a percentage of refined GM. (default: 2 per cent) +ARGUMENT percentage 0 0 FLOAT 0.0 100.0 +OPTION -csf 1 0 +Final number of CSF voxels to select, as a percentage of refined CSF. (default: 10 per cent) +ARGUMENT percentage 0 0 FLOAT 0.0 100.0 +OPTION -wm_algo 1 0 +Use external dwi2response algorithm for WM single-fibre voxel selection (options: fa, tax, tournier) (default: built-in Dhollander 2019) +ARGUMENT algorithm 0 0 CHOICE fa tax tournier +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Provide an initial mask for response voxel selection +ARGUMENT image 0 0 IMAGEIN +OPTION -voxels 1 0 +Output an image showing the final voxel selection(s) +ARGUMENT image 0 0 IMAGEOUT +OPTION -shells 1 0 +The b-value(s) to use in response function estimation (comma-separated list in case of multiple b-values; b=0 must be included explicitly if desired) +ARGUMENT bvalues 0 0 FSEQ +OPTION -lmax 1 0 +The maximum harmonic degree(s) for response function estimation (comma-separated list in case of multiple b-values) +ARGUMENT values 0 0 ISEQ +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2response/dwi2response b/interfaces/legacy/dwi2response/dwi2response new file mode 100644 index 0000000000..6ae0380e30 --- /dev/null +++ b/interfaces/legacy/dwi2response/dwi2response @@ -0,0 +1,54 @@ +Estimate response function(s) for spherical deconvolution +dwi2response offers different algorithms for performing various types of response function estimation. The name of the algorithm must appear as the first argument on the command-line after "dwi2response". The subsequent arguments and options depend on the particular algorithm being invoked. +Each algorithm available has its own help page, including necessary references; e.g. to see the help page of the "fa" algorithm, type "dwi2response fa". +More information on response function estimation for spherical deconvolution can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/constrained_spherical_deconvolution/response_function_estimation.html +Note that if the -mask command-line option is not specified, the MRtrix3 command dwi2mask will automatically be called to derive an initial voxel exclusion mask. More information on mask derivation from DWI data can be found at: https://mrtrix.readthedocs.io/en/3.0.4/dwi_preprocessing/masking.html +ARGUMENT algorithm CHOICE dhollander fa manual msmt_5tt tax tournier +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Provide an initial mask for response voxel selection +ARGUMENT image 0 0 IMAGEIN +OPTION -voxels 1 0 +Output an image showing the final voxel selection(s) +ARGUMENT image 0 0 IMAGEOUT +OPTION -shells 1 0 +The b-value(s) to use in response function estimation (comma-separated list in case of multiple b-values; b=0 must be included explicitly if desired) +ARGUMENT bvalues 0 0 FSEQ +OPTION -lmax 1 0 +The maximum harmonic degree(s) for response function estimation (comma-separated list in case of multiple b-values) +ARGUMENT values 0 0 ISEQ +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2response/fa b/interfaces/legacy/dwi2response/fa new file mode 100644 index 0000000000..169948f13d --- /dev/null +++ b/interfaces/legacy/dwi2response/fa @@ -0,0 +1,61 @@ +Use the old FA-threshold heuristic for single-fibre voxel selection and response function estimation +ARGUMENT input 0 0 IMAGEIN +The input DWI +ARGUMENT output 0 0 FILEOUT +The output response function text file +OPTION -erode 1 0 +Number of brain mask erosion steps to apply prior to threshold (not used if mask is provided manually) +ARGUMENT passes 0 0 INT 0 9223372036854775807 +OPTION -number 1 0 +The number of highest-FA voxels to use +ARGUMENT voxels 0 0 INT 1 9223372036854775807 +OPTION -threshold 1 0 +Apply a hard FA threshold, rather than selecting the top voxels +ARGUMENT value 0 0 FLOAT 0.0 1.0 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Provide an initial mask for response voxel selection +ARGUMENT image 0 0 IMAGEIN +OPTION -voxels 1 0 +Output an image showing the final voxel selection(s) +ARGUMENT image 0 0 IMAGEOUT +OPTION -shells 1 0 +The b-value(s) to use in response function estimation (comma-separated list in case of multiple b-values; b=0 must be included explicitly if desired) +ARGUMENT bvalues 0 0 FSEQ +OPTION -lmax 1 0 +The maximum harmonic degree(s) for response function estimation (comma-separated list in case of multiple b-values) +ARGUMENT values 0 0 ISEQ +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2response/manual b/interfaces/legacy/dwi2response/manual new file mode 100644 index 0000000000..c24e9ce6dd --- /dev/null +++ b/interfaces/legacy/dwi2response/manual @@ -0,0 +1,57 @@ +Derive a response function using an input mask image alone (i.e. pre-selected voxels) +ARGUMENT input 0 0 IMAGEIN +The input DWI +ARGUMENT in_voxels 0 0 IMAGEIN +Input voxel selection mask +ARGUMENT output 0 0 FILEOUT +Output response function text file +OPTION -dirs 1 0 +Provide an input image that contains a pre-estimated fibre direction in each voxel (a tensor fit will be used otherwise) +ARGUMENT image 0 0 IMAGEIN +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Provide an initial mask for response voxel selection +ARGUMENT image 0 0 IMAGEIN +OPTION -voxels 1 0 +Output an image showing the final voxel selection(s) +ARGUMENT image 0 0 IMAGEOUT +OPTION -shells 1 0 +The b-value(s) to use in response function estimation (comma-separated list in case of multiple b-values; b=0 must be included explicitly if desired) +ARGUMENT bvalues 0 0 FSEQ +OPTION -lmax 1 0 +The maximum harmonic degree(s) for response function estimation (comma-separated list in case of multiple b-values) +ARGUMENT values 0 0 ISEQ +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2response/msmt_5tt b/interfaces/legacy/dwi2response/msmt_5tt new file mode 100644 index 0000000000..d3a34b427b --- /dev/null +++ b/interfaces/legacy/dwi2response/msmt_5tt @@ -0,0 +1,73 @@ +Derive MSMT-CSD tissue response functions based on a co-registered five-tissue-type (5TT) image +ARGUMENT input 0 0 IMAGEIN +The input DWI +ARGUMENT in_5tt 0 0 IMAGEIN +Input co-registered 5TT image +ARGUMENT out_wm 0 0 FILEOUT +Output WM response text file +ARGUMENT out_gm 0 0 FILEOUT +Output GM response text file +ARGUMENT out_csf 0 0 FILEOUT +Output CSF response text file +OPTION -dirs 1 0 +Provide an input image that contains a pre-estimated fibre direction in each voxel (a tensor fit will be used otherwise) +ARGUMENT image 0 0 IMAGEIN +OPTION -fa 1 0 +Upper fractional anisotropy threshold for GM and CSF voxel selection (default: 0.2) +ARGUMENT value 0 0 FLOAT 0.0 1.0 +OPTION -pvf 1 0 +Partial volume fraction threshold for tissue voxel selection (default: 0.95) +ARGUMENT fraction 0 0 FLOAT 0.0 1.0 +OPTION -wm_algo 1 0 +dwi2response algorithm to use for WM single-fibre voxel selection (options: fa, tax, tournier; default: tournier) +ARGUMENT algorithm 0 0 CHOICE fa tax tournier +OPTION -sfwm_fa_threshold 1 0 +Sets -wm_algo to fa and allows to specify a hard FA threshold for single-fibre WM voxels, which is passed to the -threshold option of the fa algorithm (warning: overrides -wm_algo option) +ARGUMENT value 0 0 FLOAT 0.0 1.0 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Provide an initial mask for response voxel selection +ARGUMENT image 0 0 IMAGEIN +OPTION -voxels 1 0 +Output an image showing the final voxel selection(s) +ARGUMENT image 0 0 IMAGEOUT +OPTION -shells 1 0 +The b-value(s) to use in response function estimation (comma-separated list in case of multiple b-values; b=0 must be included explicitly if desired) +ARGUMENT bvalues 0 0 FSEQ +OPTION -lmax 1 0 +The maximum harmonic degree(s) for response function estimation (comma-separated list in case of multiple b-values) +ARGUMENT values 0 0 ISEQ +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2response/tax b/interfaces/legacy/dwi2response/tax new file mode 100644 index 0000000000..f601836e91 --- /dev/null +++ b/interfaces/legacy/dwi2response/tax @@ -0,0 +1,61 @@ +Use the Tax et al. (2014) recursive calibration algorithm for single-fibre voxel selection and response function estimation +ARGUMENT input 0 0 IMAGEIN +The input DWI +ARGUMENT output 0 0 FILEOUT +The output response function text file +OPTION -peak_ratio 1 0 +Second-to-first-peak amplitude ratio threshold +ARGUMENT value 0 0 FLOAT 0.0 1.0 +OPTION -max_iters 1 0 +Maximum number of iterations (set to 0 to force convergence) +ARGUMENT iterations 0 0 INT 0 9223372036854775807 +OPTION -convergence 1 0 +Percentile change in any RF coefficient required to continue iterating +ARGUMENT percentage 0 0 FLOAT 0.0 inf +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Provide an initial mask for response voxel selection +ARGUMENT image 0 0 IMAGEIN +OPTION -voxels 1 0 +Output an image showing the final voxel selection(s) +ARGUMENT image 0 0 IMAGEOUT +OPTION -shells 1 0 +The b-value(s) to use in response function estimation (comma-separated list in case of multiple b-values; b=0 must be included explicitly if desired) +ARGUMENT bvalues 0 0 FSEQ +OPTION -lmax 1 0 +The maximum harmonic degree(s) for response function estimation (comma-separated list in case of multiple b-values) +ARGUMENT values 0 0 ISEQ +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2response/tournier b/interfaces/legacy/dwi2response/tournier new file mode 100644 index 0000000000..2c4a9342f5 --- /dev/null +++ b/interfaces/legacy/dwi2response/tournier @@ -0,0 +1,64 @@ +Use the Tournier et al. (2013) iterative algorithm for single-fibre voxel selection and response function estimation +ARGUMENT input 0 0 IMAGEIN +The input DWI +ARGUMENT output 0 0 FILEOUT +The output response function text file +OPTION -number 1 0 +Number of single-fibre voxels to use when calculating response function +ARGUMENT voxels 0 0 INT 1 9223372036854775807 +OPTION -iter_voxels 1 0 +Number of single-fibre voxels to select when preparing for the next iteration (default = 10 x value given in -number) +ARGUMENT voxels 0 0 INT 0 9223372036854775807 +OPTION -dilate 1 0 +Number of mask dilation steps to apply when deriving voxel mask to test in the next iteration +ARGUMENT passes 0 0 INT 1 9223372036854775807 +OPTION -max_iters 1 0 +Maximum number of iterations (set to 0 to force convergence) +ARGUMENT iterations 0 0 INT 0 9223372036854775807 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Provide an initial mask for response voxel selection +ARGUMENT image 0 0 IMAGEIN +OPTION -voxels 1 0 +Output an image showing the final voxel selection(s) +ARGUMENT image 0 0 IMAGEOUT +OPTION -shells 1 0 +The b-value(s) to use in response function estimation (comma-separated list in case of multiple b-values; b=0 must be included explicitly if desired) +ARGUMENT bvalues 0 0 FSEQ +OPTION -lmax 1 0 +The maximum harmonic degree(s) for response function estimation (comma-separated list in case of multiple b-values) +ARGUMENT values 0 0 ISEQ +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwi2tensor b/interfaces/legacy/dwi2tensor new file mode 100644 index 0000000000..c63421b33e --- /dev/null +++ b/interfaces/legacy/dwi2tensor @@ -0,0 +1,67 @@ +Diffusion (kurtosis) tensor estimation +By default, the diffusion tensor (and optionally the kurtosis tensor) is fitted to the log-signal in two steps: firstly, using weighted least-squares (WLS) with weights based on the empirical signal intensities; secondly, by further iterated weighted least-squares (IWLS) with weights determined by the signal predictions from the previous iteration (by default, 2 iterations will be performed). This behaviour can be altered in two ways: +* The -ols option will cause the first fitting step to be performed using ordinary least-squares (OLS); that is, all measurements contribute equally to the fit, instead of the default behaviour of weighting based on the empirical signal intensities. +* The -iter option controls the number of iterations of the IWLS prodedure. If this is set to zero, then the output model parameters will be those resulting from the first fitting step only: either WLS by default, or OLS if the -ols option is used in conjunction with -iter 0. +By default, the diffusion tensor (and optionally the kurtosis tensor) is fitted using unconstrained optimization. This can result in unexpected diffusion parameters, e.g. parameters that represent negative apparent diffusivities or negative apparent kurtoses, or parameters that correspond to non-monotonic decay of the predicted signal. By supplying the -constrain option, constrained optimization is performed instead and such physically implausible parameters can be avoided. Depending on the presence of the -dkt option, the -constrain option will enforce the following constraints: +* Non-negative apparent diffusivity (always). +* Non-negative apparent kurtosis (when the -dkt option is provided). +* Monotonic signal decay in the b = [0 b_max] range (when the -dkt option is provided). +The tensor coefficients are stored in the output image as follows: +volumes 0-5: D11, D22, D33, D12, D13, D23 +If diffusion kurtosis is estimated using the -dkt option, these are stored as follows: +volumes 0-2: W1111, W2222, W3333 +volumes 3-8: W1112, W1113, W1222, W1333, W2223, W2333 +volumes 9-11: W1122, W1133, W2233 +volumes 12-14: W1123, W1223, W1233 +ARGUMENT dwi 0 0 IMAGEIN +the input dwi image. +ARGUMENT dt 0 0 IMAGEOUT +the output dt image. +OPTION ols 1 0 +perform initial fit using an ordinary least-squares (OLS) fit (see Description). +OPTION iter 1 0 +number of iterative reweightings for IWLS algorithm (default: 2) (see Description). +ARGUMENT integer 0 0 INT 0 10 +OPTION constrain 1 0 +constrain fit to non-negative diffusivity and kurtosis as well as monotonic signal decay (see Description). +OPTION directions 1 0 +specify the directions along which to apply the constraints (by default, the built-in 300 direction set is used). These should be supplied as a text file containing [ az el ] pairs for the directions. +ARGUMENT file 0 0 FILEIN +OPTION mask 1 0 +only perform computation within the specified binary brain mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION b0 1 0 +the output b0 image. +ARGUMENT image 0 0 IMAGEOUT +OPTION dkt 1 0 +the output dkt image. +ARGUMENT image 0 0 IMAGEOUT +OPTION predicted_signal 1 0 +the predicted dwi image. +ARGUMENT image 0 0 IMAGEOUT +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwibiascorrect/ants b/interfaces/legacy/dwibiascorrect/ants new file mode 100644 index 0000000000..d08aa7ccf1 --- /dev/null +++ b/interfaces/legacy/dwibiascorrect/ants @@ -0,0 +1,55 @@ +Perform DWI bias field correction using the N4 algorithm as provided in ANTs +ARGUMENT input 0 0 IMAGEIN +The input image series to be corrected +ARGUMENT output 0 0 IMAGEOUT +The output corrected image series +OPTION -ants_b 1 0 +N4BiasFieldCorrection option -b: [initial mesh resolution in mm, spline order] This value is optimised for human adult data and needs to be adjusted for rodent data. +ARGUMENT [100,3] 0 0 TEXT +OPTION -ants_c 1 0 +N4BiasFieldCorrection option -c: [numberOfIterations,convergenceThreshold] +ARGUMENT [1000,0.0] 0 0 TEXT +OPTION -ants_s 1 0 +N4BiasFieldCorrection option -s: shrink-factor applied to spatial dimensions +ARGUMENT 4 0 0 TEXT +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Manually provide an input mask image for bias field estimation +ARGUMENT image 0 0 IMAGEIN +OPTION -bias 1 0 +Output an image containing the estimated bias field +ARGUMENT image 0 0 IMAGEOUT +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwibiascorrect/dwibiascorrect b/interfaces/legacy/dwibiascorrect/dwibiascorrect new file mode 100644 index 0000000000..1df3165d21 --- /dev/null +++ b/interfaces/legacy/dwibiascorrect/dwibiascorrect @@ -0,0 +1,45 @@ +Perform B1 field inhomogeneity correction for a DWI volume series +Note that if the -mask command-line option is not specified, the MRtrix3 command dwi2mask will automatically be called to derive a mask that will be passed to the relevant bias field estimation command. More information on mask derivation from DWI data can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/dwi_preprocessing/masking.html +ARGUMENT algorithm CHOICE ants fsl mtnorm +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Manually provide an input mask image for bias field estimation +ARGUMENT image 0 0 IMAGEIN +OPTION -bias 1 0 +Output an image containing the estimated bias field +ARGUMENT image 0 0 IMAGEOUT +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwibiascorrect/fsl b/interfaces/legacy/dwibiascorrect/fsl new file mode 100644 index 0000000000..5240cfc1ca --- /dev/null +++ b/interfaces/legacy/dwibiascorrect/fsl @@ -0,0 +1,47 @@ +Perform DWI bias field correction using the "fast" command as provided in FSL +The FSL "fast" command only estimates the bias field within a brain mask, and cannot extrapolate this smoothly-varying field beyond the defined mask. As such, this algorithm by necessity introduces a hard masking of the input DWI. Since this attribute may interfere with the purpose of using the command (e.g. correction of a bias field is commonly used to improve brain mask estimation), use of this particular algorithm is generally not recommended. +ARGUMENT input 0 0 IMAGEIN +The input image series to be corrected +ARGUMENT output 0 0 IMAGEOUT +The output corrected image series +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Manually provide an input mask image for bias field estimation +ARGUMENT image 0 0 IMAGEIN +OPTION -bias 1 0 +Output an image containing the estimated bias field +ARGUMENT image 0 0 IMAGEOUT +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwibiascorrect/mtnorm b/interfaces/legacy/dwibiascorrect/mtnorm new file mode 100644 index 0000000000..ef031dca32 --- /dev/null +++ b/interfaces/legacy/dwibiascorrect/mtnorm @@ -0,0 +1,52 @@ +Perform DWI bias field correction using the "mtnormalise" command +This algorithm bases its operation almost entirely on the utilisation of multi-tissue decomposition information to estimate an underlying B1 receive field, as is implemented in the MRtrix3 command "mtnormalise". Its typical usage is however slightly different, in that the primary output of the command is not the bias-field-corrected FODs, but a bias-field-corrected version of the DWI series. +The operation of this script is a subset of that performed by the script "dwibiasnormmask". Many users may find that comprehensive solution preferable; this dwibiascorrect algorithm is nevertheless provided to demonstrate specifically the bias field correction portion of that command. +The ODFs estimated within this optimisation procedure are by default of lower maximal spherical harmonic degree than what would be advised for analysis. This is done for computational efficiency. This behaviour can be modified through the -lmax command-line option. +ARGUMENT input 0 0 IMAGEIN +The input image series to be corrected +ARGUMENT output 0 0 IMAGEOUT +The output corrected image series +OPTION -lmax 1 0 +The maximum spherical harmonic degree for the estimated FODs (see Description); defaults are "4,0,0" for multi-shell and "4,0" for single-shell data) +ARGUMENT values 0 0 ISEQ +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -mask 1 0 +Manually provide an input mask image for bias field estimation +ARGUMENT image 0 0 IMAGEIN +OPTION -bias 1 0 +Output an image containing the estimated bias field +ARGUMENT image 0 0 IMAGEOUT +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwibiasnormmask b/interfaces/legacy/dwibiasnormmask new file mode 100644 index 0000000000..35e5998a8f --- /dev/null +++ b/interfaces/legacy/dwibiasnormmask @@ -0,0 +1,75 @@ +Perform a combination of bias field correction, intensity normalisation, and mask derivation, for DWI data +DWI bias field correction, intensity normalisation and masking are inter-related steps, and errors in each may influence other steps. This script is designed to perform all of these steps in an integrated iterative fashion, with the intention of making all steps more robust. +The operation of the algorithm is as follows. An initial mask is defined, either using the default dwi2mask algorithm or as provided by the user. Based on this mask, a sequence of response function estimation, multi-shell multi-tissue CSD, bias field correction (using the mtnormalise command), and intensity normalisation is performed. The default dwi2mask algorithm is then re-executed on the bias-field-corrected DWI series. This sequence of steps is then repeated based on the revised mask, until either a convergence criterion or some number of maximum iterations is reached. +The MRtrix3 mtnormalise command is used to estimate information relating to bias field and intensity normalisation. However its usage in this context is different to its conventional usage. Firstly, while the corrected ODF images are typically used directly following invocation of this command, here the estimated bias field and scaling factors are instead used to apply the relevant corrections to the originating DWI data. Secondly, the global intensity scaling that is calculated and applied is typically based on achieving close to a unity sum of tissue signal fractions throughout the masked region. Here, it is instead the b=0 signal in CSF that forms the reference for this global intensity scaling; this is calculated based on the estimated CSF response function and the tissue-specific intensity scaling (this is calculated internally by mtnormalise as part of its optimisation process, but typically subsequently discarded in favour of a single scaling factor for all tissues) +The ODFs estimated within this optimisation procedure are by default of lower maximal spherical harmonic degree than what would be advised for analysis. This is done for computational efficiency. This behaviour can be modified through the -lmax command-line option. +By default, the optimisation procedure will terminate after only two iterations. This is done because it has been observed for some data / configurations that additional iterations can lead to unstable divergence and erroneous results for bias field estimation and masking. For other configurations, it may be preferable to use a greater number of iterations, and allow the iterative algorithm to converge to a stable solution. This can be controlled via the -max_iters command-line option. +Within the optimisation algorithm, derivation of the mask may potentially be performed differently to a conventional mask derivation that is based on a DWI series (where, in many instances, it is actually only the mean b=0 image that is used). Here, the image corresponding to the sum of tissue signal fractions following spherical deconvolution / bias field correction / intensity normalisation is also available, and this can potentially be used for mask derivation. Available options are as follows. "dwi2mask": Use the MRtrix3 command dwi2mask on the bias-field-corrected DWI series (ie. do not use the ODF tissue sum image for mask derivation); the algorithm to be invoked can be controlled by the user via the MRtrix config file entry "Dwi2maskAlgorithm". "fslbet": Invoke the FSL command "bet" on the ODF tissue sum image. "hdbet": Invoke the HD-BET command on the ODF tissue sum image. "mrthreshold": Invoke the MRtrix3 command "mrthreshold" on the ODF tissue sum image, where an appropriate threshold value will be determined automatically (and some heuristic cleanup of the resulting mask will be performed). "synthstrip": Invoke the FreeSurfer SynthStrip method on the ODF tissue sum image. "threshold": Apply a fixed partial volume threshold of 0.5 to the ODF tissue sum image (and some heuristic cleanup of the resulting mask will be performed). +ARGUMENT input 0 0 IMAGEIN +The input DWI series to be corrected +ARGUMENT output_dwi 0 0 IMAGEOUT +The output corrected DWI series +ARGUMENT output_mask 0 0 IMAGEOUT +The output DWI mask +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -dice 1 0 +Set the Dice coefficient threshold for similarity of masks between sequential iterations that will result in termination due to convergence; default = 0.999 +ARGUMENT value 0 0 FLOAT 0.0 1.0 +OPTION -init_mask 1 0 +Provide an initial mask for the first iteration of the algorithm (if not provided, the default dwi2mask algorithm will be used) +ARGUMENT init_mask 0 0 IMAGEIN +OPTION -max_iters 1 0 +The maximum number of iterations (see Description); default is 2; set to 0 to proceed until convergence +ARGUMENT count 0 0 INT 0 9223372036854775807 +OPTION -mask_algo 1 0 +The algorithm to use for mask estimation, potentially based on the ODF sum image (see Description); default: threshold +ARGUMENT algorithm 0 0 CHOICE dwi2mask fslbet hdbet mrthreshold synthstrip threshold +OPTION -lmax 1 0 +The maximum spherical harmonic degree for the estimated FODs (see Description); defaults are "4,0,0" for multi-shell and "4,0" for single-shell data) +ARGUMENT values 0 0 ISEQ +OPTION -output_bias 1 0 +Export the final estimated bias field to an image +ARGUMENT output_bias 0 0 IMAGEOUT +OPTION -output_scale 1 0 +Write the scaling factor applied to the DWI series to a text file +ARGUMENT output_scale 0 0 FILEOUT +OPTION -output_tissuesum 1 0 +Export the tissue sum image that was used to generate the final mask +ARGUMENT output_tissuesum 0 0 IMAGEOUT +OPTION -reference 1 0 +Set the target CSF b=0 intensity in the output DWI series (default: 1000.0) +ARGUMENT value 0 0 FLOAT 0.0 inf +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwicat b/interfaces/legacy/dwicat new file mode 100644 index 0000000000..abcf5cf1e1 --- /dev/null +++ b/interfaces/legacy/dwicat @@ -0,0 +1,37 @@ +Concatenating multiple DWI series accounting for differential intensity scaling +This script concatenates two or more 4D DWI series, accounting for the fact that there may be differences in intensity scaling between those series. This intensity scaling is corrected by determining scaling factors that will make the overall image intensities in the b=0 volumes of each series approximately equivalent. +ARGUMENT inputs 0 1 IMAGEIN +Multiple input diffusion MRI series +ARGUMENT output 0 0 IMAGEOUT +The output image series (all DWIs concatenated) +OPTION -mask 1 0 +Provide a binary mask within which image intensities will be matched +ARGUMENT image 0 0 IMAGEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwidenoise b/interfaces/legacy/dwidenoise new file mode 100644 index 0000000000..500b533bcc --- /dev/null +++ b/interfaces/legacy/dwidenoise @@ -0,0 +1,47 @@ +dMRI noise level estimation and denoising using Marchenko-Pastur PCA +DWI data denoising and noise map estimation by exploiting data redundancy in the PCA domain using the prior knowledge that the eigenspectrum of random covariance matrices is described by the universal Marchenko-Pastur (MP) distribution. Fitting the MP distribution to the spectrum of patch-wise signal matrices hence provides an estimator of the noise level 'sigma', as was first shown in Veraart et al. (2016) and later improved in Cordero-Grande et al. (2019). This noise level estimate then determines the optimal cut-off for PCA denoising. +Important note: image denoising must be performed as the first step of the image processing pipeline. The routine will fail if interpolation or smoothing has been applied to the data prior to denoising. +Note that this function does not correct for non-Gaussian noise biases present in magnitude-reconstructed MRI images. If available, including the MRI phase data can reduce such non-Gaussian biases, and the command now supports complex input data. +ARGUMENT dwi 0 0 IMAGEIN +the input diffusion-weighted image. +ARGUMENT out 0 0 IMAGEOUT +the output denoised DWI image. +OPTION mask 1 0 +Only process voxels within the specified binary brain mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION extent 1 0 +Set the patch size of the denoising filter. By default, the command will select the smallest isotropic patch size that exceeds the number of DW images in the input data, e.g., 5x5x5 for data with <= 125 DWI volumes, 7x7x7 for data with <= 343 DWI volumes, etc. +ARGUMENT window 0 0 ISEQ +OPTION noise 1 0 +The output noise map, i.e., the estimated noise level 'sigma' in the data. Note that on complex input data, this will be the total noise level across real and imaginary channels, so a scale factor sqrt(2) applies. +ARGUMENT level 0 0 IMAGEOUT +OPTION rank 1 0 +The selected signal rank of the output denoised image. +ARGUMENT cutoff 0 0 IMAGEOUT +OPTION datatype 1 0 +Datatype for the eigenvalue decomposition (single or double precision). For complex input data, this will select complex float32 or complex float64 datatypes. +ARGUMENT float32/float64 0 0 CHOICE float32 float64 +OPTION estimator 1 0 +Select the noise level estimator (default = Exp2), either: +* Exp1: the original estimator used in Veraart et al. (2016), or +* Exp2: the improved estimator introduced in Cordero-Grande et al. (2019). +ARGUMENT Exp1/Exp2 0 0 CHOICE exp1 exp2 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwiextract b/interfaces/legacy/dwiextract new file mode 100644 index 0000000000..8adcb4423f --- /dev/null +++ b/interfaces/legacy/dwiextract @@ -0,0 +1,62 @@ +Extract diffusion-weighted volumes, b=0 volumes, or certain shells from a DWI dataset +Calculate the mean b=0 image from a 4D DWI series: $ dwiextract dwi.mif - -bzero | mrmath - mean mean_bzero.mif -axis 3 The dwiextract command extracts all volumes for which the b-value is (approximately) zero; the resulting 4D image can then be provided to the mrmath command to calculate the mean intensity across volumes for each voxel. +ARGUMENT input 0 0 IMAGEIN +the input DW image. +ARGUMENT output 0 0 IMAGEOUT +the output image (diffusion-weighted volumes by default). +OPTION bzero 1 0 +Output b=0 volumes (instead of the diffusion weighted volumes, if -singleshell is not specified). +OPTION no_bzero 1 0 +Output only non b=0 volumes (default, if -singleshell is not specified). +OPTION singleshell 1 0 +Force a single-shell (single non b=0 shell) output. This will include b=0 volumes, if present. Use with -bzero to enforce presence of b=0 volumes (error if not present) or with -no_bzero to exclude them. +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION shells 1 0 +specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. +WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. +ARGUMENT b-values 0 0 FSEQ +OPTION export_grad_mrtrix 1 0 +export the diffusion-weighted gradient table to file in MRtrix format +ARGUMENT path 0 0 FILEOUT +OPTION export_grad_fsl 1 0 +export the diffusion-weighted gradient table to files in FSL (bvecs / bvals) format +ARGUMENT bvecs_path 0 0 FILEOUT +ARGUMENT bvals_path 0 0 FILEOUT +OPTION import_pe_table 1 0 +import a phase-encoding table from file +ARGUMENT file 0 0 FILEIN +OPTION import_pe_eddy 1 0 +import phase-encoding information from an EDDY-style config / index file pair +ARGUMENT config 0 0 FILEIN +ARGUMENT indices 0 0 FILEIN +OPTION pe 1 0 +select volumes with a particular phase encoding; this can be three comma-separated values (for i,j,k components of vector direction) or four (direction & total readout time) +ARGUMENT desc 0 0 FSEQ +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwifslpreproc b/interfaces/legacy/dwifslpreproc new file mode 100644 index 0000000000..ec0bb9dda7 --- /dev/null +++ b/interfaces/legacy/dwifslpreproc @@ -0,0 +1,101 @@ +Perform diffusion image pre-processing using FSL's eddy tool; including inhomogeneity distortion correction using FSL's topup tool if possible +This script is intended to provide convenience of use of the FSL software tools topup and eddy for performing DWI pre-processing, by encapsulating some of the surrounding image data and metadata processing steps. It is intended to simply these processing steps for most commonly-used DWI acquisition strategies, whilst also providing support for some more exotic acquisitions. The "example usage" section demonstrates the ways in which the script can be used based on the (compulsory) -rpe_* command-line options. +More information on use of the dwifslpreproc command can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/dwi_preprocessing/dwifslpreproc.html +Note that the MRtrix3 command dwi2mask will automatically be called to derive a processing mask for the FSL command "eddy", which determines which voxels contribute to the estimation of geometric distortion parameters and possibly also the classification of outlier slices. If FSL command "topup" is used to estimate a susceptibility field, then dwi2mask will be executed on the resuts of running FSL command "applytopup" to the input DWIs; otherwise it will be executed directly on the input DWIs. Alternatively, the -eddy_mask option can be specified in order to manually provide such a processing mask. More information on mask derivation from DWI data can be found at: https://mrtrix.readthedocs.io/en/3.0.4/dwi_preprocessing/masking.html +The "-topup_options" and "-eddy_options" command-line options allow the user to pass desired command-line options directly to the FSL commands topup and eddy. The available options for those commands may vary between versions of FSL; users can interrogate such by querying the help pages of the installed software, and/or the FSL online documentation: (topup) https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup/TopupUsersGuide ; (eddy) https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/eddy/UsersGuide +The script will attempt to run the CUDA version of eddy; if this does not succeed for any reason, or is not present on the system, the CPU version will be attempted instead. By default, the CUDA eddy binary found that indicates compilation against the most recent version of CUDA will be attempted; this can be over-ridden by providing a soft-link "eddy_cuda" within your path that links to the binary you wish to be executed. +Note that this script does not perform any explicit registration between images provided to topup via the -se_epi option, and the DWI volumes provided to eddy. In some instances (motion between acquisitions) this can result in erroneous application of the inhomogeneity field during distortion correction. Use of the -align_seepi option is advocated in this scenario, which ensures that the first volume in the series provided to topup is also the first volume in the series provided to eddy, guaranteeing alignment. But a prerequisite for this approach is that the image contrast within the images provided to the -se_epi option must match the b=0 volumes present within the input DWI series: this means equivalent TE, TR and flip angle (note that differences in multi-band factors between two acquisitions may lead to differences in TR). +A basic DWI acquisition, where all image volumes are acquired in a single protocol with fixed phase encoding: $ dwifslpreproc DWI_in.mif DWI_out.mif -rpe_none -pe_dir ap -readout_time 0.55; Due to use of a single fixed phase encoding, no EPI distortion correction can be applied in this case. +DWIs all acquired with a single fixed phase encoding; but additionally a pair of b=0 images with reversed phase encoding to estimate the inhomogeneity field: $ mrcat b0_ap.mif b0_pa.mif b0_pair.mif -axis 3; dwifslpreproc DWI_in.mif DWI_out.mif -rpe_pair -se_epi b0_pair.mif -pe_dir ap -readout_time 0.72 -align_seepi; Here the two individual b=0 volumes are concatenated into a single 4D image series, and this is provided to the script via the -se_epi option. Note that with the -rpe_pair option used here, which indicates that the SE-EPI image series contains one or more pairs of b=0 images with reversed phase encoding, the FIRST HALF of the volumes in the SE-EPI series must possess the same phase encoding as the input DWI series, while the second half are assumed to contain the opposite phase encoding direction but identical total readout time. Use of the -align_seepi option is advocated as long as its use is valid (more information in the Description section). +All DWI directions & b-values are acquired twice, with the phase encoding direction of the second acquisition protocol being reversed with respect to the first: $ mrcat DWI_lr.mif DWI_rl.mif DWI_all.mif -axis 3; dwifslpreproc DWI_all.mif DWI_out.mif -rpe_all -pe_dir lr -readout_time 0.66; Here the two acquisition protocols are concatenated into a single DWI series containing all acquired volumes. The direction indicated via the -pe_dir option should be the direction of phase encoding used in acquisition of the FIRST HALF of volumes in the input DWI series; ie. the first of the two files that was provided to the mrcat command. In this usage scenario, the output DWI series will contain the same number of image volumes as ONE of the acquired DWI series (ie. half of the number in the concatenated series); this is because the script will identify pairs of volumes that possess the same diffusion sensitisation but reversed phase encoding, and perform explicit recombination of those volume pairs in such a way that image contrast in regions of inhomogeneity is determined from the stretched rather than the compressed image. +Any acquisition scheme that does not fall into one of the example usages above: $ mrcat DWI_*.mif DWI_all.mif -axis 3; mrcat b0_*.mif b0_all.mif -axis 3; dwifslpreproc DWI_all.mif DWI_out.mif -rpe_header -se_epi b0_all.mif -align_seepi; With this usage, the relevant phase encoding information is determined entirely based on the contents of the relevant image headers, and dwifslpreproc prepares all metadata for the executed FSL commands accordingly. This can therefore be used if the particular DWI acquisition strategy used does not correspond to one of the simple examples as described in the prior examples. This usage is predicated on the headers of the input files containing appropriately-named key-value fields such that MRtrix3 tools identify them as such. In some cases, conversion from DICOM using MRtrix3 commands will automatically extract and embed this information; however this is not true for all scanner vendors and/or software versions. In the latter case it may be possible to manually provide these metadata; either using the -json_import command-line option of dwifslpreproc, or the -json_import or one of the -import_pe_* command-line options of MRtrix3's mrconvert command (and saving in .mif format) prior to running dwifslpreproc. +ARGUMENT input 0 0 IMAGEIN +The input DWI series to be corrected +ARGUMENT output 0 0 IMAGEOUT +The output corrected image series +OPTION -json_import 1 0 +Import image header information from an associated JSON file (may be necessary to determine phase encoding information) +ARGUMENT file 0 0 FILEIN +OPTION -rpe_none 1 0 +Specify that no reversed phase-encoding image data is being provided; eddy will perform eddy current and motion correction only +OPTION -rpe_pair 1 0 +Specify that a set of images (typically b=0 volumes) will be provided for use in inhomogeneity field estimation only (using the -se_epi option) +OPTION -rpe_all 1 0 +Specify that ALL DWIs have been acquired with opposing phase-encoding +OPTION -rpe_header 1 0 +Specify that the phase-encoding information can be found in the image header(s), and that this is the information that the script should use +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -export_grad_mrtrix 1 0 +Export the final gradient table in MRtrix format +ARGUMENT grad 0 0 FILEOUT +OPTION -export_grad_fsl 1 0 +Export the final gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEOUT +ARGUMENT bvals 0 0 FILEOUT +OPTION -eddyqc_text 1 0 +Copy the various text-based statistical outputs generated by eddy, and the output of eddy_qc (if installed), into an output directory +ARGUMENT directory 0 0 DIROUT +OPTION -eddyqc_all 1 0 +Copy ALL outputs generated by eddy (including images), and the output of eddy_qc (if installed), into an output directory +ARGUMENT directory 0 0 DIROUT +OPTION -eddy_mask 1 0 +Provide a processing mask to use for eddy, instead of having dwifslpreproc generate one internally using dwi2mask +ARGUMENT image 0 0 IMAGEIN +OPTION -eddy_slspec 1 0 +Provide a file containing slice groupings for eddy's slice-to-volume registration +ARGUMENT file 0 0 FILEIN +OPTION -eddy_options 1 0 +Manually provide additional command-line options to the eddy command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to eddy) +ARGUMENT " EddyOptions" 0 0 TEXT +OPTION -se_epi 1 0 +Provide an additional image series consisting of spin-echo EPI images, which is to be used exclusively by topup for estimating the inhomogeneity field (i.e. it will not form part of the output image series) +ARGUMENT image 0 0 IMAGEIN +OPTION -align_seepi 1 0 +Achieve alignment between the SE-EPI images used for inhomogeneity field estimation and the DWIs (more information in Description section) +OPTION -topup_options 1 0 +Manually provide additional command-line options to the topup command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to topup) +ARGUMENT " TopupOptions" 0 0 TEXT +OPTION -topup_files 1 0 +Provide files generated by prior execution of the FSL "topup" command to be utilised by eddy +ARGUMENT prefix 0 0 TEXT +OPTION -pe_dir 1 0 +Manually specify the phase encoding direction of the input series; can be a signed axis number (e.g. -0, 1, +2), an axis designator (e.g. RL, PA, IS), or NIfTI axis codes (e.g. i-, j, k) +ARGUMENT PE 0 0 TEXT +OPTION -readout_time 1 0 +Manually specify the total readout time of the input series (in seconds) +ARGUMENT time 0 0 FLOAT 0.0 inf +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwigradcheck b/interfaces/legacy/dwigradcheck new file mode 100644 index 0000000000..ba31dd9c29 --- /dev/null +++ b/interfaces/legacy/dwigradcheck @@ -0,0 +1,54 @@ +Check the orientation of the diffusion gradient table +Note that the corrected gradient table can be output using the -export_grad_{mrtrix,fsl} option. +Note that if the -mask command-line option is not specified, the MRtrix3 command dwi2mask will automatically be called to derive a binary mask image to be used for streamline seeding and to constrain streamline propagation. More information on mask derivation from DWI data can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/dwi_preprocessing/masking.html +ARGUMENT input 0 0 IMAGEIN +The input DWI series to be checked +OPTION -mask 1 0 +Provide a mask image within which to seed & constrain tracking +ARGUMENT image 0 0 IMAGEIN +OPTION -number 1 0 +Set the number of tracks to generate for each test +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -export_grad_mrtrix 1 0 +Export the final gradient table in MRtrix format +ARGUMENT grad 0 0 FILEOUT +OPTION -export_grad_fsl 1 0 +Export the final gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEOUT +ARGUMENT bvals 0 0 FILEOUT +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwinormalise/dwinormalise b/interfaces/legacy/dwinormalise/dwinormalise new file mode 100644 index 0000000000..eee867f5af --- /dev/null +++ b/interfaces/legacy/dwinormalise/dwinormalise @@ -0,0 +1,31 @@ +Perform various forms of intensity normalisation of DWIs +This script provides access to different techniques for globally scaling the intensity of diffusion-weighted images. The different algorithms have different purposes, and different requirements with respect to the data with which they must be provided & will produce as output. Further information on the individual algorithms available can be accessed via their individual help pages; eg. "dwinormalise group -help". +ARGUMENT algorithm CHOICE group manual mtnorm +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwinormalise/group b/interfaces/legacy/dwinormalise/group new file mode 100644 index 0000000000..505168b7a9 --- /dev/null +++ b/interfaces/legacy/dwinormalise/group @@ -0,0 +1,44 @@ +Performs a global DWI intensity normalisation on a group of subjects using the median b=0 white matter value as the reference +The white matter mask is estimated from a population average FA template then warped back to each subject to perform the intensity normalisation. Note that bias field correction should be performed prior to this step. +All input DWI files must contain an embedded diffusion gradient table; for this reason, these images must all be in either .mif or .mif.gz format. +ARGUMENT input_dir 0 0 DIRIN +The input directory containing all DWI images +ARGUMENT mask_dir 0 0 DIRIN +Input directory containing brain masks, corresponding to one per input image (with the same file name prefix) +ARGUMENT output_dir 0 0 DIROUT +The output directory containing all of the intensity normalised DWI images +ARGUMENT fa_template 0 0 IMAGEOUT +The output population-specific FA template, which is thresholded to estimate a white matter mask +ARGUMENT wm_mask 0 0 IMAGEOUT +The output white matter mask (in template space), used to estimate the median b=0 white matter value for normalisation +OPTION -fa_threshold 1 0 +The threshold applied to the Fractional Anisotropy group template used to derive an approximate white matter mask (default: 0.4) +ARGUMENT value 0 0 FLOAT 0.0 1.0 +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwinormalise/manual b/interfaces/legacy/dwinormalise/manual new file mode 100644 index 0000000000..46d6ffd4cb --- /dev/null +++ b/interfaces/legacy/dwinormalise/manual @@ -0,0 +1,48 @@ +Intensity normalise a DWI series based on the b=0 signal within a supplied mask +ARGUMENT input_dwi 0 0 IMAGEIN +The input DWI series +ARGUMENT input_mask 0 0 IMAGEIN +The mask within which a reference b=0 intensity will be sampled +ARGUMENT output_dwi 0 0 IMAGEOUT +The output intensity-normalised DWI series +OPTION -intensity 1 0 +Normalise the b=0 signal to a specified value (Default: 1000) +ARGUMENT value 0 0 FLOAT 0.0 inf +OPTION -percentile 1 0 +Define the percentile of the b=0 image intensties within the mask used for normalisation; if this option is not supplied then the median value (50th percentile) will be normalised to the desired intensity value +ARGUMENT value 0 0 FLOAT 0.0 100.0 +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwinormalise/mtnorm b/interfaces/legacy/dwinormalise/mtnorm new file mode 100644 index 0000000000..ea29a228de --- /dev/null +++ b/interfaces/legacy/dwinormalise/mtnorm @@ -0,0 +1,55 @@ +Normalise a DWI series to the estimated b=0 CSF intensity +This algorithm determines an appropriate global scaling factor to apply to a DWI series such that after the scaling is applied, the b=0 CSF intensity corresponds to some reference value (1000 by default). +The operation of this script is a subset of that performed by the script "dwibiasnormmask". Many users may find that comprehensive solution preferable; this dwinormalise algorithm is nevertheless provided to demonstrate specifically the global intensituy normalisation portion of that command. +The ODFs estimated within this optimisation procedure are by default of lower maximal spherical harmonic degree than what would be advised for analysis. This is done for computational efficiency. This behaviour can be modified through the -lmax command-line option. +ARGUMENT input 0 0 IMAGEIN +The input DWI series +ARGUMENT output 0 0 IMAGEOUT +The normalised DWI series +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -lmax 1 0 +The maximum spherical harmonic degree for the estimated FODs (see Description); defaults are "4,0,0" for multi-shell and "4,0" for single-shell data) +ARGUMENT values 0 0 ISEQ +OPTION -mask 1 0 +Provide a mask image for relevant calculations (if not provided, the default dwi2mask algorithm will be used) +ARGUMENT image 0 0 IMAGEIN +OPTION -reference 1 0 +Set the target CSF b=0 intensity in the output DWI series (default: 1000) +ARGUMENT value 0 0 FLOAT 0.0 inf +OPTION -scale 1 0 +Write the scaling factor applied to the DWI series to a text file +ARGUMENT file 0 0 FILEOUT +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/dwishellmath b/interfaces/legacy/dwishellmath new file mode 100644 index 0000000000..cdf8140051 --- /dev/null +++ b/interfaces/legacy/dwishellmath @@ -0,0 +1,44 @@ +Apply an mrmath operation to each b-value shell in a DWI series +The output of this command is a 4D image, where each volume corresponds to a b-value shell (in order of increasing b-value), an the intensities within each volume correspond to the chosen statistic having been computed from across the DWI volumes belonging to that b-value shell. +To compute the mean diffusion-weighted signal in each b-value shell: $ dwishellmath dwi.mif mean shellmeans.mif +ARGUMENT input 0 0 IMAGEIN +The input diffusion MRI series +ARGUMENT operation 0 0 CHOICE mean median sum product rms norm var std min max absmax magmax +The operation to be applied to each shell; this must be one of the following: mean, median, sum, product, rms, norm, var, std, min, max, absmax, magmax +ARGUMENT output 0 0 IMAGEOUT +The output image series +OPTION -grad 1 0 +Provide the diffusion gradient table in MRtrix format +ARGUMENT file 0 0 FILEIN +OPTION -fslgrad 1 0 +Provide the diffusion gradient table in FSL bvecs/bvals format +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixel2peaks b/interfaces/legacy/fixel2peaks new file mode 100644 index 0000000000..b95aa1f6fe --- /dev/null +++ b/interfaces/legacy/fixel2peaks @@ -0,0 +1,32 @@ +Convert data in the fixel directory format into a 4D image of 3-vectors +If a fixel data file is provided as input, then the 3-vectors in the output image will be scaled based on the data in that file. If the input is instead the fixel directory, or the index or directions file, then all output 3-vectors will possess unit norm. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT in 0 0 VARIOUS +the input fixel information +ARGUMENT out 0 0 IMAGEOUT +the output peaks image +OPTION number 1 0 +maximum number of fixels in each voxel (default: based on input data) +ARGUMENT value 0 0 INT 1 9223372036854775807 +OPTION nan 1 0 +fill excess peak data with NaNs rather than zeroes +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixel2sh b/interfaces/legacy/fixel2sh new file mode 100644 index 0000000000..e837b0c871 --- /dev/null +++ b/interfaces/legacy/fixel2sh @@ -0,0 +1,32 @@ +Convert a fixel-based sparse-data image into an spherical harmonic image +This command generates spherical harmonic data from fixels that can be visualised using the ODF tool in MRview. The output ODF lobes are scaled according to the values in the input fixel image. +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT fixel_in 0 0 IMAGEIN +the input fixel data file. +ARGUMENT sh_out 0 0 IMAGEOUT +the output sh image. +OPTION lmax 1 0 +set the maximum harmonic order for the output series (Default: 8) +ARGUMENT order 0 0 INT 0 30 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixel2tsf b/interfaces/legacy/fixel2tsf new file mode 100644 index 0000000000..d4c839e650 --- /dev/null +++ b/interfaces/legacy/fixel2tsf @@ -0,0 +1,32 @@ +Map fixel values to a track scalar file based on an input tractogram +This command is useful for visualising all brain fixels (e.g. the output from fixelcfestats) in 3D. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT fixel_in 0 0 IMAGEIN +the input fixel data file (within the fixel directory) +ARGUMENT tracks 0 0 TRACKSIN +the input track file +ARGUMENT tsf 0 0 FILEOUT +the output track scalar file +OPTION angle 1 0 +the max anglular threshold for computing correspondence between a fixel direction and track tangent (default = 45 degrees) +ARGUMENT value 0 0 FLOAT 0.001 90 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixel2voxel b/interfaces/legacy/fixel2voxel new file mode 100644 index 0000000000..34f0f6481b --- /dev/null +++ b/interfaces/legacy/fixel2voxel @@ -0,0 +1,44 @@ +Convert a fixel-based sparse-data image into some form of scalar image +Fixel data can be reduced to voxel data in a number of ways: +- Some statistic computed across all fixel values within a voxel: mean, sum, product, min, max, absmax, magmax +- The number of fixels in each voxel: count +- Some measure of crossing-fibre organisation: complexity, sf ('single-fibre') +- A 4D directionally-encoded colour image: dec_unit, dec_scaled +- A 4D image containing all fixel data values in each voxel unmodified: none +The -weighted option deals with the case where there is some per-fixel metric of interest that you wish to collapse into a single scalar measure per voxel, but each fixel possesses a different volume, and you wish for those fixels with greater volume to have a greater influence on the calculation than fixels with lesser volume. For instance, when estimating a voxel-based measure of mean axon diameter from per-fixel mean axon diameters, a fixel's mean axon diameter should be weigthed by its relative volume within the voxel in the calculation of that voxel mean. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT fixel_in 0 0 IMAGEIN +the input fixel data file +ARGUMENT operation 0 0 CHOICE mean sum product min max absmax magmax count complexity sf dec_unit dec_scaled none +the operation to apply, one of: mean, sum, product, min, max, absmax, magmax, count, complexity, sf, dec_unit, dec_scaled, none. +ARGUMENT image_out 0 0 IMAGEOUT +the output scalar image. +OPTION number 1 0 +use only the largest N fixels in calculation of the voxel-wise statistic; in the case of operation "none", output only the largest N fixels in each voxel. +ARGUMENT N 0 0 INT 1 9223372036854775807 +OPTION fill 1 0 +for "none" operation, specify the value to fill when number of fixels is fewer than the maximum (default: 0.0) +ARGUMENT value 0 0 FLOAT -inf inf +OPTION weighted 1 0 +weight the contribution of each fixel to the per-voxel result according to its volume. +ARGUMENT fixel_in 0 0 IMAGEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixelcfestats b/interfaces/legacy/fixelcfestats new file mode 100644 index 0000000000..80cf07d261 --- /dev/null +++ b/interfaces/legacy/fixelcfestats @@ -0,0 +1,95 @@ +Fixel-based analysis using connectivity-based fixel enhancement and non-parametric permutation testing +Unlike previous versions of this command, where a whole-brain tractogram file would be provided as input in order to generate the fixel-fixel connectivity matrix and smooth fixel data, this version expects to be provided with the directory path to a pre-calculated fixel-fixel connectivity matrix (likely generated using the MRtrix3 command fixelconnectivity), and for the input fixel data to have already been smoothed (likely using the MRtrix3 command fixelfilter). +Note that if the -mask option is used, the output fixel directory will still contain the same set of fixels as that present in the input fixel template, in order to retain fixel correspondence. However a consequence of this is that all fixels in the template will be initialy visible when the output fixel directory is loaded in mrview. Those fixels outside the processing mask will immediately disappear from view as soon as any data-file-based fixel colouring or thresholding is applied. +In some software packages, a column of ones is automatically added to the GLM design matrix; the purpose of this column is to estimate the "global intercept", which is the predicted value of the observed variable if all explanatory variables were to be zero. However there are rare situations where including such a column would not be appropriate for a particular experimental design. Hence, in MRtrix3 statistical inference commands, it is up to the user to determine whether or not this column of ones should be included in their design matrix, and add it explicitly if necessary. The contrast matrix must also reflect the presence of this additional column. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT in_fixel_directory 0 0 DIRIN +the fixel directory containing the data files for each subject (after obtaining fixel correspondence +ARGUMENT subjects 0 0 IMAGEIN +a text file listing the subject identifiers (one per line). This should correspond with the filenames in the fixel directory (including the file extension), and be listed in the same order as the rows of the design matrix. +ARGUMENT design 0 0 FILEIN +the design matrix +ARGUMENT contrast 0 0 FILEIN +the contrast matrix, specified as rows of weights +ARGUMENT connectivity 0 0 VARIOUS +the fixel-fixel connectivity matrix +ARGUMENT out_fixel_directory 0 0 TEXT +the output directory where results will be saved. Will be created if it does not exist +OPTION mask 1 0 +provide a fixel data file containing a mask of those fixels to be used during processing +ARGUMENT file 0 0 IMAGEIN +OPTION notest 1 0 +don't perform statistical inference; only output population statistics (effect size, stdev etc) +OPTION errors 1 0 +specify nature of errors for shuffling; options are: ee,ise,both (default: ee) +ARGUMENT spec 0 0 CHOICE ee ise both +OPTION exchange_within 1 0 +specify blocks of observations within each of which data may undergo restricted exchange +ARGUMENT file 0 0 FILEIN +OPTION exchange_whole 1 0 +specify blocks of observations that may be exchanged with one another (for independent and symmetric errors, sign-flipping will occur block-wise) +ARGUMENT file 0 0 FILEIN +OPTION strong 1 0 +use strong familywise error control across multiple hypotheses +OPTION nshuffles 1 0 +the number of shuffles (default: 5000) +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION permutations 1 0 +manually define the permutations (relabelling). The input should be a text file defining a m x n matrix, where each relabelling is defined as a column vector of size m, and the number of columns, n, defines the number of permutations. Can be generated with the palm_quickperms function in PALM (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM). Overrides the -nshuffles option. +ARGUMENT file 0 0 FILEIN +OPTION nonstationarity 1 0 +perform non-stationarity correction +OPTION skew_nonstationarity 1 0 +specify the skew parameter for empirical statistic calculation (default for this command is 1) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION nshuffles_nonstationarity 1 0 +the number of shuffles to use when precomputing the empirical statistic image for non-stationarity correction (default: 5000) +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION permutations_nonstationarity 1 0 +manually define the permutations (relabelling) for computing the emprical statistics for non-stationarity correction. The input should be a text file defining a m x n matrix, where each relabelling is defined as a column vector of size m, and the number of columns, n, defines the number of permutations. Can be generated with the palm_quickperms function in PALM (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM) Overrides the -nshuffles_nonstationarity option. +ARGUMENT file 0 0 FILEIN +OPTION cfe_dh 1 0 +the height increment used in the cfe integration (default: 0.1) +ARGUMENT value 0 0 FLOAT 0.001 1 +OPTION cfe_e 1 0 +cfe extent exponent (default: 2) +ARGUMENT value 0 0 FLOAT 0 100 +OPTION cfe_h 1 0 +cfe height exponent (default: 3) +ARGUMENT value 0 0 FLOAT 0 100 +OPTION cfe_c 1 0 +cfe connectivity exponent (default: 0.5) +ARGUMENT value 0 0 FLOAT 0 100 +OPTION cfe_legacy 1 0 +use the legacy (non-normalised) form of the cfe equation +OPTION variance 1 0 +define variance groups for the G-statistic; measurements for which the expected variance is equivalent should contain the same index +ARGUMENT file 0 0 FILEIN +OPTION ftests 1 0 +perform F-tests; input text file should contain, for each F-test, a row containing ones and zeros, where ones indicate the rows of the contrast matrix to be included in the F-test. +ARGUMENT path 0 0 FILEIN +OPTION fonly 1 0 +only assess F-tests; do not perform statistical inference on entries in the contrast matrix +OPTION column 1 1 +add a column to the design matrix corresponding to subject fixel-wise values (note that the contrast matrix must include an additional column for each use of this option); the text file provided via this option should contain a file name for each subject +ARGUMENT path 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixelconnectivity b/interfaces/legacy/fixelconnectivity new file mode 100644 index 0000000000..f8f412d893 --- /dev/null +++ b/interfaces/legacy/fixelconnectivity @@ -0,0 +1,47 @@ +Generate a fixel-fixel connectivity matrix +This command will generate a directory containing three images, which encodes the fixel-fixel connectivity matrix. Documentation regarding this format and how to use it will come in the future. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT fixel_directory 0 0 DIRIN +the directory containing the fixels between which connectivity will be quantified +ARGUMENT tracks 0 0 TRACKSIN +the tracks used to determine fixel-fixel connectivity +ARGUMENT matrix 0 0 DIROUT +the output fixel-fixel connectivity matrix directory path +OPTION threshold 1 0 +a threshold to define the required fraction of shared connections to be included in the neighbourhood (default: 0.01) +ARGUMENT value 0 0 FLOAT 0 1 +OPTION angle 1 0 +the max angle threshold for assigning streamline tangents to fixels (Default: 45 degrees) +ARGUMENT value 0 0 FLOAT 0 90 +OPTION mask 1 0 +provide a fixel data file containing a mask of those fixels to be computed; fixels outside the mask will be empty in the output matrix +ARGUMENT file 0 0 IMAGEIN +OPTION tck_weights_in 1 0 +specify a text scalar file containing the streamline weights +ARGUMENT path 0 0 FILEIN +OPTION count 1 0 +export a fixel data file encoding the number of connections for each fixel +ARGUMENT path 0 0 IMAGEOUT +OPTION extent 1 0 +export a fixel data file encoding the extent of connectivity (sum of weights) for each fixel +ARGUMENT path 0 0 IMAGEOUT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixelconvert b/interfaces/legacy/fixelconvert new file mode 100644 index 0000000000..a8ce15e880 --- /dev/null +++ b/interfaces/legacy/fixelconvert @@ -0,0 +1,45 @@ +Convert between the old format fixel image (.msf / .msh) and the new fixel directory format +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +Convert from the old file format to the new directory format: $ fixelconvert old_fixels.msf new_fixels/ -out_size This performs a simple conversion from old to new format, and additionally writes the contents of the "size" field within old-format fixel images stored using the "FixelMetric" class (likely all of them) as an additional fixel data file. +Convert multiple files from old to new format, preserving fixel correspondence: $ for_each *.msf : fixelconvert IN NAME_new/ -template template_fixels/ In this example, the for_each script is used to execute the fixelconvert command once for each of a series of input files in the old fixel format, generating a new output fixel directory for each.Importantly here though, the -template option is used to ensure that the ordering of fixels within these output directories is identical, such that fixel data files can be exchanged between them (e.g. accumulating fixel data files across subjects into a single template fixel directory +Convert from the new directory format to the old file format: $ fixelconvert new_fixels/ old_fixels.msf -value parameter.mif -in_size new_fixels/afd.mif Conversion from the new directory format will contain the value 1.0 for all output fixels in both the "size" and "value" fields of the "FixelMetric" class, unless the -in_size and/or -value options are used respectively to indicate which fixel data files should be used as the source(s) of this information. +ARGUMENT fixel_in 0 0 VARIOUS +the input fixel file / directory. +ARGUMENT fixel_out 0 0 VARIOUS +the output fixel file / directory. +OPTION name 1 0 +assign a different name to the value field output (Default: value). Do not include the file extension. +ARGUMENT string 0 0 TEXT +OPTION nii 1 0 +output the index, directions and data file in NIfTI format instead of .mif +OPTION out_size 1 0 +also output the 'size' field from the old format +OPTION template 1 0 +specify an existing fixel directory (in the new format) to which the new output should conform +ARGUMENT path 0 0 DIRIN +OPTION value 1 0 +nominate the data file to import to the 'value' field in the old format +ARGUMENT path 0 0 FILEIN +OPTION in_size 1 0 +import data for the 'size' field in the old format +ARGUMENT path 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixelcorrespondence b/interfaces/legacy/fixelcorrespondence new file mode 100644 index 0000000000..82929c3654 --- /dev/null +++ b/interfaces/legacy/fixelcorrespondence @@ -0,0 +1,34 @@ +Obtain fixel-fixel correpondence between a subject fixel image and a template fixel mask +It is assumed that the subject image has already been spatially normalised and is aligned with the template. The output fixel image will have the same fixels (and directions) of the template. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT subject_data 0 0 IMAGEIN +the input subject fixel data file. This should be a file inside the fixel directory +ARGUMENT template_directory 0 0 DIRIN +the input template fixel directory. +ARGUMENT output_directory 0 0 TEXT +the fixel directory where the output file will be written. +ARGUMENT output_data 0 0 TEXT +the name of the output fixel data file. This will be placed in the output fixel directory +OPTION angle 1 0 +the max angle threshold for computing inter-subject fixel correspondence (Default: 45 degrees) +ARGUMENT value 0 0 FLOAT 0 90 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixelcrop b/interfaces/legacy/fixelcrop new file mode 100644 index 0000000000..b59c31750a --- /dev/null +++ b/interfaces/legacy/fixelcrop @@ -0,0 +1,29 @@ +Crop/remove fixels from sparse fixel image using a binary fixel mask +The mask must be input as a fixel data file the same dimensions as the fixel data file(s) to be cropped. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT input_fixel_directory 0 0 DIRIN +input fixel directory, all data files and directions file will be cropped and saved in the output fixel directory +ARGUMENT input_fixel_mask 0 0 IMAGEIN +the input fixel data file defining which fixels to crop. Fixels with zero values will be removed +ARGUMENT output_fixel_directory 0 0 DIROUT +the output directory to store the cropped directions and data files +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixelfilter b/interfaces/legacy/fixelfilter new file mode 100644 index 0000000000..cbca8d51ac --- /dev/null +++ b/interfaces/legacy/fixelfilter @@ -0,0 +1,47 @@ +Perform filtering operations on fixel-based data +If the first input to the command is a specific fixel data file, then a filtered version of only that file will be generated by the command. Alternatively, if the input is the location of a fixel directory, then the command will create a duplicate of the fixel directory, and apply the specified filter operation to all fixel data files within the directory. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT input 0 0 VARIOUS +the input: either a fixel data file, or a fixel directory (see Description) +ARGUMENT filter 0 0 CHOICE connect smooth +the filtering operation to perform; options are: connect, smooth +ARGUMENT output 0 0 VARIOUS +the output: either a fixel data file, or a fixel directory (see Description) +OPTION matrix 0 0 +provide a fixel-fixel connectivity matrix for filtering operations that require it +ARGUMENT file 0 0 DIRIN +OPTION threshold_value 1 0 +specify a threshold for the input fixel data file values (default = 0.5) +ARGUMENT value 0 0 FLOAT -inf inf +OPTION threshold_connectivity 1 0 +specify a fixel-fixel connectivity threshold for connected-component analysis (default = 0.10000000000000001) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION fwhm 1 0 +the full-width half-maximum (FWHM) of the spatial component of the smoothing filter (default = 10mm) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION minweight 1 0 +apply a minimum threshold to smoothing weights (default = 0.01) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION mask 1 0 +only perform smoothing within a specified binary fixel mask +ARGUMENT image 0 0 IMAGEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fixelreorient b/interfaces/legacy/fixelreorient new file mode 100644 index 0000000000..f8837cba1b --- /dev/null +++ b/interfaces/legacy/fixelreorient @@ -0,0 +1,29 @@ +Reorient fixel directions +Reorientation is performed by transforming the vector representing the fixel direction with the Jacobian (local affine transform) computed at each voxel in the warp, then re-normalising the vector. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT fixel_in 0 0 DIRIN +the input fixel directory +ARGUMENT warp 0 0 IMAGEIN +a 4D deformation field used to perform reorientation. Reorientation is performed by applying the Jacobian affine transform in each voxel in the warp, then re-normalising the vector representing the fixel direction +ARGUMENT fixel_out 0 0 DIROUT +the output fixel directory. If the the input and output directories are the same, the existing directions file will be replaced (providing the -force option is supplied). If a new directory is supplied then the fixel directions and all other fixel data will be copied to the new directory. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fod2dec b/interfaces/legacy/fod2dec new file mode 100644 index 0000000000..67a1347071 --- /dev/null +++ b/interfaces/legacy/fod2dec @@ -0,0 +1,47 @@ +Generate FOD-based DEC maps, with optional panchromatic sharpening and/or luminance/perception correction +By default, the FOD-based DEC is weighted by the integral of the FOD. To weight by another scalar map, use the -contrast option. This option can also be used for panchromatic sharpening, e.g., by supplying a T1 (or other sensible) anatomical volume with a higher spatial resolution. +ARGUMENT input 0 0 IMAGEIN +The input FOD image (spherical harmonic coefficients). +ARGUMENT output 0 0 IMAGEOUT +The output DEC image (weighted RGB triplets). +OPTION mask 1 0 +Only perform DEC computation within the specified mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION contrast 1 0 +Weight the computed DEC map by the provided image contrast. If the contrast has a different image grid, the DEC map is first resliced and renormalised. To achieve panchromatic sharpening, provide an image with a higher spatial resolution than the input FOD image; e.g., a T1 anatomical volume. Only the DEC is subject to the mask, so as to allow for partial colouring of the contrast image. +Default when this option is *not* provided: integral of input FOD, subject to the same mask/threshold as used for DEC computation. +ARGUMENT image 0 0 IMAGEIN +OPTION lum 1 0 +Correct for luminance/perception, using default values Cr,Cg,Cb = 0.3,0.5,0.2 and gamma = 2.2 (*not* correcting is the theoretical equivalent of Cr,Cg,Cb = 1,1,1 and gamma = 2). +OPTION lum_coefs 1 0 +The coefficients Cr,Cg,Cb to correct for luminance/perception. +Note: this implicitly switches on luminance/perception correction, using a default gamma = 2.2 unless specified otherwise. +ARGUMENT values 0 0 FSEQ +OPTION lum_gamma 1 0 +The gamma value to correct for luminance/perception. +Note: this implicitly switches on luminance/perception correction, using a default Cr,Cg,Cb = 0.3,0.5,0.2 unless specified otherwise. +ARGUMENT value 0 0 FLOAT -inf inf +OPTION threshold 1 0 +FOD amplitudes below the threshold value are considered zero. +ARGUMENT value 0 0 FLOAT -inf inf +OPTION no_weight 1 0 +Do not weight the DEC map; just output the unweighted colours. Reslicing and renormalising of colours will still happen when providing the -contrast option as a template. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/fod2fixel b/interfaces/legacy/fod2fixel new file mode 100644 index 0000000000..fdf8644154 --- /dev/null +++ b/interfaces/legacy/fod2fixel @@ -0,0 +1,56 @@ +Perform segmentation of continuous Fibre Orientation Distributions (FODs) to produce discrete fixels +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT fod 0 0 IMAGEIN +the input fod image. +ARGUMENT fixel_directory 0 0 DIROUT +the output fixel directory +OPTION afd 1 0 +output the total Apparent Fibre Density per fixel (integral of FOD lobe) +ARGUMENT image 0 0 IMAGEOUT +OPTION peak_amp 1 0 +output the amplitude of the FOD at the maximal peak per fixel +ARGUMENT image 0 0 IMAGEOUT +OPTION disp 1 0 +output a measure of dispersion per fixel as the ratio between FOD lobe integral and maximal peak amplitude +ARGUMENT image 0 0 IMAGEOUT +OPTION fmls_integral 1 0 +threshold absolute numerical integral of positive FOD lobes. Any lobe for which the integral is smaller than this threshold will be discarded. Default: 0. +ARGUMENT value 0 0 FLOAT 0 inf +OPTION fmls_peak_value 1 0 +threshold peak amplitude of positive FOD lobes. Any lobe for which the maximal peak amplitude is smaller than this threshold will be discarded. Default: 0.1. +ARGUMENT value 0 0 FLOAT 0 inf +OPTION fmls_no_thresholds 1 0 +disable all FOD lobe thresholding; every lobe where the FOD is positive will be retained. +OPTION fmls_lobe_merge_ratio 1 0 +Specify the ratio between a given FOD amplitude sample between two lobes, and the smallest peak amplitude of the adjacent lobes, above which those lobes will be merged. This is the amplitude of the FOD at the 'bridge' point between the two lobes, divided by the peak amplitude of the smaller of the two adjoining lobes. A value of 1.0 will never merge two lobes into one; a value of 0.0 will always merge lobes unless they are bisected by a zero-valued crossing. Default: 1. +ARGUMENT value 0 0 FLOAT 0 1 +OPTION mask 1 0 +only perform computation within the specified binary brain mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION maxnum 1 0 +maximum number of fixels to output for any particular voxel (default: no limit) +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION nii 1 0 +output the directions and index file in nii format (instead of the default mif) +OPTION dirpeak 1 0 +define the fixel direction as that of the lobe's maximal peak as opposed to its weighted mean direction (the default) +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/for_each b/interfaces/legacy/for_each new file mode 100644 index 0000000000..8e55bfd5e3 --- /dev/null +++ b/interfaces/legacy/for_each @@ -0,0 +1,54 @@ +Perform some arbitrary processing step for each of a set of inputs +This script greatly simplifies various forms of batch processing by enabling the execution of a command (or set of commands) independently for each of a set of inputs. +More information on use of the for_each command can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/tips_and_tricks/batch_processing_with_foreach.html +The way that this batch processing capability is achieved is by providing basic text substitutions, which simplify the formation of valid command strings based on the unique components of the input strings on which the script is instructed to execute. This does however mean that the items to be passed as inputs to the for_each command (e.g. file / directory names) MUST NOT contain any instances of these substitution strings, as otherwise those paths will be corrupted during the course of the substitution. +The available substitutions are listed below (note that the -test command-line option can be used to ensure correct command string formation prior to actually executing the commands): + - IN: The full matching pattern, including leading folders. For example, if the target list contains a file "folder/image.mif", any occurrence of "IN" will be substituted with "folder/image.mif". + - NAME: The basename of the matching pattern. For example, if the target list contains a file "folder/image.mif", any occurrence of "NAME" will be substituted with "image.mif". + - PRE: The prefix of the input pattern (the basename stripped of its extension). For example, if the target list contains a file "folder/my.image.mif.gz", any occurrence of "PRE" will be substituted with "my.image". + - UNI: The unique part of the input after removing any common prefix and common suffix. For example, if the target list contains files: "folder/001dwi.mif", "folder/002dwi.mif", "folder/003dwi.mif", any occurrence of "UNI" will be substituted with "001", "002", "003". +Note that due to a limitation of the Python "argparse" module, any command-line OPTIONS that the user intends to provide specifically to the for_each script must appear BEFORE providing the list of inputs on which for_each is intended to operate. While command-line options provided as such will be interpreted specifically by the for_each script, any command-line options that are provided AFTER the COLON separator will form part of the executed COMMAND, and will therefore be interpreted as command-line options having been provided to that underlying command. +Demonstration of basic usage syntax: $ for_each folder/*.mif : mrinfo IN; This will run the "mrinfo" command for every .mif file present in "folder/". Note that the compulsory colon symbol is used to separate the list of items on which for_each is being instructed to operate, from the command that is intended to be run for each input. +Multi-threaded use of for_each: $ for_each -nthreads 4 freesurfer/subjects/* : recon-all -subjid NAME -all; In this example, for_each is instructed to run the FreeSurfer command "recon-all" for all subjects within the "subjects" directory, with four subjects being processed in parallel at any one time. Whenever processing of one subject is completed, processing for a new unprocessed subject will commence. This technique is useful for improving the efficiency of running single-threaded commands on multi-core systems, as long as the system possesses enough memory to support such parallel processing. Note that in the case of multi-threaded commands (which includes many MRtrix3 commands), it is generally preferable to permit multi-threaded execution of the command on a single input at a time, rather than processing multiple inputs in parallel. +Excluding specific inputs from execution: $ for_each *.nii -exclude 001.nii : mrconvert IN PRE.mif; Particularly when a wildcard is used to define the list of inputs for for_each, it is possible in some instances that this list will include one or more strings for which execution should in fact not be performed; for instance, if a command has already been executed for one or more files, and then for_each is being used to execute the same command for all other files. In this case, the -exclude option can be used to effectively remove an item from the list of inputs that would otherwise be included due to the use of a wildcard (and can be used more than once to exclude more than one string). In this particular example, mrconvert is instructed to perform conversions from NIfTI to MRtrix image formats, for all except the first image in the directory. Note that any usages of this option must appear AFTER the list of inputs. Note also that the argument following the -exclude option can alternatively be a regular expression, in which case any inputs for which a match to the expression is found will be excluded from processing. +Testing the command string substitution: $ for_each -test * : mrconvert IN PRE.mif; By specifying the -test option, the script will print to the terminal the results of text substitutions for all of the specified inputs, but will not actually execute those commands. It can therefore be used to verify that the script is receiving the intended set of inputs, and that the text substitutions on those inputs lead to the intended command strings. +ARGUMENT inputs 0 1 TEXT +Each of the inputs for which processing should be run +ARGUMENT colon 0 0 CHOICE : +Colon symbol (":") delimiting the for_each inputs & command-line options from the actual command to be executed +ARGUMENT command 0 0 TEXT +The command string to run for each input, containing any number of substitutions listed in the Description section +OPTION -exclude 1 0 +Exclude one specific input string / all strings matching a regular expression from being processed (see Example Usage) +ARGUMENT "regex" 0 0 TEXT +OPTION -test 1 0 +Test the operation of the for_each script, by printing the command strings following string substitution but not actually executing them +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/label2colour b/interfaces/legacy/label2colour new file mode 100644 index 0000000000..676a83a62e --- /dev/null +++ b/interfaces/legacy/label2colour @@ -0,0 +1,28 @@ +Convert a parcellated image (where values are node indices) into a colour image +Many software packages handle this colouring internally within their viewer program; this binary explicitly converts a parcellation image into a colour image that should be viewable in any software. +ARGUMENT nodes_in 0 0 IMAGEIN +the input node parcellation image +ARGUMENT colour_out 0 0 IMAGEOUT +the output colour image +OPTION lut 1 0 +Provide the relevant colour lookup table (if not provided, nodes will be coloured randomly) +ARGUMENT file 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/label2mesh b/interfaces/legacy/label2mesh new file mode 100644 index 0000000000..d01829ec64 --- /dev/null +++ b/interfaces/legacy/label2mesh @@ -0,0 +1,26 @@ +Generate meshes from a label image +ARGUMENT nodes_in 0 0 IMAGEIN +the input node parcellation image +ARGUMENT mesh_out 0 0 FILEOUT +the output mesh file +OPTION blocky 1 0 +generate 'blocky' meshes with precise delineation of voxel edges, rather than the default Marching Cubes approach +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/labelconvert b/interfaces/legacy/labelconvert new file mode 100644 index 0000000000..ef4dbb940d --- /dev/null +++ b/interfaces/legacy/labelconvert @@ -0,0 +1,35 @@ +Convert a connectome node image from one lookup table to another +Typical usage is to convert a parcellation image provided by some other software, based on the lookup table provided by that software, to conform to a new lookup table, particularly one where the node indices increment from 1, in preparation for connectome construction; examples of such target lookup table files are provided in share//mrtrix3//labelconvert//, but can be created by the user to provide the desired node set // ordering // colours. +A more thorough description of the operation and purpose of the labelconvert command can be found in the online documentation: +https://mrtrix.readthedocs.io/en/3.0.4/quantitative_structural_connectivity/labelconvert_tutorial.html +Convert a Desikan-Killiany parcellation image as provided by FreeSurfer to have nodes incrementing from 1: $ labelconvert aparc+aseg.mgz FreeSurferColorLUT.txt mrtrix3//share//mrtrix3//labelconvert//fs_default.txt nodes.mif Paths to the files in the example above would need to be revised according to their locations on the user's system. +ARGUMENT path_in 0 0 IMAGEIN +the input image +ARGUMENT lut_in 0 0 FILEIN +the connectome lookup table corresponding to the input image +ARGUMENT lut_out 0 0 FILEIN +the target connectome lookup table for the output image +ARGUMENT image_out 0 0 IMAGEOUT +the output image +OPTION spine 1 0 +provide a manually-defined segmentation of the base of the spine where the streamlines terminate, so that this can become a node in the connection matrix. +ARGUMENT image 0 0 IMAGEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/labelsgmfix b/interfaces/legacy/labelsgmfix new file mode 100644 index 0000000000..180dfb4501 --- /dev/null +++ b/interfaces/legacy/labelsgmfix @@ -0,0 +1,41 @@ +In a FreeSurfer parcellation image, replace the sub-cortical grey matter structure delineations using FSL FIRST +ARGUMENT parc 0 0 IMAGEIN +The input FreeSurfer parcellation image +ARGUMENT t1 0 0 IMAGEIN +The T1 image to be provided to FIRST +ARGUMENT lut 0 0 FILEIN +The lookup table file that the parcellated image is based on +ARGUMENT output 0 0 IMAGEOUT +The output parcellation image +OPTION -premasked 1 0 +Indicate that brain masking has been applied to the T1 input image +OPTION -sgm_amyg_hipp 1 0 +Consider the amygdalae and hippocampi as sub-cortical grey matter structures, and also replace their estimates with those from FIRST +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/labelstats b/interfaces/legacy/labelstats new file mode 100644 index 0000000000..ae224f975b --- /dev/null +++ b/interfaces/legacy/labelstats @@ -0,0 +1,27 @@ +Compute statistics of parcels within a label image +ARGUMENT input 0 0 IMAGEIN +the input label image +OPTION output 1 0 +output only the field specified; options are: mass,centre +ARGUMENT choice 0 0 CHOICE mass centre +OPTION voxelspace 1 0 +report parcel centres of mass in voxel space rather than scanner space +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mask2glass b/interfaces/legacy/mask2glass new file mode 100644 index 0000000000..bd7a76dc5c --- /dev/null +++ b/interfaces/legacy/mask2glass @@ -0,0 +1,44 @@ +Create a glass brain from mask input +The output of this command is a glass brain image, which can be viewed using the volume render option in mrview, and used for visualisation purposes to view results in 3D. +While the name of this script indicates that a binary mask image is required as input, it can also operate on a floating-point image. One way in which this can be exploited is to compute the mean of all subject masks within template space, in which case this script will produce a smoother result than if a binary template mask were to be used as input. +ARGUMENT input 0 0 IMAGEIN +The input mask image +ARGUMENT output 0 0 IMAGEOUT +The output glass brain image +OPTION -dilate 1 0 +Provide number of passes for dilation step; default = 2 +ARGUMENT dilate 0 0 INT 0 9223372036854775807 +OPTION -scale 1 0 +Provide resolution upscaling value; default = 2.0 +ARGUMENT scale 0 0 FLOAT 0.0 inf +OPTION -smooth 1 0 +Provide standard deviation of smoothing (in mm); default = 1.0 +ARGUMENT smooth 0 0 FLOAT 0.0 inf +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/maskdump b/interfaces/legacy/maskdump new file mode 100644 index 0000000000..ea09d086c6 --- /dev/null +++ b/interfaces/legacy/maskdump @@ -0,0 +1,25 @@ +Print out the locations of all non-zero voxels in a mask image +If no destination file is specified, the voxel locations will be printed to stdout. +ARGUMENT input 0 0 IMAGEIN +the input image. +ARGUMENT output 1 0 FILEOUT +the (optional) output text file. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/maskfilter b/interfaces/legacy/maskfilter new file mode 100644 index 0000000000..ccd6d7b51e --- /dev/null +++ b/interfaces/legacy/maskfilter @@ -0,0 +1,54 @@ +Perform filtering operations on 3D / 4D mask images +Many filters have their own unique set of optional parameters; see the option groups dedicated to each filter type. +ARGUMENT input 0 0 IMAGEIN +the input mask. +ARGUMENT filter 0 0 CHOICE clean connect dilate erode fill median +the name of the filter to be applied; options are: clean, connect, dilate, erode, fill, median +ARGUMENT output 0 0 IMAGEOUT +the output mask. +OPTION scale 1 0 +the maximum scale used to cut bridges. A certain maximum scale cuts bridges up to a width (in voxels) of 2x the provided scale. (Default: 2) +ARGUMENT value 0 0 INT 1 1000000 +OPTION axes 1 0 +specify which axes should be included in the connected components. By default only the first 3 axes are included. The axes should be provided as a comma-separated list of values. +ARGUMENT axes 0 0 ISEQ +OPTION largest 1 0 +only retain the largest connected component +OPTION connectivity 1 0 +use 26-voxel-neighbourhood connectivity (Default: 6) +OPTION minsize 1 0 +impose minimum size of segmented components (Default: select all components) +ARGUMENT value 0 0 INT 1 1000000 +OPTION npass 1 0 +the number of times to repeatedly apply the filter +ARGUMENT value 0 0 INT 1 1000000 +OPTION axes 1 0 +specify which axes should be included in the connected components. By default only the first 3 axes are included. The axes should be provided as a comma-separated list of values. +ARGUMENT axes 0 0 ISEQ +OPTION connectivity 1 0 +use 26-voxel-neighbourhood connectivity (Default: 6) +OPTION extent 1 0 +specify the extent (width) of kernel size in voxels. This can be specified either as a single value to be used for all axes, or as a comma-separated list of the extent for each axis. The default is 3x3x3. +ARGUMENT voxels 0 0 ISEQ +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mesh2voxel b/interfaces/legacy/mesh2voxel new file mode 100644 index 0000000000..8383a6f816 --- /dev/null +++ b/interfaces/legacy/mesh2voxel @@ -0,0 +1,26 @@ +Convert a mesh surface to a partial volume estimation image +ARGUMENT source 0 0 FILEIN +the mesh file; note vertices must be defined in realspace coordinates +ARGUMENT template 0 0 IMAGEIN +the template image +ARGUMENT output 0 0 IMAGEOUT +the output image +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/meshconvert b/interfaces/legacy/meshconvert new file mode 100644 index 0000000000..f125020615 --- /dev/null +++ b/interfaces/legacy/meshconvert @@ -0,0 +1,30 @@ +Convert meshes between different formats, and apply transformations +ARGUMENT input 0 0 FILEIN +the input mesh file +ARGUMENT output 0 0 FILEOUT +the output mesh file +OPTION binary 1 0 +write the output mesh file in binary format (if supported) +OPTION transform 1 0 +transform vertices from one coordinate space to another, based on a template image; options are: first2real, real2first, voxel2real, real2voxel, fs2real +ARGUMENT mode 0 0 CHOICE first2real real2first voxel2real real2voxel fs2real +ARGUMENT image 0 0 IMAGEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/meshfilter b/interfaces/legacy/meshfilter new file mode 100644 index 0000000000..5b2c0c755e --- /dev/null +++ b/interfaces/legacy/meshfilter @@ -0,0 +1,34 @@ +Apply filter operations to meshes +While this command has only one filter operation currently available, it nevertheless presents with a comparable interface to the MRtrix3 commands maskfilter and mrfilter commands. +Apply a mesh smoothing filter (currently the only filter available: $ meshfilter input.vtk smooth output.vtk The usage of this command may cause confusion due to the generic interface despite only one filtering operation being currently available. This simple example usage is therefore provided for clarity. +ARGUMENT input 0 0 FILEIN +the input mesh file +ARGUMENT filter 0 0 CHOICE smooth +the filter to apply.Options are: smooth +ARGUMENT output 0 0 FILEOUT +the output mesh file +OPTION smooth_spatial 1 0 +spatial extent of smoothing (default: 10mm) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION smooth_influence 1 0 +influence factor for smoothing (default: 10) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mraverageheader b/interfaces/legacy/mraverageheader new file mode 100644 index 0000000000..05d5440979 --- /dev/null +++ b/interfaces/legacy/mraverageheader @@ -0,0 +1,35 @@ +Calculate the average (unbiased) coordinate space of all input images +ARGUMENT input 0 1 IMAGEIN +the input image(s). +ARGUMENT output 0 0 IMAGEOUT +the output image +OPTION padding 1 0 + boundary box padding in voxels. Default: 0 +ARGUMENT value 0 0 FLOAT 0 inf +OPTION resolution 1 0 + subsampling of template compared to smallest voxel size in any input image. Valid options are 'mean': unbiased but loss of resolution for individual images possible, and 'max': smallest voxel size of any input image defines the resolution. Default: mean +ARGUMENT type 0 0 CHOICE max mean +OPTION fill 1 0 + set the intensity in the first volume of the average space to 1 +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrcalc b/interfaces/legacy/mrcalc new file mode 100644 index 0000000000..5eccf5b70c --- /dev/null +++ b/interfaces/legacy/mrcalc @@ -0,0 +1,134 @@ +Apply generic voxel-wise mathematical operations to images +This command will only compute per-voxel operations. Use 'mrmath' to compute summary statistics across images or along image axes. +This command uses a stack-based syntax, with operators (specified using options) operating on the top-most entries (i.e. images or values) in the stack. Operands (values or images) are pushed onto the stack in the order they appear (as arguments) on the command-line, and operators (specified as options) operate on and consume the top-most entries in the stack, and push their output as a new entry on the stack. +As an additional feature, this command will allow images with different dimensions to be processed, provided they satisfy the following conditions: for each axis, the dimensions match if they are the same size, or one of them has size one. In the latter case, the entire image will be replicated along that axis. This allows for example a 4D image of size [ X Y Z N ] to be added to a 3D image of size [ X Y Z ], as if it consisted of N copies of the 3D image along the 4th axis (the missing dimension is assumed to have size 1). Another example would a single-voxel 4D image of size [ 1 1 1 N ], multiplied by a 3D image of size [ X Y Z ], which would allow the creation of a 4D image where each volume consists of the 3D image scaled by the corresponding value for that volume in the single-voxel image. +Double the value stored in every voxel: $ mrcalc a.mif 2 -mult r.mif This performs the operation: r = 2*a for every voxel a,r in images a.mif and r.mif respectively. +A more complex example: $ mrcalc a.mif -neg b.mif -div -exp 9.3 -mult r.mif This performs the operation: r = 9.3*exp(-a/b) +Another complex example: $ mrcalc a.mif b.mif -add c.mif d.mif -mult 4.2 -add -div r.mif This performs: r = (a+b)/(c*d+4.2). +Rescale the densities in a SH l=0 image: $ mrcalc ODF_CSF.mif 4 pi -mult -sqrt -div ODF_CSF_scaled.mif This applies the spherical harmonic basis scaling factor: 1.0/sqrt(4*pi), such that a single-tissue voxel containing the same intensities as the response function of that tissue should contain the value 1.0. +ARGUMENT operand 0 1 VARIOUS +an input image, intensity value, or the special keywords 'rand' (random number between 0 and 1) or 'randn' (random number from unit std.dev. normal distribution) or the mathematical constants 'e' and 'pi'. +OPTION abs 1 1 +|%1| : return absolute value (magnitude) of real or complex number +OPTION neg 1 1 +-%1 : negative value +OPTION add 1 1 +(%1 + %2) : add values +OPTION subtract 1 1 +(%1 - %2) : subtract nth operand from (n-1)th +OPTION multiply 1 1 +(%1 * %2) : multiply values +OPTION divide 1 1 +(%1 / %2) : divide (n-1)th operand by nth +OPTION modulo 1 1 +(%1 % %2) : remainder after dividing (n-1)th operand by nth +OPTION min 1 1 +min (%1, %2) : smallest of last two operands +OPTION max 1 1 +max (%1, %2) : greatest of last two operands +OPTION lt 1 1 +(%1 < %2) : less-than operator (true=1, false=0) +OPTION gt 1 1 +(%1 > %2) : greater-than operator (true=1, false=0) +OPTION le 1 1 +(%1 <= %2) : less-than-or-equal-to operator (true=1, false=0) +OPTION ge 1 1 +(%1 >= %2) : greater-than-or-equal-to operator (true=1, false=0) +OPTION eq 1 1 +(%1 == %2) : equal-to operator (true=1, false=0) +OPTION neq 1 1 +(%1 != %2) : not-equal-to operator (true=1, false=0) +OPTION if 1 1 +(%1 ? %2 : %3) : if first operand is true (non-zero), return second operand, otherwise return third operand +OPTION replace 1 1 +(%1, %2 -> %3) : Wherever first operand is equal to the second operand, replace with third operand +OPTION sqrt 1 1 +sqrt (%1) : square root +OPTION pow 1 1 +%1^%2 : raise (n-1)th operand to nth power +OPTION round 1 1 +round (%1) : round to nearest integer +OPTION ceil 1 1 +ceil (%1) : round up to nearest integer +OPTION floor 1 1 +floor (%1) : round down to nearest integer +OPTION not 1 1 +!%1 : NOT operator: true (1) if operand is false (i.e. zero) +OPTION and 1 1 +(%1 && %2) : AND operator: true (1) if both operands are true (i.e. non-zero) +OPTION or 1 1 +(%1 || %2) : OR operator: true (1) if either operand is true (i.e. non-zero) +OPTION xor 1 1 +(%1 ^^ %2) : XOR operator: true (1) if only one of the operands is true (i.e. non-zero) +OPTION isnan 1 1 +isnan (%1) : true (1) if operand is not-a-number (NaN) +OPTION isinf 1 1 +isinf (%1) : true (1) if operand is infinite (Inf) +OPTION finite 1 1 +finite (%1) : true (1) if operand is finite (i.e. not NaN or Inf) +OPTION complex 1 1 +(%1 + %2 i) : create complex number using the last two operands as real,imaginary components +OPTION polar 1 1 +(%1 /_ %2) : create complex number using the last two operands as magnitude,phase components (phase in radians) +OPTION real 1 1 +real (%1) : real part of complex number +OPTION imag 1 1 +imag (%1) : imaginary part of complex number +OPTION phase 1 1 +phase (%1) : phase of complex number (use -abs for magnitude) +OPTION conj 1 1 +conj (%1) : complex conjugate +OPTION proj 1 1 +proj (%1) : projection onto the Riemann sphere +OPTION exp 1 1 +exp (%1) : exponential function +OPTION log 1 1 +log (%1) : natural logarithm +OPTION log10 1 1 +log10 (%1) : common logarithm +OPTION cos 1 1 +cos (%1) : cosine +OPTION sin 1 1 +sin (%1) : sine +OPTION tan 1 1 +tan (%1) : tangent +OPTION acos 1 1 +acos (%1) : inverse cosine +OPTION asin 1 1 +asin (%1) : inverse sine +OPTION atan 1 1 +atan (%1) : inverse tangent +OPTION cosh 1 1 +cosh (%1) : hyperbolic cosine +OPTION sinh 1 1 +sinh (%1) : hyperbolic sine +OPTION tanh 1 1 +tanh (%1) : hyperbolic tangent +OPTION acosh 1 1 +acosh (%1) : inverse hyperbolic cosine +OPTION asinh 1 1 +asinh (%1) : inverse hyperbolic sine +OPTION atanh 1 1 +atanh (%1) : inverse hyperbolic tangent +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrcat b/interfaces/legacy/mrcat new file mode 100644 index 0000000000..7da4fae6c8 --- /dev/null +++ b/interfaces/legacy/mrcat @@ -0,0 +1,33 @@ +Concatenate several images into one +Concatenate individual 3D volumes into a single 4D image series: $ mrcat volume*.mif series.mif The wildcard characters will find all images in the current working directory with names that begin with "volume" and end with ".mif"; the mrcat command will receive these as a list of input file names, from which it will produce a 4D image where the input volumes have been concatenated along axis 3 (the fourth axis; the spatial axes are 0, 1 & 2). +ARGUMENT image1 0 0 IMAGEIN +the first input image. +ARGUMENT image2 0 1 IMAGEIN +additional input image(s). +ARGUMENT output 0 0 IMAGEOUT +the output image. +OPTION axis 1 0 +specify axis along which concatenation should be performed. By default, the program will use the last non-singleton, non-spatial axis of any of the input images - in other words axis 3 or whichever axis (greater than 3) of the input images has size greater than one. +ARGUMENT axis 0 0 INT 0 9223372036854775807 +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrcentroid b/interfaces/legacy/mrcentroid new file mode 100644 index 0000000000..115306c4a1 --- /dev/null +++ b/interfaces/legacy/mrcentroid @@ -0,0 +1,27 @@ +Determine the centre of mass / centre of gravity of an image +ARGUMENT input 0 0 IMAGEIN +the input image +OPTION mask 1 0 +only include voxels within a mask in the calculation +ARGUMENT image 0 0 IMAGEIN +OPTION voxelspace 1 0 +report image centre of mass in voxel space rather than scanner space +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrcheckerboardmask b/interfaces/legacy/mrcheckerboardmask new file mode 100644 index 0000000000..5521000ca4 --- /dev/null +++ b/interfaces/legacy/mrcheckerboardmask @@ -0,0 +1,31 @@ +Create bitwise checkerboard image +ARGUMENT input 0 0 IMAGEIN +the input image to be used as a template. +ARGUMENT output 0 0 IMAGEOUT +the output binary image mask. +OPTION tiles 1 0 +specify the number of tiles in any direction +ARGUMENT value 0 0 INT -9223372036854775808 9223372036854775807 +OPTION invert 1 0 +invert output binary mask. +OPTION nan 1 0 +use NaN as the output zero value. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrclusterstats b/interfaces/legacy/mrclusterstats new file mode 100644 index 0000000000..cdc5297e47 --- /dev/null +++ b/interfaces/legacy/mrclusterstats @@ -0,0 +1,86 @@ +Voxel-based analysis using permutation testing and threshold-free cluster enhancement +In some software packages, a column of ones is automatically added to the GLM design matrix; the purpose of this column is to estimate the "global intercept", which is the predicted value of the observed variable if all explanatory variables were to be zero. However there are rare situations where including such a column would not be appropriate for a particular experimental design. Hence, in MRtrix3 statistical inference commands, it is up to the user to determine whether or not this column of ones should be included in their design matrix, and add it explicitly if necessary. The contrast matrix must also reflect the presence of this additional column. +ARGUMENT input 0 0 FILEIN +a text file containing the file names of the input images, one file per line +ARGUMENT design 0 0 FILEIN +the design matrix +ARGUMENT contrast 0 0 FILEIN +the contrast matrix +ARGUMENT mask 0 0 IMAGEIN +a mask used to define voxels included in the analysis. +ARGUMENT output 0 0 TEXT +the filename prefix for all output. +OPTION notest 1 0 +don't perform statistical inference; only output population statistics (effect size, stdev etc) +OPTION errors 1 0 +specify nature of errors for shuffling; options are: ee,ise,both (default: ee) +ARGUMENT spec 0 0 CHOICE ee ise both +OPTION exchange_within 1 0 +specify blocks of observations within each of which data may undergo restricted exchange +ARGUMENT file 0 0 FILEIN +OPTION exchange_whole 1 0 +specify blocks of observations that may be exchanged with one another (for independent and symmetric errors, sign-flipping will occur block-wise) +ARGUMENT file 0 0 FILEIN +OPTION strong 1 0 +use strong familywise error control across multiple hypotheses +OPTION nshuffles 1 0 +the number of shuffles (default: 5000) +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION permutations 1 0 +manually define the permutations (relabelling). The input should be a text file defining a m x n matrix, where each relabelling is defined as a column vector of size m, and the number of columns, n, defines the number of permutations. Can be generated with the palm_quickperms function in PALM (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM). Overrides the -nshuffles option. +ARGUMENT file 0 0 FILEIN +OPTION nonstationarity 1 0 +perform non-stationarity correction +OPTION skew_nonstationarity 1 0 +specify the skew parameter for empirical statistic calculation (default for this command is 1) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION nshuffles_nonstationarity 1 0 +the number of shuffles to use when precomputing the empirical statistic image for non-stationarity correction (default: 5000) +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION permutations_nonstationarity 1 0 +manually define the permutations (relabelling) for computing the emprical statistics for non-stationarity correction. The input should be a text file defining a m x n matrix, where each relabelling is defined as a column vector of size m, and the number of columns, n, defines the number of permutations. Can be generated with the palm_quickperms function in PALM (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM) Overrides the -nshuffles_nonstationarity option. +ARGUMENT file 0 0 FILEIN +OPTION tfce_dh 1 0 +the height increment used in the tfce integration (default: 0.1) +ARGUMENT value 0 0 FLOAT 1e-06 inf +OPTION tfce_e 1 0 +tfce extent exponent (default: 0.5) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION tfce_h 1 0 +tfce height exponent (default: 2) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION variance 1 0 +define variance groups for the G-statistic; measurements for which the expected variance is equivalent should contain the same index +ARGUMENT file 0 0 FILEIN +OPTION ftests 1 0 +perform F-tests; input text file should contain, for each F-test, a row containing ones and zeros, where ones indicate the rows of the contrast matrix to be included in the F-test. +ARGUMENT path 0 0 FILEIN +OPTION fonly 1 0 +only assess F-tests; do not perform statistical inference on entries in the contrast matrix +OPTION column 1 1 +add a column to the design matrix corresponding to subject voxel-wise values (note that the contrast matrix must include an additional column for each use of this option); the text file provided via this option should contain a file name for each subject +ARGUMENT path 0 0 FILEIN +OPTION threshold 1 0 +the cluster-forming threshold to use for a standard cluster-based analysis. This disables TFCE, which is the default otherwise. +ARGUMENT value 0 0 FLOAT 1e-06 inf +OPTION connectivity 1 0 +use 26-voxel-neighbourhood connectivity (Default: 6) +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrcolour b/interfaces/legacy/mrcolour new file mode 100644 index 0000000000..19613d9d22 --- /dev/null +++ b/interfaces/legacy/mrcolour @@ -0,0 +1,37 @@ +Apply a colour map to an image +Under typical usage, this command will receive as input ad 3D greyscale image, and output a 4D image with 3 volumes corresponding to red-green-blue components; other use cases are possible, and are described in more detail below. +By default, the command will automatically determine the maximum and minimum intensities of the input image, and use that information to set the upper and lower bounds of the applied colourmap. This behaviour can be overridden by manually specifying these bounds using the -upper and -lower options respectively. +ARGUMENT input 0 0 IMAGEIN +the input image +ARGUMENT map 0 0 CHOICE gray hot cool jet inferno viridis pet colour rgb +the colourmap to apply; choices are: gray,hot,cool,jet,inferno,viridis,pet,colour,rgb +ARGUMENT output 0 0 IMAGEOUT +the output image +OPTION upper 1 0 +manually set the upper intensity of the colour mapping +ARGUMENT value 0 0 FLOAT -inf inf +OPTION lower 1 0 +manually set the lower intensity of the colour mapping +ARGUMENT value 0 0 FLOAT -inf inf +OPTION colour 1 0 +set the target colour for use of the 'colour' map (three comma-separated floating-point values) +ARGUMENT values 0 0 FSEQ +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrconvert b/interfaces/legacy/mrconvert new file mode 100644 index 0000000000..cb00829ddd --- /dev/null +++ b/interfaces/legacy/mrconvert @@ -0,0 +1,109 @@ +Perform conversion between different file types and optionally extract a subset of the input image +If used correctly, this program can be a very useful workhorse. In addition to converting images between different formats, it can be used to extract specific studies from a data set, extract a specific region of interest, or flip the images. Some of the possible operations are described in more detail below. +Note that for both the -coord and -axes options, indexing starts from 0 rather than 1. E.g. -coord 3 <#> selects volumes (the fourth dimension) from the series; -axes 0,1,2 includes only the three spatial axes in the output image. +Additionally, for the second input to the -coord option and the -axes option, you can use any valid number sequence in the selection, as well as the 'end' keyword (see the main documentation for details); this can be particularly useful to select multiple coordinates. +The -vox option is used to change the size of the voxels in the output image as reported in the image header; note however that this does not re-sample the image based on a new voxel size (that is done using the mrgrid command). +By default, the intensity scaling parameters in the input image header are passed through to the output image header when writing to an integer image, and reset to 0,1 (i.e. no scaling) for floating-point and binary images. Note that the -scaling option will therefore have no effect for floating-point or binary output images. +The -axes option specifies which axes from the input image will be used to form the output image. This allows the permutation, omission, or addition of axes into the output image. The axes should be supplied as a comma-separated list of axis indices. If an axis from the input image is to be omitted from the output image, it must either already have a size of 1, or a single coordinate along that axis must be selected by the user by using the -coord option. Examples are provided further below. +The -bvalue_scaling option controls an aspect of the import of diffusion gradient tables. When the input diffusion-weighting direction vectors have norms that differ substantially from unity, the b-values will be scaled by the square of their corresponding vector norm (this is how multi-shell acquisitions are frequently achieved on scanner platforms). However in some rare instances, the b-values may be correct, despite the vectors not being of unit norm (or conversely, the b-values may need to be rescaled even though the vectors are close to unit norm). This option allows the user to control this operation and override MRrtix3's automatic detection. +Extract the first volume from a 4D image, and make the output a 3D image: $ mrconvert in.mif -coord 3 0 -axes 0,1,2 out.mif The -coord 3 0 option extracts, from axis number 3 (which is the fourth axis since counting begins from 0; this is the axis that steps across image volumes), only coordinate number 0 (i.e. the first volume). The -axes 0,1,2 ensures that only the first three axes (i.e. the spatial axes) are retained; if this option were not used in this example, then image out.mif would be a 4D image, but it would only consist of a single volume, and mrinfo would report its size along the fourth axis as 1. +Extract slice number 24 along the AP direction: $ mrconvert volume.mif slice.mif -coord 1 24 MRtrix3 uses a RAS (Right-Anterior-Superior) axis convention, and internally reorients images upon loading in order to conform to this as far as possible. So for non-exotic data, axis 1 should correspond (approximately) to the anterior-posterior direction. +Extract only every other volume from a 4D image: $ mrconvert all.mif every_other.mif -coord 3 1:2:end This example demonstrates two features: Use of the colon syntax to conveniently specify a number sequence (in the format 'start:step:stop'); and use of the 'end' keyword to generate this sequence up to the size of the input image along that axis (i.e. the number of volumes). +Alter the image header to report a new isotropic voxel size: $ mrconvert in.mif isotropic.mif -vox 1.25 By providing a single value to the -vox option only, the specified value is used to set the voxel size in mm for all three spatial axes in the output image. +Alter the image header to report a new anisotropic voxel size: $ mrconvert in.mif anisotropic.mif -vox 1,,3.5 This example will change the reported voxel size along the first and third axes (ideally left-right and inferior-superior) to 1.0mm and 3.5mm respectively, and leave the voxel size along the second axis (ideally anterior-posterior) unchanged. +Turn a single-volume 4D image into a 3D image: $ mrconvert 4D.mif 3D.mif -axes 0,1,2 Sometimes in the process of extracting or calculating a single 3D volume from a 4D image series, the size of the image reported by mrinfo will be "X x Y x Z x 1", indicating that the resulting image is in fact also 4D, it just happens to contain only one volume. This example demonstrates how to convert this into a genuine 3D image (i.e. mrinfo will report the size as "X x Y x Z". +Insert an axis of size 1 into the image: $ mrconvert XYZD.mif XYZ1D.mif -axes 0,1,2,-1,3 This example uses the value -1 as a flag to indicate to mrconvert where a new axis of unity size is to be inserted. In this particular example, the input image has four axes: the spatial axes X, Y and Z, and some form of data D is stored across the fourth axis (i.e. volumes). Due to insertion of a new axis, the output image is 5D: the three spatial axes (XYZ), a single volume (the size of the output image along the fourth axis will be 1), and data D will be stored as volume groups along the fifth axis of the image. +Manually reset the data scaling parameters stored within the image header to defaults: $ mrconvert with_scaling.mif without_scaling.mif -scaling 0.0,1.0 This command-line option alters the parameters stored within the image header that provide a linear mapping from raw intensity values stored in the image data to some other scale. Where the raw data stored in a particular voxel is I, the value within that voxel is interpreted as: value = offset + (scale x I). To adjust this scaling, the relevant parameters must be provided as a comma-separated 2-vector of floating-point values, in the format "offset,scale" (no quotation marks). This particular example sets the offset to zero and the scale to one, which equates to no rescaling of the raw intensity data. +ARGUMENT input 0 0 IMAGEIN +the input image. +ARGUMENT output 0 0 IMAGEOUT +the output image. +OPTION coord 1 1 +retain data from the input image only at the coordinates specified in the selection along the specified axis. The selection argument expects a number sequence, which can also include the 'end' keyword. +ARGUMENT axis 0 0 INT 0 9223372036854775807 +ARGUMENT selection 0 0 ISEQ +OPTION vox 1 0 +change the voxel dimensions reported in the output image header +ARGUMENT sizes 0 0 FSEQ +OPTION axes 1 0 +specify the axes from the input image that will be used to form the output image +ARGUMENT axes 0 0 ISEQ +OPTION scaling 1 0 +specify the data scaling parameters used to rescale the intensity values +ARGUMENT values 0 0 FSEQ +OPTION json_import 1 0 +import data from a JSON file into header key-value pairs +ARGUMENT file 0 0 FILEIN +OPTION json_export 1 0 +export data from an image header key-value pairs into a JSON file +ARGUMENT file 0 0 FILEOUT +OPTION clear_property 1 1 +remove the specified key from the image header altogether. +ARGUMENT key 0 0 TEXT +OPTION set_property 1 1 +set the value of the specified key in the image header. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION append_property 1 1 +append the given value to the specified key in the image header (this adds the value specified as a new line in the header value). +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION copy_properties 1 0 +clear all generic properties and replace with the properties from the image / file specified. +ARGUMENT source 0 0 VARIOUS +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION bvalue_scaling 1 0 +enable or disable scaling of diffusion b-values by the square of the corresponding DW gradient norm (see Desciption). Valid choices are yes/no, true/false, 0/1 (default: automatic). +ARGUMENT mode 0 0 +OPTION export_grad_mrtrix 1 0 +export the diffusion-weighted gradient table to file in MRtrix format +ARGUMENT path 0 0 FILEOUT +OPTION export_grad_fsl 1 0 +export the diffusion-weighted gradient table to files in FSL (bvecs / bvals) format +ARGUMENT bvecs_path 0 0 FILEOUT +ARGUMENT bvals_path 0 0 FILEOUT +OPTION import_pe_table 1 0 +import a phase-encoding table from file +ARGUMENT file 0 0 FILEIN +OPTION import_pe_eddy 1 0 +import phase-encoding information from an EDDY-style config / index file pair +ARGUMENT config 0 0 FILEIN +ARGUMENT indices 0 0 FILEIN +OPTION export_pe_table 1 0 +export phase-encoding table to file +ARGUMENT file 0 0 FILEOUT +OPTION export_pe_eddy 1 0 +export phase-encoding information to an EDDY-style config / index file pair +ARGUMENT config 0 0 FILEOUT +ARGUMENT indices 0 0 FILEOUT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrdegibbs b/interfaces/legacy/mrdegibbs new file mode 100644 index 0000000000..2feb1dbd2b --- /dev/null +++ b/interfaces/legacy/mrdegibbs @@ -0,0 +1,45 @@ +Remove Gibbs Ringing Artifacts +This application attempts to remove Gibbs ringing artefacts from MRI images using the method of local subvoxel-shifts proposed by Kellner et al. (see reference below for details). By default, the original 2D slice-wise version is used. If the -mode 3d option is provided, the program will run the 3D version as proposed by Bautista et al. (also in the reference list below). +This command is designed to run on data directly after it has been reconstructed by the scanner, before any interpolation of any kind has taken place. You should not run this command after any form of motion correction (e.g. not after dwifslpreproc). Similarly, if you intend running dwidenoise, you should run denoising before this command to not alter the noise structure, which would impact on dwidenoise's performance. +Note that this method is designed to work on images acquired with full k-space coverage. Running this method on partial Fourier ('half-scan') or filtered data may not remove all ringing artefacts. Users are encouraged to acquired full-Fourier data where possible, and disable any form of filtering on the scanner. +ARGUMENT in 0 0 IMAGEIN +the input image. +ARGUMENT out 0 0 IMAGEOUT +the output image. +OPTION mode 1 0 +specify the mode of operation. Valid choices are: 2d, 3d (default: 2d). The 2d mode corresponds to the original slice-wise approach as propoosed by Kellner et al., appropriate for images acquired using 2D muli-slice approaches. The 3d mode corresponds to the 3D volume-wise extension proposed by Bautista et al., which is appropriate for images acquired using 3D Fourier encoding. +ARGUMENT type 0 0 CHOICE 2d 3d +OPTION axes 1 0 +select the slice axes (default: 0,1 - i.e. x-y). Select all 3 spatial axes for 3D operation, i.e. 0:2 or 0,1,2 (this is equivalent to '-mode 3d'). +ARGUMENT list 0 0 ISEQ +OPTION nshifts 1 0 +discretization of subpixel spacing (default: 20). +ARGUMENT value 0 0 INT 8 128 +OPTION minW 1 0 +left border of window used for TV computation (default: 1). +ARGUMENT value 0 0 INT 0 10 +OPTION maxW 1 0 +right border of window used for TV computation (default: 3). +ARGUMENT value 0 0 INT 0 128 +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrdump b/interfaces/legacy/mrdump new file mode 100644 index 0000000000..1b8eda9868 --- /dev/null +++ b/interfaces/legacy/mrdump @@ -0,0 +1,28 @@ +Print out the values within an image +If no destination file is specified, the voxel locations will be printed to stdout. +ARGUMENT input 0 0 IMAGEIN +the input image. +ARGUMENT output 1 0 FILEOUT +the (optional) output text file. +OPTION mask 1 0 +only write the image values within voxels specified by a mask image +ARGUMENT image 0 0 IMAGEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mredit b/interfaces/legacy/mredit new file mode 100644 index 0000000000..8ba77223fc --- /dev/null +++ b/interfaces/legacy/mredit @@ -0,0 +1,41 @@ +Directly edit the intensities within an image from the command-line +A range of options are provided to enable direct editing of voxel intensities based on voxel / real-space coordinates. If only one image path is provided, the image will be edited in-place (use at own risk); if input and output image paths are provided, the output will contain the edited image, and the original image will not be modified in any way. +ARGUMENT input 0 0 IMAGEIN +the input image +ARGUMENT output 1 0 IMAGEOUT +the (optional) output image +OPTION plane 1 1 +fill one or more planes on a particular image axis +ARGUMENT axis 0 0 INT 0 2 +ARGUMENT coord 0 0 ISEQ +ARGUMENT value 0 0 FLOAT -inf inf +OPTION sphere 1 1 +draw a sphere with radius in mm +ARGUMENT position 0 0 FSEQ +ARGUMENT radius 0 0 FLOAT -inf inf +ARGUMENT value 0 0 FLOAT -inf inf +OPTION voxel 1 1 +change the image value within a single voxel +ARGUMENT position 0 0 FSEQ +ARGUMENT value 0 0 FLOAT -inf inf +OPTION scanner 1 0 +indicate that coordinates are specified in scanner space, rather than as voxel coordinates +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrfilter b/interfaces/legacy/mrfilter new file mode 100644 index 0000000000..4fb74fcd9b --- /dev/null +++ b/interfaces/legacy/mrfilter @@ -0,0 +1,80 @@ +Perform filtering operations on 3D / 4D MR images +The available filters are: fft, gradient, median, smooth, normalise, zclean. +Each filter has its own unique set of optional parameters. +For 4D images, each 3D volume is processed independently. +ARGUMENT input 0 0 IMAGEIN +the input image. +ARGUMENT filter 0 0 CHOICE fft gradient median smooth normalise zclean +the type of filter to be applied +ARGUMENT output 0 0 IMAGEOUT +the output image. +OPTION axes 1 0 +the axes along which to apply the Fourier Transform. By default, the transform is applied along the three spatial axes. Provide as a comma-separate list of axis indices. +ARGUMENT list 0 0 ISEQ +OPTION inverse 1 0 +apply the inverse FFT +OPTION magnitude 1 0 +output a magnitude image rather than a complex-valued image +OPTION rescale 1 0 +rescale values so that inverse FFT recovers original values +OPTION centre_zero 1 0 +re-arrange the FFT results so that the zero-frequency component appears in the centre of the image, rather than at the edges +OPTION stdev 1 0 +the standard deviation of the Gaussian kernel used to smooth the input image (in mm). The image is smoothed to reduced large spurious gradients caused by noise. Use this option to override the default stdev of 1 voxel. This can be specified either as a single value to be used for all 3 axes, or as a comma-separated list of 3 values, one for each axis. +ARGUMENT sigma 0 0 FSEQ +OPTION magnitude 1 0 +output the gradient magnitude, rather than the default x,y,z components +OPTION scanner 1 0 +define the gradient with respect to the scanner coordinate frame of reference. +OPTION extent 1 0 +specify extent of median filtering neighbourhood in voxels. This can be specified either as a single value to be used for all 3 axes, or as a comma-separated list of 3 values, one for each axis (default: 3x3x3). +ARGUMENT size 0 0 ISEQ +OPTION extent 1 0 +specify extent of normalisation filtering neighbourhood in voxels. This can be specified either as a single value to be used for all 3 axes, or as a comma-separated list of 3 values, one for each axis (default: 3x3x3). +ARGUMENT size 0 0 ISEQ +OPTION stdev 1 0 +apply Gaussian smoothing with the specified standard deviation. The standard deviation is defined in mm (Default 1 voxel). This can be specified either as a single value to be used for all axes, or as a comma-separated list of the stdev for each axis. +ARGUMENT mm 0 0 FSEQ +OPTION fwhm 1 0 +apply Gaussian smoothing with the specified full-width half maximum. The FWHM is defined in mm (Default 1 voxel * 2.3548). This can be specified either as a single value to be used for all axes, or as a comma-separated list of the FWHM for each axis. +ARGUMENT mm 0 0 FSEQ +OPTION extent 1 0 +specify the extent (width) of kernel size in voxels. This can be specified either as a single value to be used for all axes, or as a comma-separated list of the extent for each axis. The default extent is 2 * ceil(2.5 * stdev / voxel_size) - 1. +ARGUMENT voxels 0 0 ISEQ +OPTION zupper 1 0 +define high intensity outliers: default: 2.5 +ARGUMENT num 0 0 FLOAT 0.1 inf +OPTION zlower 1 0 +define low intensity outliers: default: 2.5 +ARGUMENT num 0 0 FLOAT 0.1 inf +OPTION bridge 1 0 +number of voxels to gap to fill holes in mask: default: 4 +ARGUMENT num 0 0 INT 0 9223372036854775807 +OPTION maskin 1 0 +initial mask that defines the maximum spatial extent and the region from which to smaple the intensity range. +ARGUMENT image 0 0 IMAGEIN +OPTION maskout 1 0 +Output a refined mask based on a spatially coherent region with normal intensity range. +ARGUMENT image 0 0 IMAGEOUT +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrgrid b/interfaces/legacy/mrgrid new file mode 100644 index 0000000000..5970a57ee5 --- /dev/null +++ b/interfaces/legacy/mrgrid @@ -0,0 +1,78 @@ +Modify the grid of an image without interpolation (cropping or padding) or by regridding to an image grid with modified orientation, location and or resolution. The image content remains in place in real world coordinates. +- regrid: This operation performs changes of the voxel grid that require interpolation of the image such as changing the resolution or location and orientation of the voxel grid. If the image is down-sampled, the appropriate smoothing is automatically applied using Gaussian smoothing unless nearest neighbour interpolation is selected or oversample is changed explicitly. The resolution can only be changed for spatial dimensions. +- crop: The image extent after cropping, can be specified either manually for each axis dimensions, or via a mask or reference image. The image can be cropped to the extent of a mask. This is useful for axially-acquired brain images, where the image size can be reduced by a factor of 2 by removing the empty space on either side of the brain. Note that cropping does not extend the image beyond the original FOV unless explicitly specified (via -crop_unbound or negative -axis extent). +- pad: Analogously to cropping, padding increases the FOV of an image without image interpolation. Pad and crop can be performed simultaneously by specifying signed specifier argument values to the -axis option. +This command encapsulates and extends the functionality of the superseded commands 'mrpad', 'mrcrop' and 'mrresize'. Note the difference in -axis convention used for 'mrcrop' and 'mrpad' (see -axis option description). +Crop and pad the first axis: $ mrgrid in.mif crop -axis 0 10,-5 out.mif This removes 10 voxels on the lower and pads with 5 on the upper bound, which is equivalent to padding with the negated specifier (mrgrid in.mif pad -axis 0 -10,5 out.mif). +Right-pad the image to the number of voxels of a reference image: $ mrgrid in.mif pad -as ref.mif -all_axes -axis 3 0,0 out.mif -fill nan This pads the image on the upper bound of all axes except for the volume dimension. The headers of in.mif and ref.mif are ignored and the output image uses NAN values to fill in voxels outside the original range of in.mif. +Regrid and interpolate to match the voxel grid of a reference image: $ mrgrid in.mif regrid -template ref.mif -scale 1,1,0.5 out.mif -fill nan The -template instructs to regrid in.mif to match the voxel grid of ref.mif (voxel size, grid orientation and voxel centres). The -scale option overwrites the voxel scaling factor yielding voxel sizes in the third dimension that are twice as coarse as those of the template image. +ARGUMENT input 0 0 IMAGEIN +input image to be regridded. +ARGUMENT operation 0 0 CHOICE regrid crop pad +the operation to be performed, one of: regrid, crop, pad. +ARGUMENT output 0 0 IMAGEOUT +the output image. +OPTION template 1 0 +match the input image grid (voxel spacing, image size, header transformation) to that of a reference image. The image resolution relative to the template image can be changed with one of -size, -voxel, -scale. +ARGUMENT image 0 0 IMAGEIN +OPTION size 1 0 +define the size (number of voxels) in each spatial dimension for the output image. This should be specified as a comma-separated list. +ARGUMENT dims 0 0 ISEQ +OPTION voxel 1 0 +define the new voxel size for the output image. This can be specified either as a single value to be used for all spatial dimensions, or as a comma-separated list of the size for each voxel dimension. +ARGUMENT size 0 0 FSEQ +OPTION scale 1 0 +scale the image resolution by the supplied factor. This can be specified either as a single value to be used for all dimensions, or as a comma-separated list of scale factors for each dimension. +ARGUMENT factor 0 0 FSEQ +OPTION interp 1 0 +set the interpolation method to use when reslicing (choices: nearest, linear, cubic, sinc. Default: cubic). +ARGUMENT method 0 0 CHOICE nearest linear cubic sinc +OPTION oversample 1 0 +set the amount of over-sampling (in the target space) to perform when regridding. This is particularly relevant when downsamping a high-resolution image to a low-resolution image, to avoid aliasing artefacts. This can consist of a single integer, or a comma-separated list of 3 integers if different oversampling factors are desired along the different axes. Default is determined from ratio of voxel dimensions (disabled for nearest-neighbour interpolation). +ARGUMENT factor 0 0 ISEQ +OPTION as 1 0 +pad or crop the input image on the upper bound to match the specified reference image grid. This operation ignores differences in image transformation between input and reference image. +ARGUMENT reference image 0 0 IMAGEIN +OPTION uniform 1 0 +pad or crop the input image by a uniform number of voxels on all sides +ARGUMENT number 0 0 INT -9223372036854775808 9223372036854775807 +OPTION mask 1 0 +crop the input image according to the spatial extent of a mask image. The mask must share a common voxel grid with the input image but differences in image transformations are ignored. Note that even though only 3 dimensions are cropped when using a mask, the bounds are computed by checking the extent for all dimensions. Note that by default a gap of 1 voxel is left at all edges of the image to allow valid trilinear interpolation. This gap can be modified with the -uniform option but by default it does not extend beyond the FOV unless -crop_unbound is used. +ARGUMENT image 0 0 IMAGEIN +the mask image. +OPTION crop_unbound 1 0 +Allow padding beyond the original FOV when cropping. +OPTION axis 1 1 +pad or crop the input image along the provided axis (defined by index). The specifier argument defines the number of voxels added or removed on the lower or upper end of the axis (-axis index delta_lower,delta_upper) or acts as a voxel selection range (-axis index start:stop). In both modes, values are relative to the input image (overriding all other extent-specifying options). Negative delta specifier values trigger the inverse operation (pad instead of crop and vice versa) and negative range specifier trigger padding. Note that the deprecated commands 'mrcrop' and 'mrpad' used range-based and delta-based -axis indices, respectively. +ARGUMENT index 0 0 INT 0 9223372036854775807 +ARGUMENT spec 0 0 TEXT +OPTION all_axes 1 0 +Crop or pad all, not just spatial axes. +OPTION fill 1 0 +Use number as the out of bounds value. nan, inf and -inf are valid arguments. (Default: 0.0) +ARGUMENT number 0 0 FLOAT -inf inf +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrhistmatch b/interfaces/legacy/mrhistmatch new file mode 100644 index 0000000000..f579b93094 --- /dev/null +++ b/interfaces/legacy/mrhistmatch @@ -0,0 +1,37 @@ +Modify the intensities of one image to match the histogram of another +ARGUMENT type 0 0 CHOICE scale linear nonlinear +type of histogram matching to perform; options are: scale,linear,nonlinear +ARGUMENT input 0 0 IMAGEIN +the input image to be modified +ARGUMENT target 0 0 IMAGEIN +the input image from which to derive the target histogram +ARGUMENT output 0 0 IMAGEOUT +the output image +OPTION mask_input 1 0 +only generate input histogram based on a specified binary mask image +ARGUMENT image 0 0 IMAGEIN +OPTION mask_target 1 0 +only generate target histogram based on a specified binary mask image +ARGUMENT image 0 0 IMAGEIN +OPTION bins 1 0 +the number of bins to use to generate the histograms +ARGUMENT num 0 0 INT 2 9223372036854775807 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrhistogram b/interfaces/legacy/mrhistogram new file mode 100644 index 0000000000..cddca96aa2 --- /dev/null +++ b/interfaces/legacy/mrhistogram @@ -0,0 +1,37 @@ +Generate a histogram of image intensities +ARGUMENT image 0 0 IMAGEIN +the input image from which the histogram will be computed +ARGUMENT hist 0 0 FILEOUT +the output histogram file +OPTION bins 1 0 +Manually set the number of bins to use to generate the histogram. +ARGUMENT num 0 0 INT 2 9223372036854775807 +OPTION template 1 0 +Use an existing histogram file as the template for histogram formation +ARGUMENT file 0 0 FILEIN +OPTION mask 1 0 +Calculate the histogram only within a mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION ignorezero 1 0 +ignore zero-valued data during histogram construction. +OPTION allvolumes 1 0 +generate one histogram across all image volumes, rather than one per image volume +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrinfo b/interfaces/legacy/mrinfo new file mode 100644 index 0000000000..e56778919a --- /dev/null +++ b/interfaces/legacy/mrinfo @@ -0,0 +1,94 @@ +Display image header information, or extract specific information from the header +By default, all information contained in each image header will be printed to the console in a reader-friendly format. +Alternatively, command-line options may be used to extract specific details from the header(s); these are printed to the console in a format more appropriate for scripting purposes or piping to file. If multiple options and/or images are provided, the requested header fields will be printed in the order in which they appear in the help page, with all requested details from each input image in sequence printed before the next image is processed. +The command can also write the diffusion gradient table from a single input image to file; either in the MRtrix or FSL format (bvecs/bvals file pair; includes appropriate diffusion gradient vector reorientation) +The -dwgrad, -export_* and -shell_* options provide (information about) the diffusion weighting gradient table after it has been processed by the MRtrix3 back-end (vectors normalised, b-values scaled by the square of the vector norm, depending on the -bvalue_scaling option). To see the raw gradient table information as stored in the image header, i.e. without MRtrix3 back-end processing, use "-property dw_scheme". +The -bvalue_scaling option controls an aspect of the import of diffusion gradient tables. When the input diffusion-weighting direction vectors have norms that differ substantially from unity, the b-values will be scaled by the square of their corresponding vector norm (this is how multi-shell acquisitions are frequently achieved on scanner platforms). However in some rare instances, the b-values may be correct, despite the vectors not being of unit norm (or conversely, the b-values may need to be rescaled even though the vectors are close to unit norm). This option allows the user to control this operation and override MRrtix3's automatic detection. +ARGUMENT image 0 1 IMAGEIN +the input image(s). +OPTION all 1 0 +print all properties, rather than the first and last 2 of each. +OPTION name 1 0 +print the file system path of the image +OPTION format 1 0 +image file format +OPTION ndim 1 0 +number of image dimensions +OPTION size 1 0 +image size along each axis +OPTION spacing 1 0 +voxel spacing along each image dimension +OPTION datatype 1 0 +data type used for image data storage +OPTION strides 1 0 +data strides i.e. order and direction of axes data layout +OPTION offset 1 0 +image intensity offset +OPTION multiplier 1 0 +image intensity multiplier +OPTION transform 1 0 +the transformation from image coordinates [mm] to scanner / real world coordinates [mm] +OPTION property 1 1 +any text properties embedded in the image header under the specified key (use 'all' to list all keys found) +ARGUMENT key 0 0 TEXT +OPTION json_keyval 1 0 +export header key/value entries to a JSON file +ARGUMENT file 0 0 FILEOUT +OPTION json_all 1 0 +export all header contents to a JSON file +ARGUMENT file 0 0 FILEOUT +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION bvalue_scaling 1 0 +enable or disable scaling of diffusion b-values by the square of the corresponding DW gradient norm (see Desciption). Valid choices are yes/no, true/false, 0/1 (default: automatic). +ARGUMENT mode 0 0 +OPTION export_grad_mrtrix 1 0 +export the diffusion-weighted gradient table to file in MRtrix format +ARGUMENT path 0 0 FILEOUT +OPTION export_grad_fsl 1 0 +export the diffusion-weighted gradient table to files in FSL (bvecs / bvals) format +ARGUMENT bvecs_path 0 0 FILEOUT +ARGUMENT bvals_path 0 0 FILEOUT +OPTION dwgrad 1 0 +the diffusion-weighting gradient table, as interpreted by MRtrix3 +OPTION shell_bvalues 1 0 +list the average b-value of each shell +OPTION shell_sizes 1 0 +list the number of volumes in each shell +OPTION shell_indices 1 0 +list the image volumes attributed to each b-value shell +OPTION export_pe_table 1 0 +export phase-encoding table to file +ARGUMENT file 0 0 FILEOUT +OPTION export_pe_eddy 1 0 +export phase-encoding information to an EDDY-style config / index file pair +ARGUMENT config 0 0 FILEOUT +ARGUMENT indices 0 0 FILEOUT +OPTION petable 1 0 +print the phase encoding table +OPTION nodelete 1 0 +don't delete temporary images or images passed to mrinfo via Unix pipes +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrmath b/interfaces/legacy/mrmath new file mode 100644 index 0000000000..9336724471 --- /dev/null +++ b/interfaces/legacy/mrmath @@ -0,0 +1,39 @@ +Compute summary statistic on image intensities either across images, or along a specified axis of a single image +Supported operations are: +mean, median, sum, product, rms (root-mean-square value), norm (vector 2-norm), var (unbiased variance), std (unbiased standard deviation), min, max, absmax (maximum absolute value), magmax (value with maximum absolute value, preserving its sign). +This command is used to traverse either along an image axis, or across a set of input images, calculating some statistic from the values along each traversal. If you are seeking to instead perform mathematical calculations that are done independently for each voxel, pleaase see the 'mrcalc' command. +Calculate a 3D volume representing the mean intensity across a 4D image series: $ mrmath 4D.mif mean 3D_mean.mif -axis 3 This is a common operation for calculating e.g. the mean value within a specific DWI b-value. Note that axis indices start from 0; thus, axes 0, 1 & 2 are the three spatial axes, and axis 3 operates across volumes. +Generate a Maximum Intensity Projection (MIP) along the inferior-superior direction: $ mrmath input.mif max MIP.mif -axis 2 Since a MIP is literally the maximal value along a specific projection direction, axis-aligned MIPs can be generated easily using mrmath with the 'max' operation. +ARGUMENT input 0 1 IMAGEIN +the input image(s). +ARGUMENT operation 0 0 CHOICE mean median sum product rms norm var std min max absmax magmax +the operation to apply, one of: mean, median, sum, product, rms, norm, var, std, min, max, absmax, magmax. +ARGUMENT output 0 0 IMAGEOUT +the output image. +OPTION axis 1 0 +perform operation along a specified axis of a single input image +ARGUMENT index 0 0 INT 0 9223372036854775807 +OPTION keep_unary_axes 1 0 +Keep unary axes in input images prior to calculating the stats. The default is to wipe axes with single elements. +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrmetric b/interfaces/legacy/mrmetric new file mode 100644 index 0000000000..7b101f4b10 --- /dev/null +++ b/interfaces/legacy/mrmetric @@ -0,0 +1,44 @@ +Computes a dissimilarity metric between two images +Currently only the mean squared difference is fully implemented. +ARGUMENT image1 0 0 IMAGEIN +the first input image. +ARGUMENT image2 0 0 IMAGEIN +the second input image. +OPTION space 1 0 +voxel (default): per voxel image1: scanner space of image 1 image2: scanner space of image 2 average: scanner space of the average affine transformation of image 1 and 2 +ARGUMENT iteration method 0 0 CHOICE voxel image1 image2 average +OPTION interp 1 0 +set the interpolation method to use when reslicing (choices: nearest, linear, cubic, sinc. Default: linear). +ARGUMENT method 0 0 CHOICE nearest linear cubic sinc +OPTION metric 1 0 +define the dissimilarity metric used to calculate the cost. Choices: diff (squared differences), cc (non-normalised negative cross correlation aka negative cross covariance). Default: diff). cc is only implemented for -space average and -interp linear and cubic. +ARGUMENT method 0 0 CHOICE diff cc +OPTION mask1 1 0 +mask for image 1 +ARGUMENT image 0 0 IMAGEIN +OPTION mask2 1 0 +mask for image 2 +ARGUMENT image 0 0 IMAGEIN +OPTION nonormalisation 1 0 +do not normalise the dissimilarity metric to the number of voxels. +OPTION overlap 1 0 +output number of voxels that were used. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrregister b/interfaces/legacy/mrregister new file mode 100644 index 0000000000..eafcf7f942 --- /dev/null +++ b/interfaces/legacy/mrregister @@ -0,0 +1,209 @@ +Register two images together using a symmetric rigid, affine or non-linear transformation model +By default this application will perform an affine, followed by non-linear registration. +FOD registration (with apodised point spread reorientation) will be performed by default if the number of volumes in the 4th dimension equals the number of coefficients in an antipodally symmetric spherical harmonic series (e.g. 6, 15, 28 etc). The -no_reorientation option can be used to force reorientation off if required. +Non-linear registration computes warps to map from both image1->image2 and image2->image1. Similar to Avants (2008) Med Image Anal. 12(1): 26–41, registration is performed by matching both the image1 and image2 in a 'midway space'. Warps can be saved as two deformation fields that map directly between image1->image2 and image2->image1, or if using -nl_warp_full as a single 5D file that stores all 4 warps image1->mid->image2, and image2->mid->image1. The 5D warp format stores x,y,z deformations in the 4th dimension, and uses the 5th dimension to index the 4 warps. The affine transforms estimated (to midway space) are also stored as comments in the image header. The 5D warp file can be used to reinitialise subsequent registrations, in addition to transforming images to midway space (e.g. for intra-subject alignment in a 2-time-point longitudinal analysis). +ARGUMENT image1 image2 0 0 IMAGEIN +input image 1 ('moving') and input image 2 ('template') +ARGUMENT contrast1 contrast2 1 1 IMAGEIN +optional list of additional input images used as additional contrasts. Can be used multiple times. contrastX and imageX must share the same coordinate system. +OPTION type 1 0 +the registration type. Valid choices are: rigid, affine, nonlinear, rigid_affine, rigid_nonlinear, affine_nonlinear, rigid_affine_nonlinear (Default: affine_nonlinear) +ARGUMENT choice 0 0 CHOICE rigid affine nonlinear rigid_affine rigid_nonlinear affine_nonlinear rigid_affine_nonlinear +OPTION transformed 1 1 +image1 after registration transformed and regridded to the space of image2. Note that -transformed needs to be repeated for each contrast if multi-contrast registration is used. +ARGUMENT image 0 0 IMAGEOUT +OPTION transformed_midway 1 1 +image1 and image2 after registration transformed and regridded to the midway space. Note that -transformed_midway needs to be repeated for each contrast if multi-contrast registration is used. +ARGUMENT image1_transformed 0 0 IMAGEOUT +ARGUMENT image2_transformed 0 0 IMAGEOUT +OPTION mask1 1 0 +a mask to define the region of image1 to use for optimisation. +ARGUMENT filename 0 0 IMAGEIN +OPTION mask2 1 0 +a mask to define the region of image2 to use for optimisation. +ARGUMENT filename 0 0 IMAGEIN +OPTION nan 1 0 +use NaN as out of bounds value. (Default: 0.0) +OPTION rigid 1 0 +the output text file containing the rigid transformation as a 4x4 matrix +ARGUMENT file 0 0 FILEOUT +OPTION rigid_1tomidway 1 0 +the output text file containing the rigid transformation that aligns image1 to image2 in their common midway space as a 4x4 matrix +ARGUMENT file 0 0 FILEOUT +OPTION rigid_2tomidway 1 0 +the output text file containing the rigid transformation that aligns image2 to image1 in their common midway space as a 4x4 matrix +ARGUMENT file 0 0 FILEOUT +OPTION rigid_init_translation 1 0 +initialise the translation and centre of rotation +Valid choices are: +mass (aligns the centers of mass of both images, default), +geometric (aligns geometric image centres) and none. +ARGUMENT type 0 0 CHOICE mass geometric none +OPTION rigid_init_rotation 1 0 +initialise the rotation Valid choices are: +search (search for the best rotation using mean squared residuals), +moments (rotation based on directions of intensity variance with respect to centre of mass), +none (default). +ARGUMENT type 0 0 CHOICE search moments none +OPTION rigid_init_matrix 1 0 +initialise either the rigid, affine, or syn registration with the supplied rigid transformation (as a 4x4 matrix in scanner coordinates). Note that this overrides rigid_init_translation and rigid_init_rotation initialisation +ARGUMENT file 0 0 FILEIN +OPTION rigid_scale 1 0 +use a multi-resolution scheme by defining a scale factor for each level using comma separated values (Default: 0.25,0.5,1.0) +ARGUMENT factor 0 0 FSEQ +OPTION rigid_niter 1 0 +the maximum number of gradient descent iterations per stage. This can be specified either as a single number for all multi-resolution levels, or a single value for each level. (Default: 1000) +ARGUMENT num 0 0 ISEQ +OPTION rigid_metric 1 0 +valid choices are: diff (intensity differences), Default: diff +ARGUMENT type 0 0 CHOICE diff ncc +OPTION rigid_metric.diff.estimator 1 0 +Valid choices are: l1 (least absolute: |x|), l2 (ordinary least squares), lp (least powers: |x|^1.2), none (no robust estimator). Default: l2 +ARGUMENT type 0 0 CHOICE l1 l2 lp none +OPTION rigid_lmax 1 0 +explicitly set the lmax to be used per scale factor in rigid FOD registration. By default FOD registration will use lmax 0,2,4 with default scale factors 0.25,0.5,1.0 respectively. Note that no reorientation will be performed with lmax = 0. +ARGUMENT num 0 0 ISEQ +OPTION rigid_log 1 0 +write gradient descent parameter evolution to log file +ARGUMENT file 0 0 FILEOUT +OPTION affine 1 0 +the output text file containing the affine transformation as a 4x4 matrix +ARGUMENT file 0 0 FILEOUT +OPTION affine_1tomidway 1 0 +the output text file containing the affine transformation that aligns image1 to image2 in their common midway space as a 4x4 matrix +ARGUMENT file 0 0 FILEOUT +OPTION affine_2tomidway 1 0 +the output text file containing the affine transformation that aligns image2 to image1 in their common midway space as a 4x4 matrix +ARGUMENT file 0 0 FILEOUT +OPTION affine_init_translation 1 0 +initialise the translation and centre of rotation +Valid choices are: +mass (aligns the centers of mass of both images), +geometric (aligns geometric image centres) and none. (Default: mass) +ARGUMENT type 0 0 CHOICE mass geometric none +OPTION affine_init_rotation 1 0 +initialise the rotation Valid choices are: +search (search for the best rotation using mean squared residuals), +moments (rotation based on directions of intensity variance with respect to centre of mass), +none (Default: none). +ARGUMENT type 0 0 CHOICE search moments none +OPTION affine_init_matrix 1 0 +initialise either the affine, or syn registration with the supplied affine transformation (as a 4x4 matrix in scanner coordinates). Note that this overrides affine_init_translation and affine_init_rotation initialisation +ARGUMENT file 0 0 FILEIN +OPTION affine_scale 1 0 +use a multi-resolution scheme by defining a scale factor for each level using comma separated values (Default: 0.25,0.5,1.0) +ARGUMENT factor 0 0 FSEQ +OPTION affine_niter 1 0 +the maximum number of gradient descent iterations per stage. This can be specified either as a single number for all multi-resolution levels, or a single value for each level. (Default: 1000) +ARGUMENT num 0 0 ISEQ +OPTION affine_metric 1 0 +valid choices are: diff (intensity differences), Default: diff +ARGUMENT type 0 0 CHOICE diff ncc +OPTION affine_metric.diff.estimator 1 0 +Valid choices are: l1 (least absolute: |x|), l2 (ordinary least squares), lp (least powers: |x|^1.2), Default: l2 +ARGUMENT type 0 0 CHOICE l1 l2 lp none +OPTION affine_lmax 1 0 +explicitly set the lmax to be used per scale factor in affine FOD registration. By default FOD registration will use lmax 0,2,4 with default scale factors 0.25,0.5,1.0 respectively. Note that no reorientation will be performed with lmax = 0. +ARGUMENT num 0 0 ISEQ +OPTION affine_log 1 0 +write gradient descent parameter evolution to log file +ARGUMENT file 0 0 FILEOUT +OPTION init_translation.unmasked1 1 0 +disregard mask1 for the translation initialisation (affects 'mass') +OPTION init_translation.unmasked2 1 0 +disregard mask2 for the translation initialisation (affects 'mass') +OPTION init_rotation.unmasked1 1 0 +disregard mask1 for the rotation initialisation (affects 'search' and 'moments') +OPTION init_rotation.unmasked2 1 0 +disregard mask2 for the rotation initialisation (affects 'search' and 'moments') +OPTION init_rotation.search.angles 1 0 +rotation angles for the local search in degrees between 0 and 180. (Default: 2,5,10,15,20) +ARGUMENT angles 0 0 FSEQ +OPTION init_rotation.search.scale 1 0 +relative size of the images used for the rotation search. (Default: 0.15) +ARGUMENT scale 0 0 FLOAT 0.0001 1 +OPTION init_rotation.search.directions 1 0 +number of rotation axis for local search. (Default: 250) +ARGUMENT num 0 0 INT 1 10000 +OPTION init_rotation.search.run_global 1 0 +perform a global search. (Default: local) +OPTION init_rotation.search.global.iterations 1 0 +number of rotations to investigate (Default: 10000) +ARGUMENT num 0 0 INT 1 10000000000 +OPTION linstage.iterations 1 0 +number of iterations for each registration stage, not to be confused with -rigid_niter or -affine_niter. This can be used to generate intermediate diagnostics images (-linstage.diagnostics.prefix) or to change the cost function optimiser during registration (without the need to repeatedly resize the images). (Default: 1 == no repetition) +ARGUMENT num or comma separated list 0 0 ISEQ +OPTION linstage.optimiser.first 1 0 +Cost function optimisation algorithm to use at first iteration of all stages. Valid choices: bbgd (Barzilai-Borwein gradient descent) or gd (simple gradient descent). (Default: bbgd) +ARGUMENT algorithm 0 0 CHOICE bbgd gd +OPTION linstage.optimiser.last 1 0 +Cost function optimisation algorithm to use at last iteration of all stages (if there are more than one). Valid choices: bbgd (Barzilai-Borwein gradient descent) or gd (simple gradient descent). (Default: bbgd) +ARGUMENT algorithm 0 0 CHOICE bbgd gd +OPTION linstage.optimiser.default 1 0 +Cost function optimisation algorithm to use at any stage iteration other than first or last iteration. Valid choices: bbgd (Barzilai-Borwein gradient descent) or gd (simple gradient descent). (Default: bbgd) +ARGUMENT algorithm 0 0 CHOICE bbgd gd +OPTION linstage.diagnostics.prefix 1 0 +generate diagnostics images after every registration stage +ARGUMENT file prefix 0 0 TEXT +OPTION nl_warp 1 0 +the non-linear warp output defined as two deformation fields, where warp1 can be used to transform image1->image2 and warp2 to transform image2->image1. The deformation fields also encapsulate any linear transformation estimated prior to non-linear registration. +ARGUMENT warp1 0 0 IMAGEOUT +ARGUMENT warp2 0 0 IMAGEOUT +OPTION nl_warp_full 1 0 +output all warps used during registration. This saves four different warps that map each image to a midway space and their inverses in a single 5D image file. The 4th image dimension indexes the x,y,z component of the deformation vector and the 5th dimension indexes the field in this order: image1->midway, midway->image1, image2->midway, midway->image2. Where image1->midway defines the field that maps image1 onto the midway space using the reverse convention When linear registration is performed first, the estimated linear transform will be included in the comments of the image header, and therefore the entire linear and non-linear transform can be applied (in either direction) using this output warp file with mrtransform +ARGUMENT image 0 0 IMAGEOUT +OPTION nl_init 1 0 +initialise the non-linear registration with the supplied warp image. The supplied warp must be in the same format as output using the -nl_warp_full option (i.e. have 4 deformation fields with the linear transforms in the image header) +ARGUMENT image 0 0 IMAGEIN +OPTION nl_scale 1 0 +use a multi-resolution scheme by defining a scale factor for each level using comma separated values (Default: 0.25,0.5,1.0) +ARGUMENT factor 0 0 FSEQ +OPTION nl_niter 1 0 +the maximum number of iterations. This can be specified either as a single number for all multi-resolution levels, or a single value for each level. (Default: 50) +ARGUMENT num 0 0 ISEQ +OPTION nl_update_smooth 1 0 +regularise the gradient update field with Gaussian smoothing (standard deviation in voxel units, Default 2.0) +ARGUMENT stdev 0 0 FLOAT -inf inf +OPTION nl_disp_smooth 1 0 +regularise the displacement field with Gaussian smoothing (standard deviation in voxel units, Default 1.0) +ARGUMENT stdev 0 0 FLOAT -inf inf +OPTION nl_grad_step 1 0 +the gradient step size for non-linear registration (Default: 0.5) +ARGUMENT num 0 0 FLOAT 0.0001 1 +OPTION nl_lmax 1 0 +explicitly set the lmax to be used per scale factor in non-linear FOD registration. By default FOD registration will use lmax 0,2,4 with default scale factors 0.25,0.5,1.0 respectively. Note that no reorientation will be performed with lmax = 0. +ARGUMENT num 0 0 ISEQ +OPTION diagnostics_image 1 0 +write intermediate images for diagnostics purposes +ARGUMENT path 0 0 +OPTION directions 1 0 +the directions used for FOD reorientation using apodised point spread functions (Default: 60 directions) +ARGUMENT file 0 0 FILEIN +a list of directions [az el] generated using the gendir command. +OPTION noreorientation 1 0 +turn off FOD reorientation. Reorientation is on by default if the number of volumes in the 4th dimension corresponds to the number of coefficients in an antipodally symmetric spherical harmonic series (i.e. 6, 15, 28, 45, 66 etc) +OPTION mc_weights 1 0 +relative weight of images used for multi-contrast registration. Default: 1.0 (equal weighting) +ARGUMENT weights 0 0 FSEQ +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrstats b/interfaces/legacy/mrstats new file mode 100644 index 0000000000..9ad86580a5 --- /dev/null +++ b/interfaces/legacy/mrstats @@ -0,0 +1,32 @@ +Compute images statistics +ARGUMENT image 0 0 IMAGEIN +the input image from which statistics will be computed. +OPTION output 1 1 +output only the field specified. Multiple such options can be supplied if required. Choices are: mean, median, std, std_rv, min, max, count. Useful for use in scripts. Both std options refer to the unbiased (sample) standard deviation. For complex data, min, max and std are calculated separately for real and imaginary parts, std_rv is based on the real valued variance (equals sqrt of sum of variances of imaginary and real parts). +ARGUMENT field 0 0 CHOICE mean median std std_rv min max count +OPTION mask 1 0 +only perform computation within the specified binary mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION ignorezero 1 0 +ignore zero values during statistics calculation +OPTION allvolumes 1 0 +generate statistics across all image volumes, rather than one set of statistics per image volume +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrthreshold b/interfaces/legacy/mrthreshold new file mode 100644 index 0000000000..5a9bea56d4 --- /dev/null +++ b/interfaces/legacy/mrthreshold @@ -0,0 +1,59 @@ +Create bitwise image by thresholding image intensity +The threshold value to be applied can be determined in one of a number of ways: +- If no relevant command-line option is used, the command will automatically determine an optimal threshold; +- The -abs option provides the threshold value explicitly; +- The -percentile, -top and -bottom options enable more fine-grained control over how the threshold value is determined. +The -mask option only influences those image values that contribute toward the determination of the threshold value; once the threshold is determined, it is applied to the entire image, irrespective of use of the -mask option. If you wish for the voxels outside of the specified mask to additionally be excluded from the output mask, this can be achieved by providing the -out_masked option. +The four operators available through the "-comparison" option ("lt", "le", "ge" and "gt") correspond to "less-than" (<), "less-than-or-equal" (<=), "greater-than-or-equal" (>=) and "greater-than" (>). This offers fine-grained control over how the thresholding operation will behave in the presence of values equivalent to the threshold. By default, the command will select voxels with values greater than or equal to the determined threshold ("ge"); unless the -bottom option is used, in which case after a threshold is determined from the relevant lowest-valued image voxels, those voxels with values less than or equal to that threshold ("le") are selected. This provides more fine-grained control than the -invert option; the latter is provided for backwards compatibility, but is equivalent to selection of the opposite comparison within this selection. +If no output image path is specified, the command will instead write to standard output the determined threshold value. +ARGUMENT input 0 0 IMAGEIN +the input image to be thresholded +ARGUMENT output 1 0 IMAGEOUT +the (optional) output binary image mask +OPTION abs 1 0 +specify threshold value as absolute intensity +ARGUMENT value 0 0 FLOAT -inf inf +OPTION percentile 1 0 +determine threshold based on some percentile of the image intensity distribution +ARGUMENT value 0 0 FLOAT 0 100 +OPTION top 1 0 +determine threshold that will result in selection of some number of top-valued voxels +ARGUMENT count 0 0 INT 1 9223372036854775807 +OPTION bottom 1 0 +determine & apply threshold resulting in selection of some number of bottom-valued voxels (note: implies threshold application operator of "le" unless otherwise specified) +ARGUMENT count 0 0 INT 1 9223372036854775807 +OPTION allvolumes 1 0 +compute a single threshold for all image volumes, rather than an individual threshold per volume +OPTION ignorezero 1 0 +ignore zero-valued input values during threshold determination +OPTION mask 1 0 +compute the threshold based only on values within an input mask image +ARGUMENT image 0 0 IMAGEIN +OPTION comparison 1 0 +comparison operator to use when applying the threshold; options are: lt,le,ge,gt (default = "le" for -bottom; "ge" otherwise) +ARGUMENT choice 0 0 CHOICE lt le ge gt +OPTION invert 1 0 +invert the output binary mask (equivalent to flipping the operator; provided for backwards compatibility) +OPTION out_masked 1 0 +mask the output image based on the provided input mask image +OPTION nan 1 0 +set voxels that fail the threshold to NaN rather than zero (output image will be floating-point rather than binary) +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrtransform b/interfaces/legacy/mrtransform new file mode 100644 index 0000000000..cc65613ca7 --- /dev/null +++ b/interfaces/legacy/mrtransform @@ -0,0 +1,100 @@ +Apply spatial transformations to an image +If a linear transform is applied without a template image the command will modify the image header transform matrix +FOD reorientation (with apodised point spread functions) can be performed if the number of volumes in the 4th dimension equals the number of coefficients in an antipodally symmetric spherical harmonic series (e.g. 6, 15, 28 etc). For such data, the -reorient_fod yes/no option must be used to specify if reorientation is required. +The output image intensity can be modulated using the (local or global) volume change if a linear or nonlinear transformation is applied. 'FOD' modulation preserves the apparent fibre density across the fibre bundle width and can only be applied if FOD reorientation is used. Alternatively, non-directional scaling by the Jacobian determinant can be applied to any image type. +If a DW scheme is contained in the header (or specified separately), and the number of directions matches the number of volumes in the images, any transformation applied using the -linear option will also be applied to the directions. +When the -template option is used to specify the target image grid, the image provided via this option will not influence the axis data strides of the output image; these are determined based on the input image, or the input to the -strides option. +ARGUMENT input 0 0 IMAGEIN +input image to be transformed. +ARGUMENT output 0 0 IMAGEOUT +the output image. +OPTION linear 1 0 +specify a linear transform to apply, in the form of a 3x4 or 4x4 ascii file. Note the standard 'reverse' convention is used, where the transform maps points in the template image to the moving image. Note that the reverse convention is still assumed even if no -template image is supplied +ARGUMENT transform 0 0 FILEIN +OPTION flip 1 0 +flip the specified axes, provided as a comma-separated list of indices (0:x, 1:y, 2:z). +ARGUMENT axes 0 0 ISEQ +OPTION inverse 1 0 +apply the inverse transformation +OPTION half 1 0 +apply the matrix square root of the transformation. This can be combined with the inverse option. +OPTION replace 1 0 +replace the linear transform of the original image by that specified, rather than applying it to the original image. The specified transform can be either a template image, or a 3x4 or 4x4 ascii file. +ARGUMENT file 0 0 FILEIN +OPTION identity 1 0 +set the header transform of the image to the identity matrix +OPTION template 1 0 +reslice the input image to match the specified template image grid. +ARGUMENT image 0 0 IMAGEIN +OPTION midway_space 1 0 +reslice the input image to the midway space. Requires either the -template or -warp option. If used with -template and -linear option the input image will be resliced onto the grid halfway between the input and template. If used with the -warp option the input will be warped to the midway space defined by the grid of the input warp (i.e. half way between image1 and image2) +OPTION interp 1 0 +set the interpolation method to use when reslicing (choices: nearest, linear, cubic, sinc. Default: cubic). +ARGUMENT method 0 0 CHOICE nearest linear cubic sinc +OPTION oversample 1 0 +set the amount of over-sampling (in the target space) to perform when regridding. This is particularly relevant when downsamping a high-resolution image to a low-resolution image, to avoid aliasing artefacts. This can consist of a single integer, or a comma-separated list of 3 integers if different oversampling factors are desired along the different axes. Default is determined from ratio of voxel dimensions (disabled for nearest-neighbour interpolation). +ARGUMENT factor 0 0 ISEQ +OPTION warp 1 0 +apply a non-linear 4D deformation field to warp the input image. Each voxel in the deformation field must define the scanner space position that will be used to interpolate the input image during warping (i.e. pull-back/reverse warp convention). If the -template image is also supplied the deformation field will be resliced first to the template image grid. If no -template option is supplied then the output image will have the same image grid as the deformation field. This option can be used in combination with the -affine option, in which case the affine will be applied first) +ARGUMENT image 0 0 IMAGEIN +OPTION warp_full 1 0 +warp the input image using a 5D warp file output from mrregister. Any linear transforms in the warp image header will also be applied. The -warp_full option must be used in combination with either the -template option or the -midway_space option. If a -template image is supplied then the full warp will be used. By default the image1->image2 transform will be applied, however the -from 2 option can be used to apply the image2->image1 transform. Use the -midway_space option to warp the input image to the midway space. The -from option can also be used to define which warp to use when transforming to midway space +ARGUMENT image 0 0 IMAGEIN +OPTION from 1 0 +used to define which space the input image is when using the -warp_mid option. Use -from 1 to warp from image1 or -from 2 to warp from image2 +ARGUMENT image 0 0 INT 1 2 +OPTION modulate 1 0 +Valid choices are: fod and jac. +fod: modulate FODs during reorientation to preserve the apparent fibre density across fibre bundle widths before and after the transformation. +jac: modulate the image intensity with the determinant of the Jacobian of the warp of linear transformation to preserve the total intensity before and after the transformation. +ARGUMENT method 0 0 CHOICE fod jac +OPTION directions 1 0 +directions defining the number and orientation of the apodised point spread functions used in FOD reorientation (Default: 300 directions) +ARGUMENT file 0 0 FILEIN +a list of directions [az el] generated using the dirgen command. +OPTION reorient_fod 1 0 +specify whether to perform FOD reorientation. This is required if the number of volumes in the 4th dimension corresponds to the number of coefficients in an antipodally symmetric spherical harmonic series with lmax >= 2 (i.e. 6, 15, 28, 45, 66 volumes). +ARGUMENT boolean 0 0 +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION export_grad_mrtrix 1 0 +export the diffusion-weighted gradient table to file in MRtrix format +ARGUMENT path 0 0 FILEOUT +OPTION export_grad_fsl 1 0 +export the diffusion-weighted gradient table to files in FSL (bvecs / bvals) format +ARGUMENT bvecs_path 0 0 FILEOUT +ARGUMENT bvals_path 0 0 FILEOUT +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION nan 1 0 +Use NaN as the out of bounds value (Default: 0.0) +OPTION no_reorientation 1 0 +deprecated, use -reorient_fod instead +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrtrix_cleanup b/interfaces/legacy/mrtrix_cleanup new file mode 100644 index 0000000000..4fcf2d7679 --- /dev/null +++ b/interfaces/legacy/mrtrix_cleanup @@ -0,0 +1,39 @@ +Clean up residual temporary files & scratch directories from MRtrix3 commands +This script will search the file system at the specified location (and in sub-directories thereof) for any temporary files or directories that have been left behind by failed or terminated MRtrix3 commands, and attempt to delete them. +Note that the script's search for temporary items will not extend beyond the user-specified filesystem location. This means that any built-in or user-specified default location for MRtrix3 piped data and scripts will not be automatically searched. Cleanup of such locations should instead be performed explicitly: e.g. "mrtrix_cleanup /tmp/" to remove residual piped images from /tmp/. +This script should not be run while other MRtrix3 commands are being executed: it may delete temporary items during operation that may lead to unexpected behaviour. +ARGUMENT path 0 0 DIRIN +Directory from which to commence filesystem search +OPTION -test 1 0 +Run script in test mode: will list identified files / directories, but not attempt to delete them +OPTION -failed 1 0 +Write list of items that the script failed to delete to a text file +ARGUMENT file 0 0 FILEOUT +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mrview b/interfaces/legacy/mrview new file mode 100644 index 0000000000..94eba0318e --- /dev/null +++ b/interfaces/legacy/mrview @@ -0,0 +1,200 @@ +The MRtrix image viewer +Any images listed as arguments will be loaded and available through the image menu, with the first listed displayed initially. Any subsequent command-line options will be processed as if the corresponding action had been performed through the GUI. +Note that because images loaded as arguments (i.e. simply listed on the command-line) are opened before the GUI is shown, subsequent actions to be performed via the various command-line options must appear after the last argument. This is to avoid confusion about which option will apply to which image. If you need fine control over this, please use the -load or -select_image options. For example: +$ mrview -load image1.mif -interpolation 0 -load image2.mif -interpolation 0 +or +$ mrview image1.mif image2.mif -interpolation 0 -select_image 2 -interpolation 0 +ARGUMENT image 1 1 IMAGEIN +An image to be loaded. +OPTION mode 1 1 +Switch to view mode specified by the integer index, as per the view menu. +ARGUMENT index 0 0 INT -9223372036854775808 9223372036854775807 +OPTION load 1 1 +Load image specified and make it current. +ARGUMENT image 0 0 IMAGEIN +OPTION reset 1 1 +Reset the view according to current image. This resets the FOV, projection and focus. +OPTION fov 1 1 +Set the field of view, in mm. +ARGUMENT value 0 0 FLOAT -inf inf +OPTION focus 1 1 +Either set the position of the crosshairs in scanner coordinates, with the new position supplied as a comma-separated list of floating-point values or show or hide the focus cross hair using a boolean value as argument. +ARGUMENT x,y,z or boolean 0 0 VARIOUS +OPTION target 1 1 +Set the target location for the viewing window (the scanner coordinate that will appear at the centre of the viewing window +ARGUMENT x,y,z 0 0 FSEQ +OPTION orientation 1 0 +Set the orientation of the camera for the viewing window, in the form of a quaternion representing the rotation away from the z-axis. This should be provided as a list of 4 comma-separated floating point values (this will be automatically normalised). +ARGUMENT w,x,y,z 0 0 FSEQ +OPTION voxel 1 1 +Set the position of the crosshairs in voxel coordinates, relative the image currently displayed. The new position should be supplied as a comma-separated list of floating-point values. +ARGUMENT x,y,z 0 0 FSEQ +OPTION volume 1 1 +Set the volume index for the image displayed, as a comma-separated list of integers. +ARGUMENT idx 0 0 ISEQ +OPTION plane 1 1 +Set the viewing plane, according to the mappping 0: sagittal; 1: coronal; 2: axial. +ARGUMENT index 0 0 INT 0 2 +OPTION lock 1 1 +Set whether view is locked to image axes (0: no, 1: yes). +ARGUMENT yesno 0 0 +OPTION select_image 1 1 +Switch to image number specified, with reference to the list of currently loaded images. +ARGUMENT index 0 0 INT 0 9223372036854775807 +OPTION autoscale 1 1 +Reset the image scaling to automatically determined range. +OPTION interpolation 1 1 +Enable or disable image interpolation in main image. +ARGUMENT boolean 0 0 +OPTION colourmap 1 1 +Switch the image colourmap to that specified, as per the colourmap menu. +ARGUMENT index 0 0 INT 0 9223372036854775807 +OPTION noannotations 1 1 +Hide all image annotation overlays +OPTION comments 1 1 +Show or hide image comments overlay. +ARGUMENT boolean 0 0 +OPTION voxelinfo 1 1 +Show or hide voxel information overlay. +ARGUMENT boolean 0 0 +OPTION orientlabel 1 1 +Show or hide orientation label overlay. +ARGUMENT boolean 0 0 +OPTION colourbar 1 1 +Show or hide colourbar overlay. +ARGUMENT boolean 0 0 +OPTION imagevisible 1 1 +Show or hide the main image. +ARGUMENT boolean 0 0 +OPTION intensity_range 1 1 +Set the image intensity range to that specified. +ARGUMENT min,max 0 0 FSEQ +OPTION size 1 1 +Set the size of the view area, in pixel units. +ARGUMENT width,height 0 0 ISEQ +OPTION position 1 1 +Set the position of the main window, in pixel units. +ARGUMENT x,y 0 0 ISEQ +OPTION fullscreen 1 0 +Start fullscreen. +OPTION exit 1 0 +Quit MRView. +OPTION sync.focus 1 0 +Sync the focus with other MRView windows that also have this turned on. +OPTION fps 1 0 +Display frames per second, averaged over the last 10 frames. The maximum over the last 3 seconds is also displayed. +OPTION overlay.load 1 1 +Loads the specified image on the overlay tool. +ARGUMENT image 0 0 IMAGEIN +OPTION overlay.opacity 1 1 +Sets the overlay opacity to floating value [0-1]. +ARGUMENT value 0 0 FLOAT 0 1 +OPTION overlay.colourmap 1 1 +Sets the colourmap of the overlay as indexed in the colourmap dropdown menu. +ARGUMENT index 0 0 INT -9223372036854775808 9223372036854775807 +OPTION overlay.colour 1 1 +Specify a manual colour for the overlay, as three comma-separated values +ARGUMENT R,G,B 0 0 FSEQ +OPTION overlay.intensity 1 1 +Set the intensity windowing of the overlay +ARGUMENT Min,Max 0 0 FSEQ +OPTION overlay.threshold_min 1 1 +Set the lower threshold value of the overlay +ARGUMENT value 0 0 FLOAT -inf inf +OPTION overlay.threshold_max 1 1 +Set the upper threshold value of the overlay +ARGUMENT value 0 0 FLOAT -inf inf +OPTION overlay.no_threshold_min 1 1 +Disable the lower threshold for the overlay +OPTION overlay.no_threshold_max 1 1 +Disable the upper threshold for the overlay +OPTION overlay.interpolation 1 1 +Enable or disable overlay image interpolation. +ARGUMENT value 0 0 +OPTION roi.load 1 1 +Loads the specified image on the ROI editor tool. +ARGUMENT image 0 0 IMAGEIN +OPTION roi.opacity 1 1 +Sets the overlay opacity to floating value [0-1]. +ARGUMENT value 0 0 FLOAT 0 1 +OPTION roi.colour 1 1 +Sets the colour of the ROI overlay +ARGUMENT R,G,B 0 0 FSEQ +OPTION tractography.load 1 1 +Load the specified tracks file into the tractography tool. +ARGUMENT tracks 0 0 FILEIN +OPTION tractography.thickness 1 1 +Line thickness of tractography display, [-1.0, 1.0], default is 0.0. +ARGUMENT value 0 0 FLOAT -1 1 +OPTION tractography.geometry 1 1 +The geometry type to use when rendering tractograms (options are: pseudotubes, lines, points) +ARGUMENT value 0 0 CHOICE pseudotubes lines points +OPTION tractography.opacity 1 1 +Opacity of tractography display, [0.0, 1.0], default is 1.0. +ARGUMENT value 0 0 FLOAT 0 1 +OPTION tractography.slab 1 1 +Slab thickness of tractography display, in mm. -1 to turn off crop to slab. +ARGUMENT value 0 0 FLOAT -1 1e+06 +OPTION tractography.lighting 1 1 +Toggle the use of lighting of tractogram geometry +ARGUMENT value 0 0 +OPTION tractography.colour 1 1 +Specify a manual colour for the tractogram, as three comma-separated values +ARGUMENT R,G,B 0 0 FSEQ +OPTION tractography.tsf_load 1 1 +Load the specified tractography scalar file. +ARGUMENT tsf 0 0 FILEIN +OPTION tractography.tsf_range 1 1 +Set range for the tractography scalar file. Requires -tractography.tsf_load already provided. +ARGUMENT RangeMin,RangeMax 0 0 FSEQ +OPTION tractography.tsf_thresh 1 1 +Set thresholds for the tractography scalar file. Requires -tractography.tsf_load already provided. +ARGUMENT ThresholdMin,ThesholdMax 0 0 FSEQ +OPTION tractography.tsf_colourmap 1 1 +Sets the colourmap of the .tsf file as indexed in the tsf colourmap dropdown menu. Requires -tractography.tsf_load already. +ARGUMENT index 0 0 INT -9223372036854775808 9223372036854775807 +OPTION odf.load_sh 1 1 +Loads the specified SH-based ODF image on the ODF tool. +ARGUMENT image 0 0 IMAGEIN +OPTION odf.load_tensor 1 1 +Loads the specified tensor image on the ODF tool. +ARGUMENT image 0 0 IMAGEIN +OPTION odf.load_dixel 1 1 +Loads the specified dixel-based image on the ODF tool. +ARGUMENT image 0 0 IMAGEIN +OPTION fixel.load 1 1 +Load a fixel file (any file inside a fixel directory, or an old .msf / .msh legacy format file) into the fixel tool. +ARGUMENT image 0 0 IMAGEIN +OPTION connectome.init 1 0 +Initialise the connectome tool using a parcellation image. +ARGUMENT image 0 0 IMAGEIN +OPTION connectome.load 1 1 +Load a matrix file into the connectome tool. +ARGUMENT path 0 0 FILEIN +OPTION capture.folder 1 1 +Set the output folder for the screen capture tool. +ARGUMENT path 0 0 TEXT +OPTION capture.prefix 1 1 +Set the output file prefix for the screen capture tool. +ARGUMENT string 0 0 TEXT +OPTION capture.grab 1 1 +Start the screen capture process. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/mtnormalise b/interfaces/legacy/mtnormalise new file mode 100644 index 0000000000..f9dfa09de7 --- /dev/null +++ b/interfaces/legacy/mtnormalise @@ -0,0 +1,48 @@ +Multi-tissue informed log-domain intensity normalisation +This command takes as input any number of tissue components (e.g. from multi-tissue CSD) and outputs corresponding normalised tissue components corrected for the effects of (residual) intensity inhomogeneities. Intensity normalisation is performed by optimising the voxel-wise sum of all tissue compartments towards a constant value, under constraints of spatial smoothness (polynomial basis of a given order). Different to the Raffelt et al. 2017 abstract, this algorithm performs this task in the log-domain instead, with added gradual outlier rejection, different handling of the balancing factors between tissue compartments and a different iteration structure. +The -mask option is mandatory and is optimally provided with a brain mask (such as the one obtained from dwi2mask earlier in the processing pipeline). Outlier areas with exceptionally low or high combined tissue contributions are accounted for and reoptimised as the intensity inhomogeneity estimation becomes more accurate. +Default usage (for 3-tissue CSD compartments): $ mtnormalise wmfod.mif wmfod_norm.mif gm.mif gm_norm.mif csf.mif csf_norm.mif -mask mask.mif Note how for each tissue compartment, the input and output images are provided as a consecutive pair. +ARGUMENT input output 0 1 VARIOUS +list of all input and output tissue compartment files (see example usage). +OPTION mask 0 0 +the mask defines the data used to compute the intensity normalisation. This option is mandatory. +ARGUMENT image 0 0 IMAGEIN +OPTION order 1 0 +the maximum order of the polynomial basis used to fit the normalisation field in the log-domain. An order of 0 is equivalent to not allowing spatial variance of the intensity normalisation factor. (default: 3) +ARGUMENT number 0 0 CHOICE 0 1 2 3 +OPTION niter 1 0 +set the number of iterations. The first (and potentially only) entry applies to the main loop. If supplied as a comma-separated list of integers, the second entry applies to the inner loop to update the balance factors (default: 15,7). +ARGUMENT number 0 0 ISEQ +OPTION reference 1 0 +specify the (positive) reference value to which the summed tissue compartments will be normalised. (default: 0.282095, SH DC term for unit angular integral) +ARGUMENT number 0 0 FLOAT 2.22507e-308 inf +OPTION balanced 1 0 +incorporate the per-tissue balancing factors into scaling of the output images (NOTE: use of this option has critical consequences for AFD intensity normalisation; should not be used unless these consequences are fully understood) +OPTION check_norm 1 0 +output the final estimated spatially varying intensity level that is used for normalisation. +ARGUMENT image 0 0 IMAGEOUT +OPTION check_mask 1 0 +output the final mask used to compute the normalisation. This mask excludes regions identified as outliers by the optimisation process. +ARGUMENT image 0 0 IMAGEOUT +OPTION check_factors 1 0 +output the tissue balance factors computed during normalisation. +ARGUMENT file 0 0 FILEOUT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/peaks2amp b/interfaces/legacy/peaks2amp new file mode 100644 index 0000000000..983a3c3be6 --- /dev/null +++ b/interfaces/legacy/peaks2amp @@ -0,0 +1,24 @@ +Extract amplitudes from a peak directions image +ARGUMENT directions 0 0 IMAGEIN +the input directions image. Each volume corresponds to the x, y & z component of each direction vector in turn. +ARGUMENT amplitudes 0 0 IMAGEOUT +the output amplitudes image. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/peaks2fixel b/interfaces/legacy/peaks2fixel new file mode 100644 index 0000000000..fc3ba92e6c --- /dev/null +++ b/interfaces/legacy/peaks2fixel @@ -0,0 +1,29 @@ +Convert peak directions image to a fixel directory +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT directions 0 0 IMAGEIN +the input directions image; each volume corresponds to the x, y & z component of each direction vector in turn. +ARGUMENT fixels 0 0 DIROUT +the output fixel directory. +OPTION dataname 1 0 +the name of the output fixel data file encoding peak amplitudes +ARGUMENT path 0 0 TEXT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/population_template b/interfaces/legacy/population_template new file mode 100644 index 0000000000..8467895346 --- /dev/null +++ b/interfaces/legacy/population_template @@ -0,0 +1,131 @@ +Generates an unbiased group-average template from a series of images +First a template is optimised with linear registration (rigid and/or affine, both by default), then non-linear registration is used to optimise the template further. +Multi-contrast registration: $ population_template input_WM_ODFs/ output_WM_template.mif input_GM_ODFs/ output_GM_template.mif; When performing multi-contrast registration, the input directory and corresponding output template image for a given contrast are to be provided as a pair, with the pairs corresponding to different contrasts provided sequentially. +ARGUMENT input_dir 0 1 VARIOUS +Input directory containing all images of a given contrast +ARGUMENT template 0 0 IMAGEOUT +Output template image +OPTION -type 1 0 +Specify the types of registration stages to perform. Options are: "rigid" (perform rigid registration only, which might be useful for intra-subject registration in longitudinal analysis), "affine" (perform affine registration), "nonlinear", as well as cominations of registration types: "rigid_affine", "rigid_nonlinear", "affine_nonlinear", "rigid_affine_nonlinear". Default: rigid_affine_nonlinear +ARGUMENT type 0 0 CHOICE rigid affine nonlinear rigid_affine rigid_nonlinear affine_nonlinear rigid_affine_nonlinear +OPTION -voxel_size 1 0 +Define the template voxel size in mm. Use either a single value for isotropic voxels or 3 comma-separated values. +ARGUMENT voxel_size 0 0 FSEQ +OPTION -initial_alignment 1 0 +Method of alignment to form the initial template. Options are: "mass" (default), "robust_mass" (requires masks), "geometric", "none". +ARGUMENT initial_alignment 0 0 CHOICE mass robust_mass geometric none +OPTION -mask_dir 1 0 +Optionally input a set of masks inside a single directory, one per input image (with the same file name prefix). Using masks will speed up registration significantly. Note that masks are used for registration, not for aggregation. To exclude areas from aggregation, NaN-mask your input images. +ARGUMENT mask_dir 0 0 DIRIN +OPTION -warp_dir 1 0 +Output a directory containing warps from each input to the template. If the folder does not exist it will be created +ARGUMENT warp_dir 0 0 DIROUT +OPTION -transformed_dir 1 0 +Output a directory containing the input images transformed to the template. If the folder does not exist it will be created. For multi-contrast registration, this path will contain a sub-directory for the images per contrast. +ARGUMENT transformed_dir 0 0 DIROUT +OPTION -linear_transformations_dir 1 0 +Output a directory containing the linear transformations used to generate the template. If the folder does not exist it will be created +ARGUMENT linear_transformations_dir 0 0 DIROUT +OPTION -template_mask 1 0 +Output a template mask. Only works if -mask_dir has been input. The template mask is computed as the intersection of all subject masks in template space. +ARGUMENT template_mask 0 0 IMAGEOUT +OPTION -noreorientation 1 0 +Turn off FOD reorientation in mrregister. Reorientation is on by default if the number of volumes in the 4th dimension corresponds to the number of coefficients in an antipodally symmetric spherical harmonic series (i.e. 6, 15, 28, 45, 66 etc) +OPTION -leave_one_out 1 0 +Register each input image to a template that does not contain that image. Valid choices: 0, 1, auto. (Default: auto (true if n_subjects larger than 2 and smaller than 15)) +ARGUMENT leave_one_out 0 0 CHOICE 0 1 auto +OPTION -aggregate 1 0 +Measure used to aggregate information from transformed images to the template image. Valid choices: mean, median. Default: mean +ARGUMENT aggregate 0 0 CHOICE mean median +OPTION -aggregation_weights 1 0 +Comma-separated file containing weights used for weighted image aggregation. Each row must contain the identifiers of the input image and its weight. Note that this weighs intensity values not transformations (shape). +ARGUMENT aggregation_weights 0 0 FILEIN +OPTION -nanmask 1 0 +Optionally apply masks to (transformed) input images using NaN values to specify include areas for registration and aggregation. Only works if -mask_dir has been input. +OPTION -copy_input 1 0 +Copy input images and masks into local scratch directory. +OPTION -delete_temporary_files 1 0 +Delete temporary files from scratch directory during template creation. +OPTION -nl_scale 1 0 +Specify the multi-resolution pyramid used to build the non-linear template, in the form of a list of scale factors (default: 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0). This implicitly defines the number of template levels +ARGUMENT nl_scale 0 0 FSEQ +OPTION -nl_lmax 1 0 +Specify the lmax used for non-linear registration for each scale factor, in the form of a list of integers (default: 2,2,2,2,2,2,2,2,4,4,4,4,4,4,4,4). The list must be the same length as the nl_scale factor list +ARGUMENT nl_lmax 0 0 ISEQ +OPTION -nl_niter 1 0 +Specify the number of registration iterations used within each level before updating the template, in the form of a list of integers (default: 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5). The list must be the same length as the nl_scale factor list +ARGUMENT nl_niter 0 0 ISEQ +OPTION -nl_update_smooth 1 0 +Regularise the gradient update field with Gaussian smoothing (standard deviation in voxel units, Default 2.0 x voxel_size) +ARGUMENT nl_update_smooth 0 0 FLOAT 0.0 inf +OPTION -nl_disp_smooth 1 0 +Regularise the displacement field with Gaussian smoothing (standard deviation in voxel units, Default 1.0 x voxel_size) +ARGUMENT nl_disp_smooth 0 0 FLOAT 0.0 inf +OPTION -nl_grad_step 1 0 +The gradient step size for non-linear registration (Default: 0.5) +ARGUMENT nl_grad_step 0 0 FLOAT 0.0 inf +OPTION -linear_no_pause 1 0 +Do not pause the script if a linear registration seems implausible +OPTION -linear_no_drift_correction 1 0 +Deactivate correction of template appearance (scale and shear) over iterations +OPTION -linear_estimator 1 0 +Specify estimator for intensity difference metric. Valid choices are: l1 (least absolute: |x|), l2 (ordinary least squares), lp (least powers: |x|^1.2), none (no robust estimator). Default: none. +ARGUMENT linear_estimator 0 0 CHOICE l1 l2 lp none +OPTION -rigid_scale 1 0 +Specify the multi-resolution pyramid used to build the rigid template, in the form of a list of scale factors (default: 0.3,0.4,0.6,0.8,1.0,1.0). This and affine_scale implicitly define the number of template levels +ARGUMENT rigid_scale 0 0 FSEQ +OPTION -rigid_lmax 1 0 +Specify the lmax used for rigid registration for each scale factor, in the form of a list of integers (default: 2,2,2,4,4,4). The list must be the same length as the linear_scale factor list +ARGUMENT rigid_lmax 0 0 ISEQ +OPTION -rigid_niter 1 0 +Specify the number of registration iterations used within each level before updating the template, in the form of a list of integers (default: 50 for each scale). This must be a single number or a list of same length as the linear_scale factor list +ARGUMENT rigid_niter 0 0 ISEQ +OPTION -affine_scale 1 0 +Specify the multi-resolution pyramid used to build the affine template, in the form of a list of scale factors (default: 0.3,0.4,0.6,0.8,1.0,1.0). This and rigid_scale implicitly define the number of template levels +ARGUMENT affine_scale 0 0 FSEQ +OPTION -affine_lmax 1 0 +Specify the lmax used for affine registration for each scale factor, in the form of a list of integers (default: 2,2,2,4,4,4). The list must be the same length as the linear_scale factor list +ARGUMENT affine_lmax 0 0 ISEQ +OPTION -affine_niter 1 0 +Specify the number of registration iterations used within each level before updating the template, in the form of a list of integers (default: 500 for each scale). This must be a single number or a list of same length as the linear_scale factor list +ARGUMENT affine_niter 0 0 ISEQ +OPTION -mc_weight_initial_alignment 1 0 +Weight contribution of each contrast to the initial alignment. Comma separated, default: 1.0 for each contrast (ie. equal weighting). +ARGUMENT mc_weight_initial_alignment 0 0 FSEQ +OPTION -mc_weight_rigid 1 0 +Weight contribution of each contrast to the objective of rigid registration. Comma separated, default: 1.0 for each contrast (ie. equal weighting) +ARGUMENT mc_weight_rigid 0 0 FSEQ +OPTION -mc_weight_affine 1 0 +Weight contribution of each contrast to the objective of affine registration. Comma separated, default: 1.0 for each contrast (ie. equal weighting) +ARGUMENT mc_weight_affine 0 0 FSEQ +OPTION -mc_weight_nl 1 0 +Weight contribution of each contrast to the objective of nonlinear registration. Comma separated, default: 1.0 for each contrast (ie. equal weighting) +ARGUMENT mc_weight_nl 0 0 FSEQ +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/responsemean b/interfaces/legacy/responsemean new file mode 100644 index 0000000000..6853f467d3 --- /dev/null +++ b/interfaces/legacy/responsemean @@ -0,0 +1,40 @@ +Calculate the mean response function from a set of text files +All response function files provided must contain the same number of unique b-values (lines), as well as the same number of coefficients per line. +As long as the number of unique b-values is identical across all input files, the coefficients will be averaged. This is performed on the assumption that the actual acquired b-values are identical. This is however impossible for the responsemean command to determine based on the data provided; it is therefore up to the user to ensure that this requirement is satisfied. +Usage where all response functions are in the same directory:: $ responsemean input_response1.txt input_response2.txt input_response3.txt output_average_response.txt +Usage selecting response functions within a directory using a wildcard:: $ responsemean input_response*.txt output_average_response.txt +Usage where data for each participant reside in a participant-specific directory:: $ responsemean subject-*/response.txt output_average_response.txt +ARGUMENT inputs 0 1 FILEIN +The input response function files +ARGUMENT output 0 0 FILEOUT +The output mean response function file +OPTION -legacy 1 0 +Use the legacy behaviour of former command "average_response": average response function coefficients directly, without compensating for global magnitude differences between input files +OPTION -nocleanup 1 0 +do not delete intermediate files during script execution, and do not delete scratch directory at script completion. +OPTION -scratch 1 0 +manually specify the path in which to generate the scratch directory. +ARGUMENT /path/to/scratch/ 0 0 DIROUT +OPTION -continue 1 0 +continue the script from a previous execution; must provide the scratch directory path, and the name of the last successfully-generated file. +ARGUMENT ScratchDir 0 0 VARIOUS +ARGUMENT LastFile 0 0 VARIOUS +OPTION -info 1 0 +display information messages. +OPTION -quiet 1 0 +do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION -debug 1 0 +display debugging messages. +OPTION -force 1 0 +force overwrite of output files. +OPTION -nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION -config 1 0 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION -help 1 0 +display this information page and exit. +OPTION -version 1 0 +display version information and exit. diff --git a/interfaces/legacy/sh2amp b/interfaces/legacy/sh2amp new file mode 100644 index 0000000000..571b1f3729 --- /dev/null +++ b/interfaces/legacy/sh2amp @@ -0,0 +1,51 @@ +Evaluate the amplitude of an image of spherical harmonic functions along specified directions +The input image should consist of a 4D or 5D image, with SH coefficients along the 4th dimension according to the convention below. If 4D (or size 1 along the 5th dimension), the program expects to be provided with a single shell of directions. If 5D, each set of coefficients along the 5th dimension is understood to correspond to a different shell. +The directions can be provided as: +- a 2-column ASCII text file contained azimuth / elevation pairs (as produced by dirgen) +- a 3-column ASCII text file containing x, y, z Cartesian direction vectors (as produced by dirgen -cart) +- a 4-column ASCII text file containing the x, y, z, b components of a full DW encoding scheme (in MRtrix format, see main documentation for details). +- an image file whose header contains a valid DW encoding scheme +If a full DW encoding is provided, the number of shells needs to match those found in the input image of coefficients (i.e. its size along the 5th dimension). If needed, the -shell option can be used to pick out the specific shell(s) of interest. +If the input image contains multiple shells (its size along the 5th dimension is greater than one), the program will expect the direction set to contain multiple shells, which can only be provided as a full DW encodings (the last two options in the list above). +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +ARGUMENT input 0 0 IMAGEIN +the input image consisting of spherical harmonic (SH) coefficients. +ARGUMENT directions 0 0 FILEIN +the list of directions along which the SH functions will be sampled, generated using the dirgen command +ARGUMENT output 0 0 IMAGEOUT +the output image consisting of the amplitude of the SH functions along the specified directions. +OPTION nonnegative 1 0 +cap all negative amplitudes to zero +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/sh2peaks b/interfaces/legacy/sh2peaks new file mode 100644 index 0000000000..754bd369a1 --- /dev/null +++ b/interfaces/legacy/sh2peaks @@ -0,0 +1,48 @@ +Extract the peaks of a spherical harmonic function in each voxel +Peaks of the spherical harmonic function in each voxel are located by commencing a Newton search along each of a set of pre-specified directions +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +ARGUMENT SH 0 0 IMAGEIN +the input image of SH coefficients. +ARGUMENT output 0 0 IMAGEOUT +the output image. Each volume corresponds to the x, y & z component of each peak direction vector in turn. +OPTION num 1 0 +the number of peaks to extract (default: 3). +ARGUMENT peaks 0 0 INT 0 9223372036854775807 +OPTION direction 1 1 +the direction of a peak to estimate. The algorithm will attempt to find the same number of peaks as have been specified using this option. +ARGUMENT phi 0 0 FLOAT -inf inf +ARGUMENT theta 0 0 FLOAT -inf inf +OPTION peaks 1 0 +the program will try to find the peaks that most closely match those in the image provided. +ARGUMENT image 0 0 IMAGEIN +OPTION threshold 1 0 +only peak amplitudes greater than the threshold will be considered. +ARGUMENT value 0 0 FLOAT 0 inf +OPTION seeds 1 0 +specify a set of directions from which to start the multiple restarts of the optimisation (by default, the built-in 60 direction set is used) +ARGUMENT file 0 0 FILEIN +OPTION mask 1 0 +only perform computation within the specified binary brain mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION fast 1 0 +use lookup table to compute associated Legendre polynomials (faster, but approximate). +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/sh2power b/interfaces/legacy/sh2power new file mode 100644 index 0000000000..fd8ed39b08 --- /dev/null +++ b/interfaces/legacy/sh2power @@ -0,0 +1,29 @@ +Compute the total power of a spherical harmonics image +This command computes the sum of squared SH coefficients, which equals the mean-squared amplitude of the spherical function it represents. +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +ARGUMENT SH 0 0 IMAGEIN +the input spherical harmonics coefficients image. +ARGUMENT power 0 0 IMAGEOUT +the output power image. +OPTION spectrum 1 0 +output the power spectrum, i.e., the power contained within each harmonic degree (l=0, 2, 4, ...) as a 4-D image. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/sh2response b/interfaces/legacy/sh2response new file mode 100644 index 0000000000..afd27fec03 --- /dev/null +++ b/interfaces/legacy/sh2response @@ -0,0 +1,36 @@ +Generate an appropriate response function from the image data for spherical deconvolution +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +ARGUMENT SH 0 0 IMAGEIN +the spherical harmonic decomposition of the diffusion-weighted images +ARGUMENT mask 0 0 IMAGEIN +the mask containing the voxels from which to estimate the response function +ARGUMENT directions 0 0 IMAGEIN +a 4D image containing the direction vectors along which to estimate the response function +ARGUMENT response 0 0 FILEOUT +the output axially-symmetric spherical harmonic coefficients +OPTION lmax 1 0 +specify the maximum harmonic degree of the response function to estimate +ARGUMENT value 0 0 INT 0 20 +OPTION dump 1 0 +dump the m=0 SH coefficients from all voxels in the mask to the output file, rather than their mean +ARGUMENT file 0 0 FILEOUT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/shbasis b/interfaces/legacy/shbasis new file mode 100644 index 0000000000..02b2edec9d --- /dev/null +++ b/interfaces/legacy/shbasis @@ -0,0 +1,30 @@ +Examine the values in spherical harmonic images to estimate (and optionally change) the SH basis used +In previous versions of MRtrix, the convention used for storing spherical harmonic coefficients was a non-orthonormal basis (the m!=0 coefficients were a factor of sqrt(2) too large). This error has been rectified in newer versions of MRtrix, but will cause issues if processing SH data that was generated using an older version of MRtrix (or vice-versa). +This command provides a mechanism for testing the basis used in storage of image data representing a spherical harmonic series per voxel, and allows the user to forcibly modify the raw image data to conform to the desired basis. +Note that the "force_*" conversion choices should only be used in cases where this command has previously been unable to automatically determine the SH basis from the image data, but the user themselves are confident of the SH basis of the data. +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +ARGUMENT SH 0 1 IMAGEIN +the input image(s) of SH coefficients. +OPTION convert 1 0 +convert the image data in-place to the desired basis; options are: old,new,force_oldtonew,force_newtoold. +ARGUMENT mode 0 0 CHOICE old new force_oldtonew force_newtoold +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/shconv b/interfaces/legacy/shconv new file mode 100644 index 0000000000..107b0c29bb --- /dev/null +++ b/interfaces/legacy/shconv @@ -0,0 +1,37 @@ +Perform spherical convolution +Provided with matching pairs of response function and ODF images (containing SH coefficients), perform spherical convolution to provide the corresponding SH coefficients of the signal. +If multiple pairs of inputs are provided, their contributions will be summed into a single output. +If the responses are multi-shell (with one line of coefficients per shell), the output will be a 5-dimensional image, with the SH coefficients of the signal in each shell stored at different indices along the 5th dimension. +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +The spherical harmonic coefficients are stored according to the conventions described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html +ARGUMENT odf response 0 1 +pairs of input ODF image and corresponding responses +ARGUMENT SH_out 0 0 IMAGEOUT +the output spherical harmonics coefficients image. +OPTION datatype 1 0 +specify output image data type. Valid choices are: float16, float16le, float16be, float32, float32le, float32be, float64, float64le, float64be, int64, uint64, int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le, int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be, cfloat16, cfloat16le, cfloat16be, cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be, int8, uint8, bit. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION strides 1 0 +specify the strides of the output data in memory; either as a comma-separated list of (signed) integers, or as a template image from which the strides shall be extracted and used. The actual strides produced will depend on whether the output image format can support it. +ARGUMENT spec 0 0 VARIOUS +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/shview b/interfaces/legacy/shview new file mode 100644 index 0000000000..0d2e7d26cb --- /dev/null +++ b/interfaces/legacy/shview @@ -0,0 +1,24 @@ +View spherical harmonics surface plots +ARGUMENT coefs 1 0 FILEIN +a text file containing the even order spherical harmonics coefficients to display. +OPTION response 1 0 +assume SH coefficients file only contains m=0 terms (zonal harmonics). Used to display the response function as produced by estimate_response +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tck2connectome b/interfaces/legacy/tck2connectome new file mode 100644 index 0000000000..56cf714428 --- /dev/null +++ b/interfaces/legacy/tck2connectome @@ -0,0 +1,69 @@ +Generate a connectome matrix from a streamlines file and a node parcellation image +Default usage: $ tck2connectome tracks.tck nodes.mif connectome.csv -tck_weights_in weights.csv -out_assignments assignments.txt By default, the metric of connectivity quantified in the connectome matrix is the number of streamlines; or, if tcksift2 is used, the sum of streamline weights via the -tck_weights_in option. Use of the -out_assignments option is recommended as this enables subsequent use of the connectome2tck command. +Generate a matrix consisting of the mean streamline length between each node pair: $ tck2connectome tracks.tck nodes.mif distances.csv -scale_length -stat_edge mean By multiplying the contribution of each streamline to the connectome by the length of that streamline, and then, for each edge, computing the mean value across the contributing streamlines, one obtains a matrix where the value in each entry is the mean length across those streamlines belonging to that edge. +Generate a connectome matrix where the value of connectivity is the "mean FA": $ tcksample tracks.tck FA.mif mean_FA_per_streamline.csv -stat_tck mean; tck2connectome tracks.tck nodes.mif mean_FA_connectome.csv -scale_file mean_FA_per_streamline.csv -stat_edge mean Here, a connectome matrix that is "weighted by FA" is generated in multiple steps: firstly, for each streamline, the value of the underlying FA image is sampled at each vertex, and the mean of these values is calculated to produce a single scalar value of "mean FA" per streamline; then, as each streamline is assigned to nodes within the connectome, the magnitude of the contribution of that streamline to the matrix is multiplied by the mean FA value calculated prior for that streamline; finally, for each connectome edge, across the values of "mean FA" that were contributed by all of the streamlines assigned to that particular edge, the mean value is calculated. +Generate the connectivity fingerprint for streamlines seeded from a particular region: $ tck2connectome fixed_seed_tracks.tck nodes.mif fingerprint.csv -vector This usage assumes that the streamlines being provided to the command have all been seeded from the (effectively) same location, and as such, only the endpoint of each streamline (not their starting point) is assigned based on the provided parcellation image. Accordingly, the output file contains only a vector of connectivity values rather than a matrix, since each streamline is assigned to only one node rather than two. +ARGUMENT tracks_in 0 0 TRACKSIN +the input track file +ARGUMENT nodes_in 0 0 IMAGEIN +the input node parcellation image +ARGUMENT connectome_out 0 0 FILEOUT +the output .csv file containing edge weights +OPTION assignment_end_voxels 1 0 +use a simple voxel lookup value at each streamline endpoint +OPTION assignment_radial_search 1 0 +perform a radial search from each streamline endpoint to locate the nearest node. Argument is the maximum radius in mm; if no node is found within this radius, the streamline endpoint is not assigned to any node. Default search distance is 4mm. +ARGUMENT radius 0 0 FLOAT 0 inf +OPTION assignment_reverse_search 1 0 +traverse from each streamline endpoint inwards along the streamline, in search of the last node traversed by the streamline. Argument is the maximum traversal length in mm (set to 0 to allow search to continue to the streamline midpoint). +ARGUMENT max_dist 0 0 FLOAT 0 inf +OPTION assignment_forward_search 1 0 +project the streamline forwards from the endpoint in search of a parcellation node voxel. Argument is the maximum traversal length in mm. +ARGUMENT max_dist 0 0 FLOAT 0 inf +OPTION assignment_all_voxels 1 0 +assign the streamline to all nodes it intersects along its length (note that this means a streamline may be assigned to more than two nodes, or indeed none at all) +OPTION scale_length 1 0 +scale each contribution to the connectome edge by the length of the streamline +OPTION scale_invlength 1 0 +scale each contribution to the connectome edge by the inverse of the streamline length +OPTION scale_invnodevol 1 0 +scale each contribution to the connectome edge by the inverse of the two node volumes +OPTION scale_file 1 0 +scale each contribution to the connectome edge according to the values in a vector file +ARGUMENT path 0 0 IMAGEIN +OPTION symmetric 1 0 +Make matrices symmetric on output +OPTION zero_diagonal 1 0 +Set matrix diagonal to zero on output +OPTION stat_edge 1 0 +statistic for combining the values from all streamlines in an edge into a single scale value for that edge (options are: sum,mean,min,max; default=sum) +ARGUMENT statistic 0 0 CHOICE sum mean min max +OPTION tck_weights_in 1 0 +specify a text scalar file containing the streamline weights +ARGUMENT path 0 0 FILEIN +OPTION keep_unassigned 1 0 +By default, the program discards the information regarding those streamlines that are not successfully assigned to a node pair. Set this option to keep these values (will be the first row/column in the output matrix) +OPTION out_assignments 1 0 +output the node assignments of each streamline to a file; this can be used subsequently e.g. by the command connectome2tck +ARGUMENT path 0 0 FILEOUT +OPTION vector 1 0 +output a vector representing connectivities from a given seed point to target nodes, rather than a matrix of node-node connectivities +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tck2fixel b/interfaces/legacy/tck2fixel new file mode 100644 index 0000000000..fcf6340113 --- /dev/null +++ b/interfaces/legacy/tck2fixel @@ -0,0 +1,33 @@ +Compute a fixel TDI map from a tractogram +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT tracks 0 0 TRACKSIN +the input tracks. +ARGUMENT fixel_folder_in 0 0 DIRIN +the input fixel folder. Used to define the fixels and their directions +ARGUMENT fixel_folder_out 0 0 TEXT +the fixel folder to which the output will be written. This can be the same as the input folder if desired +ARGUMENT fixel_data_out 0 0 TEXT +the name of the fixel data image. +OPTION angle 1 0 +the max angle threshold for assigning streamline tangents to fixels (Default: 45 degrees) +ARGUMENT value 0 0 FLOAT 0 90 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tckconvert b/interfaces/legacy/tckconvert new file mode 100644 index 0000000000..57685855c7 --- /dev/null +++ b/interfaces/legacy/tckconvert @@ -0,0 +1,53 @@ +Convert between different track file formats +The program currently supports MRtrix .tck files (input/output), ascii text files (input/output), VTK polydata files (input/output), and RenderMan RIB (export only). +Note that ascii files will be stored with one streamline per numbered file. To support this, the command will use the multi-file numbering syntax, where square brackets denote the position of the numbering for the files, for example: +$ tckconvert input.tck output-'[]'.txt +will produce files named output-0000.txt, output-0001.txt, output-0002.txt, ... +ARGUMENT input 0 0 VARIOUS +the input track file. +ARGUMENT output 0 0 FILEOUT +the output track file. +OPTION scanner2voxel 1 0 +if specified, the properties of this image will be used to convert track point positions from real (scanner) coordinates into voxel coordinates. +ARGUMENT reference 0 0 IMAGEIN +OPTION scanner2image 1 0 +if specified, the properties of this image will be used to convert track point positions from real (scanner) coordinates into image coordinates (in mm). +ARGUMENT reference 0 0 IMAGEIN +OPTION voxel2scanner 1 0 +if specified, the properties of this image will be used to convert track point positions from voxel coordinates into real (scanner) coordinates. +ARGUMENT reference 0 0 IMAGEIN +OPTION image2scanner 1 0 +if specified, the properties of this image will be used to convert track point positions from image coordinates (in mm) into real (scanner) coordinates. +ARGUMENT reference 0 0 IMAGEIN +OPTION sides 1 0 +number of sides for streamlines +ARGUMENT sides 0 0 INT 3 15 +OPTION increment 1 0 +generate streamline points at every (increment) points +ARGUMENT increment 0 0 INT 1 9223372036854775807 +OPTION dec 1 0 +add DEC as a primvar +OPTION radius 1 0 +radius of the streamlines +ARGUMENT radius 0 0 FLOAT 0 inf +OPTION ascii 1 0 +write an ASCII VTK file (binary by default) +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tckdfc b/interfaces/legacy/tckdfc new file mode 100644 index 0000000000..7e66686154 --- /dev/null +++ b/interfaces/legacy/tckdfc @@ -0,0 +1,52 @@ +Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method +This command generates a Track-Weighted Image (TWI), where the contribution from each streamline to the image is the Pearson correlation between the fMRI time series at the streamline endpoints. +The output image can be generated in one of two ways (note that one of these two command-line options MUST be provided): +- "Static" functional connectivity (-static option): Each streamline contributes to a static 3D output image based on the correlation between the signals at the streamline endpoints using the entirety of the input time series. +- "Dynamic" functional connectivity (-dynamic option): The output image is a 4D image, with the same number of volumes as the input fMRI time series. For each volume, the contribution from each streamline is calculated based on a finite-width sliding time window, centred at the timepoint corresponding to that volume. +Note that the -backtrack option in this command is similar, but not precisely equivalent, to back-tracking as can be used with Anatomically-Constrained Tractography (ACT) in the tckgen command. However, here the feature does not change the streamlines trajectories in any way; it simply enables detection of the fact that the input fMRI image may not contain a valid timeseries underneath the streamline endpoint, and where this occurs, searches from the streamline endpoint inwards along the streamline trajectory in search of a valid timeseries to sample from the input image. +ARGUMENT tracks 0 0 FILEIN +the input track file. +ARGUMENT fmri 0 0 IMAGEIN +the pre-processed fMRI time series +ARGUMENT output 0 0 IMAGEOUT +the output TW-dFC image +OPTION static 1 0 +generate a "static" (3D) output image. +OPTION dynamic 1 0 +generate a "dynamic" (4D) output image; must additionally provide the shape and width (in volumes) of the sliding window. +ARGUMENT shape 0 0 CHOICE rectangle triangle cosine hann hamming lanczos +ARGUMENT width 0 0 INT 3 9223372036854775807 +OPTION template 1 0 +an image file to be used as a template for the output (the output image will have the same transform and field of view). +ARGUMENT image 0 0 IMAGEIN +OPTION vox 1 0 +provide either an isotropic voxel size (in mm), or comma-separated list of 3 voxel dimensions. +ARGUMENT size 0 0 FSEQ +OPTION stat_vox 1 0 +define the statistic for choosing the final voxel intensities for a given contrast type given the individual values from the tracks passing through each voxel +Options are: sum, min, mean, max (default: mean) +ARGUMENT type 0 0 CHOICE sum min mean max +OPTION backtrack 1 0 +if no valid timeseries is found at the streamline endpoint, back-track along the streamline trajectory until a valid timeseries is found +OPTION upsample 1 0 +upsample the tracks by some ratio using Hermite interpolation before mapping (if omitted, an appropriate ratio will be determined automatically) +ARGUMENT factor 0 0 INT 1 9223372036854775807 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tckedit b/interfaces/legacy/tckedit new file mode 100644 index 0000000000..081e6123d1 --- /dev/null +++ b/interfaces/legacy/tckedit @@ -0,0 +1,69 @@ +Perform various editing operations on track files +This command can be used to perform various types of manipulations on track data. A range of such manipulations are demonstrated in the examples provided below. +Concatenate data from multiple track files into one: $ tckedit *.tck all_tracks.tck Here the wildcard operator is used to select all files in the current working directory that have the .tck filetype suffix; but input files can equivalently be specified one at a time explicitly. +Extract a reduced number of streamlines: $ tckedit in_many.tck out_few.tck -number 1k -skip 500 The number of streamlines requested would typically be less than the number of streamlines in the input track file(s); if it is instead greater, then the command will issue a warning upon completion. By default the streamlines for the output file are extracted from the start of the input file(s); in this example the command is instead instructed to skip the first 500 streamlines, and write to the output file streamlines 501-1500. +Extract streamlines based on selection criteria: $ tckedit in.tck out.tck -include ROI1.mif -include ROI2.mif -minlength 25 Multiple criteria can be added in a single invocation of tckedit, and a streamline must satisfy all criteria imposed in order to be written to the output file. Note that both -include and -exclude options can be specified multiple times to provide multiple waypoints / exclusion masks. +Select only those streamline vertices within a mask: $ tckedit in.tck cropped.tck -mask mask.mif The -mask option is applied to each streamline vertex independently, rather than to each streamline, retaining only those streamline vertices within the mask. As such, use of this option may result in a greater number of output streamlines than input streamlines, as a single input streamline may have the vertices at either endpoint retained but some vertices at its midpoint removed, effectively cutting one long streamline into multiple shorter streamlines. +ARGUMENT tracks_in 0 1 TRACKSIN +the input track file(s) +ARGUMENT tracks_out 0 0 TRACKSOUT +the output track file +OPTION include 1 1 +specify an inclusion region of interest, as either a binary mask image, or as a sphere using 4 comma-separared values (x,y,z,radius). Streamlines must traverse ALL inclusion regions to be accepted. +ARGUMENT spec 0 0 VARIOUS +OPTION include_ordered 1 1 +specify an inclusion region of interest, as either a binary mask image, or as a sphere using 4 comma-separared values (x,y,z,radius). Streamlines must traverse ALL inclusion_ordered regions in the order they are specified in order to be accepted. +ARGUMENT image 0 0 TEXT +OPTION exclude 1 1 +specify an exclusion region of interest, as either a binary mask image, or as a sphere using 4 comma-separared values (x,y,z,radius). Streamlines that enter ANY exclude region will be discarded. +ARGUMENT spec 0 0 VARIOUS +OPTION mask 1 1 +specify a masking region of interest, as either a binary mask image, or as a sphere using 4 comma-separared values (x,y,z,radius). If defined, streamlines exiting the mask will be truncated. +ARGUMENT spec 0 0 VARIOUS +OPTION maxlength 1 0 +set the maximum length of any streamline in mm +ARGUMENT value 0 0 FLOAT 0 inf +OPTION minlength 1 0 +set the minimum length of any streamline in mm +ARGUMENT value 0 0 FLOAT 0 inf +OPTION number 1 0 +set the desired number of selected streamlines to be propagated to the output file +ARGUMENT count 0 0 INT 1 9223372036854775807 +OPTION skip 1 0 +omit this number of selected streamlines before commencing writing to the output file +ARGUMENT count 0 0 INT 1 9223372036854775807 +OPTION maxweight 1 0 +set the maximum weight of any streamline +ARGUMENT value 0 0 FLOAT 0 inf +OPTION minweight 1 0 +set the minimum weight of any streamline +ARGUMENT value 0 0 FLOAT 0 inf +OPTION inverse 1 0 +output the inverse selection of streamlines based on the criteria provided; i.e. only those streamlines that fail at least one selection criterion, and/or vertices that are outside masks if provided, will be written to file +OPTION ends_only 1 0 +only test the ends of each streamline against the provided include/exclude ROIs +OPTION tck_weights_in 1 0 +specify a text scalar file containing the streamline weights +ARGUMENT path 0 0 FILEIN +OPTION tck_weights_out 1 0 +specify the path for an output text scalar file containing streamline weights +ARGUMENT path 0 0 FILEOUT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tckgen b/interfaces/legacy/tckgen new file mode 100644 index 0000000000..d325e4dad0 --- /dev/null +++ b/interfaces/legacy/tckgen @@ -0,0 +1,140 @@ +Perform streamlines tractography +By default, tckgen produces a fixed number of streamlines, by attempting to seed from new random locations until the target number of streamlines have been selected (in other words, after all inclusion & exclusion criteria have been applied), or the maximum number of seeds has been exceeded (by default, this is 1000 x the desired number of selected streamlines). Use the -select and/or -seeds options to modify as required. See also the Seeding options section for alternative seeding strategies. +Below is a list of available tracking algorithms, the input image data that they require, and a brief description of their behaviour: +- FACT: Fiber Assigned by Continuous Tracking. A deterministic algorithm that takes as input a 4D image, with 3xN volumes, where N is the maximum number of fiber orientations in a voxel. Each triplet of volumes represents a 3D vector corresponding to a fiber orientation; the length of the vector additionally indicates some measure of density or anisotropy. As streamlines move from one voxel to another, the fiber orientation most collinear with the streamline orientation is selected (i.e. there is no intra-voxel interpolation). +- iFOD1: First-order Integration over Fiber Orientation Distributions. A probabilistic algorithm that takes as input a Fiber Orientation Distribution (FOD) image represented in the Spherical Harmonic (SH) basis. At each streamline step, random samples from the local (trilinear interpolated) FOD are taken. A streamline is more probable to follow orientations where the FOD amplitude is large; but it may also rarely traverse orientations with small FOD amplitude. +- iFOD2 (default): Second-order Integration over Fiber Orientation Distributions. A probabilistic algorithm that takes as input a Fiber Orientation Distribution (FOD) image represented in the Spherical Harmonic (SH) basis. Candidate streamline paths (based on short curved "arcs") are drawn, and the underlying (trilinear-interpolated) FOD amplitudes along those arcs are sampled. A streamline is more probable to follow a path where the FOD amplitudes along that path are large; but it may also rarely traverse orientations where the FOD amplitudes are small, as long as the amplitude remains above the FOD amplitude threshold along the entire path. +- NullDist1 / NullDist2: Null Distribution tracking algorithms. These probabilistic algorithms expect as input the same image that was used when invoking the corresponding algorithm for which the null distribution is sought. These algorithms generate streamlines based on random orientation samples; that is, no image information relating to fiber orientations is used, and streamlines trajectories are determined entirely from random sampling. The NullDist2 algorithm is designed to be used in conjunction with iFOD2; NullDist1 should be used in conjunction with any first-order algorithm. +- SD_STREAM: Streamlines tractography based on Spherical Deconvolution (SD). A deterministic algorithm that takes as input a Fiber Orientation Distribution (FOD) image represented in the Spherical Harmonic (SH) basis. At each streamline step, the local (trilinear-interpolated) FOD is sampled, and from the current streamline tangent orientation, a Newton optimisation on the sphere is performed in order to locate the orientation of the nearest FOD amplitude peak. +- SeedTest: A dummy streamlines algorithm used for testing streamline seeding mechanisms. Any image can be used as input; the image will not be used in any way. For each seed point generated by the seeding mechanism(s), a streamline containing a single point corresponding to that seed location will be written to the output track file. +- Tensor_Det: A deterministic algorithm that takes as input a 4D diffusion-weighted image (DWI) series. At each streamline step, the diffusion tensor is fitted to the local (trilinear-interpolated) diffusion data, and the streamline trajectory is determined as the principal eigenvector of that tensor. +- Tensor_Prob: A probabilistic algorithm that takes as input a 4D diffusion-weighted image (DWI) series. Within each image voxel, a residual bootstrap is performed to obtain a unique realisation of the DWI data in that voxel for each streamline. These data are then sampled via trilinear interpolation at each streamline step, the diffusion tensor model is fitted, and the streamline follows the orientation of the principal eigenvector of that tensor. +Note that the behaviour of the -angle option varies slightly depending on the order of integration: for any first-order method, this angle corresponds to the deviation in streamline trajectory per step; for higher-order methods, this corresponds to the change in underlying fibre orientation between the start and end points of each step. +ARGUMENT source 0 0 IMAGEIN +The image containing the source data. The type of image data required depends on the algorithm used (see Description section). +ARGUMENT tracks 0 0 TRACKSOUT +the output file containing the tracks generated. +OPTION algorithm 1 0 +specify the tractography algorithm to use. Valid choices are: FACT, iFOD1, iFOD2, Nulldist1, Nulldist2, SD_Stream, Seedtest, Tensor_Det, Tensor_Prob (default: iFOD2). +ARGUMENT name 0 0 CHOICE fact ifod1 ifod2 nulldist1 nulldist2 sd_stream seedtest tensor_det tensor_prob +OPTION select 1 0 +set the desired number of streamlines to be selected by tckgen, after all selection criteria have been applied (i.e. inclusion/exclusion ROIs, min/max length, etc). tckgen will keep seeding streamlines until this number of streamlines have been selected, or the maximum allowed number of seeds has been exceeded (see -seeds option). By default, 5000 streamlines are to be selected. Set to zero to disable, which will result in streamlines being seeded until the number specified by -seeds has been reached. +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION step 1 0 +set the step size of the algorithm in mm (defaults: for first-order algorithms, 0.1 x voxelsize; if using RK4, 0.25 x voxelsize; for iFOD2: 0.5 x voxelsize). +ARGUMENT size 0 0 FLOAT 0 inf +OPTION angle 1 0 +set the maximum angle in degrees between successive steps (defaults: 60 for deterministic algorithms; 15 for iFOD1 / nulldist1; 45 for iFOD2 / nulldist2) +ARGUMENT theta 0 0 FLOAT 0 inf +OPTION minlength 1 0 +set the minimum length of any track in mm (defaults: without ACT, 5 x voxelsize; with ACT, 2 x voxelsize). +ARGUMENT value 0 0 FLOAT 0 inf +OPTION maxlength 1 0 +set the maximum length of any track in mm (default: 100 x voxelsize). +ARGUMENT value 0 0 FLOAT 0 inf +OPTION cutoff 1 0 +set the FOD amplitude / fixel size / tensor FA cutoff for terminating tracks (defaults: 0.1 for FOD-based algorithms; 0.1 for fixel-based algorithms; 0.1 for tensor-based algorithms; threshold multiplied by 0.5 when using ACT). +ARGUMENT value 0 0 FLOAT 0 inf +OPTION trials 1 0 +set the maximum number of sampling trials at each point (only used for iFOD1 / iFOD2) (default: 1000). +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION noprecomputed 1 0 +do NOT pre-compute legendre polynomial values. Warning: this will slow down the algorithm by a factor of approximately 4. +OPTION rk4 1 0 +use 4th-order Runge-Kutta integration (slower, but eliminates curvature overshoot in 1st-order deterministic methods) +OPTION stop 1 0 +stop propagating a streamline once it has traversed all include regions +OPTION downsample 1 0 +downsample the generated streamlines to reduce output file size (default is (samples-1) for iFOD2, no downsampling for all other algorithms) +ARGUMENT factor 0 0 INT 1 9223372036854775807 +OPTION seed_image 1 1 +seed streamlines entirely at random within a mask image +ARGUMENT image 0 0 IMAGEIN +OPTION seed_sphere 1 1 +spherical seed as four comma-separated values (XYZ position and radius) +ARGUMENT spec 0 0 FSEQ +OPTION seed_random_per_voxel 1 1 +seed a fixed number of streamlines per voxel in a mask image; random placement of seeds in each voxel +ARGUMENT image 0 0 IMAGEIN +ARGUMENT num_per_voxel 0 0 INT 1 9223372036854775807 +OPTION seed_grid_per_voxel 1 1 +seed a fixed number of streamlines per voxel in a mask image; place seeds on a 3D mesh grid (grid_size argument is per axis; so a grid_size of 3 results in 27 seeds per voxel) +ARGUMENT image 0 0 IMAGEIN +ARGUMENT grid_size 0 0 INT 1 9223372036854775807 +OPTION seed_rejection 1 1 +seed from an image using rejection sampling (higher values = more probable to seed from) +ARGUMENT image 0 0 IMAGEIN +OPTION seed_gmwmi 1 1 +seed from the grey matter - white matter interface (only valid if using ACT framework). Input image should be a 3D seeding volume; seeds drawn within this image will be optimised to the interface using the 5TT image provided using the -act option. +ARGUMENT image 0 0 IMAGEIN +OPTION seed_dynamic 1 0 +determine seed points dynamically using the SIFT model (must not provide any other seeding mechanism). Note that while this seeding mechanism improves the distribution of reconstructed streamlines density, it should NOT be used as a substitute for the SIFT method itself. +ARGUMENT fod_image 0 0 IMAGEIN +OPTION seeds 1 0 +set the number of seeds that tckgen will attempt to track from. If this option is NOT provided, the default number of seeds is set to 1000× the number of selected streamlines. If -select is NOT also specified, tckgen will continue tracking until this number of seeds has been attempted. However, if -select is also specified, tckgen will stop when the number of seeds attempted reaches the number specified here, OR when the number of streamlines selected reaches the number requested with the -select option. This can be used to prevent the program from running indefinitely when no or very few streamlines can be found that match the selection criteria. Setting this to zero will cause tckgen to keep attempting seeds until the number specified by -select has been reached. +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION max_attempts_per_seed 1 0 +set the maximum number of times that the tracking algorithm should attempt to find an appropriate tracking direction from a given seed point. This should be set high enough to ensure that an actual plausible seed point is not discarded prematurely as being unable to initiate tracking from. Higher settings may affect performance if many seeds are genuinely impossible to track from, as many attempts will still be made in vain for such seeds. (default: 1000) +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION seed_cutoff 1 0 +set the minimum FA or FOD amplitude for seeding tracks (default is the same as the normal -cutoff). +ARGUMENT value 0 0 FLOAT 0 inf +OPTION seed_unidirectional 1 0 +track from the seed point in one direction only (default is to track in both directions). +OPTION seed_direction 1 0 +specify a seeding direction for the tracking (this should be supplied as a vector of 3 comma-separated values. +ARGUMENT dir 0 0 FSEQ +OPTION output_seeds 1 0 +output the seed location of all successful streamlines to a file +ARGUMENT path 0 0 FILEOUT +OPTION include 1 1 +specify an inclusion region of interest, as either a binary mask image, or as a sphere using 4 comma-separared values (x,y,z,radius). Streamlines must traverse ALL inclusion regions to be accepted. +ARGUMENT spec 0 0 VARIOUS +OPTION include_ordered 1 1 +specify an inclusion region of interest, as either a binary mask image, or as a sphere using 4 comma-separared values (x,y,z,radius). Streamlines must traverse ALL inclusion_ordered regions in the order they are specified in order to be accepted. +ARGUMENT image 0 0 TEXT +OPTION exclude 1 1 +specify an exclusion region of interest, as either a binary mask image, or as a sphere using 4 comma-separared values (x,y,z,radius). Streamlines that enter ANY exclude region will be discarded. +ARGUMENT spec 0 0 VARIOUS +OPTION mask 1 1 +specify a masking region of interest, as either a binary mask image, or as a sphere using 4 comma-separared values (x,y,z,radius). If defined, streamlines exiting the mask will be truncated. +ARGUMENT spec 0 0 VARIOUS +OPTION act 1 0 +use the Anatomically-Constrained Tractography framework during tracking; provided image must be in the 5TT (five-tissue-type) format +ARGUMENT image 0 0 IMAGEIN +OPTION backtrack 1 0 +allow tracks to be truncated and re-tracked if a poor structural termination is encountered +OPTION crop_at_gmwmi 1 0 +crop streamline endpoints more precisely as they cross the GM-WM interface +OPTION power 1 0 +raise the FOD to the power specified (defaults are: 1.0 for iFOD1; 1.0/nsamples for iFOD2). +ARGUMENT value 0 0 FLOAT 0 inf +OPTION samples 1 0 +set the number of FOD samples to take per step (Default: 4). +ARGUMENT number 0 0 INT 2 100 +OPTION grad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT file 0 0 FILEIN +OPTION fslgrad 1 0 +Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. +ARGUMENT bvecs 0 0 FILEIN +ARGUMENT bvals 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tckglobal b/interfaces/legacy/tckglobal new file mode 100644 index 0000000000..6fdd8454d5 --- /dev/null +++ b/interfaces/legacy/tckglobal @@ -0,0 +1,96 @@ +Multi-Shell Multi-Tissue Global Tractography +This command will reconstruct the global white matter fibre tractogram that best explains the input DWI data, using a multi-tissue spherical convolution model. +A more thorough description of the operation of global tractography in MRtrix3 can be found in the online documentation: +https://mrtrix.readthedocs.io/en/3.0.4/quantitative_structural_connectivity/global_tractography.html +Basic usage: $ tckglobal dwi.mif wmr.txt -riso csfr.txt -riso gmr.txt -mask mask.mif -niter 1e9 -fod fod.mif -fiso fiso.mif tracks.tck dwi.mif is the input image, wmr.txt is an anisotropic, multi-shell response function for WM, and csfr.txt and gmr.txt are isotropic response functions for CSF and GM. The output tractogram is saved to tracks.tck. Optional output images fod.mif and fiso.mif contain the predicted WM fODF and isotropic tissue fractions of CSF and GM respectively, estimated as part of the global optimization and thus affected by spatial regularization. +ARGUMENT source 0 0 IMAGEIN +the image containing the raw DWI data. +ARGUMENT response 0 0 FILEIN +the response of a track segment on the DWI signal. +ARGUMENT tracks 0 0 TRACKSOUT +the output file containing the tracks generated. +OPTION grad 1 0 +specify the diffusion encoding scheme (required if not supplied in the header). +ARGUMENT scheme 0 0 FILEIN +OPTION mask 1 0 +only reconstruct the tractogram within the specified brain mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION riso 1 1 +set one or more isotropic response functions. (multiple allowed) +ARGUMENT response 0 0 FILEIN +OPTION lmax 1 0 +set the maximum harmonic order for the output series. (default = 8) +ARGUMENT order 0 0 INT 2 30 +OPTION length 1 0 +set the length of the particles (fibre segments). (default = 1mm) +ARGUMENT size 0 0 FLOAT 1e-06 inf +OPTION weight 1 0 +set the weight by which particles contribute to the model. (default = 0.1) +ARGUMENT w 0 0 FLOAT 1e-06 1 +OPTION ppot 1 0 +set the particle potential, i.e., the cost of adding one segment, relative to the particle weight. (default = 0.05) +ARGUMENT u 0 0 FLOAT 0 1 +OPTION cpot 1 0 +set the connection potential, i.e., the energy term that drives two segments together. (default = 0.5) +ARGUMENT v 0 0 FLOAT 0 inf +OPTION t0 1 0 +set the initial temperature of the metropolis hastings optimizer. (default = 0.1) +ARGUMENT start 0 0 FLOAT 1e-06 1e+06 +OPTION t1 1 0 +set the final temperature of the metropolis hastings optimizer. (default = 0.001) +ARGUMENT end 0 0 FLOAT 1e-06 1e+06 +OPTION niter 1 0 +set the number of iterations of the metropolis hastings optimizer. (default = 10M) +ARGUMENT n 0 0 INT 0 9223372036854775807 +OPTION fod 1 0 +Predicted fibre orientation distribution function (fODF). +This fODF is estimated as part of the global track optimization, and therefore incorporates the spatial regularization that it imposes. Internally, the fODF is represented as a discrete sum of apodized point spread functions (aPSF) oriented along the directions of all particles in the voxel, used to predict the DWI signal from the particle configuration. +ARGUMENT odf 0 0 IMAGEOUT +OPTION noapo 1 0 +disable spherical convolution of fODF with apodized PSF, to output a sum of delta functions rather than a sum of aPSFs. +OPTION fiso 1 0 +Predicted isotropic fractions of the tissues for which response functions were provided with -riso. Typically, these are CSF and GM. +ARGUMENT iso 0 0 IMAGEOUT +OPTION eext 1 0 +Residual external energy in every voxel. +ARGUMENT eext 0 0 IMAGEOUT +OPTION etrend 1 0 +internal and external energy trend and cooling statistics. +ARGUMENT stats 0 0 FILEOUT +OPTION balance 1 0 +balance internal and external energy. (default = 0) +Negative values give more weight to the internal energy, positive to the external energy. +ARGUMENT b 0 0 FLOAT -100 100 +OPTION density 1 0 +set the desired density of the free Poisson process. (default = 1) +ARGUMENT lambda 0 0 FLOAT 0 inf +OPTION prob 1 0 +set the probabilities of generating birth, death, randshift, optshift and connect proposals respectively. (default = 0.25,0.05,0.25,0.1,0.35) +ARGUMENT prob 0 0 FSEQ +OPTION beta 1 0 +set the width of the Hanning interpolation window. (in [0, 1], default = 0) +If used, a mask is required, and this mask must keep at least one voxel distance to the image bounding box. +ARGUMENT b 0 0 FLOAT 0 1 +OPTION lambda 1 0 +set the weight of the internal energy directly. (default = 1) +If provided, any value of -balance will be ignored. +ARGUMENT lam 0 0 FLOAT 0 inf +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tckinfo b/interfaces/legacy/tckinfo new file mode 100644 index 0000000000..3ffb9ce233 --- /dev/null +++ b/interfaces/legacy/tckinfo @@ -0,0 +1,24 @@ +Print out information about a track file +ARGUMENT tracks 0 1 TRACKSIN +the input track file. +OPTION count 1 0 +count number of tracks in file explicitly, ignoring the header +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tckmap b/interfaces/legacy/tckmap new file mode 100644 index 0000000000..efbfe97da2 --- /dev/null +++ b/interfaces/legacy/tckmap @@ -0,0 +1,89 @@ +Map streamlines to an image, with various options for generating image contrast +The -contrast option controls how a value is derived for each streamline that is subsequently contributed to the image elements intersected by that streamline, and therefore strongly influences the contrast of that image. The permissible values are briefly summarised as follows: +- tdi: Each streamline effectively contributes a value of unity to the final map (equivalent to the original Track Density Imaging (TDI) method) +- length: The length of the streamline in mm +- invlength: The reciprocal of streamline length +- scalar_map: Values are sampled from a scalar image (which must be provided via -image) +- scalar_map_count: If a non-zero value is sampled from a scalar image (as provided via -image), the streamline contributes a value of 1, otherwise it contributes 0, such that an image can be produced reflecting the density of streamlines that intersect such an image +- fod_amp: The amplitudes of a Fibre Orientation Distribution (FOD) image +- curvature: The curvature of the streamline +- vector_file: A value for each streamline has been pre-calculated, and these are provided in a text file via the -vector_file option +A "super-resolution" output image can be generated using the -vox option, whether or not a template image is provided using the -template option. If -template is used in conjunction with -vox, the image axes and FoV will still match that of the template image, but the spatial resolution will differ. +Note: if you run into limitations with RAM usage, try writing the output image as a .mif file or .mih / .dat file pair to a local hard drive: this will allow tckmap to dump the generated image contents directly to disk, rather than allocating an additional buffer to store the output image for write-out, thereby potentially halving RAM usage. +ARGUMENT tracks 0 0 FILEIN +the input track file. +ARGUMENT output 0 0 IMAGEOUT +the output track-weighted image +OPTION template 1 0 +an image file to be used as a template for the output (the output image will have the same transform and field of view). +ARGUMENT image 0 0 IMAGEIN +OPTION vox 1 0 +provide either an isotropic voxel size (in mm), or comma-separated list of 3 voxel dimensions. +ARGUMENT size 0 0 FSEQ +OPTION datatype 1 0 +specify output image data type. +ARGUMENT spec 0 0 CHOICE float16 float16le float16be float32 float32le float32be float64 float64le float64be int64 uint64 int64le uint64le int64be uint64be int32 uint32 int32le uint32le int32be uint32be int16 uint16 int16le uint16le int16be uint16be cfloat16 cfloat16le cfloat16be cfloat32 cfloat32le cfloat32be cfloat64 cfloat64le cfloat64be int8 uint8 bit +OPTION dec 1 0 +perform track mapping in directionally-encoded colour (DEC) space +OPTION dixel 1 0 +map streamlines to dixels within each voxel; requires either a number of dixels (references an internal direction set), or a path to a text file containing a set of directions stored as azimuth/elevation pairs +ARGUMENT path 0 0 VARIOUS +OPTION tod 1 0 +generate a Track Orientation Distribution (TOD) in each voxel; need to specify the maximum spherical harmonic degree lmax to use when generating Apodised Point Spread Functions +ARGUMENT lmax 0 0 INT 2 20 +OPTION contrast 1 0 +define the desired form of contrast for the output image +Options are: tdi, length, invlength, scalar_map, scalar_map_count, fod_amp, curvature, vector_file (default: tdi) +ARGUMENT type 0 0 CHOICE tdi length invlength scalar_map scalar_map_count fod_amp curvature vector_file +OPTION image 1 0 +provide the scalar image map for generating images with 'scalar_map' / 'scalar_map_count' contrast, or the spherical harmonics image for 'fod_amp' contrast +ARGUMENT image 0 0 IMAGEIN +OPTION vector_file 1 0 +provide the vector data file for generating images with 'vector_file' contrast +ARGUMENT path 0 0 FILEIN +OPTION stat_vox 1 0 +define the statistic for choosing the final voxel intensities for a given contrast type given the individual values from the tracks passing through each voxel. +Options are: sum, min, mean, max (default: sum) +ARGUMENT type 0 0 CHOICE sum min mean max +OPTION stat_tck 1 0 +define the statistic for choosing the contribution to be made by each streamline as a function of the samples taken along their lengths. +Only has an effect for 'scalar_map', 'fod_amp' and 'curvature' contrast types. +Options are: sum, min, mean, max, median, mean_nonzero, gaussian, ends_min, ends_mean, ends_max, ends_prod (default: mean) +ARGUMENT type 0 0 CHOICE sum min mean max median mean_nonzero gaussian ends_min ends_mean ends_max ends_prod +OPTION fwhm_tck 1 0 +when using gaussian-smoothed per-track statistic, specify the desired full-width half-maximum of the Gaussian smoothing kernel (in mm) +ARGUMENT value 0 0 FLOAT 1e-06 inf +OPTION map_zero 1 0 +if a streamline has zero contribution based on the contrast & statistic, typically it is not mapped; use this option to still contribute to the map even if this is the case (these non-contributing voxels can then influence the mean value in each voxel of the map) +OPTION backtrack 1 0 +when using -stat_tck ends_*, if the streamline endpoint is outside the FoV, backtrack along the streamline trajectory until an appropriate point is found +OPTION upsample 1 0 +upsample the tracks by some ratio using Hermite interpolation before mappping +(If omitted, an appropriate ratio will be determined automatically) +ARGUMENT factor 0 0 INT 1 9223372036854775807 +OPTION precise 1 0 +use a more precise streamline mapping strategy, that accurately quantifies the length through each voxel (these lengths are then taken into account during TWI calculation) +OPTION ends_only 1 0 +only map the streamline endpoints to the image +OPTION tck_weights_in 1 0 +specify a text scalar file containing the streamline weights +ARGUMENT path 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tckresample b/interfaces/legacy/tckresample new file mode 100644 index 0000000000..d5b5a2e92b --- /dev/null +++ b/interfaces/legacy/tckresample @@ -0,0 +1,51 @@ +Resample each streamline in a track file to a new set of vertices +It is necessary to specify precisely ONE of the command-line options for controlling how this resampling takes place; this may be either increasing or decreasing the number of samples along each streamline, or may involve changing the positions of the samples according to some specified trajectory. +Note that because the length of a streamline is calculated based on the sums of distances between adjacent vertices, resampling a streamline to a new set of vertices will typically change the quantified length of that streamline; the magnitude of the difference will typically depend on the discrepancy in the number of vertices, with less vertices leading to a shorter length (due to taking chordal lengths of curved trajectories). +ARGUMENT in_tracks 0 0 TRACKSIN +the input track file +ARGUMENT out_tracks 0 0 TRACKSOUT +the output resampled tracks +OPTION upsample 1 0 +increase the density of points along the length of each streamline by some factor (may improve mapping streamlines to ROIs, and/or visualisation) +ARGUMENT ratio 0 0 INT 1 9223372036854775807 +OPTION downsample 1 0 +increase the density of points along the length of each streamline by some factor (decreases required storage space) +ARGUMENT ratio 0 0 INT 1 9223372036854775807 +OPTION step_size 1 0 +re-sample the streamlines to a desired step size (in mm) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION num_points 1 0 +re-sample each streamline to a fixed number of points +ARGUMENT count 0 0 INT 2 9223372036854775807 +OPTION endpoints 1 0 +only output the two endpoints of each streamline +OPTION line 1 0 +resample tracks at 'num' equidistant locations along a line between 'start' and 'end' (specified as comma-separated 3-vectors in scanner coordinates) +ARGUMENT num 0 0 INT 2 9223372036854775807 +ARGUMENT start 0 0 FSEQ +ARGUMENT end 0 0 FSEQ +OPTION arc 1 0 +resample tracks at 'num' equidistant locations along a circular arc specified by points 'start', 'mid' and 'end' (specified as comma-separated 3-vectors in scanner coordinates) +ARGUMENT num 0 0 INT 2 9223372036854775807 +ARGUMENT start 0 0 FSEQ +ARGUMENT mid 0 0 FSEQ +ARGUMENT end 0 0 FSEQ +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tcksample b/interfaces/legacy/tcksample new file mode 100644 index 0000000000..16315d8428 --- /dev/null +++ b/interfaces/legacy/tcksample @@ -0,0 +1,36 @@ +Sample values of an associated image along tracks +By default, the value of the underlying image at each point along the track is written to either an ASCII file (with all values for each track on the same line), or a track scalar file (.tsf). Alternatively, some statistic can be taken from the values along each streamline and written to a vector file. +ARGUMENT tracks 0 0 TRACKSIN +the input track file +ARGUMENT image 0 0 IMAGEIN +the image to be sampled +ARGUMENT values 0 0 FILEOUT +the output sampled values +OPTION stat_tck 1 0 +compute some statistic from the values along each streamline (options are: mean,median,min,max) +ARGUMENT statistic 0 0 CHOICE mean median min max +OPTION nointerp 1 0 +do not use trilinear interpolation when sampling image values +OPTION precise 1 0 +use the precise mechanism for mapping streamlines to voxels (obviates the need for trilinear interpolation) (only applicable if some per-streamline statistic is requested) +OPTION use_tdi_fraction 1 0 +each streamline is assigned a fraction of the image intensity in each voxel based on the fraction of the track density contributed by that streamline (this is only appropriate for processing a whole-brain tractogram, and images for which the quantiative parameter is additive) +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tcksift b/interfaces/legacy/tcksift new file mode 100644 index 0000000000..425b6c8976 --- /dev/null +++ b/interfaces/legacy/tcksift @@ -0,0 +1,70 @@ +Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals +ARGUMENT in_tracks 0 0 TRACKSIN +the input track file +ARGUMENT in_fod 0 0 IMAGEIN +input image containing the spherical harmonics of the fibre orientation distributions +ARGUMENT out_tracks 0 0 TRACKSOUT +the output filtered tracks file +OPTION nofilter 1 0 +do NOT perform track filtering - just construct the model in order to provide output debugging images +OPTION output_at_counts 1 0 +output filtered track files (and optionally debugging images if -output_debug is specified) at specific numbers of remaining streamlines; provide as comma-separated list of integers +ARGUMENT counts 0 0 ISEQ +OPTION proc_mask 1 0 +provide an image containing the processing mask weights for the model; image spatial dimensions must match the fixel image +ARGUMENT image 0 0 IMAGEIN +OPTION act 1 0 +use an ACT five-tissue-type segmented anatomical image to derive the processing mask +ARGUMENT image 0 0 IMAGEIN +OPTION fd_scale_gm 1 0 +provide this option (in conjunction with -act) to heuristically downsize the fibre density estimates based on the presence of GM in the voxel. This can assist in reducing tissue interface effects when using a single-tissue deconvolution algorithm +OPTION no_dilate_lut 1 0 +do NOT dilate FOD lobe lookup tables; only map streamlines to FOD lobes if the precise tangent lies within the angular spread of that lobe +OPTION make_null_lobes 1 0 +add an additional FOD lobe to each voxel, with zero integral, that covers all directions with zero / negative FOD amplitudes +OPTION remove_untracked 1 0 +remove FOD lobes that do not have any streamline density attributed to them; this improves filtering slightly, at the expense of longer computation time (and you can no longer do quantitative comparisons between reconstructions if this is enabled) +OPTION fd_thresh 1 0 +fibre density threshold; exclude an FOD lobe from filtering processing if its integral is less than this amount (streamlines will still be mapped to it, but it will not contribute to the cost function or the filtering) +ARGUMENT value 0 0 FLOAT 0 6.28319 +OPTION csv 1 0 +output statistics of execution per iteration to a .csv file +ARGUMENT file 0 0 FILEOUT +OPTION out_mu 1 0 +output the final value of SIFT proportionality coefficient mu to a text file +ARGUMENT file 0 0 FILEOUT +OPTION output_debug 1 0 +write to a directory various output images for assessing & debugging performance etc. +ARGUMENT dirpath 0 0 DIROUT +OPTION out_selection 1 0 +output a text file containing the binary selection of streamlines +ARGUMENT path 0 0 FILEOUT +OPTION term_number 1 0 +number of streamlines - continue filtering until this number of streamlines remain +ARGUMENT value 0 0 INT 1 9223372036854775807 +OPTION term_ratio 1 0 +termination ratio - defined as the ratio between reduction in cost function, and reduction in density of streamlines. +Smaller values result in more streamlines being filtered out. +ARGUMENT value 0 0 FLOAT 1e-06 inf +OPTION term_mu 1 0 +terminate filtering once the SIFT proportionality coefficient reaches a given value +ARGUMENT value 0 0 FLOAT 0 inf +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tcksift2 b/interfaces/legacy/tcksift2 new file mode 100644 index 0000000000..818dca32cc --- /dev/null +++ b/interfaces/legacy/tcksift2 @@ -0,0 +1,90 @@ +Optimise per-streamline cross-section multipliers to match a whole-brain tractogram to fixel-wise fibre densities +ARGUMENT in_tracks 0 0 TRACKSIN +the input track file +ARGUMENT in_fod 0 0 IMAGEIN +input image containing the spherical harmonics of the fibre orientation distributions +ARGUMENT out_weights 0 0 FILEOUT +output text file containing the weighting factor for each streamline +OPTION proc_mask 1 0 +provide an image containing the processing mask weights for the model; image spatial dimensions must match the fixel image +ARGUMENT image 0 0 IMAGEIN +OPTION act 1 0 +use an ACT five-tissue-type segmented anatomical image to derive the processing mask +ARGUMENT image 0 0 IMAGEIN +OPTION fd_scale_gm 1 0 +provide this option (in conjunction with -act) to heuristically downsize the fibre density estimates based on the presence of GM in the voxel. This can assist in reducing tissue interface effects when using a single-tissue deconvolution algorithm +OPTION no_dilate_lut 1 0 +do NOT dilate FOD lobe lookup tables; only map streamlines to FOD lobes if the precise tangent lies within the angular spread of that lobe +OPTION make_null_lobes 1 0 +add an additional FOD lobe to each voxel, with zero integral, that covers all directions with zero / negative FOD amplitudes +OPTION remove_untracked 1 0 +remove FOD lobes that do not have any streamline density attributed to them; this improves filtering slightly, at the expense of longer computation time (and you can no longer do quantitative comparisons between reconstructions if this is enabled) +OPTION fd_thresh 1 0 +fibre density threshold; exclude an FOD lobe from filtering processing if its integral is less than this amount (streamlines will still be mapped to it, but it will not contribute to the cost function or the filtering) +ARGUMENT value 0 0 FLOAT 0 6.28319 +OPTION csv 1 0 +output statistics of execution per iteration to a .csv file +ARGUMENT file 0 0 FILEOUT +OPTION out_mu 1 0 +output the final value of SIFT proportionality coefficient mu to a text file +ARGUMENT file 0 0 FILEOUT +OPTION output_debug 1 0 +write to a directory various output images for assessing & debugging performance etc. +ARGUMENT dirpath 0 0 DIROUT +OPTION out_coeffs 1 0 +output text file containing the weighting coefficient for each streamline +ARGUMENT path 0 0 FILEOUT +OPTION reg_tikhonov 1 0 +provide coefficient for regularising streamline weighting coefficients (Tikhonov regularisation) (default: 0) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION reg_tv 1 0 +provide coefficient for regularising variance of streamline weighting coefficient to fixels along its length (Total Variation regularisation) (default: 0.1) +ARGUMENT value 0 0 FLOAT 0 inf +OPTION min_td_frac 1 0 +minimum fraction of the FOD integral reconstructed by streamlines; if the reconstructed streamline density is below this fraction, the fixel is excluded from optimisation (default: 0.1) +ARGUMENT fraction 0 0 FLOAT 0 1 +OPTION min_iters 1 0 +minimum number of iterations to run before testing for convergence; this can prevent premature termination at early iterations if the cost function increases slightly (default: 10) +ARGUMENT count 0 0 INT 0 9223372036854775807 +OPTION max_iters 1 0 +maximum number of iterations to run before terminating program +ARGUMENT count 0 0 INT 0 9223372036854775807 +OPTION min_factor 1 0 +minimum weighting factor for an individual streamline; if the factor falls below this number the streamline will be rejected entirely (factor set to zero) (default: 0) +ARGUMENT factor 0 0 FLOAT 0 1 +OPTION min_coeff 1 0 +minimum weighting coefficient for an individual streamline; similar to the '-min_factor' option, but using the exponential coefficient basis of the SIFT2 model; these parameters are related as: factor = e^(coeff). Note that the -min_factor and -min_coeff options are mutually exclusive - you can only provide one. (default: -inf) +ARGUMENT coeff 0 0 FLOAT -inf 0 +OPTION max_factor 1 0 +maximum weighting factor that can be assigned to any one streamline (default: inf) +ARGUMENT factor 0 0 FLOAT 1 inf +OPTION max_coeff 1 0 +maximum weighting coefficient for an individual streamline; similar to the '-max_factor' option, but using the exponential coefficient basis of the SIFT2 model; these parameters are related as: factor = e^(coeff). Note that the -max_factor and -max_coeff options are mutually exclusive - you can only provide one. (default: inf) +ARGUMENT coeff 0 0 FLOAT 1 inf +OPTION max_coeff_step 1 0 +maximum change to a streamline's weighting coefficient in a single iteration (default: 1) +ARGUMENT step 0 0 FLOAT -inf inf +OPTION min_cf_decrease 1 0 +minimum decrease in the cost function (as a fraction of the initial value) that must occur each iteration for the algorithm to continue (default: 2.5e-05) +ARGUMENT frac 0 0 FLOAT 0 1 +OPTION linear 1 0 +perform a linear estimation of streamline weights, rather than the standard non-linear optimisation (typically does not provide as accurate a model fit; but only requires a single pass) +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tckstats b/interfaces/legacy/tckstats new file mode 100644 index 0000000000..5d7ca2b59d --- /dev/null +++ b/interfaces/legacy/tckstats @@ -0,0 +1,36 @@ +Calculate statistics on streamlines lengths +ARGUMENT tracks_in 0 0 TRACKSIN +the input track file +OPTION output 1 1 +output only the field specified. Multiple such options can be supplied if required. Choices are: mean, median, std, min, max, count. Useful for use in scripts. +ARGUMENT field 0 0 CHOICE mean median std min max count +OPTION histogram 1 0 +output a histogram of streamline lengths +ARGUMENT path 0 0 FILEOUT +OPTION dump 1 0 +dump the streamlines lengths to a text file +ARGUMENT path 0 0 FILEOUT +OPTION ignorezero 1 0 +do not generate a warning if the track file contains streamlines with zero length +OPTION tck_weights_in 1 0 +specify a text scalar file containing the streamline weights +ARGUMENT path 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tcktransform b/interfaces/legacy/tcktransform new file mode 100644 index 0000000000..a895eaf1ad --- /dev/null +++ b/interfaces/legacy/tcktransform @@ -0,0 +1,26 @@ +Apply a spatial transformation to a tracks file +ARGUMENT tracks 0 0 TRACKSIN +the input track file. +ARGUMENT transform 0 0 IMAGEIN +the image containing the transform. +ARGUMENT output 0 0 TRACKSOUT +the output track file +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tensor2metric b/interfaces/legacy/tensor2metric new file mode 100644 index 0000000000..432081d69f --- /dev/null +++ b/interfaces/legacy/tensor2metric @@ -0,0 +1,76 @@ +Generate maps of tensor-derived parameters +ARGUMENT tensor 0 0 IMAGEIN +the input tensor image. +OPTION mask 1 0 +only perform computation within the specified binary brain mask image. +ARGUMENT image 0 0 IMAGEIN +OPTION adc 1 0 +compute the mean apparent diffusion coefficient (ADC) of the diffusion tensor. (sometimes also referred to as the mean diffusivity (MD)) +ARGUMENT image 0 0 IMAGEOUT +OPTION fa 1 0 +compute the fractional anisotropy (FA) of the diffusion tensor. +ARGUMENT image 0 0 IMAGEOUT +OPTION ad 1 0 +compute the axial diffusivity (AD) of the diffusion tensor. (equivalent to the principal eigenvalue) +ARGUMENT image 0 0 IMAGEOUT +OPTION rd 1 0 +compute the radial diffusivity (RD) of the diffusion tensor. (equivalent to the mean of the two non-principal eigenvalues) +ARGUMENT image 0 0 IMAGEOUT +OPTION value 1 0 +compute the selected eigenvalue(s) of the diffusion tensor. +ARGUMENT image 0 0 IMAGEOUT +OPTION vector 1 0 +compute the selected eigenvector(s) of the diffusion tensor. +ARGUMENT image 0 0 IMAGEOUT +OPTION num 1 0 +specify the desired eigenvalue/eigenvector(s). Note that several eigenvalues can be specified as a number sequence. For example, '1,3' specifies the principal (1) and minor (3) eigenvalues/eigenvectors (default = 1). +ARGUMENT sequence 0 0 ISEQ +OPTION modulate 1 0 +specify how to modulate the magnitude of the eigenvectors. Valid choices are: none, FA, eigval (default = FA). +ARGUMENT choice 0 0 CHOICE none fa eigval +OPTION cl 1 0 +compute the linearity metric of the diffusion tensor. (one of the three Westin shape metrics) +ARGUMENT image 0 0 IMAGEOUT +OPTION cp 1 0 +compute the planarity metric of the diffusion tensor. (one of the three Westin shape metrics) +ARGUMENT image 0 0 IMAGEOUT +OPTION cs 1 0 +compute the sphericity metric of the diffusion tensor. (one of the three Westin shape metrics) +ARGUMENT image 0 0 IMAGEOUT +OPTION dkt 1 0 +input diffusion kurtosis tensor. +ARGUMENT image 0 0 IMAGEIN +OPTION mk 1 0 +compute the mean kurtosis (MK) of the kurtosis tensor. +ARGUMENT image 0 0 IMAGEOUT +OPTION ak 1 0 +compute the axial kurtosis (AK) of the kurtosis tensor. +ARGUMENT image 0 0 IMAGEOUT +OPTION rk 1 0 +compute the radial kurtosis (RK) of the kurtosis tensor. +ARGUMENT image 0 0 IMAGEOUT +OPTION mk_dirs 1 0 +specify the directions used to numerically calculate mean kurtosis (by default, the built-in 300 direction set is used). These should be supplied as a text file containing [ az el ] pairs for the directions. +ARGUMENT file 0 0 FILEIN +OPTION rk_ndirs 1 0 +specify the number of directions used to numerically calculate radial kurtosis (by default, 300 directions are used). +ARGUMENT integer 0 0 INT 0 1000 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/transformcalc b/interfaces/legacy/transformcalc new file mode 100644 index 0000000000..aa58d2753c --- /dev/null +++ b/interfaces/legacy/transformcalc @@ -0,0 +1,34 @@ +Perform calculations on linear transformation matrices +Invert a transformation: $ transformcalc matrix_in.txt invert matrix_out.txt +Calculate the matrix square root of the input transformation (halfway transformation): $ transformcalc matrix_in.txt half matrix_out.txt +Calculate the rigid component of an affine input transformation: $ transformcalc affine_in.txt rigid rigid_out.txt +Calculate the transformation matrix from an original image and an image with modified header: $ transformcalc mov mapmovhdr header output +Calculate the average affine matrix of a set of input matrices: $ transformcalc input1.txt ... inputN.txt average matrix_out.txt +Create interpolated transformation matrix between two inputs: $ transformcalc input1.txt input2.txt interpolate matrix_out.txt Based on matrix decomposition with linear interpolation of translation, rotation and stretch described in: Shoemake, K., Hill, M., & Duff, T. (1992). Matrix Animation and Polar Decomposition. Matrix, 92, 258-264. doi:10.1.1.56.1336 +Decompose transformation matrix M into translation, rotation and stretch and shear (M = T * R * S): $ transformcalc matrix_in.txt decompose matrixes_out.txt The output is a key-value text file containing: scaling: vector of 3 scaling factors in x, y, z direction; shear: list of shear factors for xy, xz, yz axes; angles: list of Euler angles about static x, y, z axes in radians in the range [0:pi]x[-pi:pi]x[-pi:pi]; angle_axis: angle in radians and rotation axis; translation : translation vector along x, y, z axes in mm; R: composed roation matrix (R = rot_x * rot_y * rot_z); S: composed scaling and shear matrix +Calculate transformation that aligns two images based on sets of corresponding landmarks: $ transformcalc input moving.txt fixed.txt align_vertices_rigid rigid.txt Similary, 'align_vertices_rigid_scale' produces an affine matrix (rigid and global scale). Vertex coordinates are in scanner space, corresponding vertices must be stored in the same row of moving.txt and fixed.txt. Requires 3 or more vertices in each file. Algorithm: Kabsch 'A solution for the best rotation to relate two sets of vectors' DOI:10.1107/S0567739476001873 +ARGUMENT inputs 0 1 +the input(s) for the specified operation +ARGUMENT operation 0 0 CHOICE invert half rigid header average interpolate decompose align_vertices_rigid align_vertices_rigid_scale +the operation to perform, one of: invert, half, rigid, header, average, interpolate, decompose, align_vertices_rigid, align_vertices_rigid_scale (see description section for details). +ARGUMENT output 0 0 FILEOUT +the output transformation matrix. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/transformcompose b/interfaces/legacy/transformcompose new file mode 100644 index 0000000000..8c9c05442c --- /dev/null +++ b/interfaces/legacy/transformcompose @@ -0,0 +1,30 @@ +Compose any number of linear transformations and/or warps into a single transformation +Any linear transforms must be supplied as a 4x4 matrix in a text file (e.g. as per the output of mrregister). Any warp fields must be supplied as a 4D image representing a deformation field (e.g. as output from mrrregister -nl_warp). +Input transformations should be provided to the command in the order in which they would be applied to an image if they were to be applied individually. +If all input transformations are linear, and the -template option is not provided, then the file output by the command will also be a linear transformation saved as a 4x4 matrix in a text file. If a template image is supplied, then the output will always be a deformation field. If at least one of the inputs is a warp field, then the output will be a deformation field, which will be defined on the grid of the last input warp image supplied if the -template option is not used. +ARGUMENT input 0 1 FILEIN +the input transforms (either linear or non-linear warps). +ARGUMENT output 0 0 VARIOUS +the output file (may be a linear transformation text file, or a deformation warp field image, depending on usage) +OPTION template 1 0 +define the output grid defined by a template image +ARGUMENT image 0 0 IMAGEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/transformconvert b/interfaces/legacy/transformconvert new file mode 100644 index 0000000000..3641bda7e8 --- /dev/null +++ b/interfaces/legacy/transformconvert @@ -0,0 +1,30 @@ +Convert linear transformation matrices +This command allows to convert transformation matrices provided by other registration softwares to a format usable in MRtrix3. Example usages are provided below. +Convert a transformation matrix produced by FSL's flirt command into a format usable by MRtrix3: $ transformconvert transform_flirt.mat flirt_in.nii flirt_ref.nii flirt_import transform_mrtrix.txt The two images provided as inputs for this operation must be in the correct order: first the image that was provided to flirt via the -in option, second the image that was provided to flirt via the -ref option. +Convert a plain text transformation matrix file produced by ITK's affine registration (e.g. ANTS, Slicer) into a format usable by MRtrix3: $ transformconvert transform_itk.txt itk_import transform_mrtrix.txt +ARGUMENT input 0 1 +the input(s) for the specified operation +ARGUMENT operation 0 0 CHOICE flirt_import itk_import +the operation to perform, one of: +flirt_import, itk_import +ARGUMENT output 0 0 FILEOUT +the output transformation matrix. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tsfdivide b/interfaces/legacy/tsfdivide new file mode 100644 index 0000000000..fc62630173 --- /dev/null +++ b/interfaces/legacy/tsfdivide @@ -0,0 +1,26 @@ +Divide corresponding values in track scalar files +ARGUMENT input1 0 0 FILEIN +the first input track scalar file. +ARGUMENT input2 0 0 FILEIN +the second input track scalar file. +ARGUMENT output 0 0 FILEOUT +the output track scalar file +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tsfinfo b/interfaces/legacy/tsfinfo new file mode 100644 index 0000000000..90c7314664 --- /dev/null +++ b/interfaces/legacy/tsfinfo @@ -0,0 +1,27 @@ +Print out information about a track scalar file +ARGUMENT tracks 0 1 FILEIN +the input track scalar file. +OPTION count 1 0 +count number of tracks in file explicitly, ignoring the header +OPTION ascii 1 0 +save values of each track scalar file in individual ascii files, with the specified prefix. +ARGUMENT prefix 0 0 TEXT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tsfmult b/interfaces/legacy/tsfmult new file mode 100644 index 0000000000..6c2c8efe31 --- /dev/null +++ b/interfaces/legacy/tsfmult @@ -0,0 +1,26 @@ +Multiply corresponding values in track scalar files +ARGUMENT input1 0 0 FILEIN +the first input track scalar file. +ARGUMENT input1 0 0 FILEIN +the second input track scalar file. +ARGUMENT output 0 0 FILEOUT +the output track scalar file +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tsfsmooth b/interfaces/legacy/tsfsmooth new file mode 100644 index 0000000000..80ce533670 --- /dev/null +++ b/interfaces/legacy/tsfsmooth @@ -0,0 +1,27 @@ +Gaussian filter a track scalar file +ARGUMENT input 0 0 FILEIN +the input track scalar file. +ARGUMENT output 0 0 FILEOUT +the output track scalar file +OPTION stdev 1 0 +apply Gaussian smoothing with the specified standard deviation. The standard deviation is defined in units of track points (default: 4) +ARGUMENT sigma 0 0 FLOAT 1e-06 inf +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tsfthreshold b/interfaces/legacy/tsfthreshold new file mode 100644 index 0000000000..7ca1305d1f --- /dev/null +++ b/interfaces/legacy/tsfthreshold @@ -0,0 +1,28 @@ +Threshold and invert track scalar files +ARGUMENT input 0 0 FILEIN +the input track scalar file. +ARGUMENT T 0 0 FLOAT -inf inf +the desired threshold +ARGUMENT output 0 0 FILEOUT +the binary output track scalar file +OPTION invert 1 0 +invert the output mask +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/tsfvalidate b/interfaces/legacy/tsfvalidate new file mode 100644 index 0000000000..157831666a --- /dev/null +++ b/interfaces/legacy/tsfvalidate @@ -0,0 +1,24 @@ +Validate a track scalar file against the corresponding track data +ARGUMENT tsf 0 0 FILEIN +the input track scalar file +ARGUMENT tracks 0 0 FILEIN +the track file on which the TSF is based +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/vectorstats b/interfaces/legacy/vectorstats new file mode 100644 index 0000000000..7a0262578d --- /dev/null +++ b/interfaces/legacy/vectorstats @@ -0,0 +1,60 @@ +Statistical testing of vector data using non-parametric permutation testing +This command can be used to perform permutation testing of any form of data. The data for each input subject must be stored in a text file, with one value per row. The data for each row across subjects will be tested independently, i.e. there is no statistical enhancement that occurs between the data; however family-wise error control will be used. +In some software packages, a column of ones is automatically added to the GLM design matrix; the purpose of this column is to estimate the "global intercept", which is the predicted value of the observed variable if all explanatory variables were to be zero. However there are rare situations where including such a column would not be appropriate for a particular experimental design. Hence, in MRtrix3 statistical inference commands, it is up to the user to determine whether or not this column of ones should be included in their design matrix, and add it explicitly if necessary. The contrast matrix must also reflect the presence of this additional column. +ARGUMENT input 0 0 FILEIN +a text file listing the file names of the input subject data +ARGUMENT design 0 0 FILEIN +the design matrix +ARGUMENT contrast 0 0 FILEIN +the contrast matrix +ARGUMENT output 0 0 TEXT +the filename prefix for all output +OPTION notest 1 0 +don't perform statistical inference; only output population statistics (effect size, stdev etc) +OPTION errors 1 0 +specify nature of errors for shuffling; options are: ee,ise,both (default: ee) +ARGUMENT spec 0 0 CHOICE ee ise both +OPTION exchange_within 1 0 +specify blocks of observations within each of which data may undergo restricted exchange +ARGUMENT file 0 0 FILEIN +OPTION exchange_whole 1 0 +specify blocks of observations that may be exchanged with one another (for independent and symmetric errors, sign-flipping will occur block-wise) +ARGUMENT file 0 0 FILEIN +OPTION strong 1 0 +use strong familywise error control across multiple hypotheses +OPTION nshuffles 1 0 +the number of shuffles (default: 5000) +ARGUMENT number 0 0 INT 1 9223372036854775807 +OPTION permutations 1 0 +manually define the permutations (relabelling). The input should be a text file defining a m x n matrix, where each relabelling is defined as a column vector of size m, and the number of columns, n, defines the number of permutations. Can be generated with the palm_quickperms function in PALM (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM). Overrides the -nshuffles option. +ARGUMENT file 0 0 FILEIN +OPTION variance 1 0 +define variance groups for the G-statistic; measurements for which the expected variance is equivalent should contain the same index +ARGUMENT file 0 0 FILEIN +OPTION ftests 1 0 +perform F-tests; input text file should contain, for each F-test, a row containing ones and zeros, where ones indicate the rows of the contrast matrix to be included in the F-test. +ARGUMENT path 0 0 FILEIN +OPTION fonly 1 0 +only assess F-tests; do not perform statistical inference on entries in the contrast matrix +OPTION column 1 1 +add a column to the design matrix corresponding to subject element-wise values (note that the contrast matrix must include an additional column for each use of this option); the text file provided via this option should contain a file name for each subject +ARGUMENT path 0 0 FILEIN +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/voxel2fixel b/interfaces/legacy/voxel2fixel new file mode 100644 index 0000000000..dcdca42c41 --- /dev/null +++ b/interfaces/legacy/voxel2fixel @@ -0,0 +1,31 @@ +Map the scalar value in each voxel to all fixels within that voxel +This command is designed to enable CFE-based statistical analysis to be performed on voxel-wise measures. +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT image_in 0 0 IMAGEIN +the input image. +ARGUMENT fixel_directory_in 0 0 DIRIN +the input fixel directory. Used to define the fixels and their directions +ARGUMENT fixel_directory_out 0 0 TEXT +the fixel directory where the output will be written. This can be the same as the input directory if desired +ARGUMENT fixel_data_out 0 0 TEXT +the name of the fixel data image. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/voxel2mesh b/interfaces/legacy/voxel2mesh new file mode 100644 index 0000000000..1af6f2e205 --- /dev/null +++ b/interfaces/legacy/voxel2mesh @@ -0,0 +1,31 @@ +Generate a surface mesh representation from a voxel image +This command utilises the Marching Cubes algorithm to generate a polygonal surface that represents the isocontour(s) of the input image at a particular intensity. By default, an appropriate threshold will be determined automatically from the input image, however the intensity value of the isocontour(s) can instead be set manually using the -threhsold option. +If the -blocky option is used, then the Marching Cubes algorithm will not be used. Instead, the input image will be interpreted as a binary mask image, and polygonal surfaces will be generated at the outer faces of the voxel clusters within the mask. +ARGUMENT input 0 0 IMAGEIN +the input image. +ARGUMENT output 0 0 FILEOUT +the output mesh file. +OPTION blocky 1 0 +generate a 'blocky' mesh that precisely represents the voxel edges +OPTION threshold 1 0 +manually set the intensity threshold for the Marching Cubes algorithm +ARGUMENT value 0 0 FLOAT -inf inf +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/warp2metric b/interfaces/legacy/warp2metric new file mode 100644 index 0000000000..247869da43 --- /dev/null +++ b/interfaces/legacy/warp2metric @@ -0,0 +1,35 @@ +Compute fixel-wise or voxel-wise metrics from a 4D deformation field +Fixel data are stored utilising the fixel directory format described in the main documentation, which can be found at the following link: +https://mrtrix.readthedocs.io/en/3.0.4/fixel_based_analysis/fixel_directory_format.html +ARGUMENT in 0 0 IMAGEIN +the input deformation field +OPTION fc 1 0 +use an input template fixel image to define fibre orientations and output a fixel image describing the change in fibre cross-section (FC) in the perpendicular plane to the fixel orientation. e.g. warp2metric warp.mif -fc fixel_template_directory output_fixel_directory fc.mif +ARGUMENT template_fixel_directory 0 0 IMAGEIN +ARGUMENT output_fixel_directory 0 0 TEXT +ARGUMENT output_fixel_data 0 0 TEXT +OPTION jmat 1 0 +output a Jacobian matrix image stored in column-major order along the 4th dimension.Note the output jacobian describes the warp gradient w.r.t the scanner space coordinate system +ARGUMENT output 0 0 IMAGEOUT +OPTION jdet 1 0 +output the Jacobian determinant instead of the full matrix +ARGUMENT output 0 0 IMAGEOUT +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/warpconvert b/interfaces/legacy/warpconvert new file mode 100644 index 0000000000..fbaa1aea05 --- /dev/null +++ b/interfaces/legacy/warpconvert @@ -0,0 +1,35 @@ +Convert between different representations of a non-linear warp +A deformation field is defined as an image where each voxel defines the corresponding position in the other image (in scanner space coordinates). A displacement field stores the displacements (in mm) to the other image from the each voxel's position (in scanner space). The warpfull file is the 5D format output from mrregister -nl_warp_full, which contains linear transforms, warps and their inverses that map each image to a midway space. +ARGUMENT in 0 0 IMAGEIN +the input warp image. +ARGUMENT type 0 0 CHOICE deformation2displacement displacement2deformation warpfull2deformation warpfull2displacement +the conversion type required. Valid choices are: deformation2displacement, displacement2deformation, warpfull2deformation, warpfull2displacement +ARGUMENT out 0 0 IMAGEOUT +the output warp image. +OPTION template 1 0 +define a template image when converting a warpfull file (which is defined on a grid in the midway space between image 1 & 2). For example to generate the deformation field that maps image1 to image2, then supply image2 as the template image +ARGUMENT image 0 0 IMAGEIN +OPTION midway_space 1 0 +to be used only with warpfull2deformation and warpfull2displacement conversion types. The output will only contain the non-linear warp to map an input image to the midway space (defined by the warpfull grid). If a linear transform exists in the warpfull file header then it will be composed and included in the output. +OPTION from 1 0 +to be used only with warpfull2deformation and warpfull2displacement conversion types. Used to define the direction of the desired output field.Use -from 1 to obtain the image1->image2 field and from 2 for image2->image1. Can be used in combination with the -midway_space option to produce a field that only maps to midway space. +ARGUMENT image 0 0 INT 1 2 +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/warpcorrect b/interfaces/legacy/warpcorrect new file mode 100644 index 0000000000..b3b1ace0a6 --- /dev/null +++ b/interfaces/legacy/warpcorrect @@ -0,0 +1,31 @@ +Replaces voxels in a deformation field that point to a specific out of bounds location with nan,nan,nan +This can be used in conjunction with the warpinit command to compute a MRtrix compatible deformation field from non-linear transformations generated by any other registration package. +ARGUMENT in 0 0 IMAGEIN +the input warp image. +ARGUMENT out 0 0 IMAGEOUT +the output warp image. +OPTION marker 1 0 +single value or a comma separated list of values that define out of bounds voxels in the input warp image. Default: (0,0,0). +ARGUMENT coordinates 0 0 FSEQ +OPTION tolerance 1 0 +numerical precision used for L2 matrix norm comparison. Default: 9.99999975e-06. +ARGUMENT value 0 0 FLOAT 1e-05 inf +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/warpinit b/interfaces/legacy/warpinit new file mode 100644 index 0000000000..16941937d0 --- /dev/null +++ b/interfaces/legacy/warpinit @@ -0,0 +1,28 @@ +Create an initial warp image, representing an identity transformation +This is useful to obtain the warp fields from other normalisation applications, by applying the transformation of interest to the warp field generated by this program. +The image generated is a 4D image with the same spatial characteristics as the input template image. It contains 3 volumes, with each voxel containing its own x,y,z coordinates. +Note that this command can be used to create 3 separate X,Y,Z images directly (which may be useful to create images suitable for use in the registration program) using the following syntax: + $ warpinit template.mif warp-'[]'.nii +ARGUMENT template 0 0 IMAGEIN +the input template image. +ARGUMENT warp 0 0 IMAGEOUT +the output warp image. +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. diff --git a/interfaces/legacy/warpinvert b/interfaces/legacy/warpinvert new file mode 100644 index 0000000000..850506a282 --- /dev/null +++ b/interfaces/legacy/warpinvert @@ -0,0 +1,30 @@ +Invert a non-linear warp field +By default, this command assumes that the input warp field is a deformation field, i.e. each voxel stores the corresponding position in the other image (in scanner space), and the calculated output warp image will also be a deformation field. If the input warp field is instead a displacment field, i.e. where each voxel stores an offset from which to sample the other image (but still in scanner space), then the -displacement option should be used; the output warp field will additionally be calculated as a displacement field in this case. +ARGUMENT in 0 0 IMAGEIN +the input warp image. +ARGUMENT out 0 0 IMAGEOUT +the output warp image. +OPTION template 1 0 +define a template image grid for the output warp +ARGUMENT image 0 0 IMAGEIN +OPTION displacement 1 0 +indicates that the input warp field is a displacement field; the output will also be a displacement field +OPTION info 1 0 +display information messages. +OPTION quiet 1 0 +do not display information messages or progress status; alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. +OPTION debug 1 0 +display debugging messages. +OPTION force 1 0 +force overwrite of output files (caution: using the same file as input and output might cause unexpected behaviour). +OPTION nthreads 1 0 +use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). +ARGUMENT number 0 0 INT 0 9223372036854775807 +OPTION config 1 1 +temporarily set the value of an MRtrix config file entry. +ARGUMENT key 0 0 TEXT +ARGUMENT value 0 0 TEXT +OPTION help 1 0 +display this information page and exit. +OPTION version 1 0 +display version information and exit. From 4d29a85137551c58bf62ce5b5e952d6673a0c8a0 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 19 Feb 2024 12:50:24 +1100 Subject: [PATCH 5/5] Legacy interface: Fix appearance of Python script algorithms Reflects reverting f1612ed in favour of ff86c44. --- interfaces/generate_interfaces.sh | 2 +- interfaces/legacy/5ttgen/5ttgen | 2 +- interfaces/legacy/dwi2mask/dwi2mask | 2 +- interfaces/legacy/dwi2response/dwi2response | 2 +- interfaces/legacy/dwibiascorrect/dwibiascorrect | 2 +- interfaces/legacy/dwinormalise/dwinormalise | 2 +- lib/mrtrix3/app.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/interfaces/generate_interfaces.sh b/interfaces/generate_interfaces.sh index 0de0858bb4..12df9234bb 100755 --- a/interfaces/generate_interfaces.sh +++ b/interfaces/generate_interfaces.sh @@ -42,7 +42,7 @@ for n in `echo "$cmdlist" | sort`; do if `grep -q "algorithm\.get_module" "${mrtrix_root}/bin/${cmdpath}"`; then mkdir $legacy_root/$cmdname $cmdpath __print_full_usage__ > $legacy_root/$cmdname/$cmdname - algorithms=`grep "ARGUMENT algorithm CHOICE" $legacy_root/$cmdname/$cmdname | cut -d" " -f 4-` + algorithms=`grep "ARGUMENT algorithm 0 0 CHOICE" $legacy_root/$cmdname/$cmdname | cut -d" " -f 6-` for a in $algorithms; do $cmdpath $a __print_full_usage__ > $legacy_root/$cmdname/$a done diff --git a/interfaces/legacy/5ttgen/5ttgen b/interfaces/legacy/5ttgen/5ttgen index b47e383ff6..d856bd1a8d 100644 --- a/interfaces/legacy/5ttgen/5ttgen +++ b/interfaces/legacy/5ttgen/5ttgen @@ -1,7 +1,7 @@ Generate a 5TT image suitable for ACT 5ttgen acts as a "master" script for generating a five-tissue-type (5TT) segmented tissue image suitable for use in Anatomically-Constrained Tractography (ACT). A range of different algorithms are available for completing this task. When using this script, the name of the algorithm to be used must appear as the first argument on the command-line after "5ttgen". The subsequent compulsory arguments and options available depend on the particular algorithm being invoked. Each algorithm available also has its own help page, including necessary references; e.g. to see the help page of the "fsl" algorithm, type "5ttgen fsl". -ARGUMENT algorithm CHOICE freesurfer fsl gif hsvs +ARGUMENT algorithm 0 0 CHOICE freesurfer fsl gif hsvs OPTION -nocrop 1 0 Do NOT crop the resulting 5TT image to reduce its size (keep the same dimensions as the input image) OPTION -sgm_amyg_hipp 1 0 diff --git a/interfaces/legacy/dwi2mask/dwi2mask b/interfaces/legacy/dwi2mask/dwi2mask index 9157275f70..008d9ca057 100644 --- a/interfaces/legacy/dwi2mask/dwi2mask +++ b/interfaces/legacy/dwi2mask/dwi2mask @@ -2,7 +2,7 @@ Generate a binary mask from DWI data This script serves as an interface for many different algorithms that generate a binary mask from DWI data in different ways. Each algorithm available has its own help page, including necessary references; e.g. to see the help page of the "fslbet" algorithm, type "dwi2mask fslbet". More information on mask derivation from DWI data can be found at the following link: https://mrtrix.readthedocs.io/en/3.0.4/dwi_preprocessing/masking.html -ARGUMENT algorithm CHOICE 3dautomask ants b02template consensus fslbet hdbet legacy mean mtnorm synthstrip trace +ARGUMENT algorithm 0 0 CHOICE 3dautomask ants b02template consensus fslbet hdbet legacy mean mtnorm synthstrip trace OPTION -grad 1 0 Provide the diffusion gradient table in MRtrix format ARGUMENT file 0 0 FILEIN diff --git a/interfaces/legacy/dwi2response/dwi2response b/interfaces/legacy/dwi2response/dwi2response index 6ae0380e30..d61100ef32 100644 --- a/interfaces/legacy/dwi2response/dwi2response +++ b/interfaces/legacy/dwi2response/dwi2response @@ -4,7 +4,7 @@ Each algorithm available has its own help page, including necessary references; More information on response function estimation for spherical deconvolution can be found at the following link: https://mrtrix.readthedocs.io/en/3.0.4/constrained_spherical_deconvolution/response_function_estimation.html Note that if the -mask command-line option is not specified, the MRtrix3 command dwi2mask will automatically be called to derive an initial voxel exclusion mask. More information on mask derivation from DWI data can be found at: https://mrtrix.readthedocs.io/en/3.0.4/dwi_preprocessing/masking.html -ARGUMENT algorithm CHOICE dhollander fa manual msmt_5tt tax tournier +ARGUMENT algorithm 0 0 CHOICE dhollander fa manual msmt_5tt tax tournier OPTION -grad 1 0 Provide the diffusion gradient table in MRtrix format ARGUMENT file 0 0 FILEIN diff --git a/interfaces/legacy/dwibiascorrect/dwibiascorrect b/interfaces/legacy/dwibiascorrect/dwibiascorrect index 1df3165d21..133b6b7555 100644 --- a/interfaces/legacy/dwibiascorrect/dwibiascorrect +++ b/interfaces/legacy/dwibiascorrect/dwibiascorrect @@ -1,7 +1,7 @@ Perform B1 field inhomogeneity correction for a DWI volume series Note that if the -mask command-line option is not specified, the MRtrix3 command dwi2mask will automatically be called to derive a mask that will be passed to the relevant bias field estimation command. More information on mask derivation from DWI data can be found at the following link: https://mrtrix.readthedocs.io/en/3.0.4/dwi_preprocessing/masking.html -ARGUMENT algorithm CHOICE ants fsl mtnorm +ARGUMENT algorithm 0 0 CHOICE ants fsl mtnorm OPTION -grad 1 0 Provide the diffusion gradient table in MRtrix format ARGUMENT file 0 0 FILEIN diff --git a/interfaces/legacy/dwinormalise/dwinormalise b/interfaces/legacy/dwinormalise/dwinormalise index eee867f5af..2531ee40cf 100644 --- a/interfaces/legacy/dwinormalise/dwinormalise +++ b/interfaces/legacy/dwinormalise/dwinormalise @@ -1,6 +1,6 @@ Perform various forms of intensity normalisation of DWIs This script provides access to different techniques for globally scaling the intensity of diffusion-weighted images. The different algorithms have different purposes, and different requirements with respect to the data with which they must be provided & will produce as output. Further information on the individual algorithms available can be accessed via their individual help pages; eg. "dwinormalise group -help". -ARGUMENT algorithm CHOICE group manual mtnorm +ARGUMENT algorithm 0 0 CHOICE group manual mtnorm OPTION -nocleanup 1 0 do not delete intermediate files during script execution, and do not delete scratch directory at script completion. OPTION -scratch 1 0 diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 970969e588..29cc181154 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -1213,7 +1213,7 @@ def allow_multiple(nargs): return '1' if nargs in ('*', '+') else '0' if self._subparsers: - sys.stdout.write(f'ARGUMENT algorithm CHOICE {" ".join(self._subparsers._group_actions[0].choices)}\n') + sys.stdout.write(f'ARGUMENT algorithm 0 0 CHOICE {" ".join(self._subparsers._group_actions[0].choices)}\n') else: for arg in self._positionals._group_actions: sys.stdout.write(f'ARGUMENT {arg.dest} 0 {allow_multiple(arg.nargs)} {arg2str(arg)}\n')