[Swift-commit] r6537 - in SwiftTutorials/OHBM_2013-06-16: . data original

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Tue Jun 11 17:23:37 CDT 2013


Author: wilde
Date: 2013-06-11 17:23:37 -0500 (Tue, 11 Jun 2013)
New Revision: 6537

Added:
   SwiftTutorials/OHBM_2013-06-16/README
   SwiftTutorials/OHBM_2013-06-16/align.sh
   SwiftTutorials/OHBM_2013-06-16/apps
   SwiftTutorials/OHBM_2013-06-16/apps.midway-westmere
   SwiftTutorials/OHBM_2013-06-16/clean.sh
   SwiftTutorials/OHBM_2013-06-16/data/
   SwiftTutorials/OHBM_2013-06-16/data/anatomy1.hdr
   SwiftTutorials/OHBM_2013-06-16/data/anatomy1.img
   SwiftTutorials/OHBM_2013-06-16/data/anatomy2.hdr
   SwiftTutorials/OHBM_2013-06-16/data/anatomy2.img
   SwiftTutorials/OHBM_2013-06-16/data/anatomy3.hdr
   SwiftTutorials/OHBM_2013-06-16/data/anatomy3.img
   SwiftTutorials/OHBM_2013-06-16/data/anatomy4.hdr
   SwiftTutorials/OHBM_2013-06-16/data/anatomy4.img
   SwiftTutorials/OHBM_2013-06-16/data/reference.hdr
   SwiftTutorials/OHBM_2013-06-16/data/reference.img
   SwiftTutorials/OHBM_2013-06-16/genatlas.swift
   SwiftTutorials/OHBM_2013-06-16/original/
   SwiftTutorials/OHBM_2013-06-16/original/workflow.sh
   SwiftTutorials/OHBM_2013-06-16/original/workflow2.sh
   SwiftTutorials/OHBM_2013-06-16/output/
   SwiftTutorials/OHBM_2013-06-16/sites.xml
   SwiftTutorials/OHBM_2013-06-16/swift.properties
   SwiftTutorials/OHBM_2013-06-16/volmapper
   SwiftTutorials/OHBM_2013-06-16/work/
Log:
Initial revision.

Added: SwiftTutorials/OHBM_2013-06-16/README
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/README	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/README	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,24 @@
+
+fMRI Data Processing demo for OHBM 2013
+
+Setup
+
+  # Get the scripts from svn
+
+  svn co https://svn.ci.uchicago.edu/svn/vdl2/SwiftTutorials/OHBM_2013-06-16 
+  cd OHBM_2013-06-16
+
+  # Set default swift.properties in $HOME/.swift.  Points to "." for apps (tc) and sites.xml
+
+  mkdir -p ~/.swift
+  cp ~/.swift/swift.properties ~/.swift/save.swift.properties # If needed, as needed.
+  cp swift.properties ~/.swift
+
+  # Get swift
+
+  module load swift
+
+To run:
+
+ swift genatlas.swift
+

Added: SwiftTutorials/OHBM_2013-06-16/align.sh
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/align.sh	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/align.sh	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+AIR5=/home/wilde/software/AIR5.3.0
+fsl=/project/wilde/software/fsl-5.0.4/fsl
+
+# Arguments: referenceImage (in) anatomicalImage (in) reslicedImage (out)
+
+ref=$1
+anat=$2
+resliced=$3
+
+time $AIR5/bin/alignlinear $ref $anat init.warp \
+  -m 15 -t1 55 -t2 55 -x 1 -r 8 -c 0.1 -h 8 
+time $AIR5/bin/align_warp  $ref $anat refined.warp \
+  -m 1 12 -b1 .1 .1 .1  -b2 .1 .1 .1 -f init.warp -h 10000 -s 1024 2 2 -c .01 # -v -q -s 1024 2 2 -c .01
+time $AIR5/bin/reslice refined.warp $resliced -a $anat
+
+exit
+
+
+
+
+
+
+
+clean=y
+
+if [ $clean = y ]; then
+  rm *warp atlas* resliced*
+fi
+
+
+
+if true; then
+
+  warp 1
+  warp 2
+  warp 3
+  warp 4
+
+  time  $AIR5/bin/softmean atlas.hdr y null resliced1.img resliced2.img resliced3.img resliced4.img
+fi
+
+export FSLOUTPUTTYPE=NIFTI
+
+time $fsl/bin/slicer atlas.hdr -x .5 atlas-x.pgm
+time $fsl/bin/slicer atlas.hdr -y .5 atlas-y.pgm
+time $fsl/bin/slicer atlas.hdr -z .5 atlas-z.pgm
+
+time convert atlas-x.pgm atlas-x.gif
+time convert atlas-y.pgm atlas-y.gif
+time convert atlas-z.pgm atlas-z.gif


