-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.py
executable file
·433 lines (341 loc) · 14 KB
/
config.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# emacs = -*- mode = python; py-indent-offset = 4; indent-tabs-mode = nil -*-
# vi = set ft=python sts=4 ts=4 sw=4 et =
"""
1. Distributed Processing Settings
a) runOnGrid : options True/False or 0/1. Run On SGE Cluster/Grid
b) qsubArgs : For use only when runOnGrid = True.
-q QUEUE.q : The queue of nodes to use on the cluster/grid,
default is set to the queue of all nodes on the cluster(all.q).
-pe A-B : Can Use with -q option. Specify the range of the number of slots to use on each node.
A is the lower bound on the range and B is the higher bound on the number of slots available
c) num_cores: Use only when runOnGrid = False( or 0).
Specify the number of cores on a multiprocessor environment.
"""
runOnGrid = False
qsubArgs = '-q all.q'
numSubjectsAtOnce = 12
numCoresPerSubject = 5
"""
2. Directory Setup
"""
"""
a) Nipype Specifications
"""
"""
Nipype Cache/Working/Debug Directory
Nipype will dump Temporary outputs and workflow engine specific outputs to this directory.
Each User must set it.
It is recommended to delete this directory once the pipeline completes execution.
"""
workingDirectory = '/home/data/Projects/nuisance_reliability_paper/working_dir_CPAC/'
"""
Crash Log Directory
"""
crashLogDirectory = '/home/data/Projects/nuisance_reliability_paper'
"""
b) Data Specifications
"""
"""
Subject Data Directory and List
For Ex:
If your data directory is
/data/projects/ADHD200/usable/0010001
/data/projects/ADHD200/usable/0010002
subjectDirectory : '/data/projects/ADHD200/usable'
subjectList(Optional): Full path to the file that contains subject numbers, one per line.
exclusionSubjectList(Optional) : File containing subjects which should be left unprocessed.
For Ex: subjectList : '/data/projects/ADHD200/docs/subjects.txt'
$ cat subjects.txt
0010001
0010002
$ cat
Note: When subjectList is set to None, all the subjects in the subject directory, except the ones in
exclusionSubjectList are processed
"""
subjectDirectory = '/home/data/Originals/NYU_TRT/'
subjectList = '/home/data/Projects/nuisance_reliability_paper/work_lists/subject_list.txt'
exclusionSubjectList = '/home/data/Projects/nuisance_reliability_paper/work_lists/subject_exclude.txt'
"""
Anatomical File Name and Location within Subject Directory
Note: anatomicalFileName substituted into anatomicalFilePath
Subject Number or subject names and anatomical file name automatically
substitute 1st %s and Last %s. This is done by the pipeline datasource.
The user needs to set the directory structure
For Ex:
/data/projects/ADHD200/
0010001/anat_1/mprage.nii.gz
0010001/anat_2/mprage.nii.gz
0010002/anat_1/mprage.nii.gz
0010002/anat_2/mprage.nii.gz
set
anatomicalFileName = 'mprage'
anatomicalFilePath = '%s/*/%s.nii.gz'
/sam/wave0/
sub3114/
session_1/anat_1/mprage.nii.gz
session_1/anat_2/mprage.nii.gz
sub3115/
session_1/anat_1/mprage.nii.gz
anatomicalFileName = 'mprage'
anatomicalFilePath = '%s/*/*/%s.nii.gz'
"""
anatTemplate = '%s/%s/anat/mprage_anonymized.nii.gz'
anatTemplateList = ['session', 'subject']
anatSessionFile = '/home/data/Projects/nuisance_reliability_paper/work_lists/session_list.txt'
"""
anatLogFile: In case of multiple anatomical scans per subject.
Specify the name of the log file which indicates which single anatomical scan to process.
anatLogFilePath: Specify the location of the log file relative to the subject directory location.
The pipeline substitutes 1st %s with the subject number/name and the 2nd %s is the name of the log file.
The User needs to specify only the structure as per his analysis.
Ex: /sam/wave1/sub8000/
anat_1/mprage.nii.gz
anat_2/mprage.nii.gz
logs/log.txt
anatLogFile = 'log.txt'
anatLogFilePath = '%s/*/%s'
"""
anatLogFile = 'log.txt'
anatLogFilePath = '%s/*/*/%s'
"""
Functional File Name and Location within Subject Directory
Note: functionalFileName substituted into functionalDirectorySetup template
"""
funcTemplate = '%s/%s/func/lfo.nii.gz'
funcTemplateList = ['session', 'subject']
funcSessionFile = '/home/data/Projects/nuisance_reliability_paper/work_lists/session_list.txt'
"""
Output Target Directory
"""
sinkDirectory = '/home/data/Projects/nuisance_reliability_paper/results'
"""
c) Miscellaneous Specifications
"""
"""
Set FSL Directory (For Purposes of Template Selection)
"""
FSLDIR = '/usr/share/fsl/4.1/'
"""
Tissue Priors Directory
"""
priorDirectory = '/home/data/Projects/nuisance_reliability_paper/tissuepriors'
"""
3. Optional Header and Timeseries Overrides
nVols: Number of volumes in functional timeseries (defaults to image header specification)
TR = time of repetition (defaults to image header specification)
startIdx : starting time point(defaults to 0)
"""
startIdx = 0
stopIdx = 196
nVols = stopIdx - startIdx + 1
TR = 2.0
"""
4. Image Processing Specs
NOTE: Specification of multiple parameters for any step indicates
execution of a unique processing path for each parameter from
current step onward (e.g., fwhm = [4.5, 6]
will produce two unique output directories, one for 4.5 spatial smoothing and one for 6mm)
"""
"""
a) MNI Template Resolution Specification For Registration
"""
standardResolution = '3mm'
MNI = 'MNI152'
"""
b) Spatial Filter
Lowpass 3D Gaussian Filter Kernel Specification in mm [FSL: fslmaths]
note: Set to [] or 0 to skip spatial filtering
"""
fwhm = [6]
"""
c) Set various thresholds for cerebral spinal fluid , white matter
and gray matter mask generation during segmentation
"""
cerebralSpinalFluidThreshold = [0.4]
whiteMatterThreshold = [0.66]
grayMatterThreshold = [0.2]
"""
d) Scrub data prior to derivate generation: In accord with Power et al. (2012)
Default value True/False or a list of True/False(if need both at the same time)
"""
scrubData = [False]
scrubbingThreshold = [0.5, 0.2]
"""
e) Nuisance Signal Correction
"""
"""
e) Nuisance Signal Correction
"""
"""
Select Desired Approach:
0 - Global mean signal regression
1 - Compcor: A component based noise correction method (CompCor)
for BOLD and perfusion based fMRI
Yashar Behzadia, Khaled Restoma, Joy Liaua, Thomas T. Liua, ,
Science Direct: Received 18 December 2006. Revised 23 April 2007.
Accepted 25 April 2007.
Available online 3 May 2007.
2 - White Matter
3 - CSF regression (CSF)
4 - GRAY Matter
5 - First principal component regression:
Extracts the principal components found in white matter and
cerebral spinal fluid. Algorithm based on:
Y. Behzadi, K. Restom, J. Liau, and T. T. Liu,
component based noise correction
method (CompCor) for BOLD and perfusion based fMRI.,
NeuroImage, vol. 37, no. 1,
pp. 90-101, Aug. 2007.
6 - Motion Regression
"""
Corrections = [
[6],
[2, 3, 6]
]
"""
f) For Compcor Use Only: Number of components to regress
"""
nComponents = [5]
"""
g) For Median Angle Correction Only: Target Angle (degrees)
Corrects the input file to a specified target angle in degrees.
Algorithm based on:
H. He and T. T. Liu, A geometric view of global signal confounds
in resting-state functional MRI, NeuroImage, Sep. 2011.
"""
targetAngleDeg = [90]
"""
h) Temporal Filtering
Temporal Filter Specification in Hz performed after Nuisance Signal Correction
Note: Set to [] or 0 to skip high- or low-pass filter
"""
"""
nuisanceHighPassFilter: Turn HighPassFilter ON(value : True/1), OFF(value : False/0)
nuisanceLowPassFilter: Turn LowPassFilter ON(value : True/1), OFF(value : False/0)
"""
nuisanceBandpassFreq = [(0.01, 0.1)]
"""
5. Derivative Specification
"""
"""
a) Select Derivates:
ALFF/fALFF, SCA, vmhc, reho,
Unit (e.g., parcellation unit, mask) Time Series Extraction, Voxel TimeSeries Extraction, Vertices Extraction
-ALFF/fALFF :
ALFF >> Zang, Y.F., He, Y., Zhu, C.Z., Cao, Q.J., Sui, M.Q., Liang, M., Tian, L.X., Jiang, T.Z., Wang, Y.F., 2007.
Altered baseline brain activity in children with ADHD
revealed by resting state functional MRI. Brain Dev
fALFF >> Zou, Q.H., Zhu, C.Z., Yang, Y., Zuo, X.N., Long, X.Y., Cao, Q.J., Wang, Y.F., Zang, Y.F., 2008.
An improved approach to detection of amplitude of low-frequency fluctuation (ALFF) for
resting state fMRI
-SCA(seed based correlation analysis):
Biswal, B., Zerrin Yetkin, F., Haughton, V. M., & Hyde, J. S. (1995).
Functional connectivity in the motor cortex of resting human brain using echo-planar mri.
Magnetic Resonance in Medicine, 34(4), 537-541. doi:10.1002/mrm.1910340409
-VMHC:
Zuo, X.-N., Kelly, C., Di Martino, A., Mennes, M., Margulies,
D. S., Bangaru, S., Grzadzinski, R., et al. (2010).
Growing together and growing apart: regional and sex differences in the
lifespan developmental trajectories of functional homotopy.
The Journal of neuroscience : the official journal of the
Society for Neuroscience, 30(45), 15034-43. doi:10.1523/JNEUROSCI.2612-10.2010
-REHO: Regional homogeneity approach to fMRI data analysis, Zang 2004 NeuroImage.
-Unit TimeSeries Extraction
-Vertices Extraction
-FSL Group Analysis: http://www.fmrib.ox.ac.uk/fsl/feat5/detail.html#higher
"""
derivatives = [False, False, False, False, False, False, False]
"""
b) ALFF/fALFF Options
"""
"""
For ALFF/fALFF only
Notes: 1) This derivative is allergic to scrubbed data and thus will never use them.
2) You need to specify both highPassFreqALFF and lowPassFreqALFF if you intend
to use this derivative. The Default values are set below.
"""
highPassFreqALFF = [0.01]
lowPassFreqALFF = [0.1]
"""
c) Seed-Based Correlation Analysis Options
"""
"""
For SCA use only
seedFile : specify full path to the seed list file.
correlationSpace : Perform SCA in Subject's Native space or in MNI Space
correlationSpace Values: 'mni' or 'native'
Each line of the seedFile contains full path to a seed.
"""
seedFile = '/home/ssikka/nki_nyu_pipeline/seed_list.txt'
correlationSpace = 'mni'
"""
d) Timeseries Extraction Options
"""
"""
For Unit Timeseries Extraction Only
Note: Definitions Directory should contain one subdirectory for each set of units
to be generated (e.g., Harvard-Oxford Atlas, AAL, Craddock, Dosenbach-160);
"""
unitDefinitionsDirectory = '/home/ssikka/nki_nyu_pipeline/tsdata'
# Output type: .csv, numPy
unitTSOutputs = [True, True]
"""
For Voxel Timeseries Extraction Only
Note: Definitions Directory should contain one subdirectory for each
mask/mask set to be used to select voxels to be output; one output file / mask
"""
voxelMasksDirectory = '/home/ssikka/nki_nyu_pipeline/tsdata'
# Output type: .csv, numPy
voxelTSOutputs = [False, True]
"""
For Vertices Timeseries Extraction Only
"""
# Output type: .csv, numPy
verticesTSOutputs = [False, True]
runSurfaceRegistraion = False
reconSubjectsDirectory = '/home/ssikka/nki_nyu_pipeline/recon_subjects'
"""
e) FSL Group Analysis
Notes:
- Separate group analysis conducted for each derivative
- Not applicable to time series extraction derivatives
"""
"""
List of one or more derivatives on which the group anlaysis is be run
As a default, some of derivatives which are generated from the pipleine have
been specified
"""
derivativeList = ['rest_Dickstein_accumbens_Z_fn2standard', 'sca_Z_fn2standard']
"""
Specify Models Directory that contains one or more models to be executed per derivate
"""
modelsDirectory = '/Users/ranjeet.khanuja/Desktop/data2/models/'
"""
Templates for Group Analysis
Design Files
.con -> list of contrasts requested.
.fts -> list of F-tests requested.
.mat -> the actual values in the design matrix
model_name in the template_list will be fetch from modelsDirectory above
"""
matTemplateList = ['model_name', 'model_name']
conTemplateList = ['model_name', 'model_name']
ftsTemplateList = ['model_name', 'model_name']
grpTemplateList = ['model_name', 'model_name']
mat = '%s/%s.mat'
con = '%s/%s.con'
fts = '%s/%s.fts'
grp = '%s/%s.grp'
"""
Derivative Template
The first argument is label which is actually the strategy name. The pipeline
automatically creates the lable-linkage file in the sym_links folder.
The second argument is derivative name. This will be fetched from
the derivative list defined above
"""
dervTemplate = sinkDirectory+ '/sym_links/%s/*/*/%s.nii.gz'
labelFile = sinkDirectory + '/sym_links/label_linkage.txt'
dervTemplateList = ['label', 'derivative']
zThreshold = 2.3
pThreshold = 0.05
fTest = True