OSCR

Psychedelics align brain activity with context.

Code ↔ Paper

3 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 3 matches
  1. [1] § Methods › MRI acquisition ↔ functions_matlab/cifti-matlab-master/ft_cifti/private/ft_filetype.m, lines 1164–1223 · score 0.58 · Neuroimaging Informatics Technology, Initiative
  2. [2] § Methods › EEG acquisition ↔ functions_matlab/cifti-matlab-master/ft_cifti/private/ft_filetype.m, lines 507–562 · score 0.56 · BrainVision, Brain Products, head, EEG
  3. [3] § Methods › MRI preprocessing and cleaning ↔ demo_eigenmode_calculation.sh, lines 1–51 · score 0.54 · FreeSurfer, cortical surface, template, hemisphere

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

MATLAB · 1,431 lines · 64 KB · Apache-2.0 · 2 matches

  1. function [type] = ft_filetype(filename, desired, varargin)
  2. % FT_FILETYPE determines the filetype of many EEG/MEG/MRI data files by
  3. % looking at the name, extension and optionally (part of) its contents.
  4. % It tries to determine the global type of file (which usually
  5. % corresponds to the manufacturer, the recording system or to the
  6. % software used to create the file) and the particular subtype (e.g.
  7. % continuous, average).
  8. %
  9. % Use as
  10. % type = ft_filetype(filename)
  11. % type = ft_filetype(dirname)
  12. %
  13. % This gives you a descriptive string with the data type, and can be
  14. % used in a switch-statement. The descriptive string that is returned
  15. % usually is something like 'XXX_YYY'/ where XXX refers to the
  16. % manufacturer and YYY to the type of the data.
  17. %
  18. % Alternatively, use as
  19. % flag = ft_filetype(filename, type)
  20. % flag = ft_filetype(dirname, type)
  21. % This gives you a boolean flag (0 or 1) indicating whether the file
  22. % is of the desired type, and can be used to check whether the
  23. % user-supplied file is what your subsequent code expects.
  24. %
  25. % Alternatively, use as
  26. % flag = ft_filetype(dirlist, type)
  27. % where the dirlist contains a list of files contained within one
  28. % directory. This gives you a boolean vector indicating for each file
  29. % whether it is of the desired type.
  30. %
  31. % Most filetypes of the following manufacturers and/or software programs are recognized
  32. % - 4D/BTi
  33. % - AFNI
  34. % - ASA
  35. % - Analyse
  36. % - Analyze/SPM
  37. % - BESA
  38. % - BrainSuite
  39. % - BrainVisa
  40. % - BrainVision
  41. % - Curry
  42. % - Dataq
  43. % - EDF
  44. % - EEProbe
  45. % - Elektra/Neuromag
  46. % - FreeSurfer
  47. % - LORETA
  48. % - Localite
  49. % - MINC
  50. % - Neuralynx
  51. % - Neuroscan
  52. % - Plexon
  53. % - SR Research Eyelink
  54. % - SensoMotoric Instruments (SMI) *.txt
  55. % - Tobii *.tsv
  56. % - Stanford *.ply
  57. % - Tucker Davis Technology
  58. % - VSM-Medtech/CTF
  59. % - Yokogawa
  60. % - nifti, gifti
  61. % Copyright (C) 2003-2013 Robert Oostenveld
  62. %
  63. % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
  64. % for the documentation and details.
  65. %
  66. % FieldTrip is free software: you can redistribute it and/or modify
  67. % it under the terms of the GNU General Public License as published by
  68. % the Free Software Foundation, either version 3 of the License, or
  69. % (at your option) any later version.
  70. %
  71. % FieldTrip is distributed in the hope that it will be useful,
  72. % but WITHOUT ANY WARRANTY; without even the implied warranty of
  73. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  74. % GNU General Public License for more details.
  75. %
  76. % You should have received a copy of the GNU General Public License
  77. % along with FieldTrip. If not, see <http://www.gnu.org/licenses/>.
  78. %
  79. % $Id$
  80. % these are for remembering the type on subsequent calls with the same input arguments
  81. persistent previous_argin previous_argout previous_pwd
  82. if nargin<2
  83. % ensure that all input arguments are defined
  84. desired = [];
  85. end
  86. current_argin = {filename, desired, varargin{:}};
  87. current_pwd = pwd;
  88. if isequal(current_argin, previous_argin) && isequal(current_pwd, previous_pwd)
  89. % don't do the detection again, but return the previous value from cache
  90. type = previous_argout{1};
  91. return
  92. end
  93. if isa(filename, 'memmapfile')
  94. filename = filename.Filename;
  95. end
  96. % % get the optional arguments
  97. % checkheader = ft_getopt(varargin, 'checkheader', true);
  98. %
  99. % if ~checkheader
  100. % % assume that the header is always ok, e.g when the file does not yet exist
  101. % % this replaces the normal function with a function that always returns true
  102. % filetype_check_header = @filetype_true;
  103. % end
  104. if iscell(filename)
  105. if ~isempty(desired)
  106. % perform the test for each filename, return a boolean vector
  107. type = false(size(filename));
  108. else
  109. % return a string with the type for each filename
  110. type = cell(size(filename));
  111. end
  112. for i=1:length(filename)
  113. if strcmp(filename{i}(end), '.')
  114. % do not recurse into this directory or the parent directory
  115. continue
  116. else
  117. if iscell(type)
  118. type{i} = ft_filetype(filename{i}, desired);
  119. else
  120. type(i) = ft_filetype(filename{i}, desired);
  121. end
  122. end
  123. end
  124. return
  125. end
  126. % start with unknown values
  127. type = 'unknown';
  128. manufacturer = 'unknown';
  129. content = 'unknown';
  130. if isempty(filename)
  131. if isempty(desired)
  132. % return the "unknown" outputs
  133. return
  134. else
  135. % return that it is a non-match
  136. type = false;
  137. return
  138. end
  139. end
  140. % the parts of the filename are used further down
  141. if isdir(filename)
  142. [p, f, x] = fileparts(filename);
  143. p = filename; % the full path to the directory name
  144. d = f; % the last part of the directory name
  145. f = '';
  146. x = '';
  147. else
  148. [p, f, x] = fileparts(filename);
  149. end
  150. % prevent this test if the filename resembles an URI, i.e. like "scheme://"
  151. if isempty(strfind(filename , '://')) && isdir(filename)
  152. % the directory listing is needed below
  153. ls = dir(filename);
  154. % remove the parent directory and the directory itself from the list
  155. ls = ls(~strcmp({ls.name}, '.'));
  156. ls = ls(~strcmp({ls.name}, '..'));
  157. for i=1:length(ls)
  158. % make sure that the directory listing includes the complete path
  159. ls(i).name = fullfile(filename, ls(i).name);
  160. end
  161. end
  162. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  163. % start determining the filetype
  164. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  165. % this checks for a compressed file (of arbitrary type)
  166. if filetype_check_extension(filename, 'zip')...
  167. || (filetype_check_extension(filename, '.gz') && ~filetype_check_extension(filename, '.nii.gz'))...
  168. || filetype_check_extension(filename, 'tgz')...
  169. || filetype_check_extension(filename, 'tar')
  170. type = 'compressed';
  171. manufacturer = 'undefined';
  172. content = 'unknown, extract first';
  173. % these are some streams for asynchronous BCI
  174. elseif filetype_check_uri(filename, 'fifo')
  175. type = 'fcdc_fifo';
  176. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  177. content = 'stream';
  178. elseif filetype_check_uri(filename, 'buffer')
  179. type = 'fcdc_buffer';
  180. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  181. content = 'stream';
  182. elseif filetype_check_uri(filename, 'mysql')
  183. type = 'fcdc_mysql';
  184. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  185. content = 'stream';
  186. elseif filetype_check_uri(filename, 'tcp')
  187. type = 'fcdc_tcp';
  188. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  189. content = 'stream';
  190. elseif filetype_check_uri(filename, 'udp')
  191. type = 'fcdc_udp';
  192. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  193. content = 'stream';
  194. elseif filetype_check_uri(filename, 'rfb')
  195. type = 'fcdc_rfb';
  196. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  197. content = 'stream';
  198. elseif filetype_check_uri(filename, 'serial')
  199. type = 'fcdc_serial';
  200. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  201. content = 'stream';
  202. elseif filetype_check_uri(filename, 'global')
  203. type = 'fcdc_global';
  204. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  205. content = 'global variable';
  206. elseif filetype_check_uri(filename, 'shm')
  207. type = 'ctf_shm';
  208. manufacturer = 'CTF';
  209. content = 'real-time shared memory buffer';
  210. elseif filetype_check_uri(filename, 'empty')
  211. type = 'empty';
  212. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  213. content = '/dev/null';
  214. % known CTF file types
  215. elseif isdir(filename) && filetype_check_extension(filename, '.ds') && exist(fullfile(filename, [f '.res4']), 'file')
  216. type = 'ctf_ds';
  217. manufacturer = 'CTF';
  218. content = 'MEG dataset';
  219. elseif isdir(filename) && ~isempty(dir(fullfile(filename, '*.res4'))) && ~isempty(dir(fullfile(filename, '*.meg4')))
  220. type = 'ctf_ds';
  221. manufacturer = 'CTF';
  222. content = 'MEG dataset';
  223. elseif filetype_check_extension(filename, '.res4') && (filetype_check_header(filename, 'MEG41RS') || filetype_check_header(filename, 'MEG42RS') || filetype_check_header(filename, 'MEG4RES') || filetype_check_header(filename, 'MEG3RES')) %'MEG3RES' pertains to ctf64.ds
  224. type = 'ctf_res4';
  225. manufacturer = 'CTF';
  226. content = 'MEG/EEG header information';
  227. elseif filetype_check_extension(filename, '.meg4') && (filetype_check_header(filename, 'MEG41CP') || filetype_check_header(filename, 'MEG4CPT')) %'MEG4CPT' pertains to ctf64.ds
  228. type = 'ctf_meg4';
  229. manufacturer = 'CTF';
  230. content = 'MEG/EEG';
  231. elseif strcmp(f, 'MarkerFile') && filetype_check_extension(filename, '.mrk') && filetype_check_header(filename, 'PATH OF DATASET:')
  232. type = 'ctf_mrk';
  233. manufacturer = 'CTF';
  234. content = 'marker file';
  235. elseif filetype_check_extension(filename, '.mri') && filetype_check_header(filename, 'CTF_MRI_FORMAT VER 2.2')
  236. type = 'ctf_mri';
  237. manufacturer = 'CTF';
  238. content = 'MRI';
  239. elseif filetype_check_extension(filename, '.mri') && filetype_check_header(filename, 'CTF_MRI_FORMAT VER 4', 31)
  240. type = 'ctf_mri4';
  241. manufacturer = 'CTF';
  242. content = 'MRI';
  243. elseif filetype_check_extension(filename, '.hdm')
  244. type = 'ctf_hdm';
  245. manufacturer = 'CTF';
  246. content = 'volume conduction model';
  247. elseif filetype_check_extension(filename, '.hc')
  248. type = 'ctf_hc';
  249. manufacturer = 'CTF';
  250. content = 'headcoil locations';
  251. elseif filetype_check_extension(filename, '.shape')
  252. type = 'ctf_shape';
  253. manufacturer = 'CTF';
  254. content = 'headshape points';
  255. elseif filetype_check_extension(filename, '.shape_info')
  256. type = 'ctf_shapeinfo';
  257. manufacturer = 'CTF';
  258. content = 'headshape information';
  259. elseif filetype_check_extension(filename, '.wts')
  260. type = 'ctf_wts';
  261. manufacturer = 'CTF';
  262. content = 'SAM coefficients, i.e. spatial filter weights';
  263. elseif filetype_check_extension(filename, '.svl')
  264. type = 'ctf_svl';
  265. manufacturer = 'CTF';
  266. content = 'SAM (pseudo-)statistic volumes';
  267. % known Micromed file types
  268. elseif filetype_check_extension(filename, '.trc') && filetype_check_header(filename, '* MICROMED')
  269. type = 'micromed_trc';
  270. manufacturer = 'Micromed';
  271. content = 'Electrophysiological data';
  272. % known Neuromag file types
  273. elseif filetype_check_extension(filename, '.fif')
  274. type = 'neuromag_fif';
  275. manufacturer = 'Neuromag';
  276. content = 'MEG header and data';
  277. elseif filetype_check_extension(filename, '.bdip')
  278. type = 'neuromag_bdip';
  279. manufacturer = 'Neuromag';
  280. content = 'dipole model';
  281. elseif filetype_check_extension(filename, '.eve') && exist(fullfile(p, [f '.fif']), 'file')
  282. type = 'neuromag_eve'; % these are being used by Tristan Technologies for the BabySQUID system
  283. manufacturer = 'Neuromag';
  284. content = 'events';
  285. % known Yokogawa file types
  286. elseif filetype_check_extension(filename, '.ave') || filetype_check_extension(filename, '.sqd')
  287. type = 'yokogawa_ave';
  288. manufacturer = 'Yokogawa';
  289. content = 'averaged MEG data';
  290. elseif filetype_check_extension(filename, '.con')
  291. type = 'yokogawa_con';
  292. manufacturer = 'Yokogawa';
  293. content = 'continuous MEG data';
  294. elseif filetype_check_extension(filename, '.raw') && filetype_check_header(filename, char([0 0 0 0])) % FIXME, this detection should possibly be improved
  295. type = 'yokogawa_raw';
  296. manufacturer = 'Yokogawa';
  297. content = 'evoked/trialbased MEG data';
  298. elseif filetype_check_extension(filename, '.mrk') && filetype_check_header(filename, char([0 0 0 0])) % FIXME, this detection should possibly be improved
  299. type = 'yokogawa_mrk';
  300. manufacturer = 'Yokogawa';
  301. content = 'headcoil locations';
  302. elseif filetype_check_extension(filename, '.txt') && numel(strfind(filename,'-coregis')) == 1
  303. type = 'yokogawa_coregis';
  304. manufacturer = 'Yokogawa';
  305. content = 'exported fiducials';
  306. elseif filetype_check_extension(filename, '.txt') && numel(strfind(filename,'-calib')) == 1
  307. type = 'yokogawa_calib';
  308. manufacturer = 'Yokogawa';
  309. elseif filetype_check_extension(filename, '.txt') && numel(strfind(filename,'-channel')) == 1
  310. type = 'yokogawa_channel';
  311. manufacturer = 'Yokogawa';
  312. elseif filetype_check_extension(filename, '.txt') && numel(strfind(filename,'-property')) == 1
  313. type = 'yokogawa_property';
  314. manufacturer = 'Yokogawa';
  315. elseif filetype_check_extension(filename, '.txt') && numel(strfind(filename,'-TextData')) == 1
  316. type = 'yokogawa_textdata';
  317. manufacturer = 'Yokogawa';
  318. elseif filetype_check_extension(filename, '.txt') && numel(strfind(filename,'-FLL')) == 1
  319. type = 'yokogawa_fll';
  320. manufacturer = 'Yokogawa';
  321. elseif filetype_check_extension(filename, '.hsp')
  322. type = 'yokogawa_hsp';
  323. manufacturer = 'Yokogawa';
  324. % Neurosim files; this has to go before the 4D detection
  325. elseif ~isdir(filename) && (strcmp(f,'spikes') || filetype_check_header(filename,'# Spike information'))
  326. type = 'neurosim_spikes';
  327. manufacturer = 'Jan van der Eerden (DCCN)';
  328. content = 'simulated spikes';
  329. elseif ~isdir(filename) && (strcmp(f,'evolution') || filetype_check_header(filename,'# Voltages'))
  330. type = 'neurosim_evolution';
  331. manufacturer = 'Jan van der Eerden (DCCN)';
  332. content = 'simulated membrane voltages and currents';
  333. elseif ~isdir(filename) && (strcmp(f,'signals') || filetype_check_header(filename,'# Internal',2))
  334. type = 'neurosim_signals';
  335. manufacturer = 'Jan van der Eerden (DCCN)';
  336. content = 'simulated network signals';
  337. elseif isdir(filename) && exist(fullfile(filename, 'signals'), 'file') && exist(fullfile(filename, 'spikes'), 'file')
  338. type = 'neurosim_ds';
  339. manufacturer = 'Jan van der Eerden (DCCN)';
  340. content = 'simulated spikes and continuous signals';
  341. % known 4D/BTI file types
  342. elseif filetype_check_extension(filename, '.pdf') && filetype_check_header(filename, 'E|lk') % I am not sure whether this header always applies
  343. type = '4d_pdf';
  344. manufacturer = '4D/BTI';
  345. content = 'raw MEG data (processed data file)';
  346. elseif exist([filename '.m4d'], 'file') && exist([filename '.xyz'], 'file') % these two ascii header files accompany the raw data
  347. type = '4d_pdf';
  348. manufacturer = '4D/BTI';
  349. content = 'raw MEG data (processed data file)';
  350. elseif filetype_check_extension(filename, '.m4d') && exist([filename(1:(end-3)) 'xyz'], 'file') % these come in pairs
  351. type = '4d_m4d';
  352. manufacturer = '4D/BTI';
  353. content = 'MEG header information';
  354. elseif filetype_check_extension(filename, '.xyz') && exist([filename(1:(end-3)) 'm4d'], 'file') % these come in pairs
  355. type = '4d_xyz';
  356. manufacturer = '4D/BTI';
  357. content = 'MEG sensor positions';
  358. elseif isequal(f, 'hs_file') % the filename is "hs_file"
  359. type = '4d_hs';
  360. manufacturer = '4D/BTI';
  361. content = 'head shape';
  362. elseif length(filename)>=4 && ~isempty(strfind(filename,',rf'))
  363. type = '4d';
  364. manufacturer = '4D/BTi';
  365. content = '';
  366. elseif filetype_check_extension(filename, '.el.ascii') && filetype_check_ascii(filename, 20) % assume that there are at least 20 bytes in the file, the example one has 4277 bytes
  367. type = '4d_el_ascii';
  368. manufacturer = '4D/BTi';
  369. content = 'electrode positions';
  370. elseif length(f)<=4 && filetype_check_dir(p, 'config')%&& ~isempty(p) && exist(fullfile(p,'config'), 'file') %&& exist(fullfile(p,'hs_file'), 'file')
  371. % this could be a 4D file with non-standard/processed name
  372. % it will be detected as a 4D file when there is a config file in the
  373. % same directory as the specified file
  374. type = '4d';
  375. manufacturer = '4D/BTi';
  376. content = '';
  377. % known EEProbe file types
  378. elseif filetype_check_extension(filename, '.cnt') && (filetype_check_header(filename, 'RIFF') || filetype_check_header(filename, 'RF64'))
  379. type = 'eep_cnt';
  380. manufacturer = 'EEProbe';
  381. content = 'EEG';
  382. elseif filetype_check_extension(filename, '.avr') && filetype_check_header(filename, char([38 0 16 0]))
  383. type = 'eep_avr';
  384. manufacturer = 'EEProbe';
  385. content = 'ERP';
  386. elseif filetype_check_extension(filename, '.trg')
  387. type = 'eep_trg';
  388. manufacturer = 'EEProbe';
  389. content = 'trigger information';
  390. elseif filetype_check_extension(filename, '.rej')
  391. type = 'eep_rej';
  392. manufacturer = 'EEProbe';
  393. content = 'rejection marks';
  394. % the yokogawa_mri has to be checked prior to asa_mri, because this one is more strict
  395. elseif filetype_check_extension(filename, '.mri') && filetype_check_header(filename, char(0)) % FIXME, this detection should possibly be improved
  396. type = 'yokogawa_mri';
  397. manufacturer = 'Yokogawa';
  398. content = 'anatomical MRI';
  399. % known ASA file types
  400. elseif filetype_check_extension(filename, '.elc')
  401. type = 'asa_elc';
  402. manufacturer = 'ASA';
  403. content = 'electrode positions';
  404. elseif filetype_check_extension(filename, '.vol')
  405. type = 'asa_vol';
  406. manufacturer = 'ASA';
  407. content = 'volume conduction model';
  408. elseif filetype_check_extension(filename, '.bnd')
  409. type = 'asa_bnd';
  410. manufacturer = 'ASA';
  411. content = 'boundary element model details';
  412. elseif filetype_check_extension(filename, '.msm')
  413. type = 'asa_msm';
  414. manufacturer = 'ASA';
  415. content = 'ERP';
  416. elseif filetype_check_extension(filename, '.msr')
  417. type = 'asa_msr';
  418. manufacturer = 'ASA';
  419. content = 'ERP';
  420. elseif filetype_check_extension(filename, '.dip')
  421. % FIXME, can also be CTF dipole file
  422. type = 'asa_dip';
  423. manufacturer = 'ASA';
  424. elseif filetype_check_extension(filename, '.mri')
  425. % FIXME, can also be CTF mri file
  426. type = 'asa_mri';
  427. manufacturer = 'ASA';
  428. content = 'MRI image header';
  429. elseif filetype_check_extension(filename, '.iso')
  430. type = 'asa_iso';
  431. manufacturer = 'ASA';
  432. content = 'MRI image data';
  433. % known BCI2000 file types
  434. elseif filetype_check_extension(filename, '.dat') && (filetype_check_header(filename, 'BCI2000') || filetype_check_header(filename, 'HeaderLen='))
  435. type = 'bci2000_dat';
  436. manufacturer = 'BCI2000';
  437. content = 'continuous EEG';
  438. % known Neuroscan file types
  439. elseif filetype_check_extension(filename, '.avg') && filetype_check_header(filename, 'Version 3.0')
  440. type = 'ns_avg';
  441. manufacturer = 'Neuroscan';
  442. content = 'averaged EEG';
  443. elseif filetype_check_extension(filename, '.cnt') && filetype_check_header(filename, 'Version 3.0')
  444. type = 'ns_cnt';
  445. manufacturer = 'Neuroscan';
  446. content = 'continuous EEG';
  447. elseif filetype_check_extension(filename, '.eeg') && filetype_check_header(filename, 'Version 3.0')
  448. type = 'ns_eeg';
  449. manufacturer = 'Neuroscan';
  450. content = 'epoched EEG';
  451. elseif filetype_check_extension(filename, '.eeg') && filetype_check_header(filename, 'V3.0')
  452. type = 'neuroprax_eeg';
  453. manufacturer = 'eldith GmbH';
  454. content = 'continuous EEG';
  455. elseif filetype_check_extension(filename, '.ee_')
  456. type = 'neuroprax_mrk';
  457. manufacturer = 'eldith GmbH';
  458. content = 'EEG markers';
  459. % known Analyze & SPM file types
  460. elseif filetype_check_extension(filename, '.hdr')
  461. type = 'analyze_hdr';
  462. manufacturer = 'Mayo Analyze';
  463. content = 'PET/MRI image header';
  464. elseif filetype_check_extension(filename, '.img')
  465. type = 'analyze_img';
  466. manufacturer = 'Mayo Analyze';
  467. content = 'PET/MRI image data';
  468. elseif filetype_check_extension(filename, '.mnc')
  469. type = 'minc';
  470. content = 'MRI image data';
  471. elseif filetype_check_extension(filename, '.nii') && filetype_check_header(filename, {[92 1 0 0], [0 0 1 92]}) % header starts with the number 348
  472. type = 'nifti';
  473. content = 'MRI image data';
  474. elseif filetype_check_extension(filename, '.nii') && filetype_check_header(filename, {[28 2 0 0], [0 0 2 28]}) % header starts with the number 540
  475. type = 'nifti2';
  476. content = 'MRI image data';
  477. % known FSL file types
  478. elseif filetype_check_extension(filename, '.nii.gz')
  479. type = 'nifti_fsl';
  480. content = 'MRI image data';
  481. % known LORETA file types
  482. elseif filetype_check_extension(filename, '.lorb')
  483. type = 'loreta_lorb';
  484. manufacturer = 'old LORETA';
  485. content = 'source reconstruction';
  486. elseif filetype_check_extension(filename, '.slor')
  487. type = 'loreta_slor';
  488. manufacturer = 'sLORETA';
  489. content = 'source reconstruction';
  490. % known AFNI file types
  491. elseif filetype_check_extension(filename, '.brik') || filetype_check_extension(filename, '.BRIK')
  492. type = 'afni_brik';
  493. content = 'MRI image data';
  494. elseif filetype_check_extension(filename, '.head') || filetype_check_extension(filename, '.HEAD')
  495. type = 'afni_head';
  496. content = 'MRI header data';
  497. % known BrainVison file types
  498. elseif filetype_check_extension(filename, '.vhdr')
  499. type = 'brainvision_vhdr';
  500. manufacturer = 'BrainProducts';
  501. content = 'EEG header';
  502. elseif filetype_check_extension(filename, '.vmrk')
  503. type = 'brainvision_vmrk';
  504. manufacturer = 'BrainProducts';
  505. content = 'EEG markers';
  506. elseif filetype_check_extension(filename, '.vabs')
  507. type = 'brainvision_vabs';
  508. manufacturer = 'BrainProducts';
  509. content = 'Brain Vison Analyzer macro';
  510. elseif filetype_check_extension(filename, '.eeg') && exist(fullfile(p, [f '.vhdr']), 'file')
  511. type = 'brainvision_eeg';
  512. manufacturer = 'BrainProducts';
  513. content = 'continuous EEG data';
  514. elseif filetype_check_extension(filename, '.seg')
  515. type = 'brainvision_seg';
  516. manufacturer = 'BrainProducts';
  517. content = 'segmented EEG data';
  518. elseif filetype_check_extension(filename, '.dat') && exist(fullfile(p, [f '.vhdr']), 'file') &&...
  519. ~filetype_check_header(filename, 'HeaderLen=') && ~filetype_check_header(filename, 'BESA_SA_IMAGE') &&...
  520. ~(exist(fullfile(p, [f '.gen']), 'file') || exist(fullfile(p, [f '.generic']), 'file'))
  521. % WARNING this is a very general name, it could be exported BrainVision
  522. % data but also a BESA beamformer source reconstruction or BCI2000
  523. type = 'brainvision_dat';
  524. manufacturer = 'BrainProducts';
  525. content = 'exported EEG data';
  526. elseif filetype_check_extension(filename, '.marker')
  527. type = 'brainvision_marker';
  528. manufacturer = 'BrainProducts';
  529. content = 'rejection markers';
  530. % known Polhemus file types
  531. elseif filetype_check_extension(filename, '.pos')
  532. type = 'polhemus_pos';
  533. manufacturer = 'BrainProducts/CTF/Polhemus?'; % actually I don't know whose software it is
  534. content = 'electrode positions';
  535. % known Blackrock Microsystems file types
  536. elseif strncmp(x,'.ns',3) && (filetype_check_header(filename, 'NEURALCD') || filetype_check_header(filename, 'NEURALSG'))
  537. type = 'blackrock_nsx';
  538. manufacturer = 'Blackrock Microsystems';
  539. content = 'conintuously sampled data';
  540. elseif filetype_check_extension(filename, '.nev') && filetype_check_header(filename, 'NEURALEV')
  541. type = 'blackrock_nev';
  542. manufacturer = 'Blackrock Microsystems';
  543. contenct = 'extracellular electrode spike information';
  544. % known Neuralynx file types
  545. elseif filetype_check_extension(filename, '.nev') || filetype_check_extension(filename, '.Nev')
  546. type = 'neuralynx_nev';
  547. manufacturer = 'Neuralynx';
  548. content = 'event information';
  549. elseif filetype_check_extension(filename, '.ncs') && filetype_check_header(filename, '####')
  550. type = 'neuralynx_ncs';
  551. manufacturer = 'Neuralynx';
  552. content = 'continuous single channel recordings';
  553. elseif filetype_check_extension(filename, '.nse') && filetype_check_header(filename, '####')
  554. type = 'neuralynx_nse';
  555. manufacturer = 'Neuralynx';
  556. content = 'spike waveforms';
  557. elseif filetype_check_extension(filename, '.nts') && filetype_check_header(filename, '####')
  558. type = 'neuralynx_nts';
  559. manufacturer = 'Neuralynx';
  560. content = 'timestamps only';
  561. elseif filetype_check_extension(filename, '.nvt')
  562. type = 'neuralynx_nvt';
  563. manufacturer = 'Neuralynx';
  564. content = 'video tracker';
  565. elseif filetype_check_extension(filename, '.nst')
  566. type = 'neuralynx_nst';
  567. manufacturer = 'Neuralynx';
  568. content = 'continuous stereotrode recordings';
  569. elseif filetype_check_extension(filename, '.ntt')
  570. type = 'neuralynx_ntt';
  571. manufacturer = 'Neuralynx';
  572. content = 'continuous tetrode recordings';
  573. elseif strcmpi(f, 'logfile') && strcmpi(x, '.txt') % case insensitive
  574. type = 'neuralynx_log';
  575. manufacturer = 'Neuralynx';
  576. content = 'log information in ASCII format';
  577. elseif ~isempty(strfind(lower(f), 'dma')) && strcmpi(x, '.log') % this is not a very strong detection
  578. type = 'neuralynx_dma';
  579. manufacturer = 'Neuralynx';
  580. content = 'raw aplifier data directly from DMA';
  581. elseif filetype_check_extension(filename, '.nrd') % see also above, since Cheetah 5.x the file extension has changed
  582. type = 'neuralynx_dma';
  583. manufacturer = 'Neuralynx';
  584. content = 'raw aplifier data directly from DMA';
  585. elseif isdir(filename) && (any(filetype_check_extension({ls.name}, '.nev')) || any(filetype_check_extension({ls.name}, '.Nev')))
  586. % a regular Neuralynx dataset directory that contains an event file
  587. type = 'neuralynx_ds';
  588. manufacturer = 'Neuralynx';
  589. content = 'dataset';
  590. elseif isdir(filename) && most(filetype_check_extension({ls.name}, '.ncs'))
  591. % a directory containing continuously sampled channels in Neuralynx format
  592. type = 'neuralynx_ds';
  593. manufacturer = 'Neuralynx';
  594. content = 'continuously sampled channels';
  595. elseif isdir(filename) && most(filetype_check_extension({ls.name}, '.nse'))
  596. % a directory containing spike waveforms in Neuralynx format
  597. type = 'neuralynx_ds';
  598. manufacturer = 'Neuralynx';
  599. content = 'spike waveforms';
  600. elseif isdir(filename) && most(filetype_check_extension({ls.name}, '.nte'))
  601. % a directory containing spike timestamps in Neuralynx format
  602. type = 'neuralynx_ds';
  603. manufacturer = 'Neuralynx';
  604. content = 'spike timestamps';
  605. elseif isdir(filename) && most(filetype_check_extension({ls.name}, '.ntt'))
  606. % a directory containing tetrode recordings in Neuralynx format
  607. type = 'neuralynx_ds';
  608. manufacturer = 'Neuralynx';
  609. content = 'tetrode recordings ';
  610. elseif isdir(p) && exist(fullfile(p, 'header'), 'file') && exist(fullfile(p, 'samples'), 'file') && exist(fullfile(p, 'events'), 'file')
  611. type = 'fcdc_buffer_offline';
  612. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  613. content = 'FieldTrip buffer offline dataset';
  614. elseif isdir(filename) && exist(fullfile(filename, 'info.xml'), 'file') && exist(fullfile(filename, 'signal1.bin'), 'file')
  615. % this is an OS X package directory representing a complete EEG dataset
  616. % it contains a Content file, multiple xml files and one or more signalN.bin files
  617. type = 'egi_mff';
  618. manufacturer = 'Electrical Geodesics Incorporated';
  619. content = 'raw EEG data';
  620. elseif ~isdir(filename) && isdir(p) && exist(fullfile(p, 'info.xml'), 'file') && exist(fullfile(p, 'signal1.bin'), 'file')
  621. % the file that the user specified is one of the files in an mff package directory
  622. type = 'egi_mff';
  623. manufacturer = 'Electrical Geodesics Incorporated';
  624. content = 'raw EEG data';
  625. % these are formally not Neuralynx file formats, but at the FCDC we use them together with Neuralynx
  626. elseif isdir(filename) && filetype_check_neuralynx_cds(filename)
  627. % a downsampled Neuralynx DMA file can be split into three separate lfp/mua/spike directories
  628. % treat them as one combined dataset
  629. type = 'neuralynx_cds';
  630. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  631. content = 'dataset containing separate lfp/mua/spike directories';
  632. elseif filetype_check_extension(filename, '.tsl') && filetype_check_header(filename, 'tsl')
  633. type = 'neuralynx_tsl';
  634. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  635. content = 'timestamps from DMA log file';
  636. elseif filetype_check_extension(filename, '.tsh') && filetype_check_header(filename, 'tsh')
  637. type = 'neuralynx_tsh';
  638. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  639. content = 'timestamps from DMA log file';
  640. elseif filetype_check_extension(filename, '.ttl') && filetype_check_header(filename, 'ttl')
  641. type = 'neuralynx_ttl';
  642. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  643. content = 'Parallel_in from DMA log file';
  644. elseif filetype_check_extension(filename, '.bin') && filetype_check_header(filename, {'uint8', 'uint16', 'uint32', 'int8', 'int16', 'int32', 'int64', 'float32', 'float64'})
  645. type = 'neuralynx_bin';
  646. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  647. content = 'single channel continuous data';
  648. elseif isdir(filename) && any(filetype_check_extension({ls.name}, '.ttl')) && any(filetype_check_extension({ls.name}, '.tsl')) && any(filetype_check_extension({ls.name}, '.tsh'))
  649. % a directory containing the split channels from a DMA logfile
  650. type = 'neuralynx_sdma';
  651. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  652. content = 'split DMA log file';
  653. elseif isdir(filename) && filetype_check_extension(filename, '.sdma')
  654. % a directory containing the split channels from a DMA logfile
  655. type = 'neuralynx_sdma';
  656. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  657. content = 'split DMA log file';
  658. % known Plexon file types
  659. elseif filetype_check_extension(filename, '.nex') && filetype_check_header(filename, 'NEX1')
  660. type = 'plexon_nex';
  661. manufacturer = 'Plexon';
  662. content = 'electrophysiological data';
  663. elseif filetype_check_extension(filename, '.plx') && filetype_check_header(filename, 'PLEX')
  664. type = 'plexon_plx';
  665. manufacturer = 'Plexon';
  666. content = 'electrophysiological data';
  667. elseif filetype_check_extension(filename, '.ddt')
  668. type = 'plexon_ddt';
  669. manufacturer = 'Plexon';
  670. elseif isdir(filename) && most(filetype_check_extension({ls.name}, '.nex')) && most(filetype_check_header({ls.name}, 'NEX1'))
  671. % a directory containing multiple plexon NEX files
  672. type = 'plexon_ds';
  673. manufacturer = 'Plexon';
  674. content = 'electrophysiological data';
  675. % known Cambridge Electronic Design file types
  676. elseif filetype_check_extension(filename, '.smr')
  677. type = 'ced_son';
  678. manufacturer = 'Cambridge Electronic Design';
  679. content = 'Spike2 SON filing system';
  680. % known BESA file types
  681. elseif filetype_check_extension(filename, '.avr') && strcmp(type, 'unknown')
  682. type = 'besa_avr'; % FIXME, can also be EEProbe average EEG
  683. manufacturer = 'BESA';
  684. content = 'average EEG';
  685. elseif filetype_check_extension(filename, '.elp')
  686. type = 'besa_elp';
  687. manufacturer = 'BESA';
  688. content = 'electrode positions';
  689. elseif filetype_check_extension(filename, '.eps')
  690. type = 'besa_eps';
  691. manufacturer = 'BESA';
  692. content = 'digitizer information';
  693. elseif filetype_check_extension(filename, '.sfp')
  694. type = 'besa_sfp';
  695. manufacturer = 'BESA';
  696. content = 'sensor positions';
  697. elseif filetype_check_extension(filename, '.ela')
  698. type = 'besa_ela';
  699. manufacturer = 'BESA';
  700. content = 'sensor information';
  701. elseif filetype_check_extension(filename, '.pdg')
  702. type = 'besa_pdg';
  703. manufacturer = 'BESA';
  704. content = 'paradigm file';
  705. elseif filetype_check_extension(filename, '.tfc')
  706. type = 'besa_tfc';
  707. manufacturer = 'BESA';
  708. content = 'time frequency coherence';
  709. elseif filetype_check_extension(filename, '.mul')
  710. type = 'besa_mul';
  711. manufacturer = 'BESA';
  712. content = 'multiplexed ascii format';
  713. elseif filetype_check_extension(filename, '.dat') && filetype_check_header(filename, 'BESA_SA') % header can start with BESA_SA_IMAGE or BESA_SA_MN_IMAGE
  714. type = 'besa_src';
  715. manufacturer = 'BESA';
  716. content = 'beamformer source reconstruction';
  717. elseif filetype_check_extension(filename, '.swf') && filetype_check_header(filename, 'Npts=')
  718. type = 'besa_swf';
  719. manufacturer = 'BESA';
  720. content = 'beamformer source waveform';
  721. elseif filetype_check_extension(filename, '.bsa')
  722. type = 'besa_bsa';
  723. manufacturer = 'BESA';
  724. content = 'beamformer source locations and orientations';
  725. elseif exist(fullfile(p, [f '.dat']), 'file') && (exist(fullfile(p, [f '.gen']), 'file') || exist(fullfile(p, [f '.generic']), 'file'))
  726. type = 'besa_sb';
  727. manufacturer = 'BESA';
  728. content = 'simple binary channel data with a separate generic ascii header';
  729. elseif filetype_check_extension(filename, '.sfh') && filetype_check_header(filename, 'NrOfPoints')
  730. type = 'besa_sfh';
  731. manufacturer = 'BESA';
  732. content = 'electrode and fiducial information';
  733. elseif filetype_check_extension(filename, '.besa')
  734. type = 'besa_besa';
  735. manufacturer = 'BESA';
  736. content = 'electrophysiological data';
  737. elseif filetype_check_extension(filename, '.srf') && filetype_check_header(filename, [0 0 0 0], 4)
  738. type = 'brainvoyager_srf';
  739. manufacturer = 'BrainVoyager'; % see http://support.brainvoyager.com/installation-introduction/23-file-formats/375-users-guide-23-the-format-of-srf-files.html
  740. content = 'surface';
  741. % known Dataq file formats
  742. elseif filetype_check_extension(upper(filename), '.WDQ')
  743. type = 'dataq_wdq';
  744. manufacturer = 'dataq instruments';
  745. content = 'electrophysiological data';
  746. % old files from Pascal Fries' PhD research at the MPI
  747. elseif filetype_check_extension(filename, '.dap') && filetype_check_header(filename, char(1))
  748. type = 'mpi_dap';
  749. manufacturer = 'MPI Frankfurt';
  750. content = 'electrophysiological data';
  751. elseif isdir(filename) && ~isempty(cell2mat(regexp({ls.name}, '.dap$')))
  752. type = 'mpi_ds';
  753. manufacturer = 'MPI Frankfurt';
  754. content = 'electrophysiological data';
  755. % Frankfurt SPASS format, which uses the Labview Datalog (DTLG) format
  756. elseif filetype_check_extension(filename, '.ana') && filetype_check_header(filename, 'DTLG')
  757. type = 'spass_ana';
  758. manufacturer = 'MPI Frankfurt';
  759. content = 'electrophysiological data';
  760. elseif filetype_check_extension(filename, '.swa') && filetype_check_header(filename, 'DTLG')
  761. type = 'spass_swa';
  762. manufacturer = 'MPI Frankfurt';
  763. content = 'electrophysiological data';
  764. elseif filetype_check_extension(filename, '.spi') && filetype_check_header(filename, 'DTLG')
  765. type = 'spass_spi';
  766. manufacturer = 'MPI Frankfurt';
  767. content = 'electrophysiological data';
  768. elseif filetype_check_extension(filename, '.stm') && filetype_check_header(filename, 'DTLG')
  769. type = 'spass_stm';
  770. manufacturer = 'MPI Frankfurt';
  771. content = 'electrophysiological data';
  772. elseif filetype_check_extension(filename, '.bhv') && filetype_check_header(filename, 'DTLG')
  773. type = 'spass_bhv';
  774. manufacturer = 'MPI Frankfurt';
  775. content = 'electrophysiological data';
  776. % known Chieti ITAB file types
  777. elseif filetype_check_extension(filename, '.raw') && (filetype_check_header(filename, 'FORMAT: ATB-BIOMAGDATA') || filetype_check_header(filename, '[HeaderType]'))
  778. type = 'itab_raw';
  779. manufacturer = 'Chieti ITAB';
  780. content = 'MEG data, including sensor positions';
  781. elseif filetype_check_extension(filename, '.raw.mhd')
  782. type = 'itab_mhd';
  783. manufacturer = 'Chieti ITAB';
  784. content = 'MEG header data, including sensor positions';
  785. elseif filetype_check_extension(filename, '.asc') && ~filetype_check_header(filename, '**')
  786. type = 'itab_asc';
  787. manufacturer = 'Chieti ITAB';
  788. content = 'headshape digitization file';
  789. % known Nexstim file types
  790. elseif filetype_check_extension(filename, '.nxe')
  791. type = 'nexstim_nxe';
  792. manufacturer = 'Nexstim';
  793. content = 'electrophysiological data';
  794. % known Tucker-Davis-Technology file types
  795. elseif filetype_check_extension(filename, '.tbk')
  796. type = 'tdt_tbk';
  797. manufacturer = 'Tucker-Davis-Technology';
  798. content = 'database/tank meta-information';
  799. elseif filetype_check_extension(filename, '.tdx')
  800. type = 'tdt_tdx';
  801. manufacturer = 'Tucker-Davis-Technology';
  802. content = 'database/tank meta-information';
  803. elseif filetype_check_extension(filename, '.tsq')
  804. type = 'tdt_tsq';
  805. manufacturer = 'Tucker-Davis-Technology';
  806. content = 'block header information';
  807. elseif filetype_check_extension(filename, '.tev')
  808. type = 'tdt_tev';
  809. manufacturer = 'Tucker-Davis-Technology';
  810. content = 'electrophysiological data';
  811. % raw audio and video data from https://github.com/andreyzhd/VideoMEG
  812. % the extension *.aud/*.vid is used at NatMEG and *.audio.dat/*.video.dat seems to be used in Helsinki
  813. elseif (filetype_check_extension(filename, '.aud') || filetype_check_extension(filename, '.audio.dat')) && filetype_check_header(filename, 'ELEKTA_AUDIO_FILE')
  814. % this should go before curry_dat
  815. type = 'videomeg_aud';
  816. manufacturer = 'VideoMEG';
  817. content = 'audio';
  818. elseif (filetype_check_extension(filename, '.vid') || filetype_check_extension(filename, '.video.dat')) && filetype_check_header(filename, 'ELEKTA_VIDEO_FILE')
  819. % this should go before curry_dat
  820. type = 'videomeg_vid';
  821. manufacturer = 'VideoMEG';
  822. content = 'video';
  823. elseif (filetype_check_extension(filename, '.dat') || filetype_check_extension(filename, '.Dat')) && (exist(fullfile(p, [f '.ini']), 'file') || exist(fullfile(p, [f '.Ini']), 'file'))
  824. % this should go before curry_dat
  825. type = 'deymed_dat';
  826. manufacturer = 'Deymed';
  827. content = 'raw eeg data';
  828. elseif (filetype_check_extension(filename, '.ini') || filetype_check_extension(filename, '.Ini')) && (exist(fullfile(p, [f '.dat']), 'file') || exist(fullfile(p, [f '.Dat']), 'file'))
  829. type = 'deymed_ini';
  830. manufacturer = 'Deymed';
  831. content = 'eeg header information';
  832. elseif filetype_check_extension(filename, '.dat') && (filetype_check_header(filename, [0 0 16 0 16 0], 8) || filetype_check_header(filename, [0 0 16 0 16 0], 0))
  833. % this should go before curry_dat
  834. type = 'jaga16';
  835. manufacturer = 'Jinga-Hi';
  836. content = 'electrophysiological data';
  837. % known Curry V4 file types
  838. elseif filetype_check_extension(filename, '.dap')
  839. type = 'curry_dap'; % FIXME, can also be MPI Frankfurt electrophysiological data
  840. manufacturer = 'Curry';
  841. content = 'data parameter file';
  842. elseif filetype_check_extension(filename, '.dat')
  843. type = 'curry_dat';
  844. manufacturer = 'Curry';
  845. content = 'raw data file';
  846. elseif filetype_check_extension(filename, '.rs4')
  847. type = 'curry_rs4';
  848. manufacturer = 'Curry';
  849. content = 'sensor geometry file';
  850. elseif filetype_check_extension(filename, '.par')
  851. type = 'curry_par';
  852. manufacturer = 'Curry';
  853. content = 'data or image parameter file';
  854. elseif filetype_check_extension(filename, '.bd0') || filetype_check_extension(filename, '.bd1') || filetype_check_extension(filename, '.bd2') || filetype_check_extension(filename, '.bd3') || filetype_check_extension(filename, '.bd4') || filetype_check_extension(filename, '.bd5') || filetype_check_extension(filename, '.bd6') || filetype_check_extension(filename, '.bd7') || filetype_check_extension(filename, '.bd8') || filetype_check_extension(filename, '.bd9')
  855. type = 'curry_bd';
  856. manufacturer = 'Curry';
  857. content = 'BEM description file';
  858. elseif filetype_check_extension(filename, '.bt0') || filetype_check_extension(filename, '.bt1') || filetype_check_extension(filename, '.bt2') || filetype_check_extension(filename, '.bt3') || filetype_check_extension(filename, '.bt4') || filetype_check_extension(filename, '.bt5') || filetype_check_extension(filename, '.bt6') || filetype_check_extension(filename, '.bt7') || filetype_check_extension(filename, '.bt8') || filetype_check_extension(filename, '.bt9')
  859. type = 'curry_bt';
  860. manufacturer = 'Curry';
  861. content = 'BEM transfer matrix file';
  862. elseif filetype_check_extension(filename, '.bm0') || filetype_check_extension(filename, '.bm1') || filetype_check_extension(filename, '.bm2') || filetype_check_extension(filename, '.bm3') || filetype_check_extension(filename, '.bm4') || filetype_check_extension(filename, '.bm5') || filetype_check_extension(filename, '.bm6') || filetype_check_extension(filename, '.bm7') || filetype_check_extension(filename, '.bm8') || filetype_check_extension(filename, '.bm9')
  863. type = 'curry_bm';
  864. manufacturer = 'Curry';
  865. content = 'BEM full matrix file';
  866. elseif filetype_check_extension(filename, '.dig')
  867. type = 'curry_dig';
  868. manufacturer = 'Curry';
  869. content = 'digitizer file';
  870. elseif filetype_check_extension(filename, '.txt') && filetype_check_header(filename, '##')
  871. type = 'smi_txt';
  872. manufacturer = 'SensoMotoric Instruments (SMI)';
  873. content = 'eyetracker data';
  874. % known SR Research eyelink file formats
  875. elseif filetype_check_extension(filename, '.asc') && filetype_check_header(filename, '**')
  876. type = 'eyelink_asc';
  877. manufacturer = 'SR Research (ascii)';
  878. content = 'eyetracker data';
  879. elseif filetype_check_extension(filename, '.edf') && filetype_check_header(filename, 'SR_RESEARCH')
  880. type = 'eyelink_edf';
  881. manufacturer = 'SR Research';
  882. content = 'eyetracker data (binary)';
  883. elseif filetype_check_extension(filename, '.tsv') && (filetype_check_header(filename, 'Data Properties:') || filetype_check_header(filename, 'System Properties:'))
  884. type = 'tobii_tsv';
  885. manufacturer = 'Tobii';
  886. content = 'eyetracker data (ascii)';
  887. % known Curry V2 file types
  888. elseif filetype_check_extension(filename, '.sp0') || filetype_check_extension(filename, '.sp1') || filetype_check_extension(filename, '.sp2') || filetype_check_extension(filename, '.sp3') || filetype_check_extension(filename, '.sp4') || filetype_check_extension(filename, '.sp5') || filetype_check_extension(filename, '.sp6') || filetype_check_extension(filename, '.sp7') || filetype_check_extension(filename, '.sp8') || filetype_check_extension(filename, '.sp9')
  889. type = 'curry_sp';
  890. manufacturer = 'Curry';
  891. content = 'point list';
  892. elseif filetype_check_extension(filename, '.s10') || filetype_check_extension(filename, '.s11') || filetype_check_extension(filename, '.s12') || filetype_check_extension(filename, '.s13') || filetype_check_extension(filename, '.s14') || filetype_check_extension(filename, '.s15') || filetype_check_extension(filename, '.s16') || filetype_check_extension(filename, '.s17') || filetype_check_extension(filename, '.s18') || filetype_check_extension(filename, '.s19') || filetype_check_extension(filename, '.s20') || filetype_check_extension(filename, '.s21') || filetype_check_extension(filename, '.s22') || filetype_check_extension(filename, '.s23') || filetype_check_extension(filename, '.s24') || filetype_check_extension(filename, '.s25') || filetype_check_extension(filename, '.s26') || filetype_check_extension(filename, '.s27') || filetype_check_extension(filename, '.s28') || filetype_check_extension(filename, '.s29') || filetype_check_extension(filename, '.s30') || filetype_check_extension(filename, '.s31') || filetype_check_extension(filename, '.s32') || filetype_check_extension(filename, '.s33') || filetype_check_extension(filename, '.s34') || filetype_check_extension(filename, '.s35') || filetype_check_extension(filename, '.s36') || filetype_check_extension(filename, '.s37') || filetype_check_extension(filename, '.s38') || filetype_check_extension(filename, '.s39')
  893. type = 'curry_s';
  894. manufacturer = 'Curry';
  895. content = 'triangle or tetraedra list';
  896. elseif filetype_check_extension(filename, '.pom')
  897. type = 'curry_pom';
  898. manufacturer = 'Curry';
  899. content = 'anatomical localization file';
  900. elseif filetype_check_extension(filename, '.res')
  901. type = 'curry_res';
  902. manufacturer = 'Curry';
  903. content = 'functional localization file';
  904. % known MBFYS file types
  905. elseif filetype_check_extension(filename, '.tri')
  906. type = 'mbfys_tri';
  907. manufacturer = 'MBFYS';
  908. content = 'triangulated surface';
  909. elseif filetype_check_extension(filename, '.ama') && filetype_check_header(filename, [10 0 0 0])
  910. type = 'mbfys_ama';
  911. manufacturer = 'MBFYS';
  912. content = 'BEM volume conduction model';
  913. % Electrical Geodesics Incorporated formats
  914. % the egi_mff format is checked earlier
  915. elseif (filetype_check_extension(filename, '.egis') || filetype_check_extension(filename, '.ave') || filetype_check_extension(filename, '.gave') || filetype_check_extension(filename, '.raw')) && (filetype_check_header(filename, [char(1) char(2) char(3) char(4) char(255) char(255)]) || filetype_check_header(filename, [char(3) char(4) char(1) char(2) char(255) char(255)]))
  916. type = 'egi_egia';
  917. manufacturer = 'Electrical Geodesics Incorporated';
  918. content = 'averaged EEG data';
  919. elseif (filetype_check_extension(filename, '.egis') || filetype_check_extension(filename, '.ses') || filetype_check_extension(filename, '.raw')) && (filetype_check_header(filename, [char(1) char(2) char(3) char(4) char(0) char(3)]) || filetype_check_header(filename, [char(3) char(4) char(1) char(2) char(0) char(3)]))
  920. type = 'egi_egis';
  921. manufacturer = 'Electrical Geodesics Incorporated';
  922. content = 'raw EEG data';
  923. elseif (filetype_check_extension(filename, '.sbin') || filetype_check_extension(filename, '.raw'))
  924. % note that the Chieti MEG data format also has the extension *.raw
  925. % but that can be detected by looking at the file header
  926. type = 'egi_sbin';
  927. manufacturer = 'Electrical Geodesics Incorporated';
  928. content = 'averaged EEG data';
  929. % FreeSurfer file formats, see also http://www.grahamwideman.com/gw/brain/fs/surfacefileformats.htm
  930. elseif filetype_check_extension(filename, '.mgz')
  931. type = 'freesurfer_mgz';
  932. manufacturer = 'FreeSurfer';
  933. content = 'anatomical MRI';
  934. elseif filetype_check_extension(filename, '.mgh')
  935. type = 'freesurfer_mgh';
  936. manufacturer = 'FreeSurfer';
  937. content = 'anatomical MRI';
  938. elseif filetype_check_header(filename, [255 255 254])
  939. % FreeSurfer Triangle Surface Binary Format
  940. type = 'freesurfer_triangle_binary'; % there is also an ascii triangle format
  941. manufacturer = 'FreeSurfer';
  942. content = 'surface description';
  943. elseif filetype_check_header(filename, [255 255 255])
  944. % Quadrangle File
  945. type = 'freesurfer_quadrangle'; % there is no ascii quadrangle format
  946. manufacturer = 'FreeSurfer';
  947. content = 'surface description';
  948. elseif filetype_check_header(filename, [255 255 253]) && ~exist([filename(1:(end-4)) '.mat'], 'file')
  949. % "New" Quadrangle File
  950. type = 'freesurfer_quadrangle_new';
  951. manufacturer = 'FreeSurfer';
  952. content = 'surface description';
  953. elseif filetype_check_extension(filename, '.curv') && filetype_check_header(filename, [255 255 255])
  954. % "New" Curv File
  955. type = 'freesurfer_curv_new';
  956. manufacturer = 'FreeSurfer';
  957. content = 'surface description';
  958. elseif filetype_check_extension(filename, '.annot')
  959. % Freesurfer annotation file
  960. type = 'freesurfer_annot';
  961. manufacturer = 'FreeSurfer';
  962. content = 'parcellation annotation';
  963. elseif filetype_check_extension(filename, '.txt') && numel(strfind(filename,'_nrs_')) == 1
  964. % This may be improved by looking into the file, rather than assuming the
  965. % filename has "_nrs_" somewhere. Also, distinction by the different file
  966. % types could be made
  967. type = 'bucn_nirs';
  968. manufacturer = 'BUCN';
  969. content = 'ascii formatted nirs data';
  970. % Homer is MATLAB software for NIRS processing, see http://www.nmr.mgh.harvard.edu/DOT/resources/homer2/home.htm
  971. elseif filetype_check_extension(filename, '.nirs') && filetype_check_header(filename, 'MATLAB')
  972. type = 'homer_nirs';
  973. manufacturer = 'Homer';
  974. content = '(f)NIRS data';
  975. % known Artinis file format
  976. elseif filetype_check_extension(filename, '.oxy3')
  977. type = 'oxy3';
  978. manufacturer = 'Artinis Medical Systems';
  979. content = '(f)NIRS data';
  980. % known TETGEN file types, see http://tetgen.berlios.de/fformats.html
  981. elseif any(filetype_check_extension(filename, {'.node' '.poly' '.smesh' '.ele' '.face' '.edge' '.vol' '.var' '.neigh'})) && exist(fullfile(p, [f '.node']), 'file') && filetype_check_ascii(fullfile(p, [f '.node']), 100) && exist(fullfile(p, [f '.poly']), 'file')
  982. type = 'tetgen_poly';
  983. manufacturer = 'TetGen, see http://tetgen.berlios.de';
  984. content = 'geometrical data desribed with piecewise linear complex';
  985. elseif any(filetype_check_extension(filename, {'.node' '.poly' '.smesh' '.ele' '.face' '.edge' '.vol' '.var' '.neigh'})) && exist(fullfile(p, [f '.node']), 'file') && filetype_check_ascii(fullfile(p, [f '.node']), 100) && exist(fullfile(p, [f '.smesh']), 'file')
  986. type = 'tetgensmesh';
  987. manufacturer = 'TetGen, see http://tetgen.berlios.de';
  988. content = 'geometrical data desribed with simple piecewise linear complex';
  989. elseif any(filetype_check_extension(filename, {'.node' '.poly' '.smesh' '.ele' '.face' '.edge' '.vol' '.var' '.neigh'})) && exist(fullfile(p, [f '.node']), 'file') && filetype_check_ascii(fullfile(p, [f '.node']), 100) && exist(fullfile(p, [f '.ele']), 'file')
  990. type = 'tetgen_ele';
  991. manufacturer = 'TetGen, see http://tetgen.berlios.de';
  992. content = 'geometrical data desribed with tetrahedra';
  993. elseif any(filetype_check_extension(filename, {'.node' '.poly' '.smesh' '.ele' '.face' '.edge' '.vol' '.var' '.neigh'})) && exist(fullfile(p, [f '.node']), 'file') && filetype_check_ascii(fullfile(p, [f '.node']), 100) && exist(fullfile(p, [f '.face']), 'file')
  994. type = 'tetgen_face';
  995. manufacturer = 'TetGen, see http://tetgen.berlios.de';
  996. content = 'geometrical data desribed with triangular faces';
  997. elseif any(filetype_check_extension(filename, {'.node' '.poly' '.smesh' '.ele' '.face' '.edge' '.vol' '.var' '.neigh'})) && exist(fullfile(p, [f '.node']), 'file') && filetype_check_ascii(fullfile(p, [f '.node']), 100) && exist(fullfile(p, [f '.edge']), 'file')
  998. type = 'tetgen_edge';
  999. manufacturer = 'TetGen, see http://tetgen.berlios.de';
  1000. content = 'geometrical data desribed with boundary edges';
  1001. elseif any(filetype_check_extension(filename, {'.node' '.poly' '.smesh' '.ele' '.face' '.edge' '.vol' '.var' '.neigh'})) && exist(fullfile(p, [f '.node']), 'file') && filetype_check_ascii(fullfile(p, [f '.node']), 100) && exist(fullfile(p, [f '.vol']), 'file')
  1002. type = 'tetgen_vol';
  1003. manufacturer = 'TetGen, see http://tetgen.berlios.de';
  1004. content = 'geometrical data desribed with maximum volumes';
  1005. elseif any(filetype_check_extension(filename, {'.node' '.poly' '.smesh' '.ele' '.face' '.edge' '.vol' '.var' '.neigh'})) && exist(fullfile(p, [f '.node']), 'file') && filetype_check_ascii(fullfile(p, [f '.node']), 100) && exist(fullfile(p, [f '.var']), 'file')
  1006. type = 'tetgen_var';
  1007. manufacturer = 'TetGen, see http://tetgen.berlios.de';
  1008. content = 'geometrical data desribed with variant constraints for facets/segments';
  1009. elseif any(filetype_check_extension(filename, {'.node' '.poly' '.smesh' '.ele' '.face' '.edge' '.vol' '.var' '.neigh'})) && exist(fullfile(p, [f '.node']), 'file') && filetype_check_ascii(fullfile(p, [f '.node']), 100) && exist(fullfile(p, [f '.neigh']), 'file')
  1010. type = 'tetgen_neigh';
  1011. manufacturer = 'TetGen, see http://tetgen.berlios.de';
  1012. content = 'geometrical data desribed with neighbors';
  1013. elseif any(filetype_check_extension(filename, {'.node' '.poly' '.smesh' '.ele' '.face' '.edge' '.vol' '.var' '.neigh'})) && exist(fullfile(p, [f '.node']), 'file') && filetype_check_ascii(fullfile(p, [f '.node']), 100)
  1014. type = 'tetgen_node';
  1015. manufacturer = 'TetGen, see http://tetgen.berlios.de';
  1016. content = 'geometrical data desribed with only nodes';
  1017. % some BrainSuite file formats, see http://brainsuite.bmap.ucla.edu/
  1018. elseif filetype_check_extension(filename, '.dfs') && filetype_check_header(filename, 'DFS_LE v2.0')
  1019. type = 'brainsuite_dfs';
  1020. manufacturer = 'BrainSuite, see http://brainsuite.bmap.ucla.edu';
  1021. content = 'list of triangles and vertices';
  1022. elseif filetype_check_extension(filename, '.bst') && filetype_check_ascii(filename)
  1023. type = 'brainsuite_dst';
  1024. manufacturer = 'BrainSuite, see http://brainsuite.bmap.ucla.edu';
  1025. content = 'a collection of files with geometrical data'; % it seems to be similar to a Caret *.spec file
  1026. elseif filetype_check_extension(filename, '.dfc') && filetype_check_header(filename, 'LONIDFC')
  1027. type = 'loni_dfc';
  1028. manufacturer = 'LONI'; % it is used in BrainSuite
  1029. content = 'curvature information';
  1030. % some BrainVISA file formats, see http://brainvisa.info
  1031. elseif filetype_check_extension(filename, '.mesh') && (filetype_check_header(filename, 'ascii') || filetype_check_header(filename, 'binarABCD') || filetype_check_header(filename, 'binarDCBA')) % http://brainvisa.info/doc/documents-4.4/formats/mesh.pdf
  1032. type = 'brainvisa_mesh';
  1033. manufacturer = 'BrainVISA';
  1034. content = 'vertices and triangles';
  1035. elseif filetype_check_extension(filename, '.minf') && filetype_check_ascii(filename)
  1036. type = 'brainvisa_minf';
  1037. manufacturer = 'BrainVISA';
  1038. content = 'annotation/metadata';
  1039. % some other known file types
  1040. elseif length(filename)>4 && exist([filename(1:(end-4)) '.mat'], 'file') && exist([filename(1:(end-4)) '.bin'], 'file')
  1041. % this is a self-defined FCDC data format, consisting of two files
  1042. % there is a MATLAB V6 file with the header and a binary file with the data (multiplexed, ieee-le, double)
  1043. type = 'fcdc_matbin';
  1044. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  1045. content = 'multiplexed electrophysiology data';
  1046. elseif filetype_check_extension(filename, '.lay')
  1047. type = 'layout';
  1048. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  1049. content = 'layout of channels for plotting';
  1050. elseif filetype_check_extension(filename, '.stl')
  1051. type = 'stl';
  1052. manufacturer = 'various';
  1053. content = 'stereo litography file';
  1054. elseif filetype_check_extension(filename, '.obj')
  1055. type = 'obj';
  1056. manufacturer = 'Wavefront Technologies';
  1057. content = 'Wavefront OBJ';
  1058. elseif filetype_check_extension(filename, '.dcm') || filetype_check_extension(filename, '.ima') || filetype_check_header(filename, 'DICM', 128)
  1059. type = 'dicom';
  1060. manufacturer = 'Dicom';
  1061. content = 'image data';
  1062. elseif filetype_check_extension(filename, '.trl')
  1063. type = 'fcdc_trl';
  1064. manufacturer = 'Donders Centre for Cognitive Neuroimaging';
  1065. content = 'trial definitions';
  1066. elseif filetype_check_extension(filename, '.bdf') && filetype_check_header(filename, [255 'BIOSEMI'])
  1067. type = 'biosemi_bdf';
  1068. manufacturer = 'Biosemi Data Format';
  1069. content = 'electrophysiological data';
  1070. elseif filetype_check_extension(filename, '.edf')
  1071. type = 'edf';
  1072. manufacturer = 'European Data Format';
  1073. content = 'electrophysiological data';
  1074. elseif filetype_check_extension(filename, '.gdf') && filetype_check_header(filename, 'GDF')
  1075. type = 'gdf';
  1076. manufacturer = 'BIOSIG - Alois Schloegl';
  1077. content = 'biosignals';
  1078. elseif filetype_check_extension(filename, '.mat') && filetype_check_header(filename, 'MATLAB') && filetype_check_spmeeg_mat(filename)
  1079. type = 'spmeeg_mat';
  1080. manufacturer = 'Wellcome Trust Centre for Neuroimaging, UCL, UK';
  1081. content = 'electrophysiological data';
  1082. elseif filetype_check_extension(filename, '.mat') && filetype_check_header(filename, 'MATLAB') && filetype_check_gtec_mat(filename)
  1083. type = 'gtec_mat';
  1084. manufacturer = 'Guger Technologies, http://www.gtec.at';
  1085. content = 'electrophysiological data';
  1086. elseif filetype_check_extension(filename, '.mat') && filetype_check_header(filename, 'MATLAB') && filetype_check_ced_spike6mat(filename)
  1087. type = 'ced_spike6mat';
  1088. manufacturer = 'Cambridge Electronic Design Limited';
  1089. content = 'electrophysiological data';
  1090. elseif filetype_check_extension(filename, '.mat') && filetype_check_header(filename, 'MATLAB')
  1091. type = 'matlab';
  1092. manufacturer = 'MATLAB';
  1093. content = 'MATLAB binary data';
  1094. elseif filetype_check_header(filename, 'RIFF', 0) && filetype_check_header(filename, 'WAVE', 8)
  1095. type = 'riff_wave';
  1096. manufacturer = 'Microsoft';
  1097. content = 'audio';
  1098. elseif filetype_check_extension(filename, '.txt') && filetype_check_header(filename, 'Site')
  1099. type = 'easycap_txt';
  1100. manufacturer = 'Easycap';
  1101. content = 'electrode positions';
  1102. elseif filetype_check_extension(filename, '.txt')
  1103. type = 'ascii_txt';
  1104. manufacturer = '';
  1105. content = '';
  1106. elseif filetype_check_extension(filename, '.pol')
  1107. type = 'polhemus_fil';
  1108. manufacturer = 'Functional Imaging Lab, London, UK';
  1109. content = 'headshape points';
  1110. elseif filetype_check_extension(filename, '.set')
  1111. type = 'eeglab_set';
  1112. manufacturer = 'Swartz Center for Computational Neuroscience, San Diego, USA';
  1113. content = 'electrophysiological data';
  1114. elseif filetype_check_extension(filename, '.erp')
  1115. type = 'eeglab_erp';
  1116. manufacturer = 'Swartz Center for Computational Neuroscience, San Diego, USA';
  1117. content = 'electrophysiological data';
  1118. elseif filetype_check_extension(filename, '.t') && filetype_check_header(filename, '%%BEGINHEADER')
  1119. type = 'mclust_t';
  1120. manufacturer = 'MClust';
  1121. content = 'sorted spikes';
  1122. elseif filetype_check_header(filename, 26)
  1123. type = 'nimh_cortex';
  1124. manufacturer = 'NIMH Laboratory of Neuropsychology, http://www.cortex.salk.edu';
  1125. content = 'events and eye channels';
  1126. elseif filetype_check_extension(filename, '.foci') && filetype_check_header(filename, '<?xml')
  1127. type = 'caret_foci';
  1128. manufacturer = 'Caret and ConnectomeWB';
  1129. elseif filetype_check_extension(filename, '.border') && filetype_check_header(filename, '<?xml')
  1130. type = 'caret_border';
  1131. manufacturer = 'Caret and ConnectomeWB';
  1132. elseif filetype_check_extension(filename, '.spec') && (filetype_check_header(filename, '<?xml') || filetype_check_header(filename, 'BeginHeader'))
  1133. type = 'caret_spec';
  1134. manufacturer = 'Caret and ConnectomeWB';
  1135. elseif filetype_check_extension(filename, '.gii') && ~isempty(strfind(filename, '.coord.')) && filetype_check_header(filename, '<?xml')
  1136. type = 'caret_coord';
  1137. manufacturer = 'Caret and ConnectomeWB';
  1138. elseif filetype_check_extension(filename, '.gii') && ~isempty(strfind(filename, '.topo.')) && filetype_check_header(filename, '<?xml')
  1139. type = 'caret_topo';
  1140. manufacturer = 'Caret and ConnectomeWB';
  1141. elseif filetype_check_extension(filename, '.gii') && ~isempty(strfind(filename, '.surf.')) && filetype_check_header(filename, '<?xml')
  1142. type = 'caret_surf';
  1143. manufacturer = 'Caret and ConnectomeWB';
  1144. elseif filetype_check_extension(filename, '.gii') && ~isempty(strfind(filename, '.label.')) && filetype_check_header(filename, '<?xml')
  1145. type = 'caret_label';
  1146. manufacturer = 'Caret and ConnectomeWB';
  1147. elseif filetype_check_extension(filename, '.gii') && ~isempty(strfind(filename, '.func.')) && filetype_check_header(filename, '<?xml')
  1148. type = 'caret_func';
  1149. manufacturer = 'Caret and ConnectomeWB';
  1150. elseif filetype_check_extension(filename, '.gii') && ~isempty(strfind(filename, '.shape.')) && filetype_check_header(filename, '<?xml')
  1151. type = 'caret_shape';
  1152. manufacturer = 'Caret and ConnectomeWB';
  1153. elseif filetype_check_extension(filename, '.gii') && filetype_check_header(filename, '<?xml')
  1154. type = 'gifti';
  1155. manufacturer = 'Neuroimaging Informatics Technology Initiative';
  1156. content = 'tesselated surface description';
  1157. elseif filetype_check_extension(filename, '.v')
  1158. type = 'vista';
  1159. manufacturer = 'University of British Columbia, Canada, http://www.cs.ubc.ca/nest/lci/vista/vista.html';
  1160. content = 'A format for computer vision research, contains meshes or volumes';
  1161. elseif filetype_check_extension(filename, '.tet')
  1162. type = 'tet';
  1163. manufacturer = 'a.o. INRIA, see http://shapes.aimatshape.net/';
  1164. content = 'tetraedral mesh';
  1165. elseif filetype_check_extension(filename, '.nc')
  1166. type = 'netmeg';
  1167. manufacturer = 'Center for Biomedical Research Excellence (COBRE), see http://cobre.mrn.org/megsim/tools/netMEG/netMEG.html';
  1168. content = 'MEG data';
  1169. elseif filetype_check_extension(filename, 'trk')
  1170. type = 'trackvis_trk';
  1171. manufacturer = 'Martinos Center for Biomedical Imaging, see http://www.trackvis.org';
  1172. content = 'fiber tracking data from diffusion MR imaging';
  1173. elseif filetype_check_extension(filename, '.xml') && filetype_check_header(filename, '<EEGMarkerList', 39)
  1174. type = 'localite_pos';
  1175. manufacturer = 'Localite';
  1176. content = 'EEG electrode positions';
  1177. elseif filetype_check_extension(filename, '.mbi')
  1178. type = 'manscan_mbi';
  1179. manufacturer = 'MANSCAN';
  1180. content = 'EEG header';
  1181. elseif filetype_check_extension(filename, '.mb2')
  1182. type = 'manscan_mb2';
  1183. manufacturer = 'MANSCAN';
  1184. content = 'EEG data';
  1185. elseif filetype_check_header(filename, 'ply')
  1186. type = 'ply';
  1187. manufacturer = 'Stanford Triangle Format';
  1188. content = 'three dimensional data from 3D scanners, see http://en.wikipedia.org/wiki/PLY_(file_format)';
  1189. elseif filetype_check_extension(filename, '.csv')
  1190. type = 'csv';
  1191. manufacturer = 'Generic';
  1192. content = 'Comma-separated values, see http://en.wikipedia.org/wiki/Comma-separated_values';
  1193. elseif filetype_check_extension(filename, '.ah5')
  1194. type = 'AnyWave';
  1195. manufacturer = 'AnyWave, http://meg.univ-amu.fr/wiki/AnyWave';
  1196. content = 'MEG/SEEG/EEG data';
  1197. elseif (isdir(filename) && exist(fullfile(p, [d '.EEG.Poly5']), 'file')) || filetype_check_extension(filename, '.Poly5')
  1198. type = 'tmsi_poly5';
  1199. manufacturer = 'TMSi PolyBench';
  1200. content = 'EEG';
  1201. end
  1202. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1203. % finished determining the filetype
  1204. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1205. if strcmp(type, 'unknown')
  1206. if ~exist(filename, 'file') && ~exist(filename, 'dir')
  1207. warning('file or directory "%s" does not exist, could not determine fileformat', filename);
  1208. else
  1209. warning('could not determine filetype of %s', filename);
  1210. end
  1211. end
  1212. if ~isempty(desired)
  1213. % return a boolean value instead of a descriptive string
  1214. type = strcmp(type, desired);
  1215. end
  1216. % remember the current input and output arguments, so that they can be
  1217. % reused on a subsequent call in case the same input argument is given
  1218. current_argout = {type};
  1219. if isempty(previous_argin) && ~strcmp(type, 'unknown')
  1220. previous_argin = current_argin;
  1221. previous_argout = current_argout;
  1222. previous_pwd = current_pwd;
  1223. elseif isempty(previous_argin) && (exist(filename,'file') || exist(filename,'dir')) && strcmp(type, 'unknown') % if the type is unknown, but the file or dir exists, save the current output
  1224. previous_argin = current_argin;
  1225. previous_argout = current_argout;
  1226. previous_pwd = current_pwd;
  1227. else
  1228. % don't remember in case unknown
  1229. previous_argin = [];
  1230. previous_argout = [];
  1231. previous_pwd = [];
  1232. end
  1233. return % filetype main()
  1234. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1235. % SUBFUNCTION that helps in deciding whether a directory with files should
  1236. % be treated as a "dataset". This function returns a logical 1 (TRUE) if more
  1237. % than half of the element of a vector are nonzero number or are 1 or TRUE.
  1238. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1239. function y = most(x)
  1240. x = x(~isnan(x(:)));
  1241. y = sum(x==0)<ceil(length(x)/2);
  1242. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1243. % SUBFUNCTION that always returns a true value
  1244. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1245. function y = filetype_true(varargin)
  1246. y = 1;
  1247. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1248. % SUBFUNCTION that checks for CED spike6 mat file
  1249. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1250. function res = filetype_check_ced_spike6mat(filename)
  1251. res = 1;
  1252. var = whos('-file', filename);
  1253. % Check whether all the variables in the file are structs (representing channels)
  1254. if ~all(strcmp('struct', unique({var(:).class})) == 1)
  1255. res = 0;
  1256. return;
  1257. end
  1258. var = load(filename, var(1).name);
  1259. var = struct2cell(var);
  1260. % Check whether the fields of the first struct have some particular names
  1261. fnames = {
  1262. 'title'
  1263. 'comment'
  1264. 'interval'
  1265. 'scale'
  1266. 'offset'
  1267. 'units'
  1268. 'start'
  1269. 'length'
  1270. 'values'
  1271. 'times'
  1272. };
  1273. res = (numel(intersect(fieldnames(var{1}), fnames)) >= 5);
  1274. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1275. % SUBFUNCTION that checks for a SPM eeg/meg mat file
  1276. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1277. function res = filetype_check_spmeeg_mat(filename)
  1278. % check for the accompanying *.dat file
  1279. res = exist([filename(1:(end-4)) '.dat'], 'file');
  1280. if ~res, return; end
  1281. % check the content of the *.mat file
  1282. var = whos('-file', filename);
  1283. res = res && numel(var)==1;
  1284. res = res && strcmp('D', getfield(var, {1}, 'name'));
  1285. res = res && strcmp('struct', getfield(var, {1}, 'class'));
  1286. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1287. % SUBFUNCTION that checks for a GTEC mat file
  1288. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1289. function res = filetype_check_gtec_mat(filename)
  1290. % check the content of the *.mat file
  1291. var = whos('-file', filename);
  1292. res = length(intersect({'log', 'names'}, {var.name}))==2;
  1293. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1294. % SUBFUNCTION that checks the presence of a specified file in a directory
  1295. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1296. function res = filetype_check_dir(p, filename)
  1297. if ~isempty(p)
  1298. d = dir(p);
  1299. else
  1300. d = dir;
  1301. end
  1302. res = any(strcmp(filename,{d.name}));
  1303. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1304. % SUBFUNCTION that checks whether the directory is neuralynx_cds
  1305. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1306. function res = filetype_check_neuralynx_cds(filename)
  1307. res=false;
  1308. files=dir(filename);
  1309. dirlist=files([files.isdir]);
  1310. % 1) check for a subdirectory with extension .lfp, .mua or .spike
  1311. haslfp = any(filetype_check_extension({dirlist.name}, 'lfp'));
  1312. hasmua = any(filetype_check_extension({dirlist.name}, 'mua'));
  1313. hasspike = any(filetype_check_extension({dirlist.name}, 'spike'));
  1314. % 2) check for each of the subdirs being a neuralynx_ds
  1315. if haslfp || hasmua || hasspike
  1316. sel=find(filetype_check_extension({dirlist.name}, 'lfp')+...
  1317. filetype_check_extension({dirlist.name}, 'mua')+...
  1318. filetype_check_extension({dirlist.name}, 'spike'));
  1319. neuralynxdirs=cell(1,length(sel));
  1320. for n=1:length(sel)
  1321. neuralynxdirs{n}=fullfile(filename, dirlist(sel(n)).name);
  1322. end
  1323. res=any(ft_filetype(neuralynxdirs, 'neuralynx_ds'));
  1324. end
  1325. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1326. % SUBFUNCTION that checks whether the file contains only ascii characters
  1327. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1328. function res = filetype_check_ascii(filename, len)
  1329. % See http://en.wikipedia.org/wiki/ASCII
  1330. if exist(filename, 'file')
  1331. fid = fopen(filename, 'rt');
  1332. bin = fread(fid, len, 'uint8=>uint8');
  1333. fclose(fid);
  1334. printable = bin>31 & bin<127; % the printable characters, represent letters, digits, punctuation marks, and a few miscellaneous symbols
  1335. special = bin==10 | bin==13 | bin==11; % line feed, form feed, tab
  1336. res = all(printable | special);
  1337. else
  1338. % always return true if the file does not (yet) exist, this is important
  1339. % for determining the format to which data should be written
  1340. res = 1;
  1341. end

ft_filetype.m at commit 986543a, under Apache-2.0 · at the source

Overview

Authors: Devon Stoliker1, Leonardo Novelli1, Moein Khajehnejad1, Mana Biabani1, Matthew D. Greaves1, Tamrin Barta1, Martin Williams2, Sidhant Chopra3,4, Olivier Bazin5, Otto Simonsson6, Richard Chambers7, Frederick S. Barrett8, Gustavo Deco9, Katrin H. Preller10, Robin L. Carhart-Harris11,12, Anil K. Seth13,14, Suresh Sundram15, Gary F. Egan1,16, Adeel Razi1,16,17
17 affiliations
  1. Turner Institute for Brain and Mental Health, School of Psychological Sciences, Monash University,Melbourne, Victoria Australia
  2. School of Health Sciences, Swinburne University of Technology,Hawthorn, Victoria Australia
  3. Orygen, The University of Melbourne,Melbourne, Victoria Australia
  4. Centre for Youth Mental Health, The University of Melbourne,Melbourne, Victoria Australia
  5. British Association of Mindfulness-based Approaches (BAMBA) Listed Teacher,Oxford, UK
  6. Department of Neurobiology, Care Sciences and Society, Karolinska Institute,Solna, Sweden
  7. Monash Centre for Consciousness and Contemplative Studies, Monash University,Melbourne, Victoria Australia
  8. Department of Psychiatry and Behavioral Sciences, Center for Psychedelic and Consciousness Research, Johns Hopkins University School of Medicine,Baltimore, MD USA
  9. Center for Brain and Cognition, Theoretical and Computational Group, Universitat Pompeu Fabra/ICREA,Barcelona, Spain
  10. Department of Adult Psychiatry and Psychotherapy, Psychiatric University Clinic Zurich and University of Zurich,Zürich, Switzerland
  11. Centre for Psychedelic Research, Department of Brain Sciences, Imperial College London,London, UK
  12. Psychedelics Division, Neuroscape, University of California, San Francisco,San Francisco, CA USA
  13. Sussex Centre for Consciousness Science, Department of Informatics, University of Sussex,Brighton, UK
  14. Program on Brain, Mind, and Consciousness, Canadian Institute for Advanced Research,Toronto, Ontario Canada
  15. Department of Psychiatry, School of Clinical Sciences, Monash University,Clayton, Victoria Australia
  16. Monash Biomedical Imaging, Monash University,Melbourne, Victoria Australia
  17. CIFAR Global Scholars Program,Toronto, Ontario Canada
Journal: Nature, volume 656, issue 8129, pages 936-947
Dates: received 13 April 2025; accepted 14 July 2026; published online 19 August 2026; in print 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41586-026-10910-z · PMID 42618786 · PMCID PMC13518247 · OpenAlex W4408336142
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: EEG (modality), fMRI (modality), human (organism), cognitive (subfield)
Methods: Spectral & time-frequency, Preprocessing, Connectivity, Statistics, Smoothing, state filtering, decompositions, Graphs, Complexity, Machine learning, fMRI & imaging
Keywords: Consciousness, Human behaviour, Neural decoding, Dynamical systems, Emergence
MeSH: Brain*, Consciousness*, Hallucinogens*, Psilocybin*, Adult, Electroencephalography, Female, Humans, Machine Learning, Magnetic Resonance Imaging, Male, Music, Rest, Young Adult (* major topic)
Topic: Psychedelics and Drug Studies (Clinical Psychology, Psychology), according to OpenAlex
Funding: European Research Council (101019254); Wellcome Trust
Citations: cited by 1 paper (Europe PMC); 121 references in the paper

Abstract

Psychedelics can profoundly alter consciousness by reorganizing brain connectivity1,2, producing acute experiences that shape lasting psychological change3,4. Psychedelic dynamics are commonly described as desynchronized or entropically disordered5,6, yet the brain organization underlying self-dissolving and boundary-dissolving experiences that participants often report7, and how context shapes that organization8, remain unresolved. To address this, we acquired the largest single-site psychedelic neuroimaging dataset to date. Sixty-two adults underwent functional magnetic resonance imaging (fMRI) and electroencephalography (EEG) during rest and naturalistic stimuli (meditation, music and movie), before and on the day of psilocybin administration (fMRI ~ 80 min post-dose; EEG ~ 150 min post-dose). Half ranked the experience among the most meaningful of their lives7. Here, using machine learning to represent the brain dynamics of each individual as low-dimensional trajectories, we show that psilocybin reorganizes brain activity into structured, context-sensitive patterns that co-vary with the quality of subjective experience, revealing a latent order missed by time-averaged measures. Networks that ordinarily segregate internal and external processing integrated, producing cohesive context-aligned trajectories in participants reporting the felt experience of being continuous with, rather than separate from, the environment, a state we refer to as embeddedness. The strength of this context alignment scaled with both the depth of self-dissolving and boundary-dissolving experience and the next-day mindset change. Our findings recast apparent disorder as latent organization aligned with context, linking neurobiology to subjective experience and behavioural change.

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

Repositories

Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.

razilab

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: the link answers
Software Heritage: not checked
Found in: “Code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
At the source: github.com/razilab

information-dynamics.github.io/complexity

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: the link answers
Software Heritage: not checked
Found in: “Code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)

NSBLab/BrainEigenmodes

License: Apache-2.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 986543aad2b921e9f51e4a26bec41f147ddf166f, 28 March 2025
Languages: MATLAB (277), C (9), Shell (4), R (2), Python (2), C/C++ (1)
Size: 492 files, 295 scripts
Software Heritage: archived
Found in: “Code availability”
Holds: README, license file, tests, documentation
Not found: CITATION.cff, environment file, continuous integration
Tools: FieldTrip (27 files), Statistics and Machine Learning Toolbox (13 files), GIfTI library for MATLAB (7 files), FreeSurfer (6 files), SPM (6 files), cifti-matlab (5 files), Image Processing Toolbox (2 files), NiBabel (2 files), NumPy (2 files), BrainSpace (1 file), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
297 files

Code availability

Open-source code for all data analysis pipelines is available on GitHub (https://github.com/razilab). These pipelines used the following software packages: fMRIprep v22.0.2 (https://fmriprep.org), tedana v0.0.12 (https://tedana.readthedocs.io), MRIQC v22.0.6 (https://mriqc.readthedocs.io), MATLAB R2022a (https://www.mathworks.com), SPM12 (https://www.fil.ion.ucl.ac.uk/spm/software/spm12), Freesurfer v7.2 (https://surfer.nmr.mgh.harvard.edu), FSL v6.0.7 (https://fsl.fmrib.ox.ac.uk/fsl/fslwiki) and FieldTrip 20240916 (https://www.fieldtriptoolbox.org). Lempel–Ziv complexity was computed by adapting open-source code by F. Rosas and P. Mediano (https://information-dynamics.github.io/complexity/information/2019/06/26/lempel-ziv.html). Projection of volumetric fMRI data to the cortical surface was performed by adapting open-source code by Pang et al., available on GitHub (https://github.com/NSBLab/BrainEigenmodes).

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

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:

  • 3 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 295 scripts, each with its path and the digest of its content;
  • 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • 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

Datasets cited

Data availability

All data reported are open access and available through OpenNeuro (https://openneuro.org/datasets/ds006110; v1.2.0). Sensitive demographic information will be available upon signing a data access and confidentiality agreement (through the link available in the OpenNeuro data repository).

Reproduced under the paper's license (CC BY), 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 2, 28 September 2026

  • Publisher: n/a → Nature Portfolio

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 19 authors, 5 keywords, 14 MeSH terms, 2 funders, 118 references.

Cite

This paper

Stoliker, D., Novelli, L., Khajehnejad, M., Biabani, M., Greaves, M. D., Barta, T., Williams, M., Chopra, S., Bazin, O., Simonsson, O., Chambers, R., Barrett, F. S., Deco, G., Preller, K. H., Carhart-Harris, R. L., Seth, A. K., Sundram, S., Egan, G. F., & Razi, A. (2026). Psychedelics align brain activity with context. Nature, 656(8129), 936-947. https://doi.org/10.1038/s41586-026-10910-z

BibTeX

@article{stoliker2026psychedelics,
author = {Stoliker, Devon and Novelli, Leonardo and Khajehnejad, Moein and Biabani, Mana and Greaves, Matthew D. and Barta, Tamrin and Williams, Martin and Chopra, Sidhant and Bazin, Olivier and Simonsson, Otto and Chambers, Richard and Barrett, Frederick S. and Deco, Gustavo and Preller, Katrin H. and Carhart-Harris, Robin L. and Seth, Anil K. and Sundram, Suresh and Egan, Gary F. and Razi, Adeel},
title = {{Psychedelics align brain activity with context}},
journal = {Nature},
year = {2026},
month = aug,
volume = {656},
number = {8129},
pages = {936--947},
publisher = {Nature Portfolio},
issn = {0028-0836},
doi = {10.1038/s41586-026-10910-z},
url = {https://doi.org/10.1038/s41586-026-10910-z},
pmid = {42618786},
pmcid = {PMC13518247}
}

RIS

TY - JOUR
AU - Stoliker, Devon
AU - Novelli, Leonardo
AU - Khajehnejad, Moein
AU - Biabani, Mana
AU - Greaves, Matthew D.
AU - Barta, Tamrin
AU - Williams, Martin
AU - Chopra, Sidhant
AU - Bazin, Olivier
AU - Simonsson, Otto
AU - Chambers, Richard
AU - Barrett, Frederick S.
AU - Deco, Gustavo
AU - Preller, Katrin H.
AU - Carhart-Harris, Robin L.
AU - Seth, Anil K.
AU - Sundram, Suresh
AU - Egan, Gary F.
AU - Razi, Adeel
TI - Psychedelics align brain activity with context
T2 - Nature
J2 - Nature
PY - 2026
DA - 2026/08/19
VL - 656
IS - 8129
SP - 936
EP - 947
SN - 0028-0836
PB - Nature Portfolio
DO - 10.1038/s41586-026-10910-z
UR - https://doi.org/10.1038/s41586-026-10910-z
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41586-026-10910-z",
"type": "article-journal",
"title": "Psychedelics align brain activity with context",
"container-title": "Nature",
"author": [
{
"family": "Stoliker",
"given": "Devon"
},
{
"family": "Novelli",
"given": "Leonardo"
},
{
"family": "Khajehnejad",
"given": "Moein"
},
{
"family": "Biabani",
"given": "Mana"
},
{
"family": "Greaves",
"given": "Matthew D."
},
{
"family": "Barta",
"given": "Tamrin"
},
{
"family": "Williams",
"given": "Martin"
},
{
"family": "Chopra",
"given": "Sidhant"
},
{
"family": "Bazin",
"given": "Olivier"
},
{
"family": "Simonsson",
"given": "Otto"
},
{
"family": "Chambers",
"given": "Richard"
},
{
"family": "Barrett",
"given": "Frederick S."
},
{
"family": "Deco",
"given": "Gustavo"
},
{
"family": "Preller",
"given": "Katrin H."
},
{
"family": "Carhart-Harris",
"given": "Robin L."
},
{
"family": "Seth",
"given": "Anil K."
},
{
"family": "Sundram",
"given": "Suresh"
},
{
"family": "Egan",
"given": "Gary F."
},
{
"family": "Razi",
"given": "Adeel"
}
],
"container-title-short": "Nature",
"volume": "656",
"issue": "8129",
"page": "936-947",
"DOI": "10.1038/s41586-026-10910-z",
"PMID": "42618786",
"PMCID": "PMC13518247",
"ISSN": "0028-0836",
"publisher": "Nature Portfolio",
"URL": "https://doi.org/10.1038/s41586-026-10910-z",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
19
]
]
}
}

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.1038/s41591-026-04287-9 [code]
An international mega-analysis of psychedelic drug effects on brain circuit function.
Journal: Nature medicine
In common: NiBabel, SciPy, NumPy, fMRI, 16 references, 2 authors
[2] doi:10.1038/s41467-026-74215-5 [code]
Multi-metric evaluations of acute psychedelic effects on fMRI brain entropy.
Journal: Nature communications
In common: Image Processing Toolbox, Statistics and Machine Learning Toolbox, SciPy, 1 other tool, fMRI, 14 references
[3] doi:10.1038/s41467-026-71151-2 [code]
Common and distinct neural correlates of social interaction processing and theory of mind in narratives.
Journal: Nature communications
In common: cifti-matlab, GIfTI library for MATLAB, FieldTrip, 7 other tools, cognitive, 3 references
[4] doi:10.1038/s41586-026-10631-3 [code]
A prognostic human brain network for diffuse midline glioma.
Journal: Nature
In common: cifti-matlab, BrainSpace, GIfTI library for MATLAB, 8 other tools, 1 reference
[5] doi:10.1002/hbm.70596 [code]
Modeled Long-Term Effects of Psilocybin on Dynamic Activity and Effective Connectivity of Fronto-Striatal-Thalamic Circuits.
Journal: Human brain mapping
In common: 8 references, author Gustavo Deco
[6] doi:10.1038/s41467-026-76011-7 [code]
Human cortex organizes dynamic co-fluctuations along the sensorimotor-association axis.
Journal: Nature communications
In common: BrainSpace, GIfTI library for MATLAB, FieldTrip, 7 other tools, 3 references
[7] doi:10.1002/hbm.70483 [code]
Untamed: Unconstrained Tensor Decomposition and Graph Node Embedding for Cortical Parcellation.
Journal: Human brain mapping
In common: cifti-matlab, GIfTI library for MATLAB, FieldTrip, 7 other tools, fMRI, 2 references
[8] doi:10.1038/s41593-026-02359-0 [code]
The cross-site reproducibility of MRI morphometric phenotypes in psychiatric disorders.
Journal: Nature neuroscience
In common: FreeSurfer, SPM, Image Processing Toolbox, 4 other tools, 3 references, author Sidhant Chopra
[9] doi:10.1162/imag.a.1262 [code]
Frame-wise multi-echo distortion correction for superior functional MRI.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: GIfTI library for MATLAB, FieldTrip, FreeSurfer, 6 other tools, fMRI, 3 references
[10] doi:10.3389/fnhum.2026.1874178
Longitudinal neural and psychological changes following psilocybin under compassion imagery priming.
Journal: Frontiers in human neuroscience
In common: fMRI, cognitive, 10 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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

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