Skip to content
Snippets Groups Projects
Commit 835ea8c1 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

DOC: update documentation

parent 32d93773
No related branches found
No related tags found
No related merge requests found
#!/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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment