Skip to content

Commit 60e97d5

Browse files
authored
Merge pull request #7 from effigies/enh/activations-count-map
TEST: Activation count map smoke test
2 parents 4b93c9e + beaf3b8 commit 60e97d5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

nipype/algorithms/tests/test_stats.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
3+
# vi: set ft=python sts=4 ts=4 sw=4 et:
4+
5+
import numpy as np
6+
import nibabel as nb
7+
from nipype.algorithms.stats import ACM
8+
9+
10+
def test_ACM(tmpdir):
11+
tmpdir.chdir()
12+
in_files = ['{:d}.nii'.format(i) for i in range(3)]
13+
for fname in in_files:
14+
nb.Nifti1Image(np.random.normal(size=(5, 5, 5)),
15+
np.eye(4)).to_filename(fname)
16+
17+
acm = ACM(in_files=in_files)
18+
res = acm.run()
19+
diff = nb.load(res.outputs.out_file)
20+
pos = nb.load(res.outputs.acm_pos)
21+
neg = nb.load(res.outputs.acm_neg)
22+
assert np.allclose(diff.get_data(), pos.get_data() - neg.get_data())

0 commit comments

Comments
 (0)