Skip to content

Commit 5464902

Browse files
author
Shoshana Berleant
committed
rsfmri workflow test skeleton
1 parent 027d47e commit 5464902

File tree

2 files changed

+53
-4
lines changed

2 files changed

+53
-4
lines changed

nipype/algorithms/tests/test_tsnr.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313

1414
class TestTSNR(unittest.TestCase):
1515
''' Note: Tests currently do a poor job of testing functionality '''
16-
'''
17-
in_file = InputMultiPath(File(exists=True), mandatory=True,
18-
regress_poly = traits.Range(low=1, desc='Remove polynomials')
19-
'''
2016

2117
in_filenames = {
2218
'in_file': 'tsnrinfile.nii',
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2+
# vi: set ft=python sts=4 ts=4 sw=4 et:
3+
4+
from nipype.testing import (assert_equal, assert_true, assert_almost_equal,
5+
skipif, utils)
6+
from nipype.workflows.rsfmri.fsl import resting
7+
8+
import unittest
9+
import mock
10+
import nibabel as nb
11+
import numpy as np
12+
import os
13+
14+
class TestResting(unittest.TestCase):
15+
16+
in_filenames = {
17+
'in_file': 'rsfmrifunc.nii',
18+
}
19+
20+
out_filenames = {
21+
'noise_mask_file': '',
22+
'filtered_file': ''
23+
}
24+
25+
def setUp(self):
26+
# setup
27+
utils.save_toy_nii(self.fake_data, self.in_filenames['in_file'])
28+
29+
@skipif(True)
30+
def test_create_resting_preproc(self):
31+
# setup
32+
print(np.random.randint(0, 10, (2, 2, 2, 5)))
33+
# run
34+
wf = resting.create_resting_preproc()
35+
wf.run()
36+
37+
# assert
38+
39+
def tearDown(self):
40+
utils.remove_nii(self.in_filenames.values())
41+
utils.remove_nii(self.out_filenames.values())
42+
43+
fake_data = np.array([[[[2, 4, 3, 9, 1],
44+
[3, 6, 4, 7, 4]],
45+
46+
[[8, 3, 4, 6, 2],
47+
[4, 0, 4, 4, 2]]],
48+
49+
[[[9, 7, 5, 5, 7],
50+
[7, 8, 4, 8, 4]],
51+
52+
[[0, 4, 7, 1, 7],
53+
[6, 8, 8, 8, 7]]]])

0 commit comments

Comments
 (0)