Skip to content
Snippets Groups Projects
Commit 0fe45912 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

TEST: Test for loadFEATDesignFile

parent 1fb9d589
No related branches found
No related tags found
No related merge requests found
...@@ -103,8 +103,9 @@ with the following commands: ...@@ -103,8 +103,9 @@ with the following commands:
""" """
import os.path as op import os.path as op
import numpy as np import textwrap as tw
import numpy as np
import pytest import pytest
...@@ -400,6 +401,45 @@ def test_loadDesignMat(): ...@@ -400,6 +401,45 @@ def test_loadDesignMat():
featdesign.loadDesignMat(badfile) featdesign.loadDesignMat(badfile)
# fsl/fslpy!469
def test_loadFEATDesignFile():
with tempdir():
with open('design1.con', 'wt') as f:
f.write(tw.dedent("""
/ContrastName1 mycontrast
/NumWaves 2
/NumContrasts 1
/Matrix
10 20
""").strip())
with open('design2.con', 'wt') as f:
f.write(tw.dedent("""
/ContrastName1
/NumWaves 2
/NumContrasts 1
/Matrix
10 20
""").strip())
des1 = featanalysis.loadFEATDesignFile('design1.con')
exp1 = {'ContrastName1': 'mycontrast',
'NumWaves': '2',
'NumContrasts': '1',
'Matrix': '10 20'}
des2 = featanalysis.loadFEATDesignFile('design2.con')
exp2 = {'ContrastName1': '',
'NumWaves': '2',
'NumContrasts': '1',
'Matrix': '10 20'}
assert des1 == exp1
assert des2 == exp2
def test_VoxelwiseEVs(): def test_VoxelwiseEVs():
with tempdir(): with tempdir():
img = tests.make_random_image('image.nii.gz', (10, 10, 10, 10)) img = tests.make_random_image('image.nii.gz', (10, 10, 10, 10))
......
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