[Swift-commit] r2503 - in SwiftApps/SIDGrid/swift/swift_scripts: . afni

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Fri Feb 6 13:13:25 CST 2009


Author: skenny
Date: 2009-02-06 13:13:24 -0600 (Fri, 06 Feb 2009)
New Revision: 2503

Added:
   SwiftApps/SIDGrid/swift/swift_scripts/afni/
   SwiftApps/SIDGrid/swift/swift_scripts/afni/AFNIPreProcs.swift
   SwiftApps/SIDGrid/swift/swift_scripts/afni/AFNIdeconvolution.swift
Log:
afni preprocessing scripts

Added: SwiftApps/SIDGrid/swift/swift_scripts/afni/AFNIPreProcs.swift
===================================================================
--- SwiftApps/SIDGrid/swift/swift_scripts/afni/AFNIPreProcs.swift	                        (rev 0)
+++ SwiftApps/SIDGrid/swift/swift_scripts/afni/AFNIPreProcs.swift	2009-02-06 19:13:24 UTC (rev 2503)
@@ -0,0 +1,64 @@
+#---- doing volreg, despike, mean, percent sig change for PK1
+type file{}
+
+type AFNI_obj{
+    file HEAD;
+    file BRIK;
+};
+
+
+app (AFNI_obj volregResult, file resultVolregMotion) AFNI_volreg (string baseName, AFNI_obj inputTS, AFNI_obj referenceTS, string volregBaseString){
+    AFNI_3dvolreg "-twopass" "-twodup" "-dfile" @strcat("mot_",baseName) "-base" @strcat(volregBaseString,"+orig[199]") "-prefix" @strcat("volreg.",baseName) @inputTS.BRIK;
+}
+
+app (AFNI_obj despikeResult) AFNI_despike (string baseName, AFNI_obj volregdInputTS){
+    AFNI_3dDespike "-prefix" @strcat("despiked.",baseName) @volregdInputTS.BRIK;
+}
+
+app (AFNI_obj meanResult) AFNI_mean (AFNI_obj despikeResult, string baseName){
+    AFNI_3dTstat "-mean" "-prefix" @strcat("mean.",baseName) @despikeResult.BRIK;
+}
+
+app (AFNI_obj nrmlzPerChngResult) AFNI_normalizePerChng (AFNI_obj despikeResult, AFNI_obj meanResult, string baseName){
+    AFNI_3dcalc "-a" @despikeResult.BRIK "-b" @meanResult.BRIK "-expr" "((a-b)/b)*100" "-fscale" "-prefix" @strcat("nrmlzdPerChng.",baseName);
+}
+
+app (AFNI_obj TScatResult) AFNI_TScat (string subject, AFNI_obj PerCh2, AFNI_obj PerCh3, AFNI_obj PerCh4, AFNI_obj PerCh5, AFNI_obj PerCh6, AFNI_obj PerCh7, AFNI_obj PerCh8, AFNI_obj PerCh9){
+    AFNI_3dTcat "-prefix" @strcat("nrmlzdPerChng_TScat.",subject) @PerCh2.BRIK @PerCh3.BRIK @PerCh4.BRIK @PerCh5.BRIK @PerCh6.BRIK @PerCh7.BRIK @PerCh8.BRIK @PerCh9.BRIK;
+}
+
+(AFNI_obj despikeResult, AFNI_obj meanResult, AFNI_obj nrmlzPerChngResult) AFNI_PerChngTS (string baseName, AFNI_obj volregdInput){
+    (despikeResult) = AFNI_despike(baseName, volregdInput);
+    (meanResult) = AFNI_mean(despikeResult, baseName);
+    (nrmlzPerChngResult) = AFNI_normalizePerChng(despikeResult, meanResult, baseName);
+}
+ 
+
+string declarelist[] = ["PK1"];
+foreach subject in declarelist{
+    int runs[] = [2:9];
+    foreach run in runs{
+        string baseName = @strcat(subject,".runLOOP",run);
+        AFNI_obj inputTS<simple_mapper; prefix=@strcat("ts.",run,"+orig.")>;
+        AFNI_obj volregResult<simple_mapper;prefix=@strcat("volreg.",baseName,"+orig.")>;
+        file resultVolregMotion<single_file_mapper; file=@strcat("mot_",baseName)>;
+        AFNI_obj volregRefTS<simple_mapper; prefix=@strcat("ts.5+orig.")>;
+        string volregBaseString = @strcat("ts.5");
+        AFNI_obj despikeResult<simple_mapper; prefix=@strcat("despiked.",baseName,"+orig.")>;
+        AFNI_obj meanResult<simple_mapper; prefix=@strcat("mean.",baseName,"+orig.")>;
+        AFNI_obj nrmlzPerChngResult<simple_mapper; prefix=@strcat("nrmlzdPerChng.",baseName,"+orig.")>;
+        (volregResult, resultVolregMotion) = AFNI_volreg(baseName, inputTS, volregRefTS, volregBaseString);
+        (despikeResult, meanResult, nrmlzPerChngResult) = AFNI_PerChngTS(baseName, volregResult);
+    }
+    string subj = @strcat(subject);
+    AFNI_obj PerCh2<simple_mapper; prefix=@strcat("nrmlzdPerChng.",subject,".run2+orig.")>;
+    AFNI_obj PerCh3<simple_mapper; prefix=@strcat("nrmlzdPerChng.",subject,".run3+orig.")>;
+    AFNI_obj PerCh4<simple_mapper; prefix=@strcat("nrmlzdPerChng.",subject,".run4+orig.")>;
+    AFNI_obj PerCh5<simple_mapper; prefix=@strcat("nrmlzdPerChng.",subject,".run5+orig.")>;
+    AFNI_obj PerCh6<simple_mapper; prefix=@strcat("nrmlzdPerChng.",subject,".run6+orig.")>;
+    AFNI_obj PerCh7<simple_mapper; prefix=@strcat("nrmlzdPerChng.",subject,".run7+orig.")>;
+    AFNI_obj PerCh8<simple_mapper; prefix=@strcat("nrmlzdPerChng.",subject,".run8+orig.")>;
+    AFNI_obj PerCh9<simple_mapper; prefix=@strcat("nrmlzdPerChng.",subject,".run9+orig.")>;
+    AFNI_obj TScatResult<simple_mapper; prefix=@strcat("nrmlzdPerChng_TScat.",subject,"+orig.")>;
+    (TScatResult) = AFNI_TScat(subj, PerCh2, PerCh3, PerCh4, PerCh5, PerCh6, PerCh7, PerCh8, PerCh9);
+}

