Skip to content

Commit 608c4d2

Browse files
committed
update test and autotest
1 parent 60e97d5 commit 608c4d2

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

nipype/algorithms/stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
BaseInterfaceInputSpec, TraitedSpec, SimpleInterface,
1515
traits, InputMultiPath, File
1616
)
17-
from ...utils.filemanip import split_filename
17+
from ..utils.filemanip import split_filename
1818

1919

2020
class ActivationCountInputSpec(BaseInterfaceInputSpec):
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from __future__ import unicode_literals
3+
from ..stats import ActivationCount
4+
5+
6+
def test_ActivationCount_inputs():
7+
input_map = dict(
8+
ignore_exception=dict(
9+
deprecated='1.0.0',
10+
nohash=True,
11+
usedefault=True,
12+
),
13+
in_files=dict(mandatory=True, ),
14+
threshold=dict(usedefault=True, ),
15+
)
16+
inputs = ActivationCount.input_spec()
17+
18+
for key, metadata in list(input_map.items()):
19+
for metakey, value in list(metadata.items()):
20+
assert getattr(inputs.traits()[key], metakey) == value
21+
def test_ActivationCount_outputs():
22+
output_map = dict(
23+
acm_neg=dict(),
24+
acm_pos=dict(),
25+
out_file=dict(),
26+
)
27+
outputs = ActivationCount.output_spec()
28+
29+
for key, metadata in list(output_map.items()):
30+
for metakey, value in list(metadata.items()):
31+
assert getattr(outputs.traits()[key], metakey) == value

nipype/algorithms/tests/test_stats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
import numpy as np
66
import nibabel as nb
7-
from nipype.algorithms.stats import ACM
7+
from nipype.algorithms.stats import ActivationCount
88

99

10-
def test_ACM(tmpdir):
10+
def test_ActivationCount(tmpdir):
1111
tmpdir.chdir()
1212
in_files = ['{:d}.nii'.format(i) for i in range(3)]
1313
for fname in in_files:
1414
nb.Nifti1Image(np.random.normal(size=(5, 5, 5)),
1515
np.eye(4)).to_filename(fname)
1616

17-
acm = ACM(in_files=in_files)
17+
acm = ActivationCount(in_files=in_files)
1818
res = acm.run()
1919
diff = nb.load(res.outputs.out_file)
2020
pos = nb.load(res.outputs.acm_pos)

0 commit comments

Comments
 (0)