From 835ea8c1d8eaf7731f48c1eb8a4f7cf87e5ef34b Mon Sep 17 00:00:00 2001 From: Michiel Cottaar <MichielCottaar@protonmail.com> Date: Wed, 11 Dec 2019 13:52:42 +0000 Subject: [PATCH] DOC: update documentation --- unit_tests/fdt/dtifit/feedsRun | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/unit_tests/fdt/dtifit/feedsRun b/unit_tests/fdt/dtifit/feedsRun index f923690..d6ddd43 100755 --- a/unit_tests/fdt/dtifit/feedsRun +++ b/unit_tests/fdt/dtifit/feedsRun @@ -1,6 +1,8 @@ #!/usr/bin/env fslpython """ -Generates data following the diffusion tensor model +Generates data following the diffusion tensor and/or kurtosis model and then fit with dtifit + +No noise is added, so we expect (near-)perfect fits """ import sys import os @@ -14,9 +16,13 @@ OUTDIR = sys.argv[0] def gen_data(): """ - Populates given directory with diffusion data + Populates given directory with diffusion data following DTI or DKI models + + :yield: tuple with - :yield: directories containing reference noiseless data with the eigen-vectors and eigen-values used to generate the data + - directory containing reference noiseless data with the eigen-vectors and eigen-values used to generate the data + - Boolean flag indicating whether data is multi-shell + - integer encoding diffusion model used (0: DTI, 1: single kurtosis value, 2: directional kurtosis) """ directory = [''] * 10 directory[0] = 'dti' @@ -124,6 +130,21 @@ def gen_data(): def fit_data(directory): + """ + Runs dtifit on the diffusion data multiple times with different flags + + Tests with and without the following flags: + + - --wls + - --kurt + - --kurtdir + + :yield: tuple with + + - base name of the output files + - boolean indicating whether the --kurt flag was set + - boolean indicating whether the --kudtdir flag was set + """ for kurtdir in (False, True): for main_kurt in (False, True): for wls in (False, True): # in this noise-free data the --wls flag should not matter @@ -154,6 +175,7 @@ def fit_data(directory): yield base_output, main_kurt, kurtdir +# Loops through multiple ways to generate and fit the data and check the output for directory, multi_shell, kurt in gen_data(): for base_output, fkurt, fkurtdir in fit_data(directory): print('testing', base_output) -- GitLab