diff --git a/src/MATLAB/+RSF/getImf.m b/src/MATLAB/+RSF/getImf.m index 635d6f3253ab0cc821704cb940a06711b97122cd..fbe762aa432152bcb15983905d48e1bf355dadeb 100644 --- a/src/MATLAB/+RSF/getImf.m +++ b/src/MATLAB/+RSF/getImf.m @@ -6,10 +6,10 @@ function imf = getImf(pData,radii) % radii = {[0.5,8,8]}; % plate % -% NGPU = HIP.Cuda.DeviceCount; +NGPU = HIP.Cuda.DeviceCount; % p = ljsStartParallel(8*NGPU); -N_CUDA_PROCS = 48; +N_CUDA_PROCS = 16 * NGPU; startTarget = 1; imf = {}; im1 = Composite(); diff --git a/src/MATLAB/clusterExamples/goLR.m b/src/MATLAB/clusterExamples/goLR.m index 8fa05c2dfcfaf4ddaa326d9894f2d80c7f179527..0e7d6bb75e8885f0db224c659c865d59fce873f5 100644 --- a/src/MATLAB/clusterExamples/goLR.m +++ b/src/MATLAB/clusterExamples/goLR.m @@ -1,7 +1,8 @@ tic -ROOT = '/g/leverjs/Schuman_OCT/OCT/qualified'; +ROOT = '/g/leverjs/Schuman_OCT/OCT/qualifiedYes'; PID = 'P10010'; +% PID = 'P10125' 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{:})); @@ -15,10 +16,10 @@ tblMeta = tblMeta(contains(tblMeta.scanType,'Optic'),:); p = ljsStartParallel(96); -% radii = {[0.5,8,8],[5,5,5],[0,0,0]}; % plate,blob +radii = {[0.5,8,8],[5,5,5],[0,0,0]}; % plate,blob % radii = {[0.5,8,8]}; % plate -radii = {[3]} % dark tubes +% radii = {[3]} % dark tubes imf = RSF.getImf(tblMeta,radii); d = []; parfor i = 1:length(imf) diff --git a/src/MATLAB/importMetadata/readme.txt b/src/MATLAB/importMetadata/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..ea28fd6019e6afa2fb12d3ca649436b25e9fb30f --- /dev/null +++ b/src/MATLAB/importMetadata/readme.txt @@ -0,0 +1,15 @@ +Hi Andy, + +Sorry for the messy spreads. But yes, those would be the files which contain the MD used in classification (column R). +And yes the Project IDs should be associated with the image files. +This data probably needed some tidying up before being shared but if you would still like to work on it its important to make sure that we use tests with +• threshold of Visual Field 24-2 Test Pattern (column I) +• have a qualification_status of yes (column CE) +• have < 33% average false_positive_p, false_negative_p, fixation_loss_c_p (columns F,G,H) + +In regards to multiple MDs on the same visit, besides the rows that are outright duplicates, please select the tests which have the lower total reliability errors (columns F,G,H). + +I hope that clarifies some of the issues, in the meantime I will work on resending a cleaner dataset! + +Best, +Ronald diff --git a/src/MATLAB/ncdVSvfmd/goKernelCorr.m b/src/MATLAB/ncdVSvfmd/goKernelCorr.m index 9451fd99008afe9d21a57c6677a9d6984305829c..caa95c1956ceb1bc4c630efc3c0e032398d3c3fd 100644 --- a/src/MATLAB/ncdVSvfmd/goKernelCorr.m +++ b/src/MATLAB/ncdVSvfmd/goKernelCorr.m @@ -1,7 +1,11 @@ +SAVE_FOLDER = './results'; +if ~exist("SAVE_FOLDER",'dir') + mkdir('SAVE_FOLDER'); +end datetime kernelCorrStart = tic(); eye = 'OD'; -ROOT = '/g/leverjs/Schuman_OCT/OCT/qualified'; +ROOT = '/g/leverjs/Schuman_OCT/OCT/qualifiedYes'; % scanType = 'Macular Cube 200x200'; scanType = 'Optic Disc Cube 200x200'; @@ -12,11 +16,15 @@ tblMeta = getMetaOCT(ROOT,eye,scanType); load('../qualify/onh_rnfl_thickness.mat'); -radii = {[0.5,8,8],[5,5,5],[4]}; % plate,blob -% radii = {[0.5,8,8]}; % plate +% radii = {[0.5,8,8],[5,5,5],[8]}; % plate,blob +% radii = {[0.5,8,8],[5,5,5],[0]}; % plate,blob +radii = {[0.5,8,8]}; % plate [rho2,tblVelo, pData, dxx] = kernelCorr(radii,tblVFMD,tblMeta,tblRNFL); [rmse1,~] = regnetCorr(tblVelo);median(rmse1) + +saveFile = fullfile(SAVE_FOLDER,['qualYes_ncdVSvfmd_' jsonencode(radii) '.mat']); +save(saveFile) diff --git a/src/MATLAB/ncdVSvfmd/regnetCorr.m b/src/MATLAB/ncdVSvfmd/regnetCorr.m index 6a0193101b72460b76db8663e57329935b69d3c4..553e7a06ebcc830b29c00df25dc28bbcdc728b61 100644 --- a/src/MATLAB/ncdVSvfmd/regnetCorr.m +++ b/src/MATLAB/ncdVSvfmd/regnetCorr.m @@ -7,7 +7,7 @@ function [err,mdlX] = regnetCorr(tblVelo) % X = [tblVelo.ncd,tblVelo.md]; t2 = tblVelo(tblVelo.dmd~=0,:); -X1 = [t2.ncd]; +X1 = [t2.ncd,t2.deltaRNFL]; X2 = [t2.ncd,t2.md]; T = t2.dmd; % T = t2.deltaRNFL; @@ -27,8 +27,11 @@ for i = 1:length(xTarget) mdlX{i} = mdl; pred = mdl.predict(xTarget(i,:)); err(i) = abs(T(i) - pred); - [i,median(err)] + fprintf(1,'%d,%0.2f, ',i,median(err)); + drawnow; + if mod(i,10) == 0,fprintf(1,'\n');end end +fprintf(1,'\n'); % mean(err) 4; diff --git a/src/MATLAB/qualify/goQualify.m b/src/MATLAB/qualify/goQualify.m index 1c94df3efb2b888aeda85e534a7f088733282e88..594785942f51beafc456ecb6c721ef4c66c559ba 100644 --- a/src/MATLAB/qualify/goQualify.m +++ b/src/MATLAB/qualify/goQualify.m @@ -1,13 +1,13 @@ ROOT = '/g/leverjs/Schuman_OCT/OCT/combined'; -target = '/g/leverjs/Schuman_OCT/OCT/qualified'; +target = '/g/leverjs/Schuman_OCT/OCT/qualifiedYes'; if ~exist(target,'dir') mkdir(target); end -% flist = dir(fullfile(ROOT,'**/*.LEVER')); -% qONH = readtable('nyu onh matched.xlsx'); -% qMacula = readtable('nyu mac matched.xlsx'); -% [~,fONH,~] = fileparts(qONH.file_name); -% [~,fMacula,~] = fileparts(qMacula.file_name); +flist = dir(fullfile(ROOT,'**/*.LEVER')); +qONH = readtable('nyu onh matched.xlsx'); +qMacula = readtable('nyu mac matched.xlsx'); +[~,fONH,~] = fileparts(qONH.file_name); +[~,fMacula,~] = fileparts(qMacula.file_name); qlist = []; for i = 1 : length(flist) @@ -23,11 +23,10 @@ for i = 1 : length(flist) continue end qs = lower(tidx.qualification_status); - if any(strcmp(qs,'no')) - continue + if any(strcmp(qs,'yes')) + qlist = [qlist,flist(i)]; + src = fullfile(flist(i).folder,fname); + cmd = ['cp "' src '".* ' target]; + system(cmd); end - qlist = [qlist,flist(i)]; - src = fullfile(flist(i).folder,fname); - cmd = ['cp "' src '".* ' target]; - system(cmd); end diff --git a/src/MATLAB/qualify/onh_rnfl_thickness.mat b/src/MATLAB/qualify/onh_rnfl_thickness.mat new file mode 100644 index 0000000000000000000000000000000000000000..e451b31e5ca3a558ead7fc5d1ee0ef2e014b4367 Binary files /dev/null and b/src/MATLAB/qualify/onh_rnfl_thickness.mat differ