Added: SwiftApps/SIDGrid/swift/swift_scripts/afni/AFNIdeconvolution.swift
===================================================================
--- SwiftApps/SIDGrid/swift/swift_scripts/afni/AFNIdeconvolution.swift	                        (rev 0)
+++ SwiftApps/SIDGrid/swift/swift_scripts/afni/AFNIdeconvolution.swift	2009-02-06 19:13:24 UTC (rev 2503)
@@ -0,0 +1,49 @@
+#---- pinche deconvolution
+type file{}
+
+type AFNI_obj{
+    	file HEAD;
+    	file BRIK;
+}
+
+type stims{
+	string labels[];
+	string fnames[];
+}	
+
+app (AFNI_obj deconvBucketResult, file deconvXsave) AFNI_pincheDeconvolution (AFNI_obj normalized, stims stimuli, file concat, file motionfile, file designmatrix){
+    AFNI_3dDeconvolve "-input" @filename(normalized.BRIK) "-tshift" "-num_stimts" 8
+	"-stim_file" 1 stimuli.fnames[0] "-stim_label" 1 stimuli.labels[0]
+	"-stim_file" 2 stimuli.fnames[1] "-stim_label" 2 stimuli.labels[1]
+	"-stim_file" 3 stimuli.fnames[2] "-stim_base" 3 "-stim_label" 3 stimuli.labels[2]
+	"-stim_file" 4 stimuli.fnames[3] "-stim_base" 4 "-stim_label" 4 stimuli.labels[3]
+	"-stim_file" 5 stimuli.fnames[4] "-stim_base" 5 "-stim_label" 5 stimuli.labels[4]
+	"-stim_file" 6 stimuli.fnames[5] "-stim_base" 6 "-stim_label" 6 stimuli.labels[5]
+	"-stim_file" 7 stimuli.fnames[6] "-stim_base" 7 "-stim_label" 7 stimuli.labels[6]
+	"-stim_file" 8 stimuli.fnames[7] "-stim_base" 8 "-stim_label" 8 stimuli.labels[7]
+	"-full_first" "-tout" "-fout" "-nodmbase" "-xsave" "-nfirst" "0" "-concat" @filename(concat) "-bucket" 
+	"TESTdeconvolveResults_PK1";
+}
+
+string declarelist[] = ["PK1"];
+foreach subject in declarelist
+{
+	## map inputs
+	file designmatrix<single_file_mapper; file="for3dDeconvolve.ntp200TR1.5faces-002.par">;
+	file motionfile<single_file_mapper; file=@strcat("motion_",subject,"audio.1D")>;
+	file concat<single_file_mapper; file=@strcat("concat_runs",subject,".1D")>;	
+	AFNI_obj normalized<simple_mapper; prefix=@strcat("audioTScat_nrmlzdPerChng.",subject,"+orig.")>;
+
+	## map outputs
+	file xsave<single_file_mapper; file=@strcat("TESTdeconvolveResults_",subject,".xsave")>;
+	AFNI_obj bucket<simple_mapper; prefix=@strcat("TESTdeconvolveResults_",subject,"+orig.")>;
+
+	stims stimuli;
+	stimuli.labels = ["pakata","whitenoise","roll","pitch","yaw","dx","dy","dz"];
+	stimuli.fnames = [@strcat(@filename(designmatrix),"[0]"), at strcat(@filename(designmatrix),"[1]"),
+			  @strcat(@filename(motionfile),"[1]"), at strcat(@filename(motionfile),"[2]"),
+    			  @strcat(@filename(motionfile),"[3]"), at strcat(@filename(motionfile),"[4]"),
+			  @strcat(@filename(motionfile),"[5]"), at strcat(@filename(motionfile),"[6]")];
+
+	(bucket, xsave) = AFNI_pincheDeconvolution(normalized, stimuli, concat, motionfile, designmatrix);
+}




More information about the Swift-commit mailing list