1 <?xml version="1.0" encoding="UTF-8"?>
2 <workflow name="odin" version="1.0">
4 <description>This application wraps the Odin MRI simulator. The Odin code source is available at http://od1n.sourceforge.net</description>
7 <source name="ProData" type="uri">
8 <source-comment><b><font color="blue">new input</font></b>: Pro file
11 <source name="SmpDir" type="uri">
12 <source-comment><b><font color="blue">new input</font></b>: Folder containing all (and only) Smp files
15 <source name="ResultsDirectory" type="uri">
16 <source-comment><b><font color="blue">new input</font></b>: add description here...
19 <constant name="OdinSeq" type="string" value="odinepiexe" cardinality="scalar" />
20 <source name="options" type="string">
21 <source-comment><b><font color="blue">options</font></b>: any option string, to be appended to the recon-all command line. For instance: '-all'. <b>Important:</b> don't put spaces, use '_' instead. And put 'no' in case you don't want to use any option.
27 <processor name="odin" >
28 <in name="input4" type="string" depth="0" />
29 <in name="input3" type="string" depth="0" />
30 <in name="input2" type="string" depth="0" />
31 <in name="input1" type="string" depth="0" />
32 <in name="input0" type="uri" depth="0" />
35 <port name="input0" />
36 <port name="input1" />
37 <port name="input2" />
38 <port name="input3" />
39 <port name="input4" />
42 <gasw descriptor="[GASW_DIR]/odin.xml"/>
44 <processor name="append-date" >
45 <in name="dir" type="uri" depth="0" />
46 <out name="result" type="string" depth="0" />
47 <beanshell>/*----------Beginning of Beanshell------------*/
48 import java.text.DateFormat;
49 import java.text.SimpleDateFormat;
50 import java.util.Date;
52 DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss");
53 String result = dir.toString()+"/"+(dateFormat.format(System.currentTimeMillis()));
54 /*------------End of Beanshell------------*/
57 <processor name="listSmpDir" >
58 <in name="inDir" type="uri" depth="0" />
59 <out name="arrayLfn" type="string" depth="1" />
61 String smpDir=inDir.toString();
62 arrayLfn = new ArrayList();
64 Runtime rt = Runtime.getRuntime();
66 String [] cmd1 = new String [2];
69 Process p1 = rt.exec(cmd1);
73 BufferedReader in = new BufferedReader(new InputStreamReader(p1.getInputStream()));
74 System.out.println(" Listing directory "+smpDir);
78 System.out.println(" Line is "+line);
79 smpLfn=smpDir+"/"+line;
80 arrayLfn.add(""+smpLfn);
82 System.out.println(" exception:"+e.getMessage());
86 BufferedReader err = new BufferedReader(new InputStreamReader(p1.getErrorStream()));
89 System.out.println(" error listing directory "+smpDir+": "+line);
91 p1.getErrorStream().close();
92 p1.getInputStream().close();
93 p1.getOutputStream().close();
98 System.out.println(" exception:"+e.getMessage());
105 <link from="ProData" to="odin:input0" />
106 <link from="ResultsDirectory" to="append-date:dir" />
107 <link from="append-date:result" to="odin:input2" />
108 <link from="OdinSeq" to="odin:input3" />
109 <link from="options" to="odin:input4" />
110 <link from="SmpDir" to="listSmpDir:inDir" />
111 <link from="listSmpDir:arrayLfn" to="odin:input1" />