|
4 | 4 | from fitlins.cli.run import run_fitlins |
5 | 5 | from pathlib import Path |
6 | 6 | import logging |
7 | | -import tarfile |
8 | | -import tempfile |
| 7 | +import re |
9 | 8 | import json |
10 | 9 |
|
11 | 10 | # Options not to be passed onto fitlins |
@@ -72,18 +71,17 @@ def run(self): |
72 | 71 | if ses_dirs: # If session, look for stat files in session fld |
73 | 72 | images = images / ses_dirs[0] |
74 | 73 |
|
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)] |
76 | 76 |
|
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)] |
82 | 79 |
|
83 | 80 | # Upload results NeuroVault |
84 | 81 | 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, |
87 | 85 | force=neurovault == 'force', |
88 | 86 | n_subjects=n_subjects) |
89 | 87 | else: |
|
0 commit comments