Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyfeeds-tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
pyfeeds-tests
Commits
835ea8c1
Commit
835ea8c1
authored
5 years ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
DOC: update documentation
parent
32d93773
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unit_tests/fdt/dtifit/feedsRun
+25
-3
25 additions, 3 deletions
unit_tests/fdt/dtifit/feedsRun
with
25 additions
and
3 deletions
unit_tests/fdt/dtifit/feedsRun
+
25
−
3
View file @
835ea8c1
#!/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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment