getGraph.m 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. % function MRI_quality(BIDS_path)
  2. % Stefan J. Blaschke, Neurology Department, University Hospital Cologne
  3. % VERSION 1.0., 31.12.2022
  4. %
  5. % matlab script to examine preprocessed fMRI dataset
  6. % display of raw imaging
  7. % overlay with registered atlas
  8. % SNR and tSNR
  9. % display of tSNR with mask outlines
  10. % DVARS and FD
  11. % - Afyouni S. & Nichols T.E., Insights and inference for DVARS, 2017
  12. % http://www.biorxiv.org/content/early/2017/04/06/125021.1
  13. % necessity of GSR (Chen et al., 2022, Magn Reson Med)
  14. if exist("Mat","var")
  15. % header
  16. addpath(".\scripts\toolbox\DVARS-master\")
  17. addpath(".\scripts\toolbox\DVARS-master\Nifti_Util\")
  18. addpath(".\scripts\toolbox\BCT\")
  19. addpath(".\scripts\toolbox\spm12")
  20. addpath(".\scripts\toolbox\fMRI-Quality-Checker-master")
  21. addpath(".\scripts\toolbox\spm12\matlabbatch")
  22. addpath(".\scripts\toolbox\nifti_utils-master\")
  23. addpath(".\scripts\toolbox\nifti_utils-master\external\NIFTI")
  24. addpath(".\scripts\toolbox\FSLNets\")
  25. addpath(".\scripts\")
  26. %%
  27. % create data table to store features
  28. varnames = {'animal','ses','ID','MRI date','qualy', 'strenght','degree','modularity','CC','CPL','SW'};
  29. vartype = repmat({'cellstr'},length(varnames),1);
  30. Graphmaster = table('Size',[length(Mat), length(varnames)],'VariableTypes',vartype,'VariableNames',varnames);
  31. %%
  32. % loop through Data
  33. %%%%%%%%%%%%%%%%%%%%
  34. %%%%%%%%%%%%%%%%%%%%
  35. for idx = 118:length(Mat) % start loop subjects
  36. fprintf('running set #%u of %u\n',idx,length(Mat))
  37. Graphmaster{idx,"animal"} = {Mat(idx).animal};
  38. Graphmaster{idx,"ses"} = {Mat(idx).ses};
  39. mNet = Mat(idx).mNet;
  40. if ~isempty(mNet)
  41. Graphmaster{idx,"ID"} = Mat(idx).ID;
  42. Graphmaster{idx,"MRI date"} = Mat(idx).date;
  43. Graphmaster{idx,'qualy'} = {Mat(idx).qualy};
  44. [degree, strength, modularity, CPL, CC, SW] = MRI_graph(mNet, AUC);
  45. Graphmaster{idx,'degree'} = {degree};
  46. Graphmaster{idx,'strenght'} = {strength};
  47. Graphmaster{idx,'modularity'} = {modularity};
  48. Graphmaster{idx,'CPL'} = {CPL};
  49. Graphmaster{idx,'CC'} = {CC};
  50. Graphmaster{idx,'SW'} = {SW};
  51. end
  52. end
  53. else
  54. disp('please load structure of matrices')
  55. end