WUSTL-ORL / NeuroDOT_Beta

A beta release of NeuroDOT, an extensible Matlab toolbox for efficient optical brain mapping. Official release located at: https://github.com/WUSTL-ORL/NeuroDOT.
Other
13 stars 6 forks source link

Subset of A matrix #3

Open bradday4 opened 5 years ago

bradday4 commented 5 years ago

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 commented 5 years ago

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')