]> Creatis software - vip-workflow-odin.git/commitdiff
SMP folder selection master
authorSorina Pop <sorina.pop@creatis.insa-lyon.fr>
Tue, 6 Dec 2016 16:24:03 +0000 (17:24 +0100)
committerSorina Pop <sorina.pop@creatis.insa-lyon.fr>
Tue, 6 Dec 2016 16:24:03 +0000 (17:24 +0100)
workflow/odin_epi_folder.gwendia [new file with mode: 0644]
workflow/odin_fisp_folder.gwendia [new file with mode: 0644]

diff --git a/workflow/odin_epi_folder.gwendia b/workflow/odin_epi_folder.gwendia
new file mode 100644 (file)
index 0000000..08d7be2
--- /dev/null
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow name="odin" version="1.0">
+
+  <description>This application wraps the Odin MRI simulator. The Odin code source is available at http://od1n.sourceforge.net</description>
+
+  <interface>
+    <source name="ProData" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Pro file
+      </source-comment>
+    </source>
+    <source name="SmpDir" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Folder containing all (and only) Smp files
+      </source-comment>
+    </source>
+    <source name="ResultsDirectory" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: add description here...
+      </source-comment>
+    </source>
+    <constant name="OdinSeq" type="string" value="odinepiexe" cardinality="scalar" />
+    <source name="options" type="string">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;options&lt;/font&gt;&lt;/b&gt;: any option string, to be appended to the recon-all command line. For instance: '-all'. &lt;b&gt;Important:&lt;/b&gt; don't put spaces, use '_'  instead. And put 'no' in case you don't want to use any option.
+      </source-comment>
+    </source>
+  </interface>
+
+  <processors>
+    <processor name="odin" >
+      <in name="input4" type="string" depth="0" />
+      <in name="input3" type="string" depth="0" />
+      <in name="input2" type="string" depth="0" />
+      <in name="input1" type="string" depth="0" />
+      <in name="input0" type="uri" depth="0" />
+      <iterationstrategy>
+        <cross>
+          <port name="input0" />
+          <port name="input1" />
+          <port name="input2" />
+          <port name="input3" />
+          <port name="input4" />
+        </cross>
+      </iterationstrategy>
+      <gasw descriptor="[GASW_DIR]/odin.xml"/>
+    </processor>
+    <processor name="append-date" >
+      <in name="dir" type="uri" depth="0" />
+      <out name="result" type="string" depth="0" />
+      <beanshell>/*----------Beginning of Beanshell------------*/
+                        import java.text.DateFormat;
+                        import java.text.SimpleDateFormat;
+                        import java.util.Date;
+
+DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss");
+String result = dir.toString()+"/"+(dateFormat.format(System.currentTimeMillis()));
+/*------------End of Beanshell------------*/
+      </beanshell>
+    </processor>
+    <processor name="listSmpDir" >
+      <in name="inDir" type="uri" depth="0" />
+      <out name="arrayLfn" type="string" depth="1" />
+      <beanshell>
+String smpDir=inDir.toString();    
+arrayLfn = new ArrayList();
+String smpLfn="";
+Runtime rt = Runtime.getRuntime();
+try{
+            String [] cmd1 = new String [2];
+            cmd1[0] = "lfc-ls";
+            cmd1[1] = smpDir;
+            Process p1 = rt.exec(cmd1);
+            p1.waitFor();
+                                                                                                                                         
+            String line ="";
+            BufferedReader in = new BufferedReader(new InputStreamReader(p1.getInputStream()));
+            System.out.println(" Listing directory "+smpDir);
+            while(in.ready()){
+       line=in.readLine();
+       try{
+         System.out.println(" Line is "+line); 
+         smpLfn=smpDir+"/"+line;
+         arrayLfn.add(""+smpLfn);
+       }catch(Exception e){
+                                       System.out.println(" exception:"+e.getMessage());
+                }
+
+                
+                BufferedReader err = new BufferedReader(new InputStreamReader(p1.getErrorStream()));
+                while(err.ready()){
+                    line=err.readLine();
+                    System.out.println(" error listing directory "+smpDir+": "+line);
+                }
+                p1.getErrorStream().close();
+                p1.getInputStream().close();
+                p1.getOutputStream().close();
+            }
+               }
+
+        catch(Exception e){
+            System.out.println(" exception:"+e.getMessage());
+        }
+      </beanshell>
+    </processor>
+  </processors>
+
+  <links>
+      <link from="ProData" to="odin:input0" />
+      <link from="ResultsDirectory" to="append-date:dir" />
+      <link from="append-date:result" to="odin:input2" />
+      <link from="OdinSeq" to="odin:input3" />
+      <link from="options" to="odin:input4" />
+      <link from="SmpDir" to="listSmpDir:inDir" />
+      <link from="listSmpDir:arrayLfn" to="odin:input1" />
+  </links>
+
+</workflow>
diff --git a/workflow/odin_fisp_folder.gwendia b/workflow/odin_fisp_folder.gwendia
new file mode 100644 (file)
index 0000000..321e060
--- /dev/null
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow name="odin" version="1.0">
+
+  <description>This application wraps the Odin MRI simulator. The Odin code source is available at http://od1n.sourceforge.net</description>
+
+  <interface>
+    <source name="ProData" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Pro file
+      </source-comment>
+    </source>
+    <source name="SmpDir" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Folder containing all (and only) Smp files
+      </source-comment>
+    </source>
+    <source name="ResultsDirectory" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: add description here...
+      </source-comment>
+    </source>
+    <constant name="OdinSeq" type="string" value="odinfispexe" cardinality="scalar" />
+    <source name="options" type="string">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;options&lt;/font&gt;&lt;/b&gt;: any option string, to be appended to the recon-all command line. For instance: '-all'. &lt;b&gt;Important:&lt;/b&gt; don't put spaces, use '_'  instead. And put 'no' in case you don't want to use any option.
+      </source-comment>
+    </source>
+  </interface>
+
+  <processors>
+    <processor name="odin" >
+      <in name="input4" type="string" depth="0" />
+      <in name="input3" type="string" depth="0" />
+      <in name="input2" type="string" depth="0" />
+      <in name="input1" type="string" depth="0" />
+      <in name="input0" type="uri" depth="0" />
+      <iterationstrategy>
+        <cross>
+          <port name="input0" />
+          <port name="input1" />
+          <port name="input2" />
+          <port name="input3" />
+          <port name="input4" />
+        </cross>
+      </iterationstrategy>
+      <gasw descriptor="[GASW_DIR]/odin.xml"/>
+    </processor>
+    <processor name="append-date" >
+      <in name="dir" type="uri" depth="0" />
+      <out name="result" type="string" depth="0" />
+      <beanshell>/*----------Beginning of Beanshell------------*/
+                        import java.text.DateFormat;
+                        import java.text.SimpleDateFormat;
+                        import java.util.Date;
+
+DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss");
+String result = dir.toString()+"/"+(dateFormat.format(System.currentTimeMillis()));
+/*------------End of Beanshell------------*/
+      </beanshell>
+    </processor>
+    <processor name="listSmpDir" >
+      <in name="inDir" type="uri" depth="0" />
+      <out name="arrayLfn" type="string" depth="1" />
+      <beanshell>
+String smpDir=inDir.toString();    
+arrayLfn = new ArrayList();
+String smpLfn="";
+Runtime rt = Runtime.getRuntime();
+try{
+            String [] cmd1 = new String [2];
+            cmd1[0] = "lfc-ls";
+            cmd1[1] = smpDir;
+            Process p1 = rt.exec(cmd1);
+            p1.waitFor();
+                                                                                                                                         
+            String line ="";
+            BufferedReader in = new BufferedReader(new InputStreamReader(p1.getInputStream()));
+            System.out.println(" Listing directory "+smpDir);
+            while(in.ready()){
+       line=in.readLine();
+       try{
+         System.out.println(" Line is "+line); 
+         smpLfn=smpDir+"/"+line;
+         arrayLfn.add(""+smpLfn);
+       }catch(Exception e){
+                                       System.out.println(" exception:"+e.getMessage());
+                }
+
+                
+                BufferedReader err = new BufferedReader(new InputStreamReader(p1.getErrorStream()));
+                while(err.ready()){
+                    line=err.readLine();
+                    System.out.println(" error listing directory "+smpDir+": "+line);
+                }
+                p1.getErrorStream().close();
+                p1.getInputStream().close();
+                p1.getOutputStream().close();
+            }
+               }
+
+        catch(Exception e){
+            System.out.println(" exception:"+e.getMessage());
+        }
+      </beanshell>
+    </processor>
+  </processors>
+
+  <links>
+      <link from="ProData" to="odin:input0" />
+      <link from="ResultsDirectory" to="append-date:dir" />
+      <link from="append-date:result" to="odin:input2" />
+      <link from="OdinSeq" to="odin:input3" />
+      <link from="options" to="odin:input4" />
+      <link from="SmpDir" to="listSmpDir:inDir" />
+      <link from="listSmpDir:arrayLfn" to="odin:input1" />
+  </links>
+
+</workflow>