sum_dose.m 338 B

1234567891011121314
  1. function D = sum_dose(B, w)
  2. if nargin < 2
  3. w = ones(size(B));
  4. end
  5. D = zeros(B{1}.x_count, B{1}.y_count, B{1}.z_count);
  6. for k = 1:numel(B)
  7. if ~isempty(B{k}.non_zero_indices)
  8. D(B{k}.non_zero_indices) = D(B{k}.non_zero_indices) + w(k) * B{k}.non_zero_values;
  9. end
  10. end
  11. % imagesc(squeeze(D(26,:,:)))
  12. % drawnow;