File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ procyamlversion : 3.0.0-dev.0
3+
4+ description : XCP-D, https://xcp-d.readthedocs.io/en/latest
5+
6+ jobtemplate : job_template_v3.txt
7+
8+ containers :
9+ - name : xcpd
10+ path : xcp_d_0.7.5.sif
11+ source : docker://pennlinc/xcp_d:0.7.5
12+
13+ requirements :
14+ walltime : 1-0
15+ memory : 8000
16+
17+ inputs :
18+ xnat :
19+
20+ filters :
21+ - type : match
22+ inputs : scan_fmri,assr_fmriprep/scan_fmri
23+
24+ scans :
25+
26+ - name : scan_fmri
27+ types : REST1_v2,REST2_v2
28+
29+ assessors :
30+
31+ - name : assr_fmriprep
32+ proctypes : fmriprep-notopup_v24
33+ resources :
34+ - {resource: fmriprepBIDS, ftype: DIR, fdest: fmriprepBIDS}
35+
36+ outputs :
37+ - {path: HTML, type: DIR, resource: HTML}
38+ - {path: xcpdBIDS, type: DIR, resource: xcpdBIDS}
39+ - {path: qc.csv, type: FILE, resource: QC}
40+
41+ command :
42+ type : singularity_run
43+ container : xcpd
44+ args : >-
45+ --work-dir /tmp
46+ --fs-license-file /opt/license.txt
47+ --skip-dcan-qc
48+ --smoothing 0
49+ --disable-bandpass-filter
50+ --nuisance-regressors acompcor
51+ --fd-thresh 0
52+ --min-coverage 0
53+ /INPUTS/fmriprepBIDS/fmriprepBIDS
54+ /OUTPUTS/xcpdBIDS
55+ participant
56+ extraopts : --bind /data/mcr/centos7/FS6/license.txt:/opt/license.txt
57+
58+ post :
59+ type : singularity_exec
60+ container : xcpd
61+ args : >-
62+ bash -c '
63+ mkdir /OUTPUTS/HTML &&
64+ cp /OUTPUTS/xcpdBIDS/sub-*.html /OUTPUTS/HTML &&
65+ cp -R /OUTPUTS/xcpdBIDS/sub-* /OUTPUTS/HTML &&
66+ rm -fr /OUTPUTS/HTML/sub-*/ses-* &&
67+
68+ qc_csv.py --xcpd_dir /OUTPUTS/xcpdBIDS --out_dir /OUTPUTS
69+ '
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ #
3+ # Stats file conversions for XCP_D when standard atlas used
4+
5+ import argparse
6+ import bids
7+ import os
8+ import pandas
9+ import sys
10+
11+ parser = argparse .ArgumentParser ()
12+ parser .add_argument ('--xcpd_dir' , required = True ,
13+ help = 'Absolute path of xcpd output (must match subject/session/etc of fmriprep)' )
14+ parser .add_argument ('--out_dir' , default = '/OUTPUTS' ,
15+ help = 'Output directory for QC CSV' )
16+ args = parser .parse_args ()
17+
18+ # Process BIDS dir
19+ bids_xcpd = bids .layout .BIDSLayout (args .xcpd_dir , validate = False )
20+
21+ # Find QC file and convert to CSV
22+ # Fail if more than one because we can't handle that right now
23+ qc_tsv = bids_xcpd .get (
24+ extension = 'tsv' ,
25+ desc = 'linc' ,
26+ suffix = 'qc' ,
27+ )
28+ if len (qc_tsv )!= 1 :
29+ raise Exception (f'Found { len (qc_tsv )} qc .tsv instead of 1' )
30+ qc_tsv = qc_tsv [0 ]
31+ qc = qc_tsv .get_df ()
32+ qc .to_csv (os .path .join (args .out_dir , 'qc.csv' ), index = False )
You can’t perform that action at this time.
0 commit comments