diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2017-10-24 14:41:20 +0100 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2017-10-24 14:41:20 +0100 |
commit | 67280dbdd5dc30b6500ba663d5f35dd8d5aa1389 (patch) | |
tree | 3cfa6e49088dfbde13452127e879fda6122a1687 /supp | |
parent | ac4408e8984be8ca23a46b2b75bb243a0a4720aa (diff) | |
parent | c91436873e48d531b9313f9c10fa5f89bcb90ab6 (diff) | |
download | regularization-67280dbdd5dc30b6500ba663d5f35dd8d5aa1389.tar.gz regularization-67280dbdd5dc30b6500ba663d5f35dd8d5aa1389.tar.bz2 regularization-67280dbdd5dc30b6500ba663d5f35dd8d5aa1389.tar.xz regularization-67280dbdd5dc30b6500ba663d5f35dd8d5aa1389.zip |
Merge branch 'master' of https://github.com/vais-ral/CCPi-FISTA_Reconstruction into pythonize
Diffstat (limited to 'supp')
-rw-r--r-- | supp/sino_add_artifacts.m | 33 |
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 |