+<?xml version="1.0" encoding="UTF-8"?>
+<workflow name="CreaPhase" version="0.1">
+
+ <description>Propagation-based phase contrast images generation</description>
+
+ <interface>
+ <source name="results-directory" type="uri">
+ <source-comment><b><font color=blue>results-directory</font></b> (<b><font color=green>Directory</font></b>): Directory where the results will be stored.
+ </source-comment>
+ </source>
+ <source name="vers" type="string">
+ <source-comment><b><font color=blue>vers</font></b> (<b><font color=green>String</font></b>): are the projections calculated analytically or using the Radon transform? use the strings 'Radon' OR 'Analytical'
+ </source-comment>
+ </source>
+ <source name="oversamp" type="string">
+ <source-comment><b><font color=blue>oversamp</font></b> (<b><font color=green>Number</font></b>): Oversampling of the projections : use 2 or 4
+ </source-comment>
+ </source>
+ <source name="basename" type="string">
+ <source-comment><b><font color=blue>basename</font></b> (<b><font color=green>String</font></b>): Basename of the result file
+ </source-comment>
+ </source>
+ <source name="dist" type="string">
+ <source-comment><b><font color=blue>dist</font></b> (<b><font color=green>String</font></b>): Distances of propagation (in m), e.g. 0 0.01 0.1 0.20 0.50
+ </source-comment>
+ </source>
+ <source name="energy" type="string">
+ <source-comment><b><font color=blue>energy</font></b> (<b><font color=green>Number</font></b>): Energy of the incoming X-ray beam (in keV)
+ </source-comment>
+ </source>
+ <source name="pixelSize" type="string">
+ <source-comment><b><font color=blue>pixelSize</font></b> (<b><font color=green>Number</font></b>): Pixel size of the detector (in um)
+ </source-comment>
+ </source>
+ <source name="nbProj" type="string">
+ <source-comment><b><font color=blue>nbProj</font></b> (<b><font color=green>Number</font></b>): Number of projections (e.g., 360)
+ </source-comment>
+ </source>
+ <source name="rangeAngle" type="string">
+ <source-comment><b><font color=blue>rangeAngle</font></b> (<b><font color=green>Number</font></b>): Range of the tomography : 180 or 360 degrees
+ </source-comment>
+ </source>
+ <source name="modelCtf" type="string">
+ <source-comment><b><font color=blue>modelCtf</font></b> (<b><font color=green>Number</font></b>): Which model do you want to use for the propagation? use 1 or 0
+ </source-comment>
+ </source>
+ <source name="modelFresnel" type="string">
+ <source-comment><b><font color=blue>modelFresnel</font></b> (<b><font color=green>Number</font></b>): Which model do you want to use for the propagation? use 1 or 0
+ </source-comment>
+ </source>
+ <source name="muMat" type="string">
+ <source-comment><b><font color=blue>muMat</font></b> (<b><font color=green>String</font></b>): Material of the circle (e.g., PET at 19 keV)
+ </source-comment>
+ </source>
+ <source name="deltaMat" type="string">
+ <source-comment><b><font color=blue>deltaMat</font></b> (<b><font color=green>String</font></b>): Material of the circle (e.g., PET at 19 keV)
+ </source-comment>
+ </source>
+ <source name="Rcircle" type="string">
+ <source-comment><b><font color=blue>Rcircle</font></b> (<b><font color=green>String</font></b>): radius of the circle
+ </source-comment>
+ </source>
+ <source name="imageSize" type="string">
+ <source-comment><b><font color=blue>imageSize</font></b> (<b><font color=green>String</font></b>): Size of the image (square)
+ </source-comment>
+ </source>
+ <source name="circleCenter" type="string">
+ <source-comment><b><font color=blue>circleCenter</font></b> (<b><font color=green>String</font></b>): 2D coordinates of the circle center (e.g., 200 250)
+ </source-comment>
+ </source>
+ <source name="noiseType" type="string">
+ <source-comment><b><font color=blue>noiseType</font></b> (<b><font color=green>String</font></b>): Use noise='gaussian' (addition of gaussian noise) or noise='poisson' ( generation of Poisson noise) Put '<b>no</b>' to ignore this optional input.
+ </source-comment>
+ </source>
+ <source name="noiseAmount" type="string">
+ <source-comment><b><font color=blue>noiseAmount</font></b> (<b><font color=green>String</font></b>): If 'gaussian' (additive noise), please specify the Peak-to-peak Signe-to-noise ratio (PPSNR, in dB)
+ </source-comment>
+ </source>
+ <constant name="dirOut" type="string" value="dirOut" cardinality="scalar" />
+ <sink name="resultTarball" type="uri" />
+ </interface>
+
+ <processors>
+ <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="CreaPhase" >
+ <in name="dirOut" type="string" depth="0" />
+ <in name="vers" type="string" depth="0" />
+ <in name="dist" type="string" depth="0" />
+ <in name="Rcircle" type="string" depth="0" />
+ <in name="pixelSize" type="string" depth="0" />
+ <in name="muMat" type="string" depth="0" />
+ <in name="deltaMat" type="string" depth="0" />
+ <in name="modelFresnel" type="string" depth="0" />
+ <in name="rangeAngle" type="string" depth="0" />
+ <in name="nbProj" type="string" depth="0" />
+ <in name="oversamp" type="string" depth="0" />
+ <in name="circleCenter" type="string" depth="0" />
+ <in name="basename" type="string" depth="0" />
+ <in name="modelCtf" type="string" depth="0" />
+ <in name="noiseAmount" type="string" depth="0" />
+ <in name="noiseType" type="string" depth="0" />
+ <in name="imageSize" type="string" depth="0" />
+ <in name="results-directory" type="string" depth="0" />
+ <in name="energy" type="string" depth="0" />
+ <out name="resultTarball" type="uri" depth="0" />
+ <iterationstrategy>
+ <cross>
+ <port name="results-directory" />
+ <port name="vers" />
+ <port name="oversamp" />
+ <port name="basename" />
+ <port name="dist" />
+ <port name="energy" />
+ <port name="pixelSize" />
+ <port name="nbProj" />
+ <port name="rangeAngle" />
+ <port name="modelCtf" />
+ <port name="modelFresnel" />
+ <port name="muMat" />
+ <port name="deltaMat" />
+ <port name="Rcircle" />
+ <port name="imageSize" />
+ <port name="circleCenter" />
+ <port name="dirOut" />
+ <port name="noiseType" />
+ <port name="noiseAmount" />
+ </cross>
+ </iterationstrategy>
+ <gasw descriptor="[GASW_DIR]/CreaPhase.xml"/>
+ </processor>
+ <processor name="append-brackets" >
+ <in name="inputString" type="string" depth="0" />
+ <out name="out" type="string" depth="0" />
+ <beanshell>/*----------Beginning of Beanshell------------*/
+//String toAppend="\\\"";
+out="["+inputString+"]";
+ </beanshell>
+ </processor>
+ <processor name="append-brackets_2" >
+ <in name="inputString" type="string" depth="0" />
+ <out name="out" type="string" depth="0" />
+ <beanshell>/*----------Beginning of Beanshell------------*/
+//String toAppend="\\\"";
+out="["+inputString+"]";
+ </beanshell>
+ </processor>
+ <processor name="append-simple-quotes" >
+ <in name="inputString" type="string" depth="0" />
+ <out name="out" type="string" depth="0" />
+ <beanshell>/*----------Beginning of Beanshell------------*/
+String toAppend="'";
+out=toAppend+inputString+toAppend;
+ </beanshell>
+ </processor>
+ <processor name="append-simple-quotes_2" >
+ <in name="inputString" type="string" depth="0" />
+ <out name="out" type="string" depth="0" />
+ <beanshell>/*----------Beginning of Beanshell------------*/
+String toAppend="'";
+out=toAppend+inputString+toAppend;
+ </beanshell>
+ </processor>
+ <processor name="append-simple-quotes_3" >
+ <in name="inputString" type="string" depth="0" />
+ <out name="out" type="string" depth="0" />
+ <beanshell>/*----------Beginning of Beanshell------------*/
+String toAppend="'";
+out=toAppend+inputString+toAppend;
+ </beanshell>
+ </processor>
+ <processor name="append-simple-quotes_4" >
+ <in name="inputString" type="string" depth="0" />
+ <out name="out" type="string" depth="0" />
+ <beanshell>/*----------Beginning of Beanshell------------*/
+String toAppend="'";
+out=toAppend+inputString+toAppend;
+ </beanshell>
+ </processor>
+ </processors>
+
+ <links>
+ <link from="results-directory" to="append-date:dir" />
+ <link from="append-date:result" to="CreaPhase:results-directory" />
+ <link from="oversamp" to="CreaPhase:oversamp" />
+ <link from="energy" to="CreaPhase:energy" />
+ <link from="pixelSize" to="CreaPhase:pixelSize" />
+ <link from="nbProj" to="CreaPhase:nbProj" />
+ <link from="rangeAngle" to="CreaPhase:rangeAngle" />
+ <link from="modelCtf" to="CreaPhase:modelCtf" />
+ <link from="modelFresnel" to="CreaPhase:modelFresnel" />
+ <link from="muMat" to="CreaPhase:muMat" />
+ <link from="deltaMat" to="CreaPhase:deltaMat" />
+ <link from="Rcircle" to="CreaPhase:Rcircle" />
+ <link from="imageSize" to="CreaPhase:imageSize" />
+ <link from="noiseAmount" to="CreaPhase:noiseAmount" />
+ <link from="CreaPhase:resultTarball" to="resultTarball" />
+ <link from="dist" to="append-brackets:inputString" />
+ <link from="circleCenter" to="append-brackets_2:inputString" />
+ <link from="append-brackets_2:out" to="CreaPhase:circleCenter" />
+ <link from="append-brackets:out" to="CreaPhase:dist" />
+ <link from="vers" to="append-simple-quotes:inputString" />
+ <link from="append-simple-quotes:out" to="CreaPhase:vers" />
+ <link from="basename" to="append-simple-quotes_2:inputString" />
+ <link from="append-simple-quotes_2:out" to="CreaPhase:basename" />
+ <link from="append-simple-quotes_3:out" to="CreaPhase:dirOut" />
+ <link from="noiseType" to="append-simple-quotes_4:inputString" />
+ <link from="append-simple-quotes_4:out" to="CreaPhase:noiseType" />
+ <link from="dirOut" to="append-simple-quotes_3:inputString" />
+ </links>
+
+</workflow>