Select Git revision
goLR.m 1.36 KiB
tic
ROOT = '/g/leverjs/Schuman_OCT/OCT/03-22-2024';
PID = 'P10010';
flist = dir(fullfile(ROOT,['**/' PID '*.LEVER']));
mx = regexp({flist.name},'P(?<PID>\d+)_(?<scanType>.+)_(?<date>\d+-\d+-\d+)_(?<time>\d+-\d+-\d+)_(?<eye>\w\w)_(?<scanID>.+?)_.*.LEVER','names');
tblMeta = struct2table(vertcat(mx{:}));
tblMeta.PID = str2double(tblMeta.PID);
tblMeta.folder = {flist.folder}';
tblMeta.filename = {flist.name}';
% tblMeta = tblMeta(contains(tblMeta.scanType,'Optic'),:);
tblMeta = tblMeta(contains(tblMeta.scanType,'Macula'),:);
% tblMeta = tblMeta(contains(tblMeta.eye,'OD'),:);
p = ljsStartParallel(96);
imf = RSF.getImf(tblMeta,[[0.5,8,8] ; [5,5,5]],'');
d = [];
parfor i = 1:length(imf)
dj = [];
for j = 1:length(imf)
dj(j) = SSF.ncd_ssf_volume(imf{i},imf{j});
end
d(i,:) = dj;
end
A = Cluster.Regularize(d);
[~,Y] = Cluster.SpectralCluster(A,3);
tblMeta.Y = Y;
tS = tblMeta(strcmp(tblMeta.eye,'OD'),:);
tD = tblMeta(strcmp(tblMeta.eye,'OS'),:);
t1 = tS;
t2 = tD;
tO = tblMeta(contains(tblMeta.scanType,'Optic'),:);
tM = tblMeta(contains(tblMeta.scanType,'Macular'),:);
t3 = tO;
t4 = tM;
clf;hold on
plot3(t1.Y(:,1),t1.Y(:,2),t1.Y(:,3),'r*')
plot3(t2.Y(:,1),t2.Y(:,2),t2.Y(:,3),'og')
legend({'OS','OD'})
xlabel('NCD1')
ylabel('NCD2')
zlabel('NCD3')
plot3(t3.Y(:,1),t3.Y(:,2),t3.Y(:,3),'mx')
plot3(t4.Y(:,1),t4.Y(:,2),t4.Y(:,3),'cs')
legend({'ONH','macula'})
toc