-
Notifications
You must be signed in to change notification settings - Fork 1
/
flywheel_analyzer_afq.py
41 lines (30 loc) · 1.21 KB
/
flywheel_analyzer_afq.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import scitran_client.flywheel_analyzer as fa
from scitran_client import ScitranClient
client = ScitranClient('https://flywheel-cni.scitran.stanford.edu')
def prefix_matcher(prefix):
# doing this funny prefix matching to catch both "afq" and "afq 2017-01-01..."
return lambda val: val == prefix or val.startswith(prefix + ' ')
dtiinit_matcher = prefix_matcher('dtiinit')
afq_matcher = prefix_matcher('afq')
def dtiinit_inputs(acquisitions, **kwargs):
diffusion = fa.find(acquisitions, label='DTI 2mm b1250 84dir(axial)')
return dict(
bvec=diffusion.find_file('*.bvec'),
bval=diffusion.find_file('*.bval'),
nifti=diffusion.find_file('*.nii.gz'),
)
def afq_inputs(analyses, **kwargs):
dtiinit = fa.find(analyses, label=dtiinit_matcher)
return dict(
dtiInit_Archive=dtiinit.find_file('dtiInit_*.zip'),
)
if __name__ == '__main__':
with fa.installed_client(client):
fa.run([
fa.define_analysis(
'dtiinit', dtiinit_inputs,
label_matcher=dtiinit_matcher),
fa.define_analysis(
'afq', afq_inputs,
label_matcher=afq_matcher),
], project=fa.find_project(label='ENGAGE'))