Property changes on: SwiftTutorials/OHBM_2013-06-16/align.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/OHBM_2013-06-16/apps
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/apps	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/apps	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,4 @@
+localhost sh       /bin/sh
+localhost softmean /home/wilde/software/AIR5.3.0/bin/softmean
+localhost slicer   /project/wilde/software/fsl-5.0.4/fsl/bin/slicer null null env::FSLOUTPUTTYPE=NIFTI
+localhost convert  convert

Added: SwiftTutorials/OHBM_2013-06-16/apps.midway-westmere
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/apps.midway-westmere	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/apps.midway-westmere	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,4 @@
+westmere  sh       /bin/sh
+localhost softmean /home/wilde/software/AIR5.3.0/bin/softmean
+localhost slicer   /project/wilde/software/fsl-5.0.4/fsl/bin/slicer null null env::FSLOUTPUTTYPE=NIFTI
+localhost convert  convert

Added: SwiftTutorials/OHBM_2013-06-16/clean.sh
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/clean.sh	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/clean.sh	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+rm -rf _concurrent work/* output/* *.log *.rlog *.d *.kml *.swiftx 
+


Property changes on: SwiftTutorials/OHBM_2013-06-16/clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/OHBM_2013-06-16/data/anatomy1.hdr
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/anatomy1.hdr
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/data/anatomy1.img
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/anatomy1.img
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/data/anatomy2.hdr
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/anatomy2.hdr
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/data/anatomy2.img
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/anatomy2.img
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/data/anatomy3.hdr
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/anatomy3.hdr
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/data/anatomy3.img
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/anatomy3.img
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/data/anatomy4.hdr
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/anatomy4.hdr
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/data/anatomy4.img
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/anatomy4.img
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/data/reference.hdr
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/reference.hdr
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/data/reference.img
===================================================================
(Binary files differ)


Property changes on: SwiftTutorials/OHBM_2013-06-16/data/reference.img
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: SwiftTutorials/OHBM_2013-06-16/genatlas.swift
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/genatlas.swift	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/genatlas.swift	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,77 @@
+type file;
+
+type Volume {
+  file header;
+  file image;
+};
+
+app (Volume alignedVol) align (file alignScript, Volume reference, Volume input)
+{
+  sh @alignScript @filename(reference.image) @filename(input.image) @filename(alignedVol.image);
+}
+
+app (Volume atlas) softmean (Volume v[])
+{
+  softmean @filename(atlas.header) "y" "null" imageNames(v);
+}
+
+app (Volume atlas) softmeanORIG (Volume v[])
+{
+  softmean @filename(atlas.header) "y" "null" @filenames(v);
+}
+
+app (file pgm) slicer (Volume v, string axis)
+{
+  slicer @filename(v.header) @strcat("-",axis) .5 @filename(pgm);
+}
+
+app (file o) convert (file i)
+{
+  convert @i @o;
+}
+
+Volume referenceVolume<ext; exec="volmapper",name="data/reference">;
+Volume inputVolumes []<ext; exec="volmapper",prefix="data/anatomy">;
+Volume outputVolumes[];
+
+file alignScript<"align.sh">;
+
+foreach v, i in inputVolumes {
+  Volume aligned<ext; exec="volmapper",name=@strcat("work/aligned",i)>;
+  aligned = align(alignScript,referenceVolume, v);
+  outputVolumes[i] = aligned;
+}
+
+Volume atlasVolume<ext; exec="volmapper",name="output/atlas">;
+atlasVolume = softmean(outputVolumes);
+
+file xSlice<"output/atlas-x.png">;
+file ySlice<"output/atlas-y.png">;
+file zSlice<"output/atlas-z.png">;
+
+xSlice = convert(slicer(atlasVolume,"x"));
+ySlice = convert(slicer(atlasVolume,"y"));
+zSlice = convert(slicer(atlasVolume,"z"));
+
+
+
+
+
+
+string testNames[] = imageNames(outputVolumes);
+foreach n, i in testNames {
+  tracef("testNames[%i] = %s\n", i, n);
+}
+
+
+(string onames[]) imageNames (Volume v[])
+{
+  string names[] = @filenames(v);
+  foreach n, i in names {
+    if ( i %% 2 == 0) {
+      // tracef("n[%i] = %s\n", i, n);
+      onames[i] = n;
+    }
+  }
+}
+

Added: SwiftTutorials/OHBM_2013-06-16/original/workflow.sh
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/original/workflow.sh	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/original/workflow.sh	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+AIR5=$HOME/software/AIR5.3.0
+fsl=/project/wilde/software/fsl-5.0.4/fsl
+
+if true; then
+
+#time  $AIR5/bin/align_warp anatomy1.img reference.img warp1.warp -m 1 12 -s 1024 2 2 -c .01 -b1 .1 .1 .1 -b2 .1 .1 .1  -h 10000 -v -j # -q
+
+time  $AIR5/bin/align_warp reference.img anatomy1.img warp1.warp -m 1 12  -b1 .1 .1 .1  -b2 .1 .1 .1  -h 10000 -v -s 1024 2 2 -c .01  -f out # -q -s 1024 2 2 -c .01
+
+
+time  $AIR5/bin/align_warp anatomy2.img reference.img warp2.warp -m 1 12 -s 64 2 2 -c .01 -b1 .1 .1 .1 -b2 .1 .1 .1  # -q
+time  $AIR5/bin/align_warp anatomy3.img reference.img warp3.warp -m 1 12 -s 64 2 2 -c .01 -b1 .1 .1 .1 -b2 .1 .1 .1  # -q
+time  $AIR5/bin/align_warp anatomy4.img reference.img warp4.warp -m 1 12 -s 64 2 2 -c .01 -b1 .1 .1 .1 -b2 .1 .1 .1  # -q
+time  $AIR5/bin/reslice warp1.warp resliced1
+time  $AIR5/bin/reslice warp2.warp resliced2
+time  $AIR5/bin/reslice warp3.warp resliced3
+time  $AIR5/bin/reslice warp4.warp resliced4
+time  $AIR5/bin/softmean atlas.hdr y null resliced1.img resliced2.img resliced3.img resliced4.img
+fi
+
+export FSLOUTPUTTYPE=NIFTI
+
+time $fsl/bin/slicer atlas.hdr -x .5 atlas-x.pgm
+time $fsl/bin/slicer atlas.hdr -y .5 atlas-y.pgm
+time $fsl/bin/slicer atlas.hdr -z .5 atlas-z.pgm
+time convert atlas-x.pgm atlas-x.gif
+time convert atlas-y.pgm atlas-y.gif
+time convert atlas-z.pgm atlas-z.gif


Property changes on: SwiftTutorials/OHBM_2013-06-16/original/workflow.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/OHBM_2013-06-16/original/workflow2.sh
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/original/workflow2.sh	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/original/workflow2.sh	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+AIR5=$HOME/software/AIR5.3.0
+
+
+clean=y
+
+if [ $clean = y ]; then
+  rm *warp atlas* resliced*
+fi
+
+warp()
+{
+time $AIR5/bin/alignlinear reference.img anatomy$1.img initwarp$1.warp -m 15 -t1 55 -t2 55 -x 1 -r 8 -c 0.1 -h 8 
+time $AIR5/bin/align_warp reference.img anatomy$1.img warp$1.warp -m 1 12  -b1 .1 .1 .1  -b2 .1 .1 .1  -h 10000 -v -s 1024 2 2 -c .01 -f initwarp$1.warp # -q -s 1024 2 2 -c .01
+}
+
+if true; then
+
+warp 1
+warp 2
+warp 3
+warp 4
+
+time  $AIR5/bin/reslice warp1.warp resliced1 -a anatomy1
+time  $AIR5/bin/reslice warp2.warp resliced2 -a anatomy2
+time  $AIR5/bin/reslice warp3.warp resliced3 -a anatomy3
+time  $AIR5/bin/reslice warp4.warp resliced4 -a anatomy4
+
+time  $AIR5/bin/softmean atlas.hdr y null resliced1.img resliced2.img resliced3.img resliced4.img
+fi
+
+export FSLOUTPUTTYPE=NIFTI
+
+time $fsl/bin/slicer atlas.hdr -x .5 atlas-x.pgm
+time $fsl/bin/slicer atlas.hdr -y .5 atlas-y.pgm
+time $fsl/bin/slicer atlas.hdr -z .5 atlas-z.pgm
+time convert atlas-x.pgm atlas-x.gif
+time convert atlas-y.pgm atlas-y.gif
+time convert atlas-z.pgm atlas-z.gif


Property changes on: SwiftTutorials/OHBM_2013-06-16/original/workflow2.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftTutorials/OHBM_2013-06-16/sites.xml
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/sites.xml	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/sites.xml	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,41 @@
+<config>
+
+  <pool handle="localhost">
+    <execution provider="local"/>
+    <profile namespace="karajan" key="initialScore">10000</profile>
+    <filesystem provider="local"/>
+    <workdirectory>/scratch/midway/{env.USER}/swiftwork</workdirectory>
+    <profile namespace="karajan" key="jobThrottle">.03</profile> <!-- eg .11 -> 12 -->
+  </pool>
+
+  <pool handle="westmere">
+    <execution provider="coaster" jobmanager="local:slurm"/>
+
+    <!-- Set partition and account here: -->
+    <profile namespace="globus" key="queue">westmere</profile>
+    <profile namespace="globus" key="ppn">12</profile>
+    <!-- <profile namespace="globus" key="project">pi-wilde</profile> -->
+
+    <!-- Set number of jobs and nodes per job here: -->
+    <profile namespace="globus" key="slots">1</profile>
+    <profile namespace="globus" key="maxnodes">1</profile>
+    <profile namespace="globus" key="nodegranularity">1</profile>
+    <profile namespace="globus" key="jobsPerNode">12</profile> <!-- apps per node! -->
+    <profile namespace="karajan" key="jobThrottle">.11</profile> <!-- eg .11 -> 12 -->
+
+    <!-- Set estimated app time (maxwalltime) and requested job time (maxtime) here: -->
+    <profile namespace="globus" key="maxWalltime">00:15:00</profile>
+    <profile namespace="globus" key="maxtime">1800</profile>  <!-- in seconds! -->
+
+    <!-- Set data staging model and work dir here: -->
+    <filesystem provider="local"/>
+    <workdirectory>/scratch/midway/{env.USER}/swiftwork</workdirectory>
+
+    <!-- Typically leave these constant: -->
+    <profile namespace="globus" key="slurm.exclusive">false</profile>
+    <profile namespace="globus" key="highOverAllocation">100</profile>
+    <profile namespace="globus" key="lowOverAllocation">100</profile>
+    <profile namespace="karajan" key="initialScore">10000</profile>
+  </pool>
+
+</config>

Added: SwiftTutorials/OHBM_2013-06-16/swift.properties
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/swift.properties	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/swift.properties	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,14 @@
+
+sites.file=sites.xml
+tc.file=apps
+
+status.mode=provider
+use.provider.staging=false
+use.wrapper.staging=false
+wrapperlog.always.transfer=true
+execution.retries=0
+lazy.errors=false
+provider.staging.pin.swiftfiles=false
+sitedir.keep=true
+file.gc.enabled=false
+#tcp.port.range=50000,51000

Added: SwiftTutorials/OHBM_2013-06-16/volmapper
===================================================================
--- SwiftTutorials/OHBM_2013-06-16/volmapper	                        (rev 0)
+++ SwiftTutorials/OHBM_2013-06-16/volmapper	2013-06-11 22:23:37 UTC (rev 6537)
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+case $1 in
+
+  -prefix)
+
+    prefix=$2
+    names=$(echo ${prefix}*.img)
+
+    for n in $names; do
+      name=$(echo $n | sed -e 's,\..*,,')
+      num=$(echo $n | sed -e 's,\..*,,' -e "s,${prefix},,")
+      echo "[$num].header $name.hdr"
+      echo "[$num].image  $name.img"
+    done
+    ;;
+
+  -name)
+
+    echo 'header' $2.hdr
+    echo 'image ' $2.img
+    ;;
+
+  *)
+    echo error in external mapper $0
+    ;;
+esac
+    
+


Property changes on: SwiftTutorials/OHBM_2013-06-16/volmapper
___________________________________________________________________
Added: svn:executable
   + *




More information about the Swift-commit mailing list