projImage.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. %% Author: Aleks Prša
  2. % Date: January, 2022
  3. % alex.prsa@gmail.com
  4. % =========================================================================
  5. %{
  6. % -------------------------------------------------------------------------
  7. % projImage(proj_tmp, parameter)
  8. % -------------------------------------------------------------------------
  9. % DESCRIPTION:
  10. %
  11. % This function converts attenuation images to signal images and adds
  12. % Poisson and Gaussian noise to projection images.
  13. %
  14. % INPUT:
  15. %
  16. % - proj_tmp = projection
  17. % - parameter = parameter of all geometry
  18. %
  19. % OUTPUT:
  20. %
  21. % - dataProj = noised projection images.
  22. %
  23. %}
  24. % =========================================================================
  25. %% Convert attenuation coefficients to signal image and add Poisson and Gaussian noise
  26. function dataProjNoise = projImage(proj_tmp, parameter)
  27. lambda = parameter.Io * exp(- parameter.dz * proj_tmp);
  28. I = parameter.eo .* poissrnd(lambda, parameter.nv, parameter.nu);
  29. D = normrnd(parameter.mu, parameter.sigma, parameter.nv, parameter.nu);
  30. dataProjNoise = I + D;
  31. end