@@ -25,6 +25,7 @@ module.exports = {
2525 this . isAnat ( path ) ||
2626 this . isDWI ( path ) ||
2727 this . isFunc ( path ) ||
28+ this . isMeg ( path ) ||
2829 this . isBehavioral ( path ) ||
2930 this . isCont ( path ) ||
3031 this . isFieldMap ( path ) ||
@@ -50,11 +51,14 @@ module.exports = {
5051
5152 var multiDirFieldmapRe = new RegExp ( '^\\/(?:dir-[a-zA-Z0-9]+)_epi.json$' ) ;
5253
54+ var megTopRe = new RegExp ( '^\\/(?:ses-[a-zA-Z0-9]+_)?task-[a-zA-Z0-9]+(?:_acq-[a-zA-Z0-9]+)?(?:_proc-[a-zA-Z0-9]+)?'
55+ + '(_meg.json|_channels.tsv|_photo.jpg|_coordsystem.json)$' ) ;
56+
5357 var otherTopFiles = new RegExp ( '^\\/(?:ses-[a-zA-Z0-9]+_)?(?:recording-[a-zA-Z0-9]+_)?(?:task-[a-zA-Z0-9]+_)?(?:acq-[a-zA-Z0-9]+_)?(?:rec-[a-zA-Z0-9]+_)?(?:run-[0-9]+_)?'
5458 + '(physio.json|stim.json)$' ) ;
5559
5660 return ( fixedTopLevelNames . indexOf ( path ) != - 1 || funcTopRe . test ( path ) || dwiTopRe . test ( path ) ||
57- anatTopRe . test ( path ) || multiDirFieldmapRe . test ( path ) || otherTopFiles . test ( path ) ) ;
61+ anatTopRe . test ( path ) || multiDirFieldmapRe . test ( path ) || otherTopFiles . test ( path ) || megTopRe . test ( path ) ) ;
5862 } ,
5963
6064 /**
@@ -101,8 +105,14 @@ module.exports = {
101105 '\\/)?\\1(_\\2)?(?:_acq-[a-zA-Z0-9]+)?(?:_rec-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_)?'
102106 + 'dwi.(?:json|bval|bvec)$' ) ;
103107
108+ var megSesRe = new RegExp ( '^\\/(sub-[a-zA-Z0-9]+)' +
109+ '\\/(?:(ses-[a-zA-Z0-9]+)' +
110+ '\\/)?\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_proc-[a-zA-Z0-9]+)?'
111+ + '(_events.tsv|_channels.tsv|_meg.json|_coordsystem.json|_photo.jpg|_headshape.pos)$' ) ;
112+
104113 return conditionalMatch ( scansRe , path ) || conditionalMatch ( funcSesRe , path ) ||
105- conditionalMatch ( anatSesRe , path ) || conditionalMatch ( dwiSesRe , path ) ;
114+ conditionalMatch ( anatSesRe , path ) || conditionalMatch ( dwiSesRe , path ) ||
115+ conditionalMatch ( megSesRe , path ) ;
106116 } ,
107117
108118 /**
@@ -178,7 +188,16 @@ module.exports = {
178188 return conditionalMatch ( funcRe , path ) ;
179189 } ,
180190
181- isBehavioral : function ( path ) {
191+ isMeg : function ( path ) {
192+ var MegRe = new RegExp ( '^\\/(sub-[a-zA-Z0-9]+)' +
193+ '\\/(?:(ses-[a-zA-Z0-9]+)' +
194+ '\\/)?meg' +
195+ '\\/\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_part-[0-9]+)?' +
196+ '(_meg.(ctf|fif|fif.gz|4d|kit|kdf|itab)|(_meg.ds\\/.*)|(_events.tsv|_channels.tsv|_meg.json|_coordsystem.json|_photo.jpg|_headshape.pos))$' ) ;
197+ return conditionalMatch ( MegRe , path ) ;
198+ } ,
199+
200+ isBehavioral : function ( path ) {
182201 var funcBeh = new RegExp ( '^\\/(sub-[a-zA-Z0-9]+)' +
183202 '\\/(?:(ses-[a-zA-Z0-9]+)' +
184203 '\\/)?beh' +
0 commit comments