From: Sorina Pop Date: Tue, 6 Dec 2016 16:24:03 +0000 (+0100) Subject: SMP folder selection X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;p=vip-workflow-odin.git SMP folder selection --- diff --git a/workflow/odin_epi_folder.gwendia b/workflow/odin_epi_folder.gwendia new file mode 100644 index 0000000..08d7be2 --- /dev/null +++ b/workflow/odin_epi_folder.gwendia @@ -0,0 +1,114 @@ + + + + This application wraps the Odin MRI simulator. The Odin code source is available at http://od1n.sourceforge.net + + + + <b><font color="blue">new input</font></b>: Pro file + + + + <b><font color="blue">new input</font></b>: Folder containing all (and only) Smp files + + + + <b><font color="blue">new input</font></b>: add description here... + + + + + <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. + + + + + + + + + + + + + + + + + + + + + + + + + + /*----------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------------*/ + + + + + + +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()); + } + + + + + + + + + + + + + + + diff --git a/workflow/odin_fisp_folder.gwendia b/workflow/odin_fisp_folder.gwendia new file mode 100644 index 0000000..321e060 --- /dev/null +++ b/workflow/odin_fisp_folder.gwendia @@ -0,0 +1,114 @@ + + + + This application wraps the Odin MRI simulator. The Odin code source is available at http://od1n.sourceforge.net + + + + <b><font color="blue">new input</font></b>: Pro file + + + + <b><font color="blue">new input</font></b>: Folder containing all (and only) Smp files + + + + <b><font color="blue">new input</font></b>: add description here... + + + + + <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. + + + + + + + + + + + + + + + + + + + + + + + + + + /*----------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------------*/ + + + + + + +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()); + } + + + + + + + + + + + + + + +