-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHick_cluster_analysis.tcsh
1086 lines (891 loc) · 72.7 KB
/
Hick_cluster_analysis.tcsh
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
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/tcsh -xef
# to execute via bash:
# tcsh -xef XXX.tcsh 2>&1 | tee output.XXX
### This program is used to analyse activation patterns on all subjects through a t-test. As some outliers has been identified, there are usually lesser
### lines in the t-tests than there are subjects. The full test is usually commented at the end.
### One tests BOLD, a second tests ASL and the results are both used to compute an intersect mask that corresponds to voxels that are both
### active in BOLD and ASL and in which we can measure CMRO2.
### The last t-tests analyses the clusteres of CMRO2 regressed data directly.
### We then do a DICE analysis and overlap count of voxels to see if we find similar stuff
### We already did some similar study on the mean CMRO2(t) regressed by tapping regressor, and threshold with arbitrary values.
### We will here use the values empirically found (PW-pval 0.01 and BOLD PVal 0.007)
###
### Input data come from different analysis that have been done at different steps. BOLD and ASL come from the regular classic regression
### thus CMRO2_classic folder, while the CMRO2 regression have been done later (CMRO2_regression.allSubj.hick_tapping.tcsh) in the thesis and are found in the CMRO2_regression folder of each subject
###
### Analysis on CMRO2 are done in positive as well as negative clusters because CMRO2 has negative activation in Tapping task
### Newest modifications include a new t-test calculation for CMRO2 that have calculated from BOLD and ASL datasets directly.
### We then have to take into account that the CMRO2 mean is 1 not 0, contrary to BOLD, ASL and regressed CMRO2 dataset that are beta coefficients, thus mean around 0.
set Home = $PWD
set githubFolder = "XXX/hick_entropy_analysis"
set results_dir = "$githubFolder/results/task_versus_rest_clusterization_analysis"
set dataFolder = "XXX/quantitativ_fMRI/data"
set input_directory = "Analysis/CMRO2calc_classic"
set CMRO2_input_directory = "Analysis/CMRO2_regression"
set underlayMNI = "XXX/abin/MNI152_2009_template_SSW.nii.gz"
set ImageFolder = "$results_dir/images"
set ModelresultFolderName = Model_results
set ModelresultFolder = "$results_dir/$ModelresultFolderName"
set atlas = "Schaefer_Yeo_17n_400 -atlas MNI_Glasser_HCP_v1.0 -atlas Brainnetome_1.0"
setenv AFNI_SUPP_ATLAS "XXX/abin/AFNI_atlas_spaces.niml"
set NN = 2
set GMmask = "$githubFolder/results/meanGMmask+tlrc"
mkdir -p $results_dir
cd $results_dir
mkdir -p $ImageFolder
mkdir -p $ModelresultFolder/ClustSimdata
## The mean of every dataset has to be 0 because ttest tests against 0.
# because : * With 1 set ('-setA'), the mean across input datasets (usually subjects)
# is tested against 0.
### ========== M analysis ================= ###
set regressors = ('hrf' 'rrf')
foreach reg ( $regressors )
set file_name = M_${reg}_thresholded+tlrc
if (! -f "./$ModelresultFolderName/TtestM_${reg}+tlrc.HEAD" ) then
## running 3dttest on TaskVsRest for PW
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestM_$reg \
-resid ./$ModelresultFolderName/errtsM_$reg -ACF -Clustsim -prefix_clustsim ccM_$reg -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA M \
01 "$dataFolder/XXX/${input_directory}/$file_name"
endif
end
if (! -f "./$ModelresultFolderName/TtestTvsR_PW2+tlrc.HEAD" ) then
### ========== Task versus Rest ASL ================= ###
## running 3dttest on TaskVsRest for PW
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestTvsR_PW2 \
-resid ./$ModelresultFolderName/errtsTvsR_PW -ACF -Clustsim -prefix_clustsim ccTvsR_PW -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_PW \
01 "$dataFolder/XXX/${input_directory}/stats.PW2_TvsR.XXX+tlrc.BRIK[6]"
endif
if (! -f "./$ModelresultFolderName/TtestTvsR_BOLD2+tlrc.HEAD" ) then
### ============= Task versus Rest BOLD ================ ###
## running 3dttest on TaskVsRest for BOLD
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestTvsR_BOLD2 \
-resid ./$ModelresultFolderName/errts_TvsR_BOLD -ACF -Clustsim -prefix_clustsim ccTvsR_BOLD -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_BOLD \
01 "$dataFolder/XXX/${input_directory}/stats.MEC2_TvsR.XXX_REML+tlrc.BRIK[6]"
endif
if (! -f "./$ModelresultFolderName/TtestTvsR_CMRO2+tlrc.HEAD" ) then
### ========== Task versus Rest CMRO2 ================= ###
## running 3dttest on TaskVsRest for CMRO2 from regression datasets
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestTvsR_CMRO2 \
-resid ./$ModelresultFolderName/errtsTvsR_CMRO2 -ACF -Clustsim -prefix_clustsim ccTvsR_CMRO2 -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_CMRO2 \
01 "$dataFolder/XXX/${CMRO2_input_directory}/stats.CMRO2_HRF_Hick_TvsR+tlrc.HEAD[2]"
endif
## --------------------- CMRO2 ttest from calculated CMRO2 from beta coefficients of BOLD and ASL ------------------
## running 3dttest on TaskVsRest for CMRO2 from BOLD and ASl beta coefs HRF
## demeaning the CMRO2 datasets.
set dataToDemean = `ls $dataFolder/*/${input_directory}/CMRO2_TvsR_hrf+tlrc.BRIK`
set list = ()
set numberList = (`count -digits 2 1 24`)
set counter = 0
foreach dataset ($dataToDemean)
set fileName = `echo $dataset | awk -F/ '{print $NF}'`
set folderName = `echo $dataset | awk -F'data/' '{print $2}' | awk -F/ '{print $1}'`
set newFileName = demeaned_${folderName}_${fileName}
echo $newFileName
if (! ("$folderName" == "CeHa") && ! ("$folderName" == "MiAn")) then
@ counter = ($counter + 1)
3dcalc -overwrite -a ${dataset} -b $GMmask\
-exp 'b*(a-1)' -prefix ./$ModelresultFolderName/$newFileName
set list = ($list "$numberList[$counter] ./$ModelresultFolderName/$newFileName \ ")
endif
end
echo $list
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestTvsR_CMRO2_calculated_HRF \
-resid ./$ModelresultFolderName/errts_CMRO2_calculated_HRF -ACF -Clustsim \
-prefix_clustsim ccTvsR_CMRO2_calculated_HRF -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA "taskVsRest_CMRO2_calculated_HRF" \
01 ./Model_results/demeaned_XXX_CMRO2_TvsR_hrf+tlrc.BRIK
## running 3dttest on TaskVsRest for CMRO2 from BOLD and ASl beta coefs HRF
## demeaning the CMRO2 datasets.
set dataToDemean = `ls $dataFolder/*/${input_directory}/CMRO2_TvsR_rrf+tlrc.BRIK`
set list = ()
set counter = 0
foreach dataset ($dataToDemean)
set fileName = `echo $dataset | awk -F/ '{print $NF}'`
set folderName = `echo $dataset | awk -F'data/' '{print $2}' | awk -F/ '{print $1}'`
set newFileName = demeaned_${folderName}_${fileName}
echo $newFileName
if (! ("$folderName" == "CeHa") && ! ("$folderName" == "MiAn")) then
@ counter = ($counter + 1)
3dcalc -overwrite -a ${dataset} -b $GMmask\
-exp 'b*(a-1)' -prefix ./$ModelresultFolderName/$newFileName
set list = ($list "$numberList[$counter] ./$ModelresultFolderName/$newFileName \ ")
endif
end
echo $list
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestTvsR_CMRO2_calculated_RRF \
-resid ./$ModelresultFolderName/errts_CMRO2_calculated_RRF -ACF -Clustsim -prefix_clustsim ccTvsR_CMRO2_calculated_RRF -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA "taskVsRest_CMRO2_calculated_RRF" \
01 ./Model_results/demeaned_XXX_CMRO2_TvsR_rrf+tlrc.BRIK
### ========== Condition 1 (H0) CMRO2 ================= ###
## running 3dttest on H0 for CMRO2
if (! -f "./$ModelresultFolderName/TtestH0_CMRO2+tlrc.HEAD" ) then
# set fileName = "stats.CMRO2_RRF_Hick_conds+tlrc.HEAD[2]"
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestH0_CMRO2 \
-resid ./$ModelresultFolderName/errtsH0_CMRO2 -ACF -Clustsim -prefix_clustsim ccH0_CMRO2 -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_CMRO2 \
01 "$dataFolder/XXX/${CMRO2_input_directory}/stats.CMRO2_HRF_Hick_conds+tlrc.HEAD[2]"
endif
if (! -f "./$ModelresultFolderName/TtestH1_CMRO2+tlrc.HEAD" ) then
### ========== Condition 2 (H1) CMRO2 ================= ###
## running 3dttest on H1 for CMRO2
# set fileName = "stats.stats.CMRO2_HRF_Hick_conds+tlrc.HEAD'[6]'"
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestH1_CMRO2 \
-resid ./$ModelresultFolderName/errtsH1_CMRO2 -ACF -Clustsim -prefix_clustsim ccH1_CMRO2 -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_CMRO2 \
01 "$dataFolder/XXX/${CMRO2_input_directory}/stats.CMRO2_HRF_Hick_conds+tlrc.HEAD[6]"
endif
if (! -f "./$ModelresultFolderName/TtestH2_CMRO2+tlrc.HEAD" ) then
### ========== Condition 4 (H2) CMRO2 ================= ###
## running 3dttest on H2 for CMRO2
# set fileName = "stats.CMRO2_HRF_Hick_conds+tlrc.HEAD'[10]'"
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestH2_CMRO2 \
-resid ./$ModelresultFolderName/errtsH2_CMRO2 -ACF -Clustsim -prefix_clustsim ccH2_CMRO2 -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_CMRO2 \
01 "$dataFolder/XXX/${CMRO2_input_directory}/stats.CMRO2_HRF_Hick_conds+tlrc.HEAD[10]"
endif
if (! -f "./$ModelresultFolderName/TtestTvsR_CMRO2_RRF+tlrc.HEAD" ) then
### ========== Task versus Rest CMRO2 RRF ================= ###
## running 3dttest on TaskVsRest for CMRO2 RRF
# set fileName = "stats.CMRO2_HRF_Hick_TvsR+tlrc.HEAD[2]"
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestTvsR_CMRO2_RRF \
-resid ./$ModelresultFolderName/errtsTvsR_CMRO2_RRF -ACF -Clustsim -prefix_clustsim ccTvsR_CMRO2_RRF -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_CMRO2_RRF \
01 "$dataFolder/XXX/${CMRO2_input_directory}/stats.CMRO2_RRF_Hick_TvsR+tlrc.HEAD[2]"
endif
### ========== Condition 1 (H0) CMRO2 ================= ###
## running 3dttest on H0 for CMRO2
# set fileName = "stats.CMRO2_RRF_Hick_conds+tlrc.HEAD[2]"
if (! -f "./$ModelresultFolderName/TtestH0_CMRO2_RRF+tlrc.HEAD" ) then
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestH0_CMRO2_RRF \
-resid ./$ModelresultFolderName/errtsH0_CMRO2_RRF -ACF -Clustsim -prefix_clustsim ccH0_CMRO2_RRF -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_CMRO2_RRF \
01 "$dataFolder/XXX/${CMRO2_input_directory}/stats.CMRO2_RRF_Hick_conds+tlrc.HEAD[2]"
endif
if (! -f "./$ModelresultFolderName/TtestH1_CMRO2_RRF+tlrc.HEAD" ) then
### ========== Condition 2 (H1) CMRO2 ================= ###
## running 3dttest on H1 for CMRO2
# set fileName = "stats.stats.CMRO2_RRF_Hick_conds+tlrc.HEAD'[6]'"
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestH1_CMRO2_RRF \
-resid ./$ModelresultFolderName/errtsH1_CMRO2_RRF -ACF -Clustsim -prefix_clustsim ccH1_CMRO2_RRF -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_CMRO2_RRF \
01 "$dataFolder/XXX/${CMRO2_input_directory}/stats.CMRO2_RRF_Hick_conds+tlrc.HEAD[6]"
endif
if (! -f "./$ModelresultFolderName/TtestH2_CMRO2_RRF+tlrc.HEAD" ) then
### ========== Condition 4 (H2) CMRO2 ================= ###
## running 3dttest on H2 for CMRO2
# set fileName = "stats.CMRO2_RRF_Hick_conds+tlrc.HEAD'[10]'"
3dttest++ -overwrite -prefix ./$ModelresultFolderName/TtestH2_CMRO2_RRF \
-resid ./$ModelresultFolderName/errtsH2_CMRO2_RRF -ACF -Clustsim -prefix_clustsim ccH2_CMRO2_RRF -tempdir ./$ModelresultFolderName/ClustSimdata \
-mask $GMmask -setA taskVsRest_CMRO2_RRF \
01 "$dataFolder/XXX/${CMRO2_input_directory}/stats.CMRO2_RRF_Hick_conds+tlrc.HEAD[10]"
endif
### ======================= BOLD & ASL =========================================
### BOLD ans ASL analysis with PW pval = 0.01 and BOLD pVal = 0.007
set pValThresholdPW = 0.01
set pValThresholdBOLD = 0.007
set suffix_atlas = "_${pValThresholdPW}_${pValThresholdBOLD}"
## PW analysis
set boundaryTvsR_PW = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestTvsR_PW2+tlrc[1]" -1sided -pval $pValThresholdPW`
set ClustSizeTvsR_PW = `1d_tool.py -infile ccTvsR_PW.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdPW -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_PW2+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_PW -pref_map "$ModelresultFolder/clustMapTvsR_PWPos${suffix_atlas}" -pref_dat "$ModelresultFolder/clustDataTvsR_PWPos${suffix_atlas}" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryTvsR_PW > "$ModelresultFolder/clustResultsTvsR_PWpos${suffix_atlas}.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_PW2+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_PW -pref_map "$ModelresultFolder/clustMapTvsR_PWNeg${suffix_atlas}" -pref_dat "$ModelresultFolder/clustDataTvsR_PWNeg${suffix_atlas}" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryTvsR_PW > "$ModelresultFolder/clustResultsTvsR_PWneg${suffix_atlas}.1D"
set testPosPW=`cat "$ModelresultFolder/clustResultsTvsR_PWpos${suffix_atlas}.1D"`
set testNegPW=`cat "$ModelresultFolder/clustResultsTvsR_PWneg${suffix_atlas}.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosPW" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_PWpos${suffix_atlas}.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_PWPos${suffix_atlas}+tlrc -tab > posROIs_TvsR_PW.1D
set opref = "$ImageFolder/clustMapTvsR_PW_Pos${suffix_atlas}"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_PWPos${suffix_atlas}+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
## BOLD analysis
set ClustSizeTvsR_BOLD = `1d_tool.py -infile ccTvsR_BOLD.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdBOLD -csim_alpha 0.05 -verb 0`
set boundaryTvsR_BOLD = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestTvsR_BOLD2+tlrc[1]" -1sided -pval $pValThresholdBOLD`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_BOLD2+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_BOLD -pref_map $ModelresultFolder/clustMapTvsR_BOLDPos${suffix_atlas} -pref_dat $ModelresultFolder/clustDataTvsR_BOLDPos${suffix_atlas} -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryTvsR_BOLD > $ModelresultFolder/clustResultsTvsR_BOLDpos${suffix_atlas}.1D
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_BOLD2+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_BOLD -pref_map $ModelresultFolder/clustMapTvsR_BOLDNeg${suffix_atlas} -pref_dat $ModelresultFolder/clustDataTvsR_BOLDNeg${suffix_atlas} -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryTvsR_BOLD > $ModelresultFolder/clustResultsTvsR_BOLDneg${suffix_atlas}.1D
set testPosBOLD=`cat $ModelresultFolder/clustResultsTvsR_BOLDpos${suffix_atlas}.1D`
set testNegBOLD=`cat $ModelresultFolder/clustResultsTvsR_BOLDneg${suffix_atlas}.1D`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosBOLD" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in BOLD data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_BOLDpos${suffix_atlas}.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_BOLDPos${suffix_atlas}+tlrc -tab > posROIs_TvsR_BOLD.1D
endif
set opref = "$ImageFolder/clustMapTvsR_BOLD_Pos${suffix_atlas}"
@chauffeur_afni \
-ulay "$underlayMNI" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_BOLDPos${suffix_atlas}+tlrc"\
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
### finding common voxels between masks ###
if (! ("$testPosBOLD" == "#** NO CLUSTERS FOUND ***") && ! ("$testPosPW" == "#** NO CLUSTERS FOUND ***")) then
3dmask_tool -overwrite -input "$ModelresultFolder/clustMapTvsR_BOLDPos${suffix_atlas}+tlrc.HEAD $ModelresultFolder/clustMapTvsR_PWPos${suffix_atlas}+tlrc.HEAD" -prefix $ModelresultFolder/atlas_inter \
-inter
3dclust -dxyz=3 -1Dformat -NN2 $ModelresultFolder/atlas_inter+tlrc > $ModelresultFolder/clustResults_atlas_inter.1D
whereami -atlas $atlas -coord_file $ModelresultFolder/clustResults_atlas_inter.1D'[1,2,3]' -bmask $ModelresultFolder/atlas_inter+tlrc -tab > posROIs_atlas_inter.1D
set opref = "$ImageFolder/clustMap_intersection_pos${suffix_atlas}"
@chauffeur_afni \
-ulay "$underlayMNI" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/atlas_inter+tlrc" \
-ulay_range 0% 130% \
-set_subbricks 0 -1 -1 \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
### =============================== CMRO2 ========================================
### CMRO2 task versus rest analysis from regression with pval = 0.01
set pValThresholdCMRO2 = 0.01
## CMRO2 analysis
set boundaryTvsR_CMRO2 = `p2dsetstat -quiet -inset $ModelresultFolder/TtestTvsR_CMRO2+tlrc'[1]' -1sided -pval $pValThresholdCMRO2`
set ClustSizeTvsR_CMRO2 = `1d_tool.py -infile ccTvsR_CMRO2.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_CMRO2+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_CMRO2 -pref_map "$ModelresultFolder/clustMapTvsR_CMRO2Pos" -pref_dat "$ModelresultFolder/clustDataTvsR_CMRO2Pos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryTvsR_CMRO2 > "$ModelresultFolder/clustResultsTvsR_CMRO2pos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_CMRO2+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_CMRO2 -pref_map "$ModelresultFolder/clustMapTvsR_CMRO2Neg" -pref_dat "$ModelresultFolder/clustDataTvsR_CMRO2Neg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryTvsR_CMRO2 > "$ModelresultFolder/clustResultsTvsR_CMRO2neg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsTvsR_CMRO2pos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsTvsR_CMRO2neg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_CMRO2pos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_CMRO2Pos+tlrc -tab > posROIs_TvsR_CMRO2.1D
set opref = "$ImageFolder/clustMapTvsR_CMRO2_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_CMRO2Pos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_CMRO2neg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_CMRO2Neg+tlrc -tab > negROIs_TvsR_CMRO2.1D
set opref = "$ImageFolder/clustMapTvsR_CMRO2_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_CMRO2Neg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
## -------------------------------- calculated --------------------------------
### CMRO2 task versus rest analysis from BOLD and ASL beta coeffs with pval = 0.01
set boundaryTvsR_CMRO2 = `p2dsetstat -quiet -inset $ModelresultFolder/TtestTvsR_CMRO2_calculated_HRF+tlrc'[1]' -1sided -pval $pValThresholdCMRO2`
set ClustSizeTvsR_CMRO2 = `1d_tool.py -infile ccTvsR_CMRO2_calculated_HRF.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_CMRO2_calculated_HRF+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_CMRO2 -pref_map "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFPos" -pref_dat "$ModelresultFolder/clustDataTvsR_CMRO2_calculated_HRFPos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryTvsR_CMRO2 > "$ModelresultFolder/clustResultsTvsR_CMRO2_calculated_HRFpos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_CMRO2_calculated_HRF+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_CMRO2 -pref_map "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFNeg" -pref_dat "$ModelresultFolder/clustDataTvsR_CMRO2_calculated_HRFNeg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryTvsR_CMRO2 > "$ModelresultFolder/clustResultsTvsR_CMRO2_calculated_HRFneg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsTvsR_CMRO2_calculated_HRFpos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsTvsR_CMRO2_calculated_HRFneg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_CMRO2_calculated_HRFpos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFPos+tlrc -tab > posROIs_TvsR_CMRO2_calculated_HRF.1D
set opref = "$ImageFolder/clustMapTvsR_CMRO2_calculated_HRF_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFPos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_CMRO2_calculated_HRFneg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFNeg+tlrc -tab > negROIs_TvsR_CMRO2_calculated_HRF.1D
set opref = "$ImageFolder/clustMapTvsR_CMRO2_calculated_HRF_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFNeg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
## -------------------------------- H0 -----------------------------------------
## CMRO2 analysis H0 from regression
set boundaryH0_CMRO2 = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestH0_CMRO2+tlrc[1]" -1sided -pval $pValThresholdCMRO2`
set ClustSizeH0_CMRO2 = `1d_tool.py -infile ccH0_CMRO2.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH0_CMRO2+tlrc" -NN $NN -clust_nvox $ClustSizeH0_CMRO2 -pref_map "$ModelresultFolder/clustMapH0_CMRO2Pos" -pref_dat "$ModelresultFolder/clustDataH0_CMRO2Pos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryH0_CMRO2 > "$ModelresultFolder/clustResultsH0_CMRO2pos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH0_CMRO2+tlrc" -NN $NN -clust_nvox $ClustSizeH0_CMRO2 -pref_map "$ModelresultFolder/clustMapH0_CMRO2Neg" -pref_dat "$ModelresultFolder/clustDataH0_CMRO2Neg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryH0_CMRO2 > "$ModelresultFolder/clustResultsH0_CMRO2neg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsH0_CMRO2pos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsH0_CMRO2neg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH0_CMRO2pos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH0_CMRO2Pos+tlrc -tab > posROIs_H0_CMRO2.1D
set opref = "$ImageFolder/clustMapH0_CMRO2_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH0_CMRO2Pos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH0_CMRO2neg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH0_CMRO2Neg+tlrc -tab > negROIs_H0_CMRO2.1D
set opref = "$ImageFolder/clustMapH0_CMRO2_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH0_CMRO2Neg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
## -------------------------------- H1 -----------------------------------------
## CMRO2 analysis H1
set boundaryH1_CMRO2 = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestH1_CMRO2+tlrc[1]" -1sided -pval $pValThresholdCMRO2`
set ClustSizeH1_CMRO2 = `1d_tool.py -infile ccH1_CMRO2.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH1_CMRO2+tlrc" -NN $NN -clust_nvox $ClustSizeH1_CMRO2 -pref_map "$ModelresultFolder/clustMapH1_CMRO2Pos" -pref_dat "$ModelresultFolder/clustDataH1_CMRO2Pos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryH1_CMRO2 > "$ModelresultFolder/clustResultsH1_CMRO2pos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH1_CMRO2+tlrc" -NN $NN -clust_nvox $ClustSizeH1_CMRO2 -pref_map "$ModelresultFolder/clustMapH1_CMRO2Neg" -pref_dat "$ModelresultFolder/clustDataH1_CMRO2Neg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryH1_CMRO2 > "$ModelresultFolder/clustResultsH1_CMRO2neg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsH1_CMRO2pos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsH1_CMRO2neg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH1_CMRO2pos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH1_CMRO2Pos+tlrc -tab > posROIs_H1_CMRO2.1D
set opref = "$ImageFolder/clustMapH1_CMRO2_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH1_CMRO2Pos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH1_CMRO2neg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH1_CMRO2Neg+tlrc -tab > negROIs_H1_CMRO2.1D
set opref = "$ImageFolder/clustMapH1_CMRO2_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH1_CMRO2Neg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
## -------------------------------- H2 ------------------------------------------
## CMRO2 analysis H2
set boundaryH2_CMRO2 = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestH2_CMRO2+tlrc[1]" -1sided -pval $pValThresholdCMRO2`
set ClustSizeH2_CMRO2 = `1d_tool.py -infile ccH2_CMRO2.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH2_CMRO2+tlrc" -NN $NN -clust_nvox $ClustSizeH2_CMRO2 -pref_map "$ModelresultFolder/clustMapH2_CMRO2Pos" -pref_dat "$ModelresultFolder/clustDataH2_CMRO2Pos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryH2_CMRO2 > "$ModelresultFolder/clustResultsH2_CMRO2pos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH2_CMRO2+tlrc" -NN $NN -clust_nvox $ClustSizeH2_CMRO2 -pref_map "$ModelresultFolder/clustMapH2_CMRO2Neg" -pref_dat "$ModelresultFolder/clustDataH2_CMRO2Neg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryH2_CMRO2 > "$ModelresultFolder/clustResultsH2_CMRO2neg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsH2_CMRO2pos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsH2_CMRO2neg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH2_CMRO2pos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH2_CMRO2Pos+tlrc -tab > posROIs_H2_CMRO2.1D
set opref = "$ImageFolder/clustMapH2_CMRO2_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH2_CMRO2Pos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH2_CMRO2neg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH2_CMRO2Neg+tlrc -tab > negROIs_H2_CMRO2.1D
set opref = "$ImageFolder/clustMapH2_CMRO2_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH2_CMRO2Neg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
### =============================== CMRO2 RRF ========================================
### CMRO2 RRF task versus rest analysis with pval = 0.01
set pValThresholdCMRO2 = 0.01
## CMRO2 analysis
set boundaryTvsR_CMRO2 = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestTvsR_CMRO2_RRF+tlrc[1]" -1sided -pval $pValThresholdCMRO2`
set ClustSizeTvsR_CMRO2 = `1d_tool.py -infile ccTvsR_CMRO2_RRF.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_CMRO2_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_CMRO2 -pref_map "$ModelresultFolder/clustMapTvsR_CMRO2_RRFPos" -pref_dat "$ModelresultFolder/clustDataTvsR_CMRO2_RRFPos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryTvsR_CMRO2 > "$ModelresultFolder/clustResultsTvsR_CMRO2_RRFpos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_CMRO2_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_CMRO2 -pref_map "$ModelresultFolder/clustMapTvsR_CMRO2_RRFNeg" -pref_dat "$ModelresultFolder/clustDataTvsR_CMRO2_RRFNeg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryTvsR_CMRO2 > "$ModelresultFolder/clustResultsTvsR_CMRO2_RRFneg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsTvsR_CMRO2_RRFpos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsTvsR_CMRO2_RRFneg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in CMRO2 RRF data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_CMRO2_RRFpos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_CMRO2_RRFPos+tlrc -tab > posROIs_TvsR_CMRO2_RRF.1D
set opref = "$ImageFolder/clustMapTvsR_CMRO2_RRF_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_CMRO2_RRFPos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_CMRO2_RRFneg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_CMRO2_RRFNeg+tlrc -tab > negROIs_TvsR_CMRO2_RRF.1D
set opref = "$ImageFolder/clustMapTvsR_CMRO2_RRF_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_CMRO2_RRFNeg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
## -------------------------------- calculated --------------------------------
### CMRO2 task versus rest analysis from BOLD and ASL beta coeffs with pval = 0.01
set boundaryTvsR_CMRO2 = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestTvsR_CMRO2_calculated_RRF+tlrc[1]" -1sided -pval $pValThresholdCMRO2`
set ClustSizeTvsR_CMRO2 = `1d_tool.py -infile ccTvsR_CMRO2_calculated_RRF.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_CMRO2_calculated_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_CMRO2 -pref_map "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFPos" -pref_dat "$ModelresultFolder/clustDataTvsR_CMRO2_calculated_RRFPos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryTvsR_CMRO2 > "$ModelresultFolder/clustResultsTvsR_CMRO2_calculated_RRFpos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestTvsR_CMRO2_calculated_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeTvsR_CMRO2 -pref_map "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFNeg" -pref_dat "$ModelresultFolder/clustDataTvsR_CMRO2_calculated_RRFNeg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryTvsR_CMRO2 > "$ModelresultFolder/clustResultsTvsR_CMRO2_calculated_RRFneg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsTvsR_CMRO2_calculated_RRFpos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsTvsR_CMRO2_calculated_RRFneg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_CMRO2_calculated_RRFpos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFPos+tlrc -tab > posROIs_TvsR_CMRO2_calculated_RRF.1D
set opref = "$ImageFolder/clustMapTvsR_CMRO2_calculated_RRF_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFPos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsTvsR_CMRO2_calculated_RRFneg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFNeg+tlrc -tab > negROIs_TvsR_CMRO2_calculated_RRF.1D
set opref = "$ImageFolder/clustMapTvsR_CMRO2_calculated_RRF_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFNeg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
## -------------------------------- H0 -----------------------------------------
## CMRO2_RRF analysis H0 regressed
set boundaryH0_CMRO2 = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestH0_CMRO2_RRF+tlrc[1]" -1sided -pval $pValThresholdCMRO2`
set ClustSizeH0_CMRO2 = `1d_tool.py -infile ccH0_CMRO2_RRF.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH0_CMRO2_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeH0_CMRO2 -pref_map "$ModelresultFolder/clustMapH0_CMRO2_RRFPos" -pref_dat "$ModelresultFolder/clustDataH0_CMRO2_RRFPos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryH0_CMRO2 > "$ModelresultFolder/clustResultsH0_CMRO2_RRFpos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH0_CMRO2_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeH0_CMRO2 -pref_map "$ModelresultFolder/clustMapH0_CMRO2_RRFNeg" -pref_dat "$ModelresultFolder/clustDataH0_CMRO2_RRFNeg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryH0_CMRO2 > "$ModelresultFolder/clustResultsH0_CMRO2_RRFneg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsH0_CMRO2_RRFpos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsH0_CMRO2_RRFneg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH0_CMRO2_RRFpos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH0_CMRO2_RRFPos+tlrc -tab > posROIs_H0_CMRO2_RRF.1D
set opref = "$ImageFolder/clustMapH0_CMRO2_RRF_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH0_CMRO2_RRFPos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH0_CMRO2_RRFneg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH0_CMRO2_RRFNeg+tlrc -tab > negROIs_H0_CMRO2_RRF.1D
set opref = "$ImageFolder/clustMapH0_CMRO2_RRF_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH0_CMRO2_RRFNeg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
## -------------------------------- H1 -----------------------------------------
## CMRO2_RRF analysis H1 regressed
set boundaryH1_CMRO2 = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestH1_CMRO2_RRF+tlrc[1]" -1sided -pval $pValThresholdCMRO2`
set ClustSizeH1_CMRO2 = `1d_tool.py -infile ccH1_CMRO2_RRF.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH1_CMRO2_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeH1_CMRO2 -pref_map "$ModelresultFolder/clustMapH1_CMRO2_RRFPos" -pref_dat "$ModelresultFolder/clustDataH1_CMRO2_RRFPos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryH1_CMRO2 > "$ModelresultFolder/clustResultsH1_CMRO2_RRFpos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH1_CMRO2_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeH1_CMRO2 -pref_map "$ModelresultFolder/clustMapH1_CMRO2_RRFNeg" -pref_dat "$ModelresultFolder/clustDataH1_CMRO2_RRFNeg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryH1_CMRO2 > "$ModelresultFolder/clustResultsH1_CMRO2_RRFneg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsH1_CMRO2_RRFpos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsH1_CMRO2_RRFneg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH1_CMRO2_RRFpos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH1_CMRO2_RRFPos+tlrc -tab > posROIs_H1_CMRO2_RRF.1D
set opref = "$ImageFolder/clustMapH1_CMRO2_RRF_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH1_CMRO2_RRFPos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH1_CMRO2_RRFneg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH1_CMRO2_RRFNeg+tlrc -tab > negROIs_H1_CMRO2_RRF.1D
set opref = "$ImageFolder/clustMapH1_CMRO2_RRF_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH1_CMRO2_RRFNeg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
## -------------------------------- H2 ------------------------------------------
## CMRO2_RRF analysis H2 regressed
set boundaryH2_CMRO2 = `p2dsetstat -quiet -inset "$ModelresultFolder/TtestH2_CMRO2_RRF+tlrc[1]" -1sided -pval $pValThresholdCMRO2`
set ClustSizeH2_CMRO2 = `1d_tool.py -infile ccH2_CMRO2_RRF.CSimA.NN2_1sided.1D -csim_show_clustsize -csim_pthr $pValThresholdCMRO2 -csim_alpha 0.05 -verb 0`
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH2_CMRO2_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeH2_CMRO2 -pref_map "$ModelresultFolder/clustMapH2_CMRO2_RRFPos" -pref_dat "$ModelresultFolder/clustDataH2_CMRO2_RRFPos" -mask $GMmask -ithr 1 -idat 0 -1sided 'RIGHT_TAIL' $boundaryH2_CMRO2 > "$ModelresultFolder/clustResultsH2_CMRO2_RRFpos.1D"
3dClusterize -overwrite -noabs -1Dformat -inset "$ModelresultFolder/TtestH2_CMRO2_RRF+tlrc" -NN $NN -clust_nvox $ClustSizeH2_CMRO2 -pref_map "$ModelresultFolder/clustMapH2_CMRO2_RRFNeg" -pref_dat "$ModelresultFolder/clustDataH2_CMRO2_RRFNeg" -mask $GMmask -ithr 1 -idat 0 -1sided 'LEFT_TAIL' -$boundaryH2_CMRO2 > "$ModelresultFolder/clustResultsH2_CMRO2_RRFneg.1D"
set testPosCMRO2=`cat "$ModelresultFolder/clustResultsH2_CMRO2_RRFpos.1D"`
set testNegCMRO2=`cat "$ModelresultFolder/clustResultsH2_CMRO2_RRFneg.1D"`
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testPosCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for positively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH2_CMRO2_RRFpos.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH2_CMRO2_RRFPos+tlrc -tab > posROIs_H2_CMRO2_RRF.1D
set opref = "$ImageFolder/clustMapH2_CMRO2_RRF_Pos"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH2_CMRO2_RRFPos+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
# identifying the ROIs of the clusters and printing the results in txt file
if ("$testNegCMRO2" == "#** NO CLUSTERS FOUND ***" ) then
echo "no clusters found for negatively activated voxels in ASL data"
else
whereami -space MNI -atlas $atlas -coord_file $ModelresultFolder/clustResultsH2_CMRO2_RRFneg.1D'[1,2,3]' -bmask $ModelresultFolder/clustMapH2_CMRO2_RRFNeg+tlrc -tab > negROIs_H2_CMRO2_RRF.1D
set opref = "$ImageFolder/clustMapH2_CMRO2_RRF_Neg"
@chauffeur_afni \
-ulay "${underlayMNI}" \
-box_focus_slices AMASK_FOCUS_ULAY \
-olay "$ModelresultFolder/clustMapH2_CMRO2_RRFNeg+tlrc" \
-set_subbricks 0 -1 -1 \
-ulay_range 0% 130% \
-cbar ROI_i64 \
-func_range 64 \
-pbar_posonly \
-opacity 6 \
-prefix ${opref} \
-set_xhairs OFF \
-montx 3 -monty 3 \
-label_mode 1 -label_size 4
endif
### ==============================================================================================
### ====================== overlapping and DICE of the tso methods ========================== ###
echo "Computing the overlapping of both method of computing mask of active voxels."
echo " Overlapping results " > Overlapping_masks_results_factor.txt
## testing CMRO2 positive with intersection mask
if (-e $ModelresultFolder/clustMapTvsR_CMRO2Pos+tlrc.HEAD) then
3dABoverlap -no_automask "$ModelresultFolder/clustMapTvsR_CMRO2Pos+tlrc" "$ModelresultFolder/atlas_inter+tlrc" >> Overlapping_masks_results_factor.txt
# set totVxl = `3dBrickStat -count -non-zero "$ModelresultFolder/clustMapTvsR_CMRO2Pos+tlrc"`
# set Noverlap = `3dOverlap "$ModelresultFolder/clustMapTvsR_CMRO2Pos+tlrc" "$ModelresultFolder/atlas_inter+tlrc"`
# set prctOverlap = `echo "scale=5; ($Noverlap / $totVxl) * 100" | bc`
# echo "number of overlapping voxels between CMRO2 HRF and intersectional masks is: $Noverlap" >> Overlapping_masks_results_factor.txt
# echo "number of total voxels in CMRO2 HRF clustered mask is: $totVxl voxels" >> Overlapping_masks_results_factor.txt
# echo "percent of voxel overlap: $prctOverlap % of CMRO2 HRF mask voxels" >> Overlapping_masks_results_factor.txt
else
echo "No positive CMRO2 HRF clusters" >> Overlapping_masks_results_factor.txt
endif
if (-e $ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFPos+tlrc.HEAD) then
3dABoverlap -no_automask "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFPos+tlrc" "$ModelresultFolder/atlas_inter+tlrc" >> Overlapping_masks_results_factor.txt
# set totVxl = `3dBrickStat -count -non-zero "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFPos+tlrc"`
# set Noverlap = `3dOverlap "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_RRFPos+tlrc" "$ModelresultFolder/atlas_inter+tlrc"`
# set prctOverlap = `echo "scale=5; ($Noverlap / $totVxl) * 100" | bc`
# echo "number of overlapping voxels between CMRO2 RRF calculated from BOLD and ASL beta coeffs and intersectional masks is: $Noverlap" >> Overlapping_masks_results_factor.txt
# echo "number of total voxels in CMRO2 RRF calculated from BOLD and ASL beta coeffs clustered mask is: $totVxl voxels" >> Overlapping_masks_results_factor.txt
# echo "percent of voxel overlap: $prctOverlap % of CMRO2 RRF calculated from BOLD and ASL beta coeffs mask voxels" >> Overlapping_masks_results_factor.txt
else
echo "No positive CMRO2 RRF calculated from BOLD and ASL beta coeffs clusters" >> Overlapping_masks_results_factor.txt
endif
if (-e $ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFPos+tlrc.HEAD) then
3dABoverlap -no_automask "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFPos+tlrc" "$ModelresultFolder/atlas_inter+tlrc" >> Overlapping_masks_results_factor.txt
# set totVxl = `3dBrickStat -count -non-zero "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFPos+tlrc"`
# set Noverlap = `3dOverlap "$ModelresultFolder/clustMapTvsR_CMRO2_calculated_HRFPos+tlrc" "$ModelresultFolder/atlas_inter+tlrc"`
# set prctOverlap = `echo "scale=5; ($Noverlap / $totVxl) * 100" | bc`
# echo "number of overlapping voxels between CMRO2 HRF calculated from BOLD and ASL beta coeffs and intersectional masks is: $Noverlap" >> Overlapping_masks_results_factor.txt
# echo "number of total voxels in CMRO2 HRF calculated from BOLD and ASL beta coeffs clustered mask is: $totVxl voxels" >> Overlapping_masks_results_factor.txt
# echo "percent of voxel overlap: $prctOverlap % of CMRO2 HRF calculated from BOLD and ASL beta coeffs mask voxels" >> Overlapping_masks_results_factor.txt
else
echo "No positive CMRO2 HRF calculated from BOLD and ASL beta coeffs clusters" >> Overlapping_masks_results_factor.txt
endif
if (-e $ModelresultFolder/clustMapTvsR_CMRO2_RRFPos+tlrc.HEAD) then
3dABoverlap -no_automask "$ModelresultFolder/clustMapTvsR_CMRO2_RRFPos+tlrc" "$ModelresultFolder/atlas_inter+tlrc" >> Overlapping_masks_results_factor.txt
# set totVxl = `3dBrickStat -count -non-zero "$ModelresultFolder/clustMapTvsR_CMRO2_RRFPos+tlrc"`
# set Noverlap = `3dOverlap "$ModelresultFolder/clustMapTvsR_CMRO2_RRFPos+tlrc" "$ModelresultFolder/atlas_inter+tlrc"`
# set prctOverlap = `echo "scale=5; ($Noverlap / $totVxl) * 100" | bc`
# echo "number of overlapping voxels between CMRO2 RRF and intersectional masks is: $Noverlap" >> Overlapping_masks_results_factor.txt
# echo "number of total voxels in CMRO2 RRF clustered mask is: $totVxl voxels" >> Overlapping_masks_results_factor.txt
# echo "percent of voxel overlap: $prctOverlap % of CMRO2 RRF mask voxels" >> Overlapping_masks_results_factor.txt
else
echo "No positive CMRO2 RRF clusters" >> Overlapping_masks_results_factor.txt
endif
if (-e $ModelresultFolder/clustMapTvsR_BOLDPos${suffix_atlas}+tlrc.HEAD) then
3dABoverlap -no_automask "$ModelresultFolder/clustMapTvsR_BOLDPos+tlrc" "$ModelresultFolder/atlas_inter+tlrc" >> Overlapping_masks_results_factor.txt