]> Creatis software - vip-workflow-creaphase.git/blob - workflow/1D_CreaPhase.gwendia
Fixed LFN issues
[vip-workflow-creaphase.git] / workflow / 1D_CreaPhase.gwendia
1 <?xml version="1.0" encoding="UTF-8"?>
2 <workflow name="1D_CreaPhase" version="0.1">
3
4   <description>Propagation-based phase contrast images generation</description>
5
6   <interface>
7     <source name="results-directory" type="uri">
8       <source-comment>&lt;b&gt;&lt;font color=blue&gt;results-directory&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;Directory&lt;/font&gt;&lt;/b&gt;): Directory where the results will be stored.
9       </source-comment>
10     </source>
11     <source name="oversamp" type="string">
12       <source-comment>&lt;b&gt;&lt;font color=blue&gt;oversamp&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;Number&lt;/font&gt;&lt;/b&gt;): Oversampling of the projections : use 2 or 4
13       </source-comment>
14     </source>
15     <source name="basename" type="string">
16       <source-comment>&lt;b&gt;&lt;font color=blue&gt;basename&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;String&lt;/font&gt;&lt;/b&gt;): Basename of the result files
17       </source-comment>
18     </source>
19     <source name="dist" type="string">
20       <source-comment>&lt;b&gt;&lt;font color=blue&gt;dist&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;String&lt;/font&gt;&lt;/b&gt;):  Distances of propagation (in m), e.g. 0 0.01 0.1 0.20 0.50
21       </source-comment>
22     </source>
23     <source name="energy" type="string">
24       <source-comment>&lt;b&gt;&lt;font color=blue&gt;energy&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;Number&lt;/font&gt;&lt;/b&gt;): Energy of the incoming X-ray beam (in keV)
25       </source-comment>
26     </source>
27     <source name="pixelSize" type="string">
28       <source-comment>&lt;b&gt;&lt;font color=blue&gt;pixelSize&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;Number&lt;/font&gt;&lt;/b&gt;): Pixel size of the detector (in um)
29       </source-comment>
30     </source>
31     <source name="nbProj" type="string">
32       <source-comment>&lt;b&gt;&lt;font color=blue&gt;nbProj&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;Number&lt;/font&gt;&lt;/b&gt;): Number of projections (e.g., 360)
33       </source-comment>
34     </source>
35     <source name="rangeAngle" type="string">
36       <source-comment>&lt;b&gt;&lt;font color=blue&gt;rangeAngle&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;Number&lt;/font&gt;&lt;/b&gt;): Range of the tomography : 180 or 360 degrees
37       </source-comment>
38     </source>
39     <source name="modelCtf" type="string">
40       <source-comment>&lt;b&gt;&lt;font color=blue&gt;modelCtf&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;Number&lt;/font&gt;&lt;/b&gt;):  Which model do you want to use for the propagation? use 1 or 0
41       </source-comment>
42     </source>
43     <source name="modelFresnel" type="string">
44       <source-comment>&lt;b&gt;&lt;font color=blue&gt;modelFresnel&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;Number&lt;/font&gt;&lt;/b&gt;): Which model do you want to use for the propagation? use 1 or 0
45       </source-comment>
46     </source>
47     <source name="muMatLfn" type="uri">
48       <source-comment>&lt;b&gt;&lt;font color=blue&gt;muMat&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;String&lt;/font&gt;&lt;/b&gt;):  Attenuation map file (in cm^-1)
49       </source-comment>
50     </source>
51     <source name="deltaMatLfn" type="uri">
52       <source-comment>&lt;b&gt;&lt;font color=blue&gt;deltaMat&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;String&lt;/font&gt;&lt;/b&gt;): Refractive index decrement map file (delta)
53       </source-comment>
54     </source>
55     <source name="noiseType" type="string">
56       <source-comment>&lt;b&gt;&lt;font color=blue&gt;noiseType&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;String&lt;/font&gt;&lt;/b&gt;): Use noise='gaussian' (addition of gaussian noise) or noise='poisson' (generation of Poisson noise).
57       </source-comment>
58     </source>
59     <source name="noiseAmount" type="string">
60       <source-comment>&lt;b&gt;&lt;font color=blue&gt;noiseAmount&lt;/font&gt;&lt;/b&gt; (&lt;b&gt;&lt;font color=green&gt;String&lt;/font&gt;&lt;/b&gt;): If 'gaussian' (additive noise), please specify the Peak-to-peak Signe-to-noise ratio (PPSNR, in dB). If 'poisson', please specify a scaling factor ranging in [0:1].
61       </source-comment>
62     </source>
63     <constant name="dirOut" type="string" value="dirOut" cardinality="scalar" />
64     <sink name="resultTarball" type="uri" />
65   </interface>
66
67   <processors>
68     <processor name="append-date" >
69       <in name="dir" type="uri" depth="0" />
70       <out name="result" type="string" depth="0" />
71       <beanshell>/*----------Beginning of Beanshell------------*/
72                         import java.text.DateFormat;
73                         import java.text.SimpleDateFormat;
74                         import java.util.Date;
75
76 DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss");
77 String result = dir.toString()+"/"+(dateFormat.format(System.currentTimeMillis()));
78 /*------------End of Beanshell------------*/
79       </beanshell>
80     </processor>
81     <processor name="CreaPhase" >
82       <in name="dirOut" type="string" depth="0" />
83       <in name="dist" type="string" depth="0" />
84       <in name="pixelSize" type="string" depth="0" />
85       <in name="muMat" type="string" depth="0" />
86       <in name="deltaMat" type="string" depth="0" />
87       <in name="modelFresnel" type="string" depth="0" />
88       <in name="rangeAngle" type="string" depth="0" />
89       <in name="nbProj" type="string" depth="0" />
90       <in name="oversamp" type="string" depth="0" />
91       <in name="basename" type="string" depth="0" />
92       <in name="modelCtf" type="string" depth="0" />
93       <in name="noiseAmount" type="string" depth="0" />
94       <in name="noiseType" type="string" depth="0" />
95       <in name="muLfn" type="uri" depth="0" />
96       <in name="deltaLfn" type="uri" depth="0" />
97       <in name="results-directory" type="string" depth="0" />
98       <in name="energy" type="string" depth="0" />
99       <out name="resultTarball" type="uri" depth="0" />
100       <iterationstrategy>
101         <cross>
102           <port name="results-directory" />
103           <port name="oversamp" />
104           <port name="basename" />
105           <port name="dist" />
106           <port name="energy" />
107           <port name="pixelSize" />
108           <port name="nbProj" />
109           <port name="rangeAngle" />
110           <port name="modelCtf" />
111           <port name="modelFresnel" />
112           <port name="muMat" />
113           <port name="deltaMat" />
114           <port name="dirOut" />
115           <port name="noiseType" />
116           <port name="noiseAmount" />
117           <port name="muLfn" />
118           <port name="deltaLfn" />
119         </cross>
120       </iterationstrategy>
121       <gasw descriptor="[GASW_DIR]/1D_CreaPhase.xml"/>
122     </processor>
123     <processor name="append-brackets" >
124       <in name="inputString" type="string" depth="0" />
125       <out name="out" type="string" depth="0" />
126       <beanshell>/*----------Beginning of Beanshell------------*/
127 //String toAppend="\\\"";
128 out="["+inputString+"]";
129       </beanshell>
130     </processor>
131     <processor name="append-simple-quotes_2" >
132       <in name="inputString" type="string" depth="0" />
133       <out name="out" type="string" depth="0" />
134       <beanshell>/*----------Beginning of Beanshell------------*/
135 String toAppend="'";
136 out=toAppend+inputString+toAppend;
137       </beanshell>
138     </processor>
139     <processor name="append-simple-quotes_3" >
140       <in name="inputString" type="string" depth="0" />
141       <out name="out" type="string" depth="0" />
142       <beanshell>/*----------Beginning of Beanshell------------*/
143 String toAppend="'";
144 out=toAppend+inputString+toAppend;
145       </beanshell>
146     </processor>
147     <processor name="append-simple-quotes_4" >
148       <in name="inputString" type="string" depth="0" />
149       <out name="out" type="string" depth="0" />
150       <beanshell>/*----------Beginning of Beanshell------------*/
151 String toAppend="'";
152 out=toAppend+inputString+toAppend;
153       </beanshell>
154     </processor>
155     <processor name="getFileName_1" >
156       <in name="lfn" type="uri" depth="0" />
157       <out name="fileName" type="string" depth="0" />
158       <beanshell>/*----------Beginning of Beanshell------------*/
159 String[] bits = lfn.toString().split("/");
160 String lastOne = bits[bits.length-1];
161 String toAppend="'";
162 fileName=toAppend+lastOne+toAppend;
163       </beanshell>
164     </processor>
165     <processor name="getFileName_2" >
166       <in name="lfn" type="uri" depth="0" />
167       <out name="fileName" type="string" depth="0" />
168       <beanshell>/*----------Beginning of Beanshell------------*/
169 String[] bits = lfn.toString().split("/");
170 String lastOne = bits[bits.length-1];
171 String toAppend="'";
172 fileName=toAppend+lastOne+toAppend;
173       </beanshell>
174     </processor>
175   </processors>
176
177   <links>
178       <link from="results-directory" to="append-date:dir" />
179       <link from="append-date:result" to="CreaPhase:results-directory" />
180       <link from="oversamp" to="CreaPhase:oversamp" />
181       <link from="energy" to="CreaPhase:energy" />
182       <link from="pixelSize" to="CreaPhase:pixelSize" />
183       <link from="nbProj" to="CreaPhase:nbProj" />
184       <link from="rangeAngle" to="CreaPhase:rangeAngle" />
185       <link from="modelCtf" to="CreaPhase:modelCtf" />
186       <link from="modelFresnel" to="CreaPhase:modelFresnel" />
187       <link from="noiseAmount" to="CreaPhase:noiseAmount" />
188       <link from="CreaPhase:resultTarball" to="resultTarball" />
189       <link from="dist" to="append-brackets:inputString" />
190       <link from="append-brackets:out" to="CreaPhase:dist" />
191       <link from="basename" to="append-simple-quotes_2:inputString" />
192       <link from="append-simple-quotes_2:out" to="CreaPhase:basename" />
193       <link from="append-simple-quotes_3:out" to="CreaPhase:dirOut" />
194       <link from="noiseType" to="append-simple-quotes_4:inputString" />
195       <link from="append-simple-quotes_4:out" to="CreaPhase:noiseType" />
196       <link from="dirOut" to="append-simple-quotes_3:inputString" />
197       <link from="deltaMatLfn" to="CreaPhase:deltaLfn" />
198       <link from="muMatLfn" to="CreaPhase:muLfn" />
199       <link from="deltaMatLfn" to="getFileName_2:lfn" />
200       <link from="getFileName_2:fileName" to="CreaPhase:deltaMat" />
201       <link from="muMatLfn" to="getFileName_1:lfn" />
202       <link from="getFileName_1:fileName" to="CreaPhase:muMat" />
203   </links>
204
205 </workflow>