summaryrefslogtreecommitdiffstats
path: root/supp
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc@hotmail.com>2017-10-19 22:16:43 +0100
committerDaniil Kazantsev <dkazanc@hotmail.com>2017-10-19 22:16:43 +0100
commit952322eb1394f18cedfbb51488e76ed52728d98d (patch)
tree1685334a1d07e49782682f72e3c00362bd5ce91d /supp
parentff543b21e175d49b95ea6da9c03f21a1789f6833 (diff)
downloadregularization-952322eb1394f18cedfbb51488e76ed52728d98d.tar.gz
regularization-952322eb1394f18cedfbb51488e76ed52728d98d.tar.bz2
regularization-952322eb1394f18cedfbb51488e76ed52728d98d.tar.xz
regularization-952322eb1394f18cedfbb51488e76ed52728d98d.zip
GH-OS fixed, demos updated, add_artifacts function
Diffstat (limited to 'supp')
-rw-r--r--supp/sino_add_artifacts.m33
1 files changed, 33 insertions, 0 deletions
diff --git a/supp/sino_add_artifacts.m b/supp/sino_add_artifacts.m
new file mode 100644
index 0000000..f601914
--- /dev/null
+++ b/supp/sino_add_artifacts.m
@@ -0,0 +1,33 @@
+function sino_artifacts = sino_add_artifacts(sino,artifact_type)
+% function to add various distortions to the sinogram space, current
+% version includes: random rings and zingers (streaks)
+% Input:
+% 1. sinogram
+% 2. artifact type: 'rings' or 'zingers' (streaks)
+
+
+[Detectors, anglesNumb, SlicesZ] = size(sino);
+fprintf('%s %i %s %i %s %i %s \n', 'Sinogram has a dimension of', Detectors, 'detectors;', anglesNumb, 'projections;', SlicesZ, 'vertical slices.');
+
+sino_artifacts = sino;
+
+if (strcmp(artifact_type,'rings'))
+ fprintf('%s \n', 'Adding rings...');
+ NumRings = round(Detectors/20); % Number of rings relatively to the size of Detectors
+ IntenOff = linspace(0.05,0.5,NumRings); % the intensity of rings in the selected range
+
+ for k = 1:SlicesZ
+ % generate random indices to propagate rings
+ RandInd = randperm(Detectors,Detectors);
+ for jj = 1:NumRings
+ ind_c = RandInd(jj);
+ sino_artifacts(ind_c,1:end,k) = sino_artifacts(ind_c,1:end,k) + IntenOff(jj).*sino_artifacts(ind_c,1:end,k); % generate a constant offset
+ end
+
+ end
+elseif (strcmp(artifact_type,'zingers'))
+ fprintf('%s \n', 'Adding zingers...');
+else
+ fprintf('%s \n', 'Nothing selected, the same sinogram returned...');
+end
+end \ No newline at end of file