Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subset of A matrix #3

Open
bradday4 opened this issue Mar 25, 2019 · 1 comment
Open

Subset of A matrix #3

bradday4 opened this issue Mar 25, 2019 · 1 comment
Assignees

Comments

@bradday4
Copy link

Given the link file I've created for my particular mesh how would it be possible to index the appropriate rows in the full A matrix returned from the g2a function. I see that the A matrix contains all possible combinations of greens functions for sources and detectors, however I am using a subset of the full combination of sources and detectors. e.g. 128 sources and 128 detectors is 16,384 pairs, but I am only using 1,736 pairs.

@jason-trobaugh
Copy link

When reducing measurements used in A, the info.pairs table needs to have the same ordering as the measurements in A. The code below reduces A based on source-detector distance.

In general, a list of measurements to keep, e.g., measTRUE, needs combinations of src, det and WL, then make the keep list from matching measurements in info.pairs,
meas=cat(2,info.pairs.Src,info.pairs.Det,info.pairs.WL);
then keep=ismember(meas,measTRUE,'rows');
and continue as below.

%% Repackage A with only short src-det pairs

Rsdmax = 40;

[Nwl,Nmeas,Nvox]=size(A);
A=reshape(permute(A,[2,1,3]),Nwl*Nmeas,Nvox);

keep = info.pairs.r2d<Rsdmax; % keep measurements with short Rsd

% generate new table for info.pairs with selected measurements
temp=table;
temp.Src=info.pairs.Src(keep);
temp.Det=info.pairs.Det(keep);
temp.NN=info.pairs.NN(keep);
temp.WL=info.pairs.WL(keep);
temp.lambda=info.pairs.lambda(keep);
temp.Mod=info.pairs.Mod(keep);
temp.r2d=info.pairs.r2d(keep);
temp.r3d=info.pairs.r3d(keep);
infoOld = info;
info.pairs=temp;
A=A(keep,:);

save(['A_',flags.tag,'r2dlth',num2str(Rsdmax),'.mat'],'A','info','-v7.3')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants