getSubjectInfos.m 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. function subjectInfos=getSubjectInfos(sSubjectName)
  2. % sSubjectName [monkey 1, monkey 2] *REQUIRED FIELD
  3. %
  4. % gets all of the informations you may need for the subject you want to inspect.
  5. %
  6. % subjectName, penIDs, subjectInfos.penInfos
  7. % Wyman 288 V1.Channels, V4.Channels, V1.ChRejected, V4.ChRejected, V1.Quality, V4.Quality, eventFileName, ctxFileName, lfpFilePath, cscFilePath
  8. % ... ...
  9. % 323 ...
  10. %
  11. % Taylor 1 ...
  12. % ... ...
  13. % 33 V1.Channels, V4.Channels, V1.ChRejected, V4.ChRejected, V1.Quality, V4.Quality, eventFileName, ctxFileName, lfpFilePath, cscFilePath
  14. if ~sum(cellfun(@(x) strcmp(sSubjectName,x),{'Wyman','Taylor','monkey 1','monkey 2'}))
  15. error(['The selected Subject Name "' sSubjectName '" is not valid.']);
  16. elseif strcmpi(sSubjectName,'Wyman'); sSubjectName='monkey 1';
  17. elseif strcmpi(sSubjectName,'Taylor'); sSubjectName='monkey 2';
  18. end
  19. startPath='../Data/';
  20. switch sSubjectName
  21. case 'monkey 1'
  22. subjectInfos.subjectName='Wyman';
  23. subjectInfos.penIDs=[288:293 295:323];
  24. subjectInfos.grcIDs=[145 148 150 152:154 157 158 160 163 165 166 167 169 170:172 174:177 179 180 181 183 186 187 189 190:192 194:197];
  25. subjectInfos.ctxIDs=160120+[1 2 6:9 83:85 89:92 96:99 103:106 181:184 195:196 285:288 292:295];
  26. %% DATE-TIME AND V1-V4 DEPTHS (Manually selected from CSDs)
  27. subjectInfos.penInfos(1).dateTime='2016-04-22_15-29-16'; % PEN 288
  28. subjectInfos.penInfos(1).V1Contacts.Depths=-1.2313+.15*(0:15);
  29. subjectInfos.penInfos(1).V4Contacts.Depths=-0.4312+.15*(0:15);
  30. subjectInfos.penInfos(2).dateTime='2016-04-06_14-54-03'; % PEN 289
  31. % MAYBE BETTER ALIGNMENT FOR PEN 289
  32. subjectInfos.penInfos(2).V1Contacts.Depths=-1.5813+.15*(0:15);
  33. %subjectInfos.penInfos(2).V1Contacts.Depths=-0.8812+.15*(0:15);
  34. subjectInfos.penInfos(2).V4Contacts.Depths=-0.8187+.15*(0:15);
  35. subjectInfos.penInfos(3).dateTime='2016-04-07_13-09-47'; % PEN 290
  36. subjectInfos.penInfos(3).V1Contacts.Depths=-1.3687+.15*(0:15);
  37. subjectInfos.penInfos(3).V4Contacts.Depths=-1.1937+.15*(0:15);
  38. subjectInfos.penInfos(4).dateTime='2016-04-08_15-33-57'; % PEN 291
  39. subjectInfos.penInfos(4).V1Contacts.Depths=-1.3438+.15*(0:15);
  40. subjectInfos.penInfos(4).V4Contacts.Depths=-0.6437+.15*(0:15);
  41. subjectInfos.penInfos(5).dateTime='2016-04-11_10-01-05'; % PEN 292
  42. subjectInfos.penInfos(5).V1Contacts.Depths=-1.8218+.15*(0:15);
  43. subjectInfos.penInfos(5).V4Contacts.Depths=-1.3562+.15*(0:15);
  44. subjectInfos.penInfos(6).dateTime='2016-04-11_14-22-23'; % PEN 293
  45. subjectInfos.penInfos(6).V1Contacts.Depths=-1.8562+.15*(0:15);
  46. subjectInfos.penInfos(6).V4Contacts.Depths=-0.8187+.15*(0:15);
  47. subjectInfos.penInfos(7).dateTime='2016-05-09_11-21-17'; % PEN 295
  48. % MAYBE BETTER ALIGNMENT FOR PEN 295
  49. % subjectInfos.penInfos(7).V1Contacts.Depths=-1.3437+.15*(0:15);
  50. subjectInfos.penInfos(7).V1Contacts.Depths=-1.8437+.15*(0:15);
  51. subjectInfos.penInfos(7).V4Contacts.Depths=-1.0062+.15*(0:15);
  52. subjectInfos.penInfos(8).dateTime='2016-04-12_09-30-14'; % PEN 296
  53. subjectInfos.penInfos(8).V1Contacts.Depths=-1.5062+.15*(0:15);
  54. subjectInfos.penInfos(8).V4Contacts.Depths=-0.8687+.15*(0:15);
  55. subjectInfos.penInfos(9).dateTime='2016-04-12_17-14-48'; % PEN 297
  56. subjectInfos.penInfos(9).V1Contacts.Depths=-1.2568+.15*(0:15);
  57. subjectInfos.penInfos(9).V4Contacts.Depths=-0.9438+.15*(0:15);
  58. subjectInfos.penInfos(10).dateTime='2016-04-13_10-07-56'; % PEN 298
  59. subjectInfos.penInfos(10).V1Contacts.Depths=[];
  60. subjectInfos.penInfos(10).V4Contacts.Depths=-0.8813+.15*(0:15);
  61. subjectInfos.penInfos(11).dateTime='2016-04-13_13-51-50'; % PEN 299
  62. subjectInfos.penInfos(11).V1Contacts.Depths=-1.6812+.15*(0:15);
  63. subjectInfos.penInfos(11).V4Contacts.Depths=-0.9687+.15*(0:15);
  64. subjectInfos.penInfos(12).dateTime='2016-04-14_08-11-50'; % PEN 300
  65. % MAYBE BETTER ALIGNMENT FOR PEN 300
  66. % subjectInfos.penInfos(12).V1Contacts.Depths=-0.7169+.15*(0:15);
  67. subjectInfos.penInfos(12).V1Contacts.Depths=-1.5169+.15*(0:15);
  68. subjectInfos.penInfos(12).V4Contacts.Depths=-1.2438+.15*(0:15);
  69. subjectInfos.penInfos(13).dateTime='2016-04-17_19-39-40'; % PEN 301
  70. subjectInfos.penInfos(13).V1Contacts.Depths=-1.6614+.15*(0:15);
  71. subjectInfos.penInfos(13).V4Contacts.Depths=-1.0813+.15*(0:15);
  72. subjectInfos.penInfos(14).dateTime='2016-04-18_10-46-29'; % PEN 302
  73. subjectInfos.penInfos(14).V1Contacts.Depths=-1.4075+.15*(0:15);
  74. subjectInfos.penInfos(14).V4Contacts.Depths=-1.1063+.15*(0:15);
  75. subjectInfos.penInfos(15).dateTime='2016-05-09_13-52-17'; % PEN 303
  76. subjectInfos.penInfos(15).V1Contacts.Depths=-1.7312+.15*(0:15);
  77. subjectInfos.penInfos(15).V4Contacts.Depths=-1.0559+.15*(0:15);
  78. subjectInfos.penInfos(16).dateTime='2016-04-18_14-07-37'; % PEN 304
  79. subjectInfos.penInfos(16).V1Contacts.Depths=-1.5437+.15*(0:15);
  80. subjectInfos.penInfos(16).V4Contacts.Depths=-0.8062+.15*(0:15);
  81. subjectInfos.penInfos(17).dateTime='2016-04-18_20-54-23'; % PEN 305
  82. subjectInfos.penInfos(17).V1Contacts.Depths=-0.7653+.15*(0:15);
  83. subjectInfos.penInfos(17).V4Contacts.Depths=-0.8937+.15*(0:15);
  84. subjectInfos.penInfos(18).dateTime='2016-04-19_16-39-04'; % PEN 306
  85. subjectInfos.penInfos(18).V1Contacts.Depths=-0.9312+.15*(0:15);
  86. subjectInfos.penInfos(18).V4Contacts.Depths=-0.6937+.15*(0:15);
  87. subjectInfos.penInfos(19).dateTime='2016-04-20_09-02-43'; % PEN 307
  88. subjectInfos.penInfos(19).V1Contacts.Depths=-0.8562+.15*(0:15);
  89. subjectInfos.penInfos(19).V4Contacts.Depths=-0.6437+.15*(0:15);
  90. subjectInfos.penInfos(20).dateTime='2016-04-20_12-41-43'; % PEN 308
  91. subjectInfos.penInfos(20).V1Contacts.Depths=-1.4312+.15*(0:15);
  92. subjectInfos.penInfos(20).V4Contacts.Depths=-1.0188+.15*(0:15);
  93. subjectInfos.penInfos(21).dateTime='2016-04-20_12-46-41'; % PEN 309
  94. subjectInfos.penInfos(21).V1Contacts.Depths=-1.3938+.15*(0:15);
  95. subjectInfos.penInfos(21).V4Contacts.Depths=-0.6313+.15*(0:15);
  96. subjectInfos.penInfos(22).dateTime='2016-04-20_13-29-49'; % PEN 310
  97. subjectInfos.penInfos(22).V1Contacts.Depths=-1.5188+.15*(0:15);
  98. subjectInfos.penInfos(22).V4Contacts.Depths=-0.7812+.15*(0:15);
  99. subjectInfos.penInfos(23).dateTime='2016-04-20_16-25-45'; % PEN 311
  100. % MAYBE BETTER ALIGNMENT FOR PEN 311
  101. %subjectInfos.penInfos(23).V1Contacts.Depths=-1.0813+.15*(0:15);
  102. subjectInfos.penInfos(23).V1Contacts.Depths=-1.4813+.15*(0:15);
  103. subjectInfos.penInfos(23).V4Contacts.Depths=-0.1562+.15*(0:15);
  104. subjectInfos.penInfos(24).dateTime='2016-04-21_11-39-33'; % PEN 312
  105. subjectInfos.penInfos(24).V1Contacts.Depths=-1.2688+.15*(0:15);
  106. subjectInfos.penInfos(24).V4Contacts.Depths=-0.8062+.15*(0:15);
  107. subjectInfos.penInfos(25).dateTime='2016-04-21_11-44-38'; % PEN 313
  108. % MAYBE BETTER ALIGNMENT FOR PEN 311
  109. % subjectInfos.penInfos(25).V1Contacts.Depths=-1.1937+.15*(0:15);
  110. subjectInfos.penInfos(25).V1Contacts.Depths=-1.3937+.15*(0:15);
  111. subjectInfos.penInfos(25).V4Contacts.Depths=-0.5562+.15*(0:15);
  112. subjectInfos.penInfos(26).dateTime='2016-04-18_21-06-04'; % PEN 314
  113. subjectInfos.penInfos(26).V1Contacts.Depths=-1.7062+.15*(0:15);
  114. subjectInfos.penInfos(26).V4Contacts.Depths=-0.6312+.15*(0:15);
  115. subjectInfos.penInfos(27).dateTime='2016-04-18_16-48-16'; % PEN 315
  116. subjectInfos.penInfos(27).V1Contacts.Depths=-1.5937+.15*(0:15);
  117. subjectInfos.penInfos(27).V4Contacts.Depths=-0.7312+.15*(0:15);
  118. subjectInfos.penInfos(28).dateTime='2016-04-11_10-56-56'; % PEN 316
  119. subjectInfos.penInfos(28).V1Contacts.Depths=-1.7062+.15*(0:15);
  120. subjectInfos.penInfos(28).V4Contacts.Depths=-0.7937+.15*(0:15);
  121. subjectInfos.penInfos(29).dateTime='2016-04-06_15-12-45'; % PEN 317
  122. subjectInfos.penInfos(29).V1Contacts.Depths=-1.1187+.15*(0:15);
  123. subjectInfos.penInfos(29).V4Contacts.Depths=-0.8299+.15*(0:15);
  124. subjectInfos.penInfos(30).dateTime='2016-04-11_12-42-31'; % PEN 318
  125. subjectInfos.penInfos(30).V1Contacts.Depths=-0.6813+.15*(0:15);
  126. subjectInfos.penInfos(30).V4Contacts.Depths=-1.5188+.15*(0:15);
  127. subjectInfos.penInfos(31).dateTime='2016-04-12_18-18-03'; % PEN 319
  128. subjectInfos.penInfos(31).V1Contacts.Depths=-1.2562+.15*(0:15);
  129. subjectInfos.penInfos(31).V4Contacts.Depths=-0.5437+.15*(0:15);
  130. subjectInfos.penInfos(32).dateTime='2016-04-19_16-44-44'; % PEN 320
  131. subjectInfos.penInfos(32).V1Contacts.Depths=-1.7312+.15*(0:15);
  132. subjectInfos.penInfos(32).V4Contacts.Depths=-1.0188+.15*(0:15);
  133. subjectInfos.penInfos(33).dateTime='2016-04-20_12-32-04'; % PEN 321
  134. % MAYBE BETTER ALIGNMENT FOR PEN 321
  135. % subjectInfos.penInfos(33).V1Contacts.Depths=-1.5562+.15*(0:15);
  136. subjectInfos.penInfos(33).V1Contacts.Depths=-1.7562+.15*(0:15);
  137. subjectInfos.penInfos(33).V4Contacts.Depths=-1.0687+.15*(0:15);
  138. subjectInfos.penInfos(34).dateTime='2016-04-21_11-22-21'; % PEN 322
  139. subjectInfos.penInfos(34).V1Contacts.Depths=-1.4937+.15*(0:15);
  140. subjectInfos.penInfos(34).V4Contacts.Depths=-0.8687+.15*(0:15);
  141. subjectInfos.penInfos(35).dateTime='2016-04-21_12-50-47'; % PEN 323
  142. % MAYBE BETTER ALIGNMENT FOR PEN 323
  143. % subjectInfos.penInfos(35).V1Contacts.Depths=-0.8187+.15*(0:15);
  144. subjectInfos.penInfos(35).V1Contacts.Depths=-1.6187+.15*(0:15);
  145. subjectInfos.penInfos(35).V4Contacts.Depths=-1.0562+.15*(0:15);
  146. %% DEFAULT FORMAT INITIALIZATION
  147. for jj=1:length(subjectInfos.penIDs)
  148. subjectInfos.penInfos(jj).penNum=subjectInfos.penIDs(jj);
  149. subjectInfos.penInfos(jj).grcNum=subjectInfos.grcIDs(jj);
  150. subjectInfos.penInfos(jj).V1Contacts.Channels=1:16;
  151. subjectInfos.penInfos(jj).V4Contacts.Channels=17:32;
  152. subjectInfos.penInfos(jj).V1Contacts.ChRejected=[];
  153. subjectInfos.penInfos(jj).V1Contacts.ChSNRLowEq3=[];
  154. subjectInfos.penInfos(jj).V4Contacts.ChRejected=[];
  155. subjectInfos.penInfos(jj).V4Contacts.ChSNRLowEq3=[];
  156. subjectInfos.penInfos(jj).V1Contacts.Quality='OK';
  157. subjectInfos.penInfos(jj).V4Contacts.Quality='OK';
  158. %% ORIGINAL FILENAMES (DEPRECATED)
  159. %subjectInfos.penInfos(jj).originalFilePaths.lfpFilePath=[startPath1 'wyman/pen' num2str(subjectInfos.penIDs(jj)) '/NLX_control/' subjectInfos.penInfos(jj).dateTime '/'];
  160. %subjectInfos.penInfos(jj).originalFilePaths.ctxFileName=[startPath1 'wyman/pen' num2str(subjectInfos.penIDs(jj)) '/Cortex/' num2str(subjectInfos.ctxIDs(jj)) '/GRCJDRU1.' num2str(subjectInfos.grcIDs(jj))];
  161. %subjectInfos.penInfos(jj).originalFilePaths.eventFileName=[subjectInfos.penInfos(jj).originalFilePaths.lfpFilePath 'Events.nev'];
  162. %subjectInfos.penInfos(jj).originalFilePaths.cscFilePath=[startPath1 'wyman/pen' num2str(subjectInfos.penIDs(jj)) '/NLX_control/gratc/'];
  163. %% SELECTED TIME WINS FILE PATHS
  164. subjectInfos.penInfos(jj).selectedTimeWinsFilePaths.V1Contacts.LFPs=[startPath 'M1 V1 - LFP/Wyman_V1_LFP_PEN' num2str(subjectInfos.penIDs(jj)) '_sorted.mat'];
  165. subjectInfos.penInfos(jj).selectedTimeWinsFilePaths.V4Contacts.LFPs=[startPath 'M1 V4 - LFP/Wyman_V4_LFP_PEN' num2str(subjectInfos.penIDs(jj)) '_sorted.mat'];
  166. subjectInfos.penInfos(jj).selectedTimeWinsFilePaths.V1Contacts.MUAs=[startPath 'M1 V1 - MUA/Wyman_V1_MUA_PEN' num2str(subjectInfos.penIDs(jj)) '_sorted.mat'];
  167. subjectInfos.penInfos(jj).selectedTimeWinsFilePaths.V4Contacts.MUAs=[startPath 'M1 V4 - MUA/Wyman_V4_MUA_PEN' num2str(subjectInfos.penIDs(jj)) '_sorted.mat'];
  168. %% LAMINAR LAYER LABELS ASSIGNMENT
  169. if ~isempty(subjectInfos.penInfos(jj).V1Contacts.Depths)
  170. [~,minV1Ch]=min((subjectInfos.penInfos(jj).V1Contacts.Depths).^2);
  171. subjectInfos.penInfos(jj).V1Contacts.LaminarAlignments=(1:16)-minV1Ch;
  172. end
  173. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers((subjectInfos.penInfos(jj).V1Contacts.Depths>1))={'TS'}; % TOO SUPERFICIAL
  174. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V1Contacts.Depths>.25).*(subjectInfos.penInfos(jj).V1Contacts.Depths<=1)))={'S'}; % SUPRAGRANULAR
  175. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V1Contacts.Depths>=-.25).*(subjectInfos.penInfos(jj).V1Contacts.Depths<=.25)))={'G'}; % GRANULAR
  176. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V1Contacts.Depths>=-.75).*(subjectInfos.penInfos(jj).V1Contacts.Depths<-.25)))={'I'}; % INFRAGRANULAR
  177. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers((subjectInfos.penInfos(jj).V1Contacts.Depths<-.75))={'TD'}; % TOO DEEP
  178. subjectInfos.penInfos(jj).V1Contacts.SelectedChs=subjectInfos.penInfos(jj).V1Contacts.Channels;
  179. if ~isempty(subjectInfos.penInfos(jj).V4Contacts.Depths)
  180. [~,minV4Ch]=min((subjectInfos.penInfos(jj).V4Contacts.Depths).^2);
  181. subjectInfos.penInfos(jj).V4Contacts.LaminarAlignments=(1:16)-minV4Ch;
  182. end
  183. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers((subjectInfos.penInfos(jj).V4Contacts.Depths>1))={'TS'}; % TOO SUPERFICIAL
  184. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V4Contacts.Depths>.1).*(subjectInfos.penInfos(jj).V4Contacts.Depths<=1)))={'S'}; % SUPRAGRANULAR
  185. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V4Contacts.Depths>=-.1).*(subjectInfos.penInfos(jj).V4Contacts.Depths<=.1)))={'G'}; % GRANULAR
  186. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V4Contacts.Depths>=-.75).*(subjectInfos.penInfos(jj).V4Contacts.Depths<-.1)))={'I'}; % INFRAGRANULAR
  187. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers((subjectInfos.penInfos(jj).V4Contacts.Depths<-.75))={'TD'}; % TOO DEEP
  188. subjectInfos.penInfos(jj).V4Contacts.SelectedChs=subjectInfos.penInfos(jj).V4Contacts.Channels;
  189. end
  190. %% COLOR ORDERS [RF, OUT1, OUT2]
  191. subjectInfos.penInfos(1).grcColorOrder='BRG'; % PEN 288
  192. subjectInfos.penInfos(2).grcColorOrder='RGB'; % PEN 289
  193. subjectInfos.penInfos(3).grcColorOrder='RBG'; % PEN 290
  194. subjectInfos.penInfos(4).grcColorOrder='GRB'; % PEN 291
  195. subjectInfos.penInfos(5).grcColorOrder='GBR'; % PEN 292
  196. subjectInfos.penInfos(6).grcColorOrder='BGR'; % PEN 293
  197. subjectInfos.penInfos(7).grcColorOrder='BRG'; % PEN 295
  198. subjectInfos.penInfos(8).grcColorOrder='RGB'; % PEN 296
  199. subjectInfos.penInfos(9).grcColorOrder='RBG'; % PEN 297
  200. subjectInfos.penInfos(10).grcColorOrder='GRB'; % PEN 298
  201. subjectInfos.penInfos(11).grcColorOrder='GBR'; % PEN 299
  202. subjectInfos.penInfos(12).grcColorOrder='BGR'; % PEN 300
  203. subjectInfos.penInfos(13).grcColorOrder='BRG'; % PEN 301
  204. subjectInfos.penInfos(14).grcColorOrder='RGB'; % PEN 302
  205. subjectInfos.penInfos(15).grcColorOrder='RBG'; % PEN 303
  206. subjectInfos.penInfos(16).grcColorOrder='GRB'; % PEN 304
  207. subjectInfos.penInfos(17).grcColorOrder='GBR'; % PEN 305
  208. subjectInfos.penInfos(18).grcColorOrder='BRG'; % PEN 306
  209. subjectInfos.penInfos(19).grcColorOrder='RGB'; % PEN 307
  210. subjectInfos.penInfos(20).grcColorOrder='RBG'; % PEN 308
  211. subjectInfos.penInfos(21).grcColorOrder='GRB'; % PEN 309
  212. subjectInfos.penInfos(22).grcColorOrder='BGR'; % PEN 310
  213. subjectInfos.penInfos(23).grcColorOrder='BRG'; % PEN 311
  214. subjectInfos.penInfos(24).grcColorOrder='RGB'; % PEN 312
  215. subjectInfos.penInfos(25).grcColorOrder='RBG'; % PEN 313
  216. subjectInfos.penInfos(26).grcColorOrder='GRB'; % PEN 314
  217. subjectInfos.penInfos(27).grcColorOrder='GBR'; % PEN 315
  218. subjectInfos.penInfos(28).grcColorOrder='BGR'; % PEN 316
  219. subjectInfos.penInfos(29).grcColorOrder='BRG'; % PEN 317
  220. subjectInfos.penInfos(30).grcColorOrder='RGB'; % PEN 318
  221. subjectInfos.penInfos(31).grcColorOrder='RBG'; % PEN 319
  222. subjectInfos.penInfos(32).grcColorOrder='GRB'; % PEN 320
  223. subjectInfos.penInfos(33).grcColorOrder='GBR'; % PEN 321
  224. subjectInfos.penInfos(34).grcColorOrder='BGR'; % PEN 322
  225. subjectInfos.penInfos(35).grcColorOrder='BRG'; % PEN 323
  226. %% CHANNEL RE-ARRANGEMENT/REJECTION ISSUES
  227. subjectInfos.penInfos(1).V1Contacts.ChSNRLowEq3=[15,16]; % PEN 288
  228. subjectInfos.penInfos(1).V4Contacts.ChSNRLowEq3=12;
  229. subjectInfos.penInfos(2).V1Contacts.ChSNRLowEq3=16; % 289
  230. subjectInfos.penInfos(2).V4Contacts.ChSNRLowEq3=[15,16];
  231. subjectInfos.penInfos(3).V1Contacts.ChSNRLowEq3=[1,15,16]; % 290
  232. subjectInfos.penInfos(4).V1Contacts.Quality='BAD'; % PEN 291
  233. subjectInfos.penInfos(4).V4Contacts.Quality='BAD';
  234. subjectInfos.penInfos(4).V1Contacts.ChSNRLowEq3=[15,16];
  235. subjectInfos.penInfos(5).V1Contacts.ChRejected=3; % PEN 292
  236. subjectInfos.penInfos(5).V1Contacts.ChSNRLowEq3=[1,2];
  237. subjectInfos.penInfos(5).V1Contacts.Quality='BAD';
  238. subjectInfos.penInfos(6).V1Contacts.ChSNRLowEq3=[1,2]; % PEN 293
  239. subjectInfos.penInfos(7).V1Contacts.ChSNRLowEq3=[1,2,15]; % PEN 295
  240. subjectInfos.penInfos(7).V4Contacts.ChSNRLowEq3=11;
  241. subjectInfos.penInfos(8).V1Contacts.Quality='UNCERTAIN'; % PEN 296
  242. subjectInfos.penInfos(8).V4Contacts.ChSNRLowEq3=[15,16];
  243. subjectInfos.penInfos(9).V1Contacts.ChRejected=7; % PEN 297
  244. subjectInfos.penInfos(9).V1Contacts.Quality='BAD';
  245. subjectInfos.penInfos(10).V1Contacts.Channels=[]; % PEN 298
  246. subjectInfos.penInfos(10).V1Contacts.Quality='NO V1 DATA'; % PEN 298
  247. subjectInfos.penInfos(10).V4Contacts.Quality='BAD';
  248. subjectInfos.penInfos(10).V4Contacts.ChSNRLowEq3=16;
  249. subjectInfos.penInfos(11).V4Contacts.ChSNRLowEq3=[14,15,16]; % PEN 299
  250. subjectInfos.penInfos(12).V1Contacts.ChRejected=7; % PEN 300
  251. subjectInfos.penInfos(12).V1Contacts.Quality='BAD';
  252. subjectInfos.penInfos(12).V1Contacts.ChSNRLowEq3=[15,16];
  253. subjectInfos.penInfos(12).V4Contacts.ChSNRLowEq3=11;
  254. subjectInfos.penInfos(13).V1Contacts.ChRejected=[7 11]; % PEN 301
  255. subjectInfos.penInfos(13).V1Contacts.Quality='BAD';
  256. subjectInfos.penInfos(13).V1Contacts.ChSNRLowEq3=16;
  257. subjectInfos.penInfos(14).V1Contacts.ChRejected=7; % PEN 302
  258. subjectInfos.penInfos(14).V1Contacts.ChSNRLowEq3=[15,16];
  259. subjectInfos.penInfos(14).V4Contacts.ChSNRLowEq3=16;
  260. subjectInfos.penInfos(14).V1Contacts.Quality='BAD';
  261. subjectInfos.penInfos(15).V4Contacts.Quality='BAD'; % PEN 303
  262. subjectInfos.penInfos(15).V1Contacts.ChSNRLowEq3=16;
  263. subjectInfos.penInfos(15).V4Contacts.ChRejected=11;
  264. subjectInfos.penInfos(15).V4Contacts.ChSNRLowEq3=[2,5,8,9,12];
  265. subjectInfos.penInfos(16).V4Contacts.Quality='UNCERTAIN'; % PEN 304
  266. subjectInfos.penInfos(16).V1Contacts.ChSNRLowEq3=[6,15,16];
  267. subjectInfos.penInfos(16).V4Contacts.ChSNRLowEq3=[2,12,14,15,16];
  268. subjectInfos.penInfos(17).V1Contacts.ChRejected=[3 7]; % PEN 305
  269. subjectInfos.penInfos(17).V1Contacts.Quality='BAD';
  270. subjectInfos.penInfos(17).V4Contacts.Quality='BAD';
  271. subjectInfos.penInfos(17).V1Contacts.ChSNRLowEq3=[1,15,16];
  272. subjectInfos.penInfos(17).V4Contacts.ChSNRLowEq3=[15,16];
  273. subjectInfos.penInfos(18).V1Contacts.ChSNRLowEq3=[1,3,15,16]; % PEN 306
  274. subjectInfos.penInfos(18).V4Contacts.ChSNRLowEq3=16;
  275. subjectInfos.penInfos(19).V1Contacts.ChSNRLowEq3=[1,2,12,13,14,15,16]; % PEN 307
  276. subjectInfos.penInfos(19).V4Contacts.ChSNRLowEq3=[14,15,16];
  277. subjectInfos.penInfos(20).V1Contacts.ChSNRLowEq3=16; % PEN 308
  278. subjectInfos.penInfos(20).V4Contacts.ChSNRLowEq3=[1,15,16];
  279. subjectInfos.penInfos(21).V1Contacts.Quality='BAD'; % PEN 309
  280. subjectInfos.penInfos(21).V4Contacts.Quality='BAD';
  281. subjectInfos.penInfos(21).V1Contacts.ChSNRLowEq3=16;
  282. subjectInfos.penInfos(21).V4Contacts.ChSNRLowEq3=[12,13,14,15,16];
  283. subjectInfos.penInfos(22).V1Contacts.ChSNRLowEq3=[15,16]; % PEN 310
  284. subjectInfos.penInfos(22).V4Contacts.ChSNRLowEq3=[10,12,14,15,16];
  285. subjectInfos.penInfos(23).V1Contacts.ChSNRLowEq3=[1,16]; % PEN 311
  286. subjectInfos.penInfos(23).V4Contacts.ChSNRLowEq3=[13,14,15,16];
  287. subjectInfos.penInfos(24).V1Contacts.ChSNRLowEq3=[14,15,16]; % PEN 312
  288. subjectInfos.penInfos(25).V1Contacts.ChSNRLowEq3=[2,3,14,15,16]; % PEN 313
  289. subjectInfos.penInfos(25).V4Contacts.ChSNRLowEq3=[15,16];
  290. subjectInfos.penInfos(26).V1Contacts.ChSNRLowEq3=[11,16]; % PEN 314
  291. subjectInfos.penInfos(26).V4Contacts.ChSNRLowEq3=[15,16];
  292. subjectInfos.penInfos(27).V1Contacts.Quality='UNCERTAIN'; % PEN 315
  293. subjectInfos.penInfos(27).V1Contacts.ChSNRLowEq3=[1,2,4,9,10,13,14,15,16];
  294. subjectInfos.penInfos(27).V4Contacts.ChSNRLowEq3=16;
  295. subjectInfos.penInfos(28).V1Contacts.Quality='UNCERTAIN'; % PEN 316
  296. subjectInfos.penInfos(28).V1Contacts.ChSNRLowEq3=[1,3,4,5,7,8,13,14,15,16];
  297. subjectInfos.penInfos(28).V4Contacts.ChSNRLowEq3=[15,16];
  298. subjectInfos.penInfos(29).V4Contacts.ChRejected=10; % PEN 317
  299. subjectInfos.penInfos(29).V1Contacts.ChSNRLowEq3=[2,4,15,16];
  300. subjectInfos.penInfos(29).V4Contacts.ChSNRLowEq3=[14,15,16];
  301. subjectInfos.penInfos(30).V1Contacts.Quality='BAD'; % PEN 318
  302. subjectInfos.penInfos(30).V4Contacts.Quality='BAD';
  303. subjectInfos.penInfos(30).V1Contacts.ChSNRLowEq3=[2,15,16];
  304. subjectInfos.penInfos(30).V4Contacts.ChSNRLowEq3=[14,15,16];
  305. subjectInfos.penInfos(31).V1Contacts.ChSNRLowEq3=16; % PEN 319
  306. subjectInfos.penInfos(31).V4Contacts.ChSNRLowEq3=[8,15,16];
  307. subjectInfos.penInfos(32).V1Contacts.ChSNRLowEq3=16; % PEN 320
  308. subjectInfos.penInfos(32).V4Contacts.ChSNRLowEq3=[15,16];
  309. subjectInfos.penInfos(33).V1Contacts.ChSNRLowEq3=[1,16]; % PEN 321
  310. subjectInfos.penInfos(34).V1Contacts.ChSNRLowEq3=[1,2,3,4,5,14,15,16]; % PEN 322
  311. subjectInfos.penInfos(34).V4Contacts.ChSNRLowEq3=[6,7,10,11,15,16];
  312. subjectInfos.penInfos(35).V1Contacts.ChSNRLowEq3=[1,16]; % PEN 323
  313. subjectInfos.penInfos(35).V4Contacts.ChSNRLowEq3=16;
  314. for jj=1:length(subjectInfos.penIDs)
  315. subjectInfos.penInfos(jj).V1Contacts.SelectedChs=subjectInfos.penInfos(jj).V1Contacts.Channels;
  316. if ~isempty(subjectInfos.penInfos(jj).V1Contacts.SelectedChs)
  317. subjectInfos.penInfos(jj).V1Contacts.SelectedChs(unique([find(subjectInfos.penInfos(jj).V1Contacts.Depths<=-.75 | subjectInfos.penInfos(jj).V1Contacts.Depths>=1) ...
  318. subjectInfos.penInfos(jj).V1Contacts.ChSNRLowEq3 subjectInfos.penInfos(jj).V1Contacts.ChRejected]))=[];
  319. end
  320. subjectInfos.penInfos(jj).V4Contacts.SelectedChs=subjectInfos.penInfos(jj).V4Contacts.Channels;
  321. if ~isempty(subjectInfos.penInfos(jj).V4Contacts.SelectedChs)
  322. subjectInfos.penInfos(jj).V4Contacts.SelectedChs(unique([find(subjectInfos.penInfos(jj).V4Contacts.Depths<=-.75 | subjectInfos.penInfos(jj).V4Contacts.Depths>=1) ...
  323. subjectInfos.penInfos(jj).V4Contacts.ChSNRLowEq3 subjectInfos.penInfos(jj).V4Contacts.ChRejected]))=[];
  324. end
  325. end
  326. case 'monkey 2'
  327. subjectInfos.subjectName='Taylor';
  328. subjectInfos.penIDs=[1:12 14:33];
  329. subjectInfos.grcIDs=[22 23 26 28 29 31:34 36 38 39 44 45 47 49 50 51 53:55 59 67 69:71 73 74 76:79];
  330. subjectInfos.ctxIDs=[];
  331. %% DATE-TIME AND V1-V4 DEPTHS (Manually selected from CSDs)
  332. subjectInfos.penInfos(1).dateTime='2017-08-10_17-51-02'; % PEN 1
  333. subjectInfos.penInfos(1).V1Contacts.Depths=-0.8645+.15*(0:15);
  334. subjectInfos.penInfos(1).V4Contacts.Depths=-1+.15*(0:15); %
  335. subjectInfos.penInfos(2).dateTime='2017-08-14_10-09-28'; % PEN 2
  336. subjectInfos.penInfos(2).V1Contacts.Depths=-0.6852+.15*(0:15);
  337. subjectInfos.penInfos(2).V4Contacts.Depths=[]; %
  338. subjectInfos.penInfos(3).dateTime='2017-08-16_16-36-23'; % PEN 3
  339. subjectInfos.penInfos(3).V1Contacts.Depths=-1.0469+.15*(0:15);
  340. subjectInfos.penInfos(3).V4Contacts.Depths=-0.0063+.15*(0:15); %
  341. subjectInfos.penInfos(4).dateTime='2017-08-16_16-44-49'; % PEN 4
  342. subjectInfos.penInfos(4).V1Contacts.Depths=[];
  343. subjectInfos.penInfos(4).V4Contacts.Depths=-0.1438+.15*(0:15); %
  344. subjectInfos.penInfos(5).dateTime='2017-08-16_18-21-16'; % PEN 5
  345. subjectInfos.penInfos(5).V1Contacts.Depths=-0.93281+.15*(0:15);
  346. subjectInfos.penInfos(5).V4Contacts.Depths=-0.3062+.15*(0:15); %
  347. subjectInfos.penInfos(6).dateTime='2017-08-17_12-05-00'; % PEN 6
  348. subjectInfos.penInfos(6).V1Contacts.Depths=-1.0453+.15*(0:15);
  349. subjectInfos.penInfos(6).V4Contacts.Depths=-0.6062+.15*(0:15); %
  350. subjectInfos.penInfos(7).dateTime='2017-08-23_12-28-24'; % PEN 7
  351. subjectInfos.penInfos(7).V1Contacts.Depths=-1.1496+.15*(0:15);
  352. subjectInfos.penInfos(7).V4Contacts.Depths=-0.7187+.15*(0:15); %
  353. subjectInfos.penInfos(8).dateTime='2017-08-17_12-51-15'; % PEN 8
  354. subjectInfos.penInfos(8).V1Contacts.Depths=-0.59102+.15*(0:15);
  355. subjectInfos.penInfos(8).V4Contacts.Depths=-0.5937+.15*(0:15); %
  356. subjectInfos.penInfos(9).dateTime='2017-08-23_12-40-01'; % PEN 9
  357. subjectInfos.penInfos(9).V1Contacts.Depths=-1.0293+.15*(0:15);
  358. subjectInfos.penInfos(9).V4Contacts.Depths=-0.7562+.15*(0:15); %
  359. subjectInfos.penInfos(10).dateTime='2017-09-07_13-30-24'; % PEN 10
  360. subjectInfos.penInfos(10).V1Contacts.Depths=-0.98906+.15*(0:15);
  361. subjectInfos.penInfos(10).V4Contacts.Depths=-0.5562+.15*(0:15); %
  362. subjectInfos.penInfos(11).dateTime='2017-08-25_10-20-16'; % PEN 11
  363. subjectInfos.penInfos(11).V1Contacts.Depths=-1.5711+.15*(0:15);
  364. subjectInfos.penInfos(11).V4Contacts.Depths=-1.2063+.15*(0:15); %
  365. subjectInfos.penInfos(12).dateTime='2017-08-25_09-37-10'; % PEN 12
  366. subjectInfos.penInfos(12).V1Contacts.Depths=-1.068+.15*(0:15);
  367. subjectInfos.penInfos(12).V4Contacts.Depths=-0.6062+.15*(0:15); %
  368. subjectInfos.penInfos(13).dateTime='2017-08-29_13-42-45'; % PEN 14
  369. subjectInfos.penInfos(13).V1Contacts.Depths=-1.2867+.15*(0:15);
  370. subjectInfos.penInfos(13).V4Contacts.Depths=-0.7687+.15*(0:15); %
  371. subjectInfos.penInfos(14).dateTime='2017-08-31_10-58-27'; % PEN 15
  372. subjectInfos.penInfos(14).V1Contacts.Depths=-1.3305+.15*(0:15);
  373. subjectInfos.penInfos(14).V4Contacts.Depths=-0.9312+.15*(0:15); %
  374. subjectInfos.penInfos(15).dateTime='2017-09-07_14-09-17'; % PEN 16
  375. subjectInfos.penInfos(15).V1Contacts.Depths=-1.0676+.15*(0:15);
  376. subjectInfos.penInfos(15).V4Contacts.Depths=-0.9312+.15*(0:15); %
  377. subjectInfos.penInfos(16).dateTime='2017-09-07_14-07-34'; % PEN 17
  378. subjectInfos.penInfos(16).V1Contacts.Depths=-1.0168+.15*(0:15);
  379. subjectInfos.penInfos(16).V4Contacts.Depths=-0.9062+.15*(0:15); %
  380. subjectInfos.penInfos(17).dateTime='2017-08-03_14-38-16'; % PEN 18
  381. subjectInfos.penInfos(17).V1Contacts.Depths=-1.1496+.15*(0:15);
  382. subjectInfos.penInfos(17).V4Contacts.Depths=-0.1687+.15*(0:15); %
  383. subjectInfos.penInfos(18).dateTime='2017-08-04_14-25-44'; % PEN 19
  384. subjectInfos.penInfos(18).V1Contacts.Depths=-1.057+.15*(0:15);
  385. subjectInfos.penInfos(18).V4Contacts.Depths=-0.8879+.15*(0:15); %
  386. subjectInfos.penInfos(19).dateTime='2017-08-15_16-05-20'; % PEN 20
  387. subjectInfos.penInfos(19).V1Contacts.Depths=-1.0066+.15*(0:15);
  388. subjectInfos.penInfos(19).V4Contacts.Depths=-0.8937+.15*(0:15); %
  389. subjectInfos.penInfos(20).dateTime='2017-08-16_17-52-11'; % PEN 21
  390. subjectInfos.penInfos(20).V1Contacts.Depths=-1.027+.15*(0:15);
  391. subjectInfos.penInfos(20).V4Contacts.Depths=-1.0562+.15*(0:15); %
  392. subjectInfos.penInfos(21).dateTime='2017-08-17_14-31-50'; % PEN 22
  393. subjectInfos.penInfos(21).V1Contacts.Depths=-0.70273+.15*(0:15);
  394. subjectInfos.penInfos(21).V4Contacts.Depths=-0.7312+.15*(0:15); %
  395. subjectInfos.penInfos(22).dateTime='2017-08-25_09-44-38'; % PEN 23
  396. subjectInfos.penInfos(22).V1Contacts.Depths=[];
  397. subjectInfos.penInfos(22).V4Contacts.Depths=-0.4563+.15*(0:15); %
  398. subjectInfos.penInfos(23).dateTime='2017-09-19_16-04-07'; % PEN 24
  399. subjectInfos.penInfos(23).V1Contacts.Depths=-1.0473+.15*(0:15);
  400. subjectInfos.penInfos(23).V4Contacts.Depths=-0.9062+.15*(0:15); %
  401. subjectInfos.penInfos(24).dateTime='2017-09-25_13-18-58'; % PEN 25
  402. subjectInfos.penInfos(24).V1Contacts.Depths=-0.8832+.15*(0:15);
  403. subjectInfos.penInfos(24).V4Contacts.Depths=-0.9312+.15*(0:15); %
  404. subjectInfos.penInfos(25).dateTime='2017-09-21_17-57-59'; % PEN 26
  405. subjectInfos.penInfos(25).V1Contacts.Depths=-1.243+.15*(0:15);
  406. subjectInfos.penInfos(25).V4Contacts.Depths=-1.0437+.15*(0:15); %
  407. subjectInfos.penInfos(26).dateTime='2017-09-22_17-19-04'; % PEN 27
  408. subjectInfos.penInfos(26).V1Contacts.Depths=-1.0574+.15*(0:15);
  409. subjectInfos.penInfos(26).V4Contacts.Depths=-1.1812+.15*(0:15); %
  410. subjectInfos.penInfos(27).dateTime='2017-10-09_12-02-05'; % PEN 28
  411. subjectInfos.penInfos(27).V1Contacts.Depths=-1.2539+.15*(0:15);
  412. subjectInfos.penInfos(27).V4Contacts.Depths=-1.1812+.15*(0:15); %
  413. subjectInfos.penInfos(28).dateTime='2017-10-02_12-56-39'; % PEN 29
  414. subjectInfos.penInfos(28).V1Contacts.Depths=-1.0879+.15*(0:15);
  415. subjectInfos.penInfos(28).V4Contacts.Depths=-1.0312+.15*(0:15); %
  416. subjectInfos.penInfos(29).dateTime='2017-10-03_15-36-18'; % PEN 30
  417. subjectInfos.penInfos(29).V1Contacts.Depths=-1.3723+.15*(0:15);
  418. subjectInfos.penInfos(29).V4Contacts.Depths=-1.1812+.15*(0:15); %
  419. subjectInfos.penInfos(30).dateTime='2017-10-04_16-57-23'; % PEN 31
  420. subjectInfos.penInfos(30).V1Contacts.Depths=-0.84844+.15*(0:15);
  421. subjectInfos.penInfos(30).V4Contacts.Depths=-1.1812+.15*(0:15); %
  422. subjectInfos.penInfos(31).dateTime='2017-10-05_16-29-41'; % PEN 32
  423. subjectInfos.penInfos(31).V1Contacts.Depths=-1.2082+.15*(0:15);
  424. subjectInfos.penInfos(31).V4Contacts.Depths=-1.1812+.15*(0:15); %
  425. subjectInfos.penInfos(32).dateTime='2017-10-06_17-02-05'; % PEN 33
  426. subjectInfos.penInfos(32).V1Contacts.Depths=-1.1555+.15*(0:15);
  427. subjectInfos.penInfos(32).V4Contacts.Depths=-1.2187+.15*(0:15); %
  428. %% DEFAULT FORMAT INITIALIZATION
  429. for jj=1:length(subjectInfos.penIDs)
  430. subjectInfos.penInfos(jj).penNum=subjectInfos.penIDs(jj);
  431. subjectInfos.penInfos(jj).grcNum=subjectInfos.grcIDs(jj);
  432. subjectInfos.penInfos(jj).V1Contacts.Channels=1:16;
  433. subjectInfos.penInfos(jj).V4Contacts.Channels=17:32;
  434. subjectInfos.penInfos(jj).V1Contacts.ChRejected=[];
  435. subjectInfos.penInfos(jj).V1Contacts.ChSNRLowEq3=[];
  436. subjectInfos.penInfos(jj).V4Contacts.ChRejected=[];
  437. subjectInfos.penInfos(jj).V4Contacts.ChSNRLowEq3=[];
  438. subjectInfos.penInfos(jj).V1Contacts.Quality='OK';
  439. subjectInfos.penInfos(jj).V4Contacts.Quality='OK';
  440. %% ORIGINAL FILENAMES (DEPRECATED)
  441. %subjectInfos.penInfos(jj).originalFilePaths.lfpFilePath=[startPath1(1:end-28) 'Taylor/PEN' num2str(subjectInfos.penIDs(jj)) '/NLX_control/' subjectInfos.penInfos(jj).dateTime '/'];
  442. %subjectInfos.penInfos(jj).originalFilePaths.ctxFileName=[startPath1(1:end-28) 'Taylor/PEN' num2str(subjectInfos.penIDs(jj)) '/Cortex/GRCJDRU1.' num2str(subjectInfos.grcIDs(jj))];
  443. %subjectInfos.penInfos(jj).originalFilePaths.eventFileName=[subjectInfos.penInfos(jj).originalFilePaths.lfpFilePath 'Events.nev'];
  444. %subjectInfos.penInfos(jj).originalFilePaths.cscFilePath=subjectInfos.penInfos(jj).originalFilePaths.lfpFilePath;
  445. %% SELECTED TIME WINS FILE PATHS
  446. subjectInfos.penInfos(jj).selectedTimeWinsFilePaths.V1Contacts.LFPs=[startPath 'M2 V1 - LFP/Taylor_V1_LFP_PEN' num2str(subjectInfos.penIDs(jj)) '_sorted.mat'];
  447. subjectInfos.penInfos(jj).selectedTimeWinsFilePaths.V4Contacts.LFPs=[startPath 'M2 V4 - LFP/Taylor_V4_LFP_PEN' num2str(subjectInfos.penIDs(jj)) '_sorted.mat'];
  448. subjectInfos.penInfos(jj).selectedTimeWinsFilePaths.V1Contacts.MUAs=[startPath 'M2 V1 - MUA/Taylor_V1_MUA_PEN' num2str(subjectInfos.penIDs(jj)) '_sorted.mat'];
  449. subjectInfos.penInfos(jj).selectedTimeWinsFilePaths.V4Contacts.MUAs=[startPath 'M2 V4 - MUA/Taylor_V4_MUA_PEN' num2str(subjectInfos.penIDs(jj)) '_sorted.mat'];
  450. %% LAMINAR LAYER LABELS ASSIGNMENT
  451. if ~isempty(subjectInfos.penInfos(jj).V1Contacts.Depths)
  452. [~,minV1Ch]=min((subjectInfos.penInfos(jj).V1Contacts.Depths).^2);
  453. subjectInfos.penInfos(jj).V1Contacts.LaminarAlignments=(1:16)-minV1Ch;
  454. end
  455. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers((subjectInfos.penInfos(jj).V1Contacts.Depths>1))={'TS'}; % TOO SUPERFICIAL
  456. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V1Contacts.Depths>.25).*(subjectInfos.penInfos(jj).V1Contacts.Depths<=1)))={'S'}; % SUPRAGRANULAR
  457. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V1Contacts.Depths>=-.25).*(subjectInfos.penInfos(jj).V1Contacts.Depths<=.25)))={'G'}; % GRANULAR
  458. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V1Contacts.Depths>=-.75).*(subjectInfos.penInfos(jj).V1Contacts.Depths<-.25)))={'I'}; % INFRAGRANULAR
  459. subjectInfos.penInfos(jj).V1Contacts.LaminarLayers((subjectInfos.penInfos(jj).V1Contacts.Depths<-.75))={'TD'}; % TOO DEEP
  460. if ~isempty(subjectInfos.penInfos(jj).V4Contacts.Depths)
  461. [~,minV4Ch]=min((subjectInfos.penInfos(jj).V4Contacts.Depths).^2);
  462. subjectInfos.penInfos(jj).V4Contacts.LaminarAlignments=(1:16)-minV4Ch;
  463. end
  464. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers((subjectInfos.penInfos(jj).V4Contacts.Depths>1))={'TS'}; % TOO SUPERFICIAL
  465. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V4Contacts.Depths>.1).*(subjectInfos.penInfos(jj).V4Contacts.Depths<=1)))={'S'}; % SUPRAGRANULAR
  466. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V4Contacts.Depths>=-.1).*(subjectInfos.penInfos(jj).V4Contacts.Depths<=.1)))={'G'}; % GRANULAR
  467. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers(logical((subjectInfos.penInfos(jj).V4Contacts.Depths>=-.75).*(subjectInfos.penInfos(jj).V4Contacts.Depths<-.1)))={'I'}; % INFRAGRANULAR
  468. subjectInfos.penInfos(jj).V4Contacts.LaminarLayers((subjectInfos.penInfos(jj).V4Contacts.Depths<-.75))={'TD'}; % TOO DEEP
  469. end
  470. %% COLOR ORDERS [RF, OUT1, OUT2]
  471. subjectInfos.penInfos(1).grcColorOrder='RBG'; % PEN 1
  472. subjectInfos.penInfos(2).grcColorOrder='GRB'; % PEN 2
  473. subjectInfos.penInfos(3).grcColorOrder='GBR'; % PEN 3
  474. subjectInfos.penInfos(4).grcColorOrder='BRG'; % PEN 4
  475. subjectInfos.penInfos(5).grcColorOrder='BGR'; % PEN 5
  476. subjectInfos.penInfos(6).grcColorOrder='RGB'; % PEN 6
  477. subjectInfos.penInfos(7).grcColorOrder='RBG'; % PEN 7
  478. subjectInfos.penInfos(8).grcColorOrder='GRB'; % PEN 8
  479. subjectInfos.penInfos(9).grcColorOrder='GBR'; % PEN 9
  480. subjectInfos.penInfos(10).grcColorOrder='BRG'; % PEN 10
  481. subjectInfos.penInfos(11).grcColorOrder='BGR'; % PEN 11
  482. subjectInfos.penInfos(12).grcColorOrder='RGB'; % PEN 12
  483. subjectInfos.penInfos(13).grcColorOrder='GRB'; % PEN 14
  484. subjectInfos.penInfos(14).grcColorOrder='GBR'; % PEN 15
  485. subjectInfos.penInfos(15).grcColorOrder='BRG'; % PEN 16
  486. subjectInfos.penInfos(16).grcColorOrder='BGR'; % PEN 17
  487. subjectInfos.penInfos(17).grcColorOrder='RGB'; % PEN 18
  488. subjectInfos.penInfos(18).grcColorOrder='RBG'; % PEN 19
  489. subjectInfos.penInfos(19).grcColorOrder='GRB'; % PEN 20
  490. subjectInfos.penInfos(20).grcColorOrder='GBR'; % PEN 21
  491. subjectInfos.penInfos(21).grcColorOrder='BRG'; % PEN 22
  492. subjectInfos.penInfos(22).grcColorOrder='BGR'; % PEN 23
  493. subjectInfos.penInfos(23).grcColorOrder='RGB'; % PEN 24
  494. subjectInfos.penInfos(24).grcColorOrder='RBG'; % PEN 25
  495. subjectInfos.penInfos(25).grcColorOrder='GRB'; % PEN 26
  496. subjectInfos.penInfos(26).grcColorOrder='GBR'; % PEN 27
  497. subjectInfos.penInfos(27).grcColorOrder='BRG'; % PEN 28
  498. subjectInfos.penInfos(28).grcColorOrder='BGR'; % PEN 29
  499. subjectInfos.penInfos(29).grcColorOrder='RGB'; % PEN 30
  500. subjectInfos.penInfos(30).grcColorOrder='RBG'; % PEN 31
  501. subjectInfos.penInfos(31).grcColorOrder='GRB'; % PEN 32
  502. subjectInfos.penInfos(32).grcColorOrder='GBR'; % PEN 33
  503. %% CHANNEL RE-ARRANGEMENT/REJECTION ISSUES
  504. subjectInfos.penInfos(1).V1Contacts.Quality='UNCERTAIN'; % PEN 1
  505. subjectInfos.penInfos(1).V4Contacts.Quality='BAD';
  506. subjectInfos.penInfos(1).V1Contacts.ChSNRLowEq3=14:16;
  507. subjectInfos.penInfos(1).V4Contacts.ChSNRLowEq3=1:16;
  508. subjectInfos.penInfos(2).V4Contacts.Quality='NO V4 DATA'; % PEN 2
  509. subjectInfos.penInfos(2).V4Contacts.Channels=[];
  510. subjectInfos.penInfos(2).V1Contacts.ChSNRLowEq3=[15,16];
  511. subjectInfos.penInfos(3).V4Contacts.Quality='UNCERTAIN'; % PEN 3
  512. subjectInfos.penInfos(3).V1Contacts.ChSNRLowEq3=[1:4 13:16];
  513. subjectInfos.penInfos(3).V4Contacts.ChSNRLowEq3=[13,14,15,16];
  514. subjectInfos.penInfos(4).V1Contacts.Quality='NO V1 DATA'; % PEN 4
  515. subjectInfos.penInfos(4).V1Contacts.Channels=[];
  516. subjectInfos.penInfos(4).V4Contacts.ChSNRLowEq3=[14,15,16];
  517. subjectInfos.penInfos(5).V1Contacts.ChSNRLowEq3=13:16; % PEN 5
  518. subjectInfos.penInfos(5).V4Contacts.ChSNRLowEq3=9:16;
  519. subjectInfos.penInfos(6).V1Contacts.ChSNRLowEq3=[1 2 15 16]; % PEN 6
  520. subjectInfos.penInfos(6).V4Contacts.ChSNRLowEq3=14:16;
  521. subjectInfos.penInfos(7).V1Contacts.Quality='UNCERTAIN'; % PEN 7
  522. subjectInfos.penInfos(7).V1Contacts.ChSNRLowEq3=16;
  523. subjectInfos.penInfos(7).V4Contacts.ChSNRLowEq3=14:16;
  524. subjectInfos.penInfos(8).V1Contacts.Quality='BAD'; % PEN 8
  525. subjectInfos.penInfos(8).V1Contacts.ChSNRLowEq3=12:16;
  526. subjectInfos.penInfos(8).V4Contacts.ChSNRLowEq3=12:16;
  527. subjectInfos.penInfos(9).V1Contacts.ChSNRLowEq3=12:16; % PEN 9
  528. subjectInfos.penInfos(9).V4Contacts.ChSNRLowEq3=12:16;
  529. subjectInfos.penInfos(10).V1Contacts.Quality='UNCERTAIN'; % PEN 10
  530. subjectInfos.penInfos(10).V1Contacts.ChSNRLowEq3=13:16;
  531. subjectInfos.penInfos(10).V4Contacts.Quality='UNCERTAIN';
  532. subjectInfos.penInfos(10).V4Contacts.ChSNRLowEq3=15:16;
  533. subjectInfos.penInfos(11).V1Contacts.Quality='UNCERTAIN'; % PEN 11
  534. subjectInfos.penInfos(11).V1Contacts.ChSNRLowEq3=15:16;
  535. subjectInfos.penInfos(11).V4Contacts.Quality='UNCERTAIN';
  536. subjectInfos.penInfos(11).V4Contacts.ChSNRLowEq3=13:16;
  537. subjectInfos.penInfos(12).V1Contacts.ChSNRLowEq3=15:16; % PEN 12
  538. subjectInfos.penInfos(12).V4Contacts.ChSNRLowEq3=13:16;
  539. subjectInfos.penInfos(13).V1Contacts.Quality='UNCERTAIN'; % PEN 14
  540. subjectInfos.penInfos(13).V1Contacts.ChSNRLowEq3=15:16;
  541. subjectInfos.penInfos(13).V4Contacts.ChSNRLowEq3=13:16;
  542. subjectInfos.penInfos(14).V1Contacts.ChSNRLowEq3=15:16; % PEN 15
  543. subjectInfos.penInfos(14).V4Contacts.ChSNRLowEq3=12:16;
  544. subjectInfos.penInfos(15).V1Contacts.ChSNRLowEq3=16; % PEN 16
  545. subjectInfos.penInfos(15).V4Contacts.ChSNRLowEq3=15:16;
  546. subjectInfos.penInfos(16).V1Contacts.ChSNRLowEq3=14:16; % PEN 17
  547. subjectInfos.penInfos(16).V4Contacts.ChSNRLowEq3=13:16;
  548. subjectInfos.penInfos(17).V4Contacts.Quality='UNCERTAIN'; % PEN 18
  549. subjectInfos.penInfos(17).V1Contacts.ChSNRLowEq3=16;
  550. subjectInfos.penInfos(17).V4Contacts.ChSNRLowEq3=15:16;
  551. subjectInfos.penInfos(18).V4Contacts.Quality='BAD'; % PEN 19
  552. subjectInfos.penInfos(18).V4Contacts.ChRejected=1:3;
  553. subjectInfos.penInfos(18).V1Contacts.ChSNRLowEq3=15:16;
  554. subjectInfos.penInfos(18).V4Contacts.ChSNRLowEq3=13:16;
  555. subjectInfos.penInfos(19).V1Contacts.ChSNRLowEq3=14:16; % PEN 20
  556. subjectInfos.penInfos(19).V4Contacts.ChSNRLowEq3=13:16;
  557. subjectInfos.penInfos(20).V1Contacts.ChSNRLowEq3=14:16; % PEN 21
  558. subjectInfos.penInfos(20).V4Contacts.ChSNRLowEq3=14:16;
  559. subjectInfos.penInfos(21).V1Contacts.Quality='UNCERTAIN'; % PEN 22
  560. subjectInfos.penInfos(21).V1Contacts.ChSNRLowEq3=12:16;
  561. subjectInfos.penInfos(21).V4Contacts.ChSNRLowEq3=14:16;
  562. subjectInfos.penInfos(22).V1Contacts.Quality='NO V1 DATA'; % PEN 23
  563. subjectInfos.penInfos(22).V1Contacts.Channels=[];
  564. subjectInfos.penInfos(22).V4Contacts.ChSNRLowEq3=14:16;
  565. subjectInfos.penInfos(23).V1Contacts.Quality='UNCERTAIN'; % PEN 24
  566. subjectInfos.penInfos(23).V1Contacts.ChSNRLowEq3=14:16;
  567. subjectInfos.penInfos(23).V4Contacts.ChSNRLowEq3=15:16;
  568. subjectInfos.penInfos(24).V1Contacts.ChSNRLowEq3=12:16; % PEN 25
  569. subjectInfos.penInfos(24).V4Contacts.ChSNRLowEq3=15:16;
  570. subjectInfos.penInfos(25).V1Contacts.ChSNRLowEq3=15:16; % PEN 26
  571. subjectInfos.penInfos(25).V4Contacts.ChSNRLowEq3=15:16;
  572. subjectInfos.penInfos(26).V4Contacts.Quality='UNCERTAIN'; % PEN 27
  573. subjectInfos.penInfos(26).V1Contacts.ChSNRLowEq3=14:16;
  574. subjectInfos.penInfos(26).V4Contacts.ChSNRLowEq3=11:16;
  575. subjectInfos.penInfos(27).V4Contacts.Quality='BAD'; % PEN 28
  576. subjectInfos.penInfos(27).V1Contacts.ChSNRLowEq3=15:16;
  577. subjectInfos.penInfos(27).V4Contacts.ChSNRLowEq3=12:16;
  578. subjectInfos.penInfos(28).V4Contacts.Quality='UNCERTAIN'; % PEN 29
  579. subjectInfos.penInfos(28).V1Contacts.ChSNRLowEq3=14:16;
  580. subjectInfos.penInfos(28).V4Contacts.ChSNRLowEq3=12:16;
  581. subjectInfos.penInfos(29).V4Contacts.Quality='BAD'; % PEN 30
  582. subjectInfos.penInfos(29).V1Contacts.ChSNRLowEq3=16;
  583. subjectInfos.penInfos(29).V4Contacts.ChSNRLowEq3=11:16;
  584. subjectInfos.penInfos(30).V4Contacts.Quality='BAD'; % PEN 31
  585. subjectInfos.penInfos(30).V1Contacts.ChSNRLowEq3=13:16;
  586. subjectInfos.penInfos(30).V4Contacts.ChSNRLowEq3=12:16;
  587. subjectInfos.penInfos(31).V1Contacts.Quality='UNCERTAIN'; % PEN 32
  588. subjectInfos.penInfos(31).V1Contacts.ChSNRLowEq3=16;
  589. subjectInfos.penInfos(31).V4Contacts.Quality='BAD';
  590. subjectInfos.penInfos(31).V4Contacts.ChSNRLowEq3=12:16;
  591. subjectInfos.penInfos(32).V1Contacts.Quality='UNCERTAIN'; % PEN 33
  592. subjectInfos.penInfos(32).V1Contacts.ChSNRLowEq3=15:16;
  593. subjectInfos.penInfos(32).V4Contacts.Quality='BAD';
  594. subjectInfos.penInfos(32).V4Contacts.ChSNRLowEq3=[10,12:16];
  595. for jj=1:length(subjectInfos.penIDs)
  596. subjectInfos.penInfos(jj).V1Contacts.SelectedChs=subjectInfos.penInfos(jj).V1Contacts.Channels;
  597. if ~isempty(subjectInfos.penInfos(jj).V1Contacts.SelectedChs)
  598. subjectInfos.penInfos(jj).V1Contacts.SelectedChs(unique([find(subjectInfos.penInfos(jj).V1Contacts.Depths<=-.75 | subjectInfos.penInfos(jj).V1Contacts.Depths>=1) ...
  599. subjectInfos.penInfos(jj).V1Contacts.ChSNRLowEq3 subjectInfos.penInfos(jj).V1Contacts.ChRejected]))=[];
  600. end
  601. subjectInfos.penInfos(jj).V4Contacts.SelectedChs=subjectInfos.penInfos(jj).V4Contacts.Channels;
  602. if ~isempty(subjectInfos.penInfos(jj).V4Contacts.SelectedChs)
  603. subjectInfos.penInfos(jj).V4Contacts.SelectedChs(unique([find(subjectInfos.penInfos(jj).V4Contacts.Depths<=-.75 | subjectInfos.penInfos(jj).V4Contacts.Depths>=1) ...
  604. subjectInfos.penInfos(jj).V4Contacts.ChSNRLowEq3 subjectInfos.penInfos(jj).V4Contacts.ChRejected]))=[];
  605. end
  606. end
  607. otherwise
  608. error(['The Selected Subject name "' sSubjectName '" is not valid.']);
  609. end
  610. end