Skip to content

Commit cd976b5

Browse files
drammockrwblair
andcommitted
add array of keys to associations.coordsystem
Co-authored-by: Ross Blair <[email protected]>
1 parent d798ffc commit cd976b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/schema/associations.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Schema as MetaSchema } from '@bids/schema/metaschema'
33

44
import type { BIDSFile } from '../types/filetree.ts'
55
import type { BIDSContext } from './context.ts'
6+
import { loadJSON } from '../files/json.ts'
67
import { loadTSV } from '../files/tsv.ts'
78
import { parseBvalBvec } from '../files/dwi.ts'
89
import { walkBack } from '../files/inheritance.ts'
@@ -85,6 +86,16 @@ const associationLookup = {
8586
sampling_frequency: columns.get('sampling_frequency'),
8687
}
8788
},
89+
coordsystem: async (file: BIDSFile, options: { maxRows: number }): Promise<Channels> => {
90+
const keys = Object.keys(await loadJSON(file, options.maxRows)
91+
.catch((e) => {
92+
return new Map()
93+
}))
94+
return {
95+
path: file.path,
96+
keys: keys,
97+
}
98+
},
8899
}
89100

90101
export async function buildAssociations(

0 commit comments

Comments
 (0)