@@ -18,9 +18,15 @@ function readBytes(json: string) {
1818export const rootFileTree = pathsToTree ( [
1919 '/dataset_description.json' ,
2020 '/T1w.json' ,
21+ '/task-movie_events.json' ,
22+ '/task-movie_physio.json' ,
2123 '/sub-01/ses-01_T1w.json' ,
2224 '/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz' ,
2325 '/sub-01/ses-01/anat/sub-01_ses-01_T1w.json' ,
26+ '/sub-01/ses-01/func/sub-01_ses-01_task-movie_bold.nii.gz' ,
27+ '/sub-01/ses-01/func/sub-01_ses-01_task-movie_bold.nii.gz' ,
28+ '/sub-01/ses-01/func/sub-01_ses-01_task-movie_events.tsv' ,
29+ '/sub-01/ses-01/func/sub-01_ses-01_task-movie_physio.tsv.gz' ,
2430 ...[ ...Array ( 10 ) . keys ( ) ] . map ( ( i ) => `/stimuli/stimfile${ i } .png` ) ,
2531] )
2632
@@ -35,5 +41,24 @@ const anatFileTree = subjectFileTree.directories[0].directories[0] as FileTree
3541
3642export const dataFile = anatFileTree . get ( 'sub-01_ses-01_T1w.nii.gz' ) as BIDSFile
3743const anatJSONFile = anatFileTree . get ( 'sub-01_ses-01_T1w.json' ) as BIDSFile
38- anatJSONFile . readBytes = ( size : number ) =>
39- Promise . resolve ( new TextEncoder ( ) . encode ( anatJson ) as Uint8Array < ArrayBuffer > )
44+ anatJSONFile . readBytes = readBytes ( anatJson )
45+
46+ const eventsSidecar = rootFileTree . get ( 'task-movie_events.json' ) as BIDSFile
47+ eventsSidecar . readBytes = readBytes (
48+ JSON . stringify ( {
49+ StimulusPresentation : {
50+ ScreenDistance : 1.8 ,
51+ ScreenOrigin : [ "top" , "left" ] ,
52+ ScreenResolution : [ 1920 , 1080 ] ,
53+ ScreenSize : [ 0.472 , 0.265 ] ,
54+ } ,
55+ } )
56+ )
57+ const physioSidecar = rootFileTree . get ( 'task-movie_physio.json' ) as BIDSFile
58+ physioSidecar . readBytes = readBytes (
59+ JSON . stringify ( {
60+ SamplingFrequency : 100 ,
61+ StartTime : 0 ,
62+ PhysioType : "eyetrack" ,
63+ } )
64+ )
0 commit comments