--- /dev/null
+## SimuPBI_circle_func: function that launches the phase-contrast simulation of a single wire, of a material defined by the user.
+# In this file, I detailed all the input and output arguments, followed by one or several examples (one line beginning with a %)
+## Author: Loriane Weber <loriane.weber@creatis.insa-lyon.fr>
+## Created: 2016-02-11
+
+## Example of use :
+## SimuPBI_circle_func('Analytical', 2, 'test', [0 0.1 0.5], 19, 2.7, 300, 180, 1, 1, 0.89, 8.265, 100, 500, [200 250], '', 'gaussian', 35)
+
+## Please note that dir_out, noise_type, noise_amount are optional arguments.
+
+################################################
+############### INPUT parameters ###############
+################################################
+
+######### Parameter related to the computation - and names of the result #########
+
+## vers: is a string that defines the way to compute the projections. (ie: are the projections calculated analytically (vers = 'Analytical') or using the Radon transform (vers = 'Radon') ?)
+## use the strings 'Radon' OR 'Analytical'
+## be careful, octave is case-sensitive.
+%vers = 'Analytical'
+%vers = 'Radon'
+
+## oversamp: is a number that defines the oversampling of the projections in the real domain.
+## use the number 2 or 4 only
+%oversamp = 2
+%oversamp = 4
+
+## basename_output: is a string that contains the basename of the resulting files.
+## use a string, of your choice.
+%basename_output = 'Test'
+
+######### Parameter related to the physics #########
+
+## dist is a vector, which contains the propagation distances, expressed in meters.
+## use a vector, beggining and ending with a square bracket; the distances should be separated by a space. Use a point as decimal mark.
+% dist = [0 0.01 0.1 0.20 0.50]
+
+## energy refers to the energy of the incoming X-ray beam, expressed in keV.
+## use a float (if decimal, the decimal mark should be a point).
+# in the following example, the energy is set to 19 keV and 17.5 keV.
+% energy = 19
+% energy = 17.5
+
+## ps refers to the physical pixel size of the detector, expressed in microns.
+## use a float (if decimal, the decimal mark should be a point).
+# in the following example, the pixel size is set to 1 um and 3.5 um.
+% ps = 1
+% ps= 3.5
+
+## nbproj refers to the number of (equally-angled) projections simulated.
+## use an integer
+%nbProj=360
+
+## range_angle refers to the angular range of the tomography (either 180 or 360 degrees).
+## use 180 or 360.
+% range_angle = 180
+% range_angle = 360
+
+## model_ctf refers to the Contrast Transfer Function propagation model. use 1 if you want to simulate propagation with the CTF model, or 0 otherwise.
+## should be equal to 0 or 1
+% model_ctf = 1
+% model_ctf = 0
+
+## model_Fresnel refers to the Fresnel propagation model. Use 1 if you want to simulate propagation with the fresnel model, or 0 otherwise.
+## should be equal to 0 or 1
+% model_Fresnel = 1
+% model_Fresnel = 0
+
+
+############# Parameters related to the circle #############
+
+## mu_mat and delta_mat refer to the physical parameters of the material of the wire
+## mu_mat is a float, corresponding to the linear attenuation coefficient of the material, expressed in cm-1. use the point as decimal mark.
+## delta_mat is a float, corresponding to the refractive index decrement of the material (real part of the refractive index), expressed in 10^-7. use the point as decimal mark.
+## Below is an example for PET (polyEthylene Terephtalate) at 19 keV. the linear attenuation coefficient of PET at 19 keV is equal to 0.89889 cm-1,
+## and the refractive index decrement delta to 8.265*10^-7.
+% mu_mat = 0.89889
+% delta_mat = 8.265
+
+## R_circle denotes the radius of the wire, expressed in pixels. Should be an integer
+# example : a radius of 50 pixel
+% R_circle = 50
+
+## size_image denotes the size of the reconstructed image, expressed in pixels. The image is supposedly square.
+# example: an image of 500 pix * 500 pix.
+% size_image = 500
+
+## circle_center is a vector referring to the 2D-coordinates of the center of the wire (in pixels).
+## The vector should begin and end by square brackets and the coordinates are separated by a space
+% circle_center = [200 250]; % 2D coordinates of the center
+
+################################
+############# OPTIONAL Parameters
+################################
+
+## dir_out is a string referring to the output directory
+## By default, the output directory is the working directory. default value is ''.
+% dir_out='/mntdirect/_users/lweber/Matlab/SimulationsPBI/Results_Circle'
+
+
+## noise_type is a string, referring to the type of noise you want to add to the simulated projections.
+## Use 'gaussian' for addition of gaussian noise, 'poisson' for generation of Poisson noise, or '' for no noise.
+## the default value is '' (no noise)
+% noise_type='gaussian'
+
+
+## noise_amount is a number (integer or float) referring to the amount of noise. It is defined depending on the type of noise:
+## For additive Gaussian noise, noise_amount is the Peak-to-Peak Signal-to-Noise Ratio (PPSNR), expressed in dB.
+## The default value for additive gaussian noise is 35 dB (noise_amount = 35).
+% noise_amount = 40
+
+## For Poisson noise, noise_amount refer to the percentage of noise.
+## The default value is 5% (noise_amount=0.05).
+% noise_amount = 0.15
+
+
+#######################################################
+############### End of INPUT parameters ###############
+#######################################################
+
+#################################################
+############### OUTPUT parameters ###############
+#################################################
+
+## None, files are directly save in the output directory (variable out_dir)
+
+########################################################
+############### End of OUTPUT parameters ###############
+########################################################
+
+++ /dev/null
-## Copyright (C) 2000 Paul Kienzle <pkienzle@users.sf.net>
-##
-## This program is free software; you can redistribute it and/or modify it under
-## the terms of the GNU General Public License as published by the Free Software
-## Foundation; either version 3 of the License, or (at your option) any later
-## version.
-##
-## This program is distributed in the hope that it will be useful, but WITHOUT
-## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-## details.
-##
-## You should have received a copy of the GNU General Public License along with
-## this program; if not, see <http://www.gnu.org/licenses/>.
-
-## usage: y = interp(x, q [, n [, Wc]])
-##
-## Upsample the signal x by a factor of q, using an order 2*q*n+1 FIR
-## filter. Note that q must be an integer for this rate change method.
-## n defaults to 4 and Wc defaults to 0.5.
-##
-## Example
-## # Generate a signal.
-## t=0:0.01:2; x=chirp(t,2,.5,10,'quadratic')+sin(2*pi*t*0.4);
-## y = interp(x(1:4:length(x)),4,4,1); # interpolate a sub-sample
-## stem(t(1:121)*1000,x(1:121),"-g;Original;"); hold on;
-## stem(t(1:121)*1000,y(1:121),"-r;Interpolated;");
-## stem(t(1:4:121)*1000,x(1:4:121),"-b;Subsampled;"); hold off;
-##
-## See also: decimate, resample
-
-function y = interp(x, q, n = 4, Wc = 0.5)
-
- if nargin < 1 || nargin > 4,
- print_usage;
- endif
- if q != fix(q), error("decimate only works with integer q."); endif
-
- if rows(x)>1
- y = zeros(length(x)*q+q*n+1,1);
- else
- y = zeros(1,length(x)*q+q*n+1);
- endif
- y(1:q:length(x)*q) = x;
- b = fir1(2*q*n+1, Wc/q);
- y=q*fftfilt(b, y);
- y(1:q*n+1) = []; # adjust for zero filter delay
-endfunction
-
-%!demo
-%! ## Generate a signal.
-%! t=0:0.01:2; x=chirp(t,2,.5,10,'quadratic')+sin(2*pi*t*0.4);
-%! y = interp(x(1:4:length(x)),4,4,1); # interpolate a sub-sample
-%! plot(t(1:121)*1000,y(1:121),"r-+;Interpolated;"); hold on;
-%! stem(t(1:4:121)*1000,x(1:4:121),"ob;Original;"); hold off;
-%!
-%! % graph shows interpolated signal following through the
-%! % sample points of the original signal.