Skip to content

Commit ac85422

Browse files
authored
Merge pull request #87 from neuroscout/enh/single_subject
Upload single subject files to NeuroVault
2 parents 4ef42f7 + 0d06940 commit ac85422

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

neuroscout_cli/commands/run.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
from fitlins.cli.run import run_fitlins
55
from pathlib import Path
66
import logging
7-
import tarfile
8-
import tempfile
7+
import re
98
import json
109

1110
# Options not to be passed onto fitlins
@@ -72,18 +71,17 @@ def run(self):
7271
if ses_dirs: # If session, look for stat files in session fld
7372
images = images / ses_dirs[0]
7473

75-
images = images.glob('*stat-t_statmap.nii.gz')
74+
group = [i for i in images.glob('task*statmap.nii.gz')
75+
if re.match('.*stat-[t|variance|effect]+.*', i.name)]
7676

77-
# Make tarball
78-
with tempfile.NamedTemporaryFile(delete=False) as tf:
79-
with tarfile.open(fileobj=tf.file, mode="w:gz") as tar:
80-
for path in images:
81-
tar.add(path.absolute(), arcname=path.parts[-1])
77+
sub = [i for i in images.glob('sub*/*statmap.nii.gz')
78+
if re.match('.*stat-[variance|effect]+.*', i.name)]
8279

8380
# Upload results NeuroVault
8481
self.api.analyses.upload_neurovault(
85-
self.bundle_id, tf.name,
86-
install.resources['validation_hash'],
82+
id=self.bundle_id,
83+
validation_hash=install.resources['validation_hash'],
84+
group_paths=group, subject_paths=sub,
8785
force=neurovault == 'force',
8886
n_subjects=n_subjects)
8987
else:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
docopt==0.6.2
22
datalad==0.10.2
33
tqdm==4.25.0
4-
pyns==0.2.3
4+
pyns==0.3

0 commit comments

Comments
 (0)