[Swift-commit] r2405 - text/hpdc09submission

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Jan 8 15:12:12 CST 2009


Author: wilde
Date: 2009-01-08 15:12:11 -0600 (Thu, 08 Jan 2009)
New Revision: 2405

Modified:
   text/hpdc09submission/paper.latex
Log:
Added a fmri example from the FPGS paper. Not likely that this is the one we want to go with - just need something to work with here at the momment.


Modified: text/hpdc09submission/paper.latex
===================================================================
--- text/hpdc09submission/paper.latex	2009-01-08 13:23:36 UTC (rev 2404)
+++ text/hpdc09submission/paper.latex	2009-01-08 21:12:11 UTC (rev 2405)
@@ -929,6 +929,104 @@
 heterogeneity between sites. Large number of sites; automatic site file
 selection; and automatic app deployment there.
 
+\subsection{fMRI Application Example}
+
+\includegraphics{IMG_fmridataset}
+
+\begin{verbatim}
+type Study { Group g[]; }     	     				   
+type Run { Volume v[]; }
+type Volume {
+  Image img;
+  Header hdr;
+}
+type Group { Subject s[]; }
+type AirVector { Air a[]; }
+type Subject {
+   Volume anat;
+   Run run[];
+}           
+
+(Run resliced) reslice_wf ( Run r) {
+     Run yR = reorientRun( r , "y", "n" );
+     Run roR  = reorientRun( yR , "x", "n" );
+     Volume std = roR.v[1];
+     AirVector roAirVec = 
+          alignlinearRun(std, roR, 12, 1000, 1000, "81 3 3");
+     resliced = resliceRun( roR, roAirVec, "-o", "-k");
+}
+
+(Volume ov) reorient (Volume iv, string direction, string overwrite) {
+        app {
+                reorient  @filename(iv.hdr) 
+             	 @filename(ov.hdr) 
+ direction 
+ overwrite;
+        }
+}
+
+(Run or) reorientRun (Run ir, string direction, string overwrite) {
+        foreach Volume iv, i in ir.v {
+                or.v[i] = reorient (iv, direction, overwrite);
+        }
+}
+
+\end{verbatim}
+
+In this example, the logical structure of the fMRI dataset shown in
+Figure 1 can be represented by the SwiftScript type declarations in
+lines 1-6 in Figure 2. Here, Study is declared as containing an array
+of Group, which in turn contains an array of Subject, etc. Similarly,
+an fMRI Run is a series of brain scans called volumes, with a Volume
+containing a 3D image of a volumetric slice of a brain image,
+represented by an Image (voxels) and a Header (scanner metadata). An
+Air is a parameter file for spatial adjustment, and an AirVector is a
+set of such parameter files.  Datasets are operated on by procedures,
+which take typed data described by XDTM as input, perform computations
+on those data, and produce data described by XDTM as output. The
+procedure reslice\_wf defines a compound procedure, which may comprise
+a series of procedure calls, using variables or datasets to establish
+data dependencies. Such procedures can themselves be called by other
+procedures, thus defining a potentially large and complex execution
+graph.
+
+In the example, reslice\_wf essentially defines a simple four-step
+pipeline computation, using variables and/or datasets to establish
+data dependencies. It applies reorientRun to a run first in the x axis
+and then in the y axis, and then aligns each image in the resulting
+run with the first image. The program alignlinear determines how to
+spatially adjust an image to match a reference image, and produces an
+air parameter file. The actual alignment is done by the program
+reslice. Note that variable yR, being the output of the first step and
+the input of the second step, defines the data dependencies between
+the two steps. The pipeline is illustrated in the center of Figure 2,
+while on the right we show the expanded graph for a 20-volume
+run. Each volume comprises an image file and a header file, so there
+are a total of 40 input files and 40 output files. We can also apply
+the same procedure to a run containing hundreds or thousands of
+volumes.
+
+In this example we show the details of the procedure reorientRun,
+which is also a compound procedure. Note the typed input arguments (to
+the right of the procedure name) and output argument (to the
+left). The foreach statement defines an iteration over the input run
+ir and applies the procedure reorient (which rotates a brain image
+along a certain axis) to each volume in the run to produces a
+reoriented run or. Because the multiple calls to reorient operate on
+independent data elements, they can proceed in parallel.  The
+procedure reorient in this example is an atomic procedure, which
+specifies the interface to calling an executable program. This
+procedure has typed input parameters iv, direction and overwrite and
+one output ov. The body of this particular procedure specifies that it
+invokes a program (conveniently, also called reorient) that will be
+dynamically mapped to a binary executable. (This executable will
+execute at an execution site chosen by the Swift runtime system.) The
+body also specifies how input parameters map to command line
+arguments. The notation @filename is a built-in mapping function that
+maps a logical data structure to a physical file name. In this case,
+it extracts the file name of input header and output header, which are
+then put in the command line to invoke the reorient program.
+
 \section{Usage Experience}
 
 \subsection{Use on large numbers of sites in the Open Science Grid}




More information about the Swift-commit mailing list