-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatchSamp.m
More file actions
31 lines (26 loc) · 776 Bytes
/
patchSamp.m
File metadata and controls
31 lines (26 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function [ percZero ] = patchSamp(A,blocks)
% [ percZero ] = patchSamp(A,blocks)
% code to quantify sampling of pixels in each block (patch) by rays
% made from defineBlocks.m code
% 9/24/17 Mike Bianco
% ----------------
% INPUTS:
% A = tomography matrix
% blocks = indices of blocks (patches)
% OUTPUT:
% percZero = percentage of pixels in blocks (patches) which aren't sampled
% by rays
%
[nPatch,nblocks] = size(blocks);
Bpass = []; % rays passing thru the pixels in each block (looking for pixels with no sampling)
A = full(A);
for k = 1:nblocks
Bpass(:,k) = sum(A(:,blocks(:,k)))';
end
Bpass_zero = Bpass==0;
zeroCheck = sum(Bpass_zero);
percZero = zeroCheck/nPatch;
% % % looking at distribution of percentage zero crossings
% % figure;
% % plot(percZero)
end