OSCR

Voice patches in the marmoset auditory cortex revealed by multimodal optical imaging.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

MATLAB · 403 lines · 19 KB · no license

  1. function varargout = CtrlThorlabsSciCams(varargin)
  2. % This is the control part of ThorlabsSci cameras
  3. %% For Standarized SubFunction Callback Control
  4. if nargin==0 % INITIATION
  5. % InitializeTASKS
  6. elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK?
  7. try
  8. if (nargout)
  9. [varargout{1:nargout}] = feval(varargin{:});
  10. % FEVAL switchyard, w/ output
  11. else
  12. feval(varargin{:});
  13. % FEVAL switchyard, w/o output
  14. end
  15. % feval('GUI_xxx', varargin);
  16. % feval(@GUI_xxx, varargin);
  17. catch MException
  18. rethrow(MException);
  19. end
  20. end
  21. function InitializeTASKS
  22. %% INITIALIZATION
  23. %% CALLBACK FUNCTIONS
  24. function msg = InitializeCallbacks(N)
  25. global Xin
  26. % set(Xin.UI.FigTLSC(N).hFig, 'CloseRequestFcn', [mfilename, '(@Cam_CleanUp,', num2str(N),')']);
  27. set(Xin.UI.FigTLSC(N).CP.hSys_CamShutter_PotenSlider, 'Callback', [mfilename, '(''Cam_Shutter'')']);
  28. set(Xin.UI.FigTLSC(N).CP.hSys_CamShutter_PotenEdit, 'Callback', [mfilename, '(''Cam_Shutter'')']);
  29. set(Xin.UI.FigTLSC(N).CP.hSys_CamDispGain_PotenSlider, 'Callback', [mfilename, '(''Cam_DispGain'')']);
  30. set(Xin.UI.FigTLSC(N).CP.hSys_CamDispGain_PotenEdit, 'Callback', [mfilename, '(''Cam_DispGain'')']);
  31. set(Xin.UI.FigTLSC(N).CP.hExp_RefImage_Momentary, 'Callback', [mfilename, '(''Ref_Image'')']);
  32. % set(Xin.UI.FigTLSC(N).CP.hMon_PreviewSwitch_Rocker, 'SelectionChangeFcn', [mfilename, '(''Preview_Switch'')']);
  33. %% LOG MSG
  34. msg = [datestr(now, 'yy/mm/dd HH:MM:SS.FFF') '\tInitializeCallbacks\tSetup the Thorlabs Sci Camera #' ...
  35. num2str(N), '''s GUI Callbacks\r\n'];
  36. updateMsg(Xin.D.Exp.hLog, msg);
  37. function Cam_Shutter(varargin)
  38. global Xin
  39. %% get the numbers
  40. if nargin==0
  41. % called by GUI:
  42. N = get(gcbo, 'UserData');
  43. uictrlstyle = get(gcbo, 'Style');
  44. switch uictrlstyle
  45. case 'slider'; Shutter = get(gcbo, 'value');
  46. case 'edit'; Shutter = str2double(get(gcbo,'string'));
  47. otherwise; errordlg('What''s the hell?');
  48. return;
  49. end
  50. else
  51. % called by general update: e.g. Cam_Shutter(1, 20.00)
  52. N = varargin{1}; % Camera number
  53. Shutter = varargin{2}; % Shutter value (ms)
  54. end
  55. %% check the constraints
  56. maxshutter = Xin.HW.Thorlabs.hSciCam{N}.ExposureTimeRange_us.Maximum/1000;
  57. minshutter = Xin.HW.Thorlabs.hSciCam{N}.ExposureTimeRange_us.Minimum/1000;
  58. if isnan(Shutter) || Shutter<minshutter || Shutter>maxshutter
  59. Shutter = Xin.D.Sys.ThorlabsSciCam(N).Shutter;
  60. warndlg('Input Shutter value is out of the device constraits')
  61. else
  62. Xin.D.Sys.ThorlabsSciCam(N).Shutter = Shutter;
  63. end
  64. Xin.HW.Thorlabs.hSciCam{N}.ExposureTime_us = Xin.D.Sys.ThorlabsSciCam(N).Shutter*1000;
  65. s = sprintf('%05.2f',Shutter);
  66. set(Xin.UI.FigTLSC(N).CP.hSys_CamShutter_PotenSlider, 'value', Shutter);
  67. set(Xin.UI.FigTLSC(N).CP.hSys_CamShutter_PotenEdit, 'string', s);
  68. %% LOG MSG
  69. msg = [datestr(now, 'yy/mm/dd HH:MM:SS.FFF') '\tCam_Shutter\tSetup the ThorlabsSci Camera #' ...
  70. num2str(N), '''s Shutter as: ' s ' (ms)\r\n'];
  71. updateMsg(Xin.D.Exp.hLog, msg);
  72. function Cam_DispGain(varargin)
  73. global Xin
  74. %% get the numbers
  75. if nargin==0
  76. % called by GUI:
  77. N = get(gcbo, 'UserData');
  78. uictrlstyle = get(gcbo, 'Style');
  79. switch uictrlstyle
  80. case 'slider'; DispGainBit = get(gcbo, 'value');
  81. DispGainNum = 2^DispGainBit;
  82. case 'edit'; DispGainNum = str2double(get(gcbo,'string'));
  83. DispGainBit = log2(DispGainNum);
  84. otherwise; errordlg('What''s the hell?');
  85. return;
  86. end
  87. else
  88. % called by general update: e.g. Disp_Gain(16)
  89. N = varargin{1}; % Camera number
  90. DispGainNum = varargin{2}; % DispGain number
  91. DispGainBit = log2(DispGainNum);
  92. end
  93. %% Check whether the number is valid to update
  94. if ismember(DispGainBit, Xin.D.Sys.Camera.DispGainBitRange)
  95. Xin.D.Sys.ThorlabsSciCam(N).DispGainBit = DispGainBit;
  96. Xin.D.Sys.ThorlabsSciCam(N).DispGainNum = DispGainNum;
  97. end
  98. s = sprintf(' %d', Xin.D.Sys.ThorlabsSciCam(N).DispGainNum);
  99. set(Xin.UI.FigTLSC(N).CP.hSys_CamDispGain_PotenSlider, 'value', Xin.D.Sys.ThorlabsSciCam(N).DispGainBit);
  100. set(Xin.UI.FigTLSC(N).CP.hSys_CamDispGain_PotenEdit, 'string', s);
  101. %% LOG MSG
  102. msg = [datestr(now, 'yy/mm/dd HH:MM:SS.FFF') '\tDisp_Gain\tSetup the ThorlabsSci Camera #' ...
  103. num2str(N), '''s DISP gain as: ' s '\r\n'];
  104. updateMsg(Xin.D.Exp.hLog, msg);
  105. function Ref_Image(varargin)
  106. global Xin
  107. %% Get the Inputs
  108. if nargin==0
  109. % called by GUI:
  110. N = get(gcbo, 'UserData');
  111. else
  112. % called by general update: e.g. Ref_Image(2)
  113. N = varargin{1};
  114. end
  115. %% Setup Parameters
  116. imageinfo = {...
  117. ['System Cam Shutter: ', sprintf('%5.2f',Xin.D.Sys.ThorlabsSciCam(N).Shutter), ' (ms); '],...
  118. ['System Cam DispGainNum: ', num2str(Xin.D.Sys.ThorlabsSciCam(N).DispGainNum), ' (frames); '],...
  119. };
  120. if ~exist(Xin.D.Exp.DataDir, 'dir')
  121. mkdir(Xin.D.Exp.DataDir);
  122. end
  123. imageinfo = [imageinfo,{...
  124. ['System Light Source: ', Xin.D.Sys.Light.Source, '; '],...
  125. ['System Light Wavelength: ', num2str(Xin.D.Sys.Light.Wavelength), 'nm; '],...
  126. ['System Light Port: ', Xin.D.Sys.Light.Port, '; '],...
  127. ['System Light Diffuser: ', num2str(Xin.D.Sys.Light.Diffuser), 'º; '],...
  128. ['System Light Head Cube: ', Xin.D.Sys.Light.HeadCube, '; '],...
  129. ['System Camera Lens Angle: ', num2str(Xin.D.Sys.CameraLens.Angle), 'º; '],...
  130. ['System Camera Lens Aperture: ', sprintf('f/%.2g',Xin.D.Sys.CameraLens.Aperture), '; '],...
  131. ['Monkey ID: ', Xin.D.Mky.ID, '; '],...
  132. ['Monkey Side: ', Xin.D.Mky.Side, '; '],...
  133. ['Monkey Prep: ', Xin.D.Mky.Prep, '; '],...
  134. ['Experiment Date: ', Xin.D.Exp.DateStr, '; '],...
  135. ['Experiment Depth: ', sprintf('%d',Xin.D.Exp.Depth), ' (LT1 fine turn); ']...
  136. }];
  137. ShutterMultiplier = Xin.D.Sys.ThorlabsSciCam(N).DispGainNum* ...
  138. Xin.D.Sys.Camera.SaveBinNum^2;
  139. % DataBit = 16;
  140. % PowerMeterFlag = 0;
  141. DataNumApp = ['_',...
  142. Xin.D.Sys.Light.Source, '_',...
  143. Xin.D.Sys.Light.Port, '_',...
  144. Xin.D.Sys.Light.HeadCube];
  145. %% Questdlg the information
  146. promptinfo = [...
  147. imageinfo,...
  148. {''},...
  149. {'Are these settings correct?'}];
  150. choice = questdlg(promptinfo,...
  151. 'Imaging conditions:',...
  152. 'No, Cancel and Reset', 'Yes, Take an Image',...
  153. 'No, Cancel and Reset');
  154. switch choice
  155. case 'No, Cancel and Reset'; return;
  156. case 'Yes, Take an Image'
  157. end
  158. %% Setup the Acquisation
  159. Xin.D.Exp.TakingRefImage = 1;
  160. Xin.HW.Thorlabs.hSciCam{N}.ExposureTime_us = Xin.D.Sys.ThorlabsSciCam(N).Shutter *1000 *ShutterMultiplier;
  161. SetupAndArm( N, 1, 1, 'soft');
  162. % N, bin, FPT, trigger
  163. %% Issue Camera Trigger & Run
  164. Xin.HW.Thorlabs.hSciCam{N}.IssueSoftwareTrigger;
  165. while Xin.D.Sys.ThorlabsSciCam(N).Running
  166. pause(Xin.D.Sys.ThorlabsSciCam(N).DispPeriod/100);
  167. status = updatePreviewFrameThorlabs(N);
  168. if status
  169. Xin.D.Sys.ThorlabsSciCam(N).Running = false;
  170. end
  171. end
  172. if (isvalid(Xin.HW.Thorlabs.hSciCam{N}))
  173. Xin.HW.Thorlabs.hSciCam{N}.Disarm;
  174. end
  175. Xin.D.Exp.TakingRefImage = 0;
  176. Xin.HW.Thorlabs.hSciCam{N}.ExposureTime_us = Xin.D.Sys.ThorlabsSciCam(N).Shutter *1000;
  177. Xin.D.Sys.ThorlabsSciCam(N).rawFrameData = uint16(Xin.D.Sys.ThorlabsSciCam(N).imageFrame.ImageData.ImageData_monoOrBGR);
  178. Xin.D.Sys.ThorlabsSciCam(N).RefImage = reshape(Xin.D.Sys.ThorlabsSciCam(N).rawFrameData,...
  179. [ Xin.D.Sys.ThorlabsSciCam(N).rawWidth,...
  180. Xin.D.Sys.ThorlabsSciCam(N).rawHeight])';
  181. %% Power Meter
  182. % if ~strcmp(Xin.D.Sys.Light.Monitoring, 'N') && strcmp(CamName, 'Grasshopper3 GS3-U3-23S6M')
  183. % Xin.D.Sys.PowerMeter{1}.WAVelength = Xin.D.Sys.Light.Wavelength;
  184. % Xin.D.Sys.PowerMeter{1}.INPutFILTering = 1*strcmp(Xin.D.Sys.Light.Monitoring, 'S');
  185. % % 15Hz :1, 100kHz :0
  186. % Xin.D.Sys.PowerMeter{1}.AVERageCOUNt = round( (TriggerRepeat+1)*(1/Xin.HW.Thorlabs.hSciCam(N).hSrc.FrameRate)/0.0003 );
  187. % % average Counts (1~=.3ms)
  188. % Xin.D.Sys.PowerMeter{1}.InitialMEAsurement= 1; % send the initial messurement request
  189. % SetupThorlabsPowerMeters('Xin');
  190. % pause((TriggerRepeat+1)*(1/Xin.HW.Thorlabs.hSciCam(N).hSrc.FrameRate)+0.1);
  191. % % wait for the power
  192. % % integration
  193. % power = Xin.HW.Thorlabs.PM100{1}.h.fscanf;
  194. % imageinfo = [ imageinfo,...
  195. % {['Power Port: ', power, ' (W); ']} ];
  196. % end
  197. %% Save the Image
  198. datestrfull = datestr(now, 30);
  199. dataname = [datestrfull(3:end), DataNumApp];
  200. figure(...
  201. 'Name', dataname,...
  202. 'NumberTitle', 'off',...
  203. 'Color', Xin.UI.C.BG,...
  204. 'MenuBar', 'none',...
  205. 'DoubleBuffer', 'off');
  206. imshow(Xin.D.Sys.ThorlabsSciCam(N).RefImage);
  207. box on
  208. imagedescription = strjoin(imageinfo);
  209. imwrite(Xin.D.Sys.ThorlabsSciCam(N).RefImage, [Xin.D.Exp.DataDir, dataname, '.tif'],...
  210. 'Compression', 'deflate',...
  211. 'Description', imagedescription);
  212. %% LOG MSG
  213. msg = [datestr(now, 'yy/mm/dd HH:MM:SS.FFF') '\tRef_Image\tA reference image has been taken from ThorlabsSci Camera #'...
  214. num2str(N), ':xxx \r\n'];
  215. updateMsg(Xin.D.Exp.hLog, msg);
  216. function SoftwareTriggerPreview(varargin)
  217. global Xin
  218. %% get the numbers
  219. if nargin==0
  220. % called by GUI:
  221. else
  222. % called by general update: e.g. Cam_Shutter(1, 20.00)
  223. N = varargin{1}; % Camera number
  224. end
  225. set(Xin.UI.FigTLSC(N).CP.hExp_RefImage_Momentary, 'Enable', 'off');
  226. SetupAndArm( N, 2, 0, 'soft');
  227. % N, bin, FPT, trigger
  228. %% Issue Camera Trigger & Run
  229. Xin.HW.Thorlabs.hSciCam{N}.IssueSoftwareTrigger;
  230. while Xin.D.Sys.ThorlabsSciCam(N).Running
  231. pause(Xin.D.Sys.ThorlabsSciCam(N).DispPeriod/100);
  232. updatePreviewFrameThorlabs(N);
  233. end
  234. %% Stop the camera
  235. if (isvalid(Xin.HW.Thorlabs.hSciCam{N}))
  236. Xin.HW.Thorlabs.hSciCam{N}.Disarm;
  237. end
  238. set(Xin.UI.FigTLSC(N).CP.hExp_RefImage_Momentary, 'Enable', 'on');
  239. function SetupAndArm(N, bin, FPT, trigger)
  240. global Xin
  241. %% Allocate Memory for the Image
  242. Xin.D.Sys.ThorlabsSciCam(N).BinX = bin;
  243. Xin.D.Sys.ThorlabsSciCam(N).BinY = bin;
  244. Xin.D.Sys.ThorlabsSciCam(N).rawHeight = Xin.D.Sys.ThorlabsSciCam(N).ROIHeight/Xin.D.Sys.ThorlabsSciCam(N).BinY;
  245. Xin.D.Sys.ThorlabsSciCam(N).rawWidth = Xin.D.Sys.ThorlabsSciCam(N).ROIWidth /Xin.D.Sys.ThorlabsSciCam(N).BinX;
  246. Xin.D.Sys.ThorlabsSciCam(N).rawFrameData = uint16(zeros(1, Xin.D.Sys.ThorlabsSciCam(N).rawWidth*...
  247. Xin.D.Sys.ThorlabsSciCam(N).rawHeight));
  248. Xin.D.Sys.ThorlabsSciCam(N).rawFrame = reshape(Xin.D.Sys.ThorlabsSciCam(N).rawFrameData,...
  249. [ Xin.D.Sys.ThorlabsSciCam(N).rawWidth,...
  250. Xin.D.Sys.ThorlabsSciCam(N).rawHeight])';
  251. Xin.D.Sys.ThorlabsSciCam(N).DispTimer = second(now);
  252. Xin.D.Sys.ThorlabsSciCam(N).frameTimerBuff = now;
  253. Xin.D.Sys.ThorlabsSciCam(N).frameTimerCurr = now;
  254. Xin.D.Sys.ThorlabsSciCam(N).frameNumBuff = 0;
  255. Xin.D.Sys.ThorlabsSciCam(N).frameNumCurr = 0;
  256. Xin.D.Sys.ThorlabsSciCam(N).DispTimer = now;
  257. Xin.D.Sys.ThorlabsSciCam(N).Running = true;
  258. %% Setup Camera
  259. roiAndBin = Xin.HW.Thorlabs.hSciCam{N}.ROIAndBin;
  260. roiAndBin.BinX = int32(Xin.D.Sys.ThorlabsSciCam(N).BinX);
  261. roiAndBin.BinY = int32(Xin.D.Sys.ThorlabsSciCam(N).BinY);
  262. roiAndBin.ROIOriginX_pixels = Xin.D.Sys.ThorlabsSciCam(N).ROIOriginX; % 0-1919
  263. roiAndBin.ROIOriginY_pixels = Xin.D.Sys.ThorlabsSciCam(N).ROIOriginY; % 0-1079
  264. roiAndBin.ROIWidth_pixels = Xin.D.Sys.ThorlabsSciCam(N).ROIWidth;
  265. roiAndBin.ROIHeight_pixels = Xin.D.Sys.ThorlabsSciCam(N).ROIHeight;
  266. Xin.HW.Thorlabs.hSciCam{N}.ROIAndBin = roiAndBin;
  267. Xin.HW.Thorlabs.hSciCam{N}.FramesPerTrigger_zeroForUnlimited = FPT; % 0 = continuous
  268. switch trigger
  269. case 'soft'; Xin.HW.Thorlabs.hSciCam{N}.OperationMode = Thorlabs.TSI.TLCameraInterfaces.OperationMode.SoftwareTriggered;
  270. case 'hard'; Xin.HW.Thorlabs.hSciCam{N}.OperationMode = Thorlabs.TSI.TLCameraInterfaces.OperationMode.HardwareTriggered;
  271. end
  272. Xin.HW.Thorlabs.hSciCam{N}.Arm;
  273. %% Search & allocate the mode
  274. if strcmp(trigger, 'hard'); ic = 3;
  275. elseif strcmp(trigger, 'soft') && FPT ==0; ic = 2;
  276. elseif strcmp(trigger, 'soft') && FPT >0; ic = 1;
  277. end
  278. %% Update Trigger GUI
  279. try
  280. a = get(Xin.UI.FigTLSC(N).CP.hSes_CamTrigger_Rocker, 'Children');
  281. set(Xin.UI.FigTLSC(N).CP.hSes_CamTrigger_Rocker, 'SelectedObject', a(ic));
  282. for j = 1:3
  283. if j == ic
  284. set(a(j), 'backgroundcolor', Xin.UI.C.SelectB);
  285. else
  286. set(a(j), 'backgroundcolor', Xin.UI.C.TextBG);
  287. end
  288. end
  289. catch
  290. disp('GUI update on trigger mode does not apply');
  291. end
  292. %% LOG MSG
  293. msg = [datestr(now, 'yy/mm/dd HH:MM:SS.FFF') '\tSetupAndArm\tSetup the ThorlabsSci Camera #' ...
  294. num2str(N), '''s Bin#=', num2str(bin), '; ', trigger, 'wareTrigger for ' ...
  295. FPT 'frames (0=continuous)\r\n'];
  296. updateMsg(Xin.D.Exp.hLog, msg);
  297. % function Preview_Switch(varargin)
  298. % global Xin
  299. % %% where the call is from
  300. % if nargin==0
  301. % % called by GUI: Camera_Preview
  302. % N = get(get(get(gcbo, 'SelectedObject'), 'Parent'), 'UserData');
  303. % val = get(get(gcbo,'SelectedObject'),'string');
  304. % [~, val] = strtok(val, ' ');
  305. % val = val(2:end);
  306. % else
  307. % % called by general update: Prreview_Switch(1, 'ON') or Prreview_Switch(1, 'OFF')
  308. % N = varargin{1}; % Camera number
  309. % val = varargin{2}; % 'ON' or 'OFF'
  310. % end
  311. % hc = get(Xin.UI.FigTLSC(N).CP.hMon_PreviewSwitch_Rocker, 'Children');
  312. % for j = 1:3
  313. % switch j
  314. % case 1
  315. % case 2 % OFF
  316. % if strcmp(val, 'OFF')
  317. % set(hc(j), 'backgroundcolor', Xin.UI.C.SelectB);
  318. % set(Xin.UI.FigTLSC(N).CP.hMon_PreviewSwitch_Rocker,...
  319. % 'SelectedObject', hc(j));
  320. % stoppreview(Xin.HW.Thorlabs.hSciCam(N).hVid);
  321. % Xin.D.Sys.ThorlabsSciCam(N).DispImg = ...
  322. % uint8(0*Xin.D.Sys.ThorlabsSciCam(N).DispImg);
  323. % set(Xin.UI.FigTLSC(N).hImage, 'CData',...
  324. % Xin.D.Sys.ThorlabsSciCam(N).DispImg);
  325. % else
  326. % set(hc(j), 'backgroundcolor', Xin.UI.C.TextBG);
  327. % end
  328. % case 3 % ON
  329. % if strcmp(val, 'ON')
  330. % set(hc(j), 'backgroundcolor', Xin.UI.C.SelectB);
  331. % set(Xin.UI.FigTLSC(N).CP.hMon_PreviewSwitch_Rocker,...
  332. % 'SelectedObject', hc(j));
  333. % setappdata(Xin.UI.FigTLSC(N).hImageHide,...
  334. % 'UpdatePreviewWindowFcn',...
  335. % Xin.D.Sys.ThorlabsSciCam(N).UpdatePreviewWindowFcn);
  336. % preview(Xin.HW.Thorlabs.hSciCam(N).hVid,...
  337. % Xin.UI.FigTLSC(N).hImageHide);
  338. % else
  339. % set(hc(j), 'backgroundcolor', Xin.UI.C.TextBG);
  340. % end
  341. % otherwise
  342. % end
  343. % end
  344. % %% LOG MSG
  345. % msg = [datestr(now, 'yy/mm/dd HH:MM:SS.FFF') '\tMon_PreviewSwitch\tThorlabsSci Camera #' ...
  346. % num2str(N), ' switched to ', val, '\r\n'];
  347. % updateMsg(Xin.D.Exp.hLog, msg);
  348. % function Trigger_Mode(varargin)
  349. % global Xin
  350. % N = varargin{1};
  351. % mode = varargin{2};
  352. % %% Search & allocate the mode
  353. % for i = 1: length(Xin.D.Sys.ThorlabsSciCam(N).TriggerMode)
  354. % if strcmp(Xin.D.Sys.ThorlabsSciCam(N).TriggerMode(i).Name, mode)
  355. % ic = i;
  356. % end
  357. % end
  358. % Xin.D.Sys.ThorlabsSciCam(N).TriggerName = Xin.D.Sys.ThorlabsSciCam(N).TriggerMode(ic).Name;
  359. % Xin.D.Sys.ThorlabsSciCam(N).TriggerType = Xin.D.Sys.ThorlabsSciCam(N).TriggerMode(ic).TriggerType;
  360. % Xin.D.Sys.ThorlabsSciCam(N).TriggerCondition = Xin.D.Sys.ThorlabsSciCam(N).TriggerMode(ic).TriggerCondition;
  361. % Xin.D.Sys.ThorlabsSciCam(N).TriggerSource = Xin.D.Sys.ThorlabsSciCam(N).TriggerMode(ic).TriggerSource;
  362. % %% Update Trigger GUI
  363. % try
  364. % a = get(Xin.UI.FigTLSC(N).CP.hSes_CamTrigger_Rocker, 'Children');
  365. % set(Xin.UI.FigTLSC(N).CP.hSes_CamTrigger_Rocker, 'SelectedObject', a(ic));
  366. % for j = 1:3
  367. % if j == ic
  368. % set(a(j), 'backgroundcolor', Xin.UI.C.SelectB);
  369. % else
  370. % set(a(j), 'backgroundcolor', Xin.UI.C.TextBG);
  371. % end
  372. % end
  373. % catch
  374. % disp('GUI update on trigger mode does not apply');
  375. % end
  376. % %% Set the VideoInput object
  377. % triggerconfig(Xin.HW.Thorlabs.hSciCam(N).hVid, ...
  378. % Xin.D.Sys.ThorlabsSciCam(N).TriggerType,...
  379. % Xin.D.Sys.ThorlabsSciCam(N).TriggerCondition,...
  380. % Xin.D.Sys.ThorlabsSciCam(N).TriggerSource);
  381. % %% LOG MSG
  382. % msg = [datestr(now, 'yy/mm/dd HH:MM:SS.FFF') '\tTrigger_Mode\tSetup the ThorlabsSci Camera #' ...
  383. % num2str(N), '''s Trigger mode selected as: "' ...
  384. % Xin.D.Sys.ThorlabsSciCam(N).TriggerName '"\r\n'];
  385. % updateMsg(Xin.D.Exp.hLog, msg);

CtrlThorlabsSciCams.m at commit 290938b, no license · at the source

Overview

  1. Laboratory of Auditory Neurophysiology, Department of Biomedical Engineering, Johns Hopkins University School of Medicine, Baltimore, MD 21205, USA
Institutions: Johns Hopkins University (United States); Johns Hopkins Medicine (United States)
Journal: Science advances, volume 12, issue 43, article eaeh3885
Dates: received 28 March 2026; accepted 21 September 2026; published online 21 October 2026; in print October 2026
Type: Research article · Language: English
License: CC BY-NC
Identifiers: DOI 10.1126/sciadv.aeh3885 · PMID 42905840 · PMCID PMC13686007 · OpenAlex W7223093976
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: human (organism), non-human primate (organism), systems (subfield)
Methods: Connectivity, Spectral & time-frequency, Statistics, fMRI & imaging, Single-unit activity, calcium imaging
MeSH: Auditory Cortex*, Callithrix*, Multimodal Imaging*, Optical Imaging*, Vocalization, Animal*, Voice*, Acoustic Stimulation, Animals, Brain Mapping, Female, Humans, Male (* major topic)
Topic: Neuroscience and Music Perception (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Citations: not cited yet (Europe PMC); 50 references in the paper

Abstract

Species-specific vocalizations (including human voices) are important for the survival and social interactions of both humans and animals. In both humans and nonhuman primates, voice/vocalization–selective regions have been identified on the lateral temporal cortex. Here, we provide evidence of localized and hierarchically organized voice patches in the auditory cortex of the common marmoset, a highly vocal New World primate, using multimodal optical imaging techniques that directly measure activity from the smooth cortical surface in a noise-controlled environment. Both intrinsic imaging and calcium imaging data revealed two discrete voice patches in a region of the auditory cortex. Our results provided precise functional localization of the two voice patches (posterior and anterior) by anchoring their positions to the tonotopic map and core/noncore areas of the auditory cortex. Both patches preferentially respond to marmoset vocalizations, exhibit quantifiable neural selectivity beyond spectral features, and encode call type and caller identity. Distinct response properties reveal functional differentiation between the posterior and anterior voice patches, with latency differences consistent with a hierarchical relationship. These findings provide new evidence for an evolutionarily conserved cortical architecture in primates that supports vocal communication via voice patches, analogous to face processing systems in human and nonhuman primate brains.

Reproduced under the paper's license (CC BY-NC), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above.

x-song-x/XINTRINSIC

License: none: the authors keep all their rights
State: the link answers, verified on 25 October 2026
Evidence: files inventoried
Commit: 290938bfccb0d1f2c3a7c7c572e91012297ee4ef, 26 July 2022
Languages: MATLAB (10)
Size: 16 files, 10 scripts
Software Heritage: not archived
Found in: the text, “Marmoset preparation and multimodal optical imag”
Holds: README, documentation
Not found: license file, CITATION.cff, environment file, tests, continuous integration
Tools: Image Processing Toolbox (1 file)
Availability: 1 check, the latest on 25 October 2026: the link answers
  • 25 October 2026: the link answers
11 files

OSF 6hb2w

License: none: the authors keep all their rights
State: the link answers, verified on 25 October 2026
Evidence: files inventoried
Size: 6 files, 0 scripts
Software Heritage: not checked
Found in: “Data, code, and materials availability:”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 25 October 2026: the link answers (HTTP 200)
  • 25 October 2026: the link answers (HTTP 200)

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 10 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data, code, and materials availability

All data and code needed to evaluate and reproduce the results in the paper are present in the paper and/or the Supplementary Materials and are deposited in the Open Science Foundation repository (OSF): https://doi.org/10.17605/OSF.IO/6HB2W. This study did not generate new materials.

Reproduced under the paper's license (CC BY-NC), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 25 October 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 12 MeSH terms, 49 references.

Cite

This paper

Zhang, Y., Chen, C., Song, X., Guo, Y., & Wang, X. (2026). Voice patches in the marmoset auditory cortex revealed by multimodal optical imaging. Science advances, 12(43), eaeh3885. https://doi.org/10.1126/sciadv.aeh3885

BibTeX

@article{zhang2026voice,
author = {Zhang, Yang and Chen, Chenggang and Song, Xindong and Guo, Yueqi and Wang, Xiaoqin},
title = {{Voice patches in the marmoset auditory cortex revealed by multimodal optical imaging}},
journal = {Science advances},
year = {2026},
month = oct,
volume = {12},
number = {43},
pages = {eaeh3885},
publisher = {American Association for the Advancement of Science},
issn = {2375-2548},
doi = {10.1126/sciadv.aeh3885},
url = {https://doi.org/10.1126/sciadv.aeh3885},
pmid = {42905840},
pmcid = {PMC13686007}
}

RIS

TY - JOUR
AU - Zhang, Yang
AU - Chen, Chenggang
AU - Song, Xindong
AU - Guo, Yueqi
AU - Wang, Xiaoqin
TI - Voice patches in the marmoset auditory cortex revealed by multimodal optical imaging
T2 - Science advances
J2 - Sci Adv
PY - 2026
DA - 2026/10/21
VL - 12
IS - 43
SP - eaeh3885
SN - 2375-2548
PB - American Association for the Advancement of Science
DO - 10.1126/sciadv.aeh3885
UR - https://doi.org/10.1126/sciadv.aeh3885
LA - en
ER -

CSL-JSON

{
"id": "10.1126/sciadv.aeh3885",
"type": "article-journal",
"title": "Voice patches in the marmoset auditory cortex revealed by multimodal optical imaging",
"container-title": "Science advances",
"author": [
{
"family": "Zhang",
"given": "Yang"
},
{
"family": "Chen",
"given": "Chenggang"
},
{
"family": "Song",
"given": "Xindong"
},
{
"family": "Guo",
"given": "Yueqi"
},
{
"family": "Wang",
"given": "Xiaoqin"
}
],
"container-title-short": "Sci Adv",
"volume": "12",
"issue": "43",
"page": "eaeh3885",
"DOI": "10.1126/sciadv.aeh3885",
"PMID": "42905840",
"PMCID": "PMC13686007",
"ISSN": "2375-2548",
"publisher": "American Association for the Advancement of Science",
"URL": "https://doi.org/10.1126/sciadv.aeh3885",
"language": "en",
"issued": {
"date-parts": [
[
2026,
10,
21
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1073/pnas.2313831121
Evolutionary continuity and divergence of auditory dorsal and ventral pathways in primates revealed by ultra-high field diffusion MRI.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: non-human primate, 18 references, 2 authors
[2] doi:10.1038/s41467-025-58034-8 [code]
Location-specific neural facilitation in marmoset auditory cortex.
Journal: Nature communications
In common: non-human primate, systems, 3 references, 2 authors
[3] doi:10.1371/journal.pbio.3003707 [code]
Behavioral engagement facilitates auditory neuron responses beyond their receptive fields.
Journal: PLoS biology
In common: Image Processing Toolbox, non-human primate, systems, 2 references, 2 authors
[4] doi:10.1038/s41467-023-42052-5 [code]
Frontal cortex activity during the production of diverse social communication calls in marmoset monkeys.
Journal: Nature communications
In common: non-human primate, 5 references, author Xiaoqin Wang
[5] doi:10.1371/journal.pbio.3001675 [code]
Neural responses in human superior temporal cortex support coding of voice representations.
Journal: PLoS biology
In common: 8 references
[6] doi:10.3389/fncir.2026.1821810
Developmental trajectories of vocal behaviors in common marmosets as a reference framework for neurobehavioral studies.
Journal: Frontiers in neural circuits
In common: non-human primate, 6 references
[7] doi:10.1038/s42003-025-09241-y [code]
Mapping functional homologies between human and marmoset brain networks using movie-driven ultra-high field fMRI.
Journal: Communications biology
In common: non-human primate, 6 references
[8] doi:10.1162/imag_a_00483 [code]
An open access resource for marmoset neuroscientific apparatus.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: non-human primate, 6 references
[9] doi:10.1038/s41598-025-31437-9 [code]
Comparison of human and marmoset basic-level face categorization based on shape.
Journal: Scientific reports
In common: non-human primate, 6 references
[10] doi:10.1073/pnas.2405588121
A population of neurons selective for human voice in the monkey brain.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: non-human primate, 6 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1126/sciadv.aeh3885.svg)](https://openscicode.org/badge/doi/10.1126/sciadv.aeh3885)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1126/sciadv.aeh3885.svg
   :target: https://openscicode.org/badge/doi/10.1126/sciadv.aeh3885
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1126/sciadv.aeh3885"><img src="https://openscicode.org/badge/doi/10.1126/sciadv.aeh3885.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.