Skip to content

Commit 688a0be

Browse files
yarikopticclaude
andcommitted
ENH: Refactor atlas metadata from JSON to atlases.tsv pattern
Replace atlas-<label>_description.json with atlases.tsv for atlas metadata, consistent with existing entity-specific TSV files (participants.tsv, sessions.tsv). Key changes: - atlases.tsv: placed at derivative dataset root or tpl-<label>/ directory - Metadata fields converted to snake_case column names - Array fields (authors, curators, funding, references_and_links) use JSON encoding Schema changes: - Add atlas_id and all atlas-specific columns to columns.yaml - Add atlases suffix to suffixes.yaml - Add Atlases rule to common_derivatives.yaml - Add atlases file rule to tables.yaml - Remove old atlas_description association, context, and metadata rules - Delete atlas.yaml check and file rules Documentation: - Update atlas.md with atlases.tsv section and updated examples - Add JSON-encoded array note - Replace all atlas-<label>_description.json references with atlases.tsv Closes: #2285 Related to: #2283 Related to: #1714 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 5e1ac9b commit 688a0be

File tree

10 files changed

+264
-149
lines changed

10 files changed

+264
-149
lines changed

src/derivatives/atlas.md

Lines changed: 103 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -267,49 +267,106 @@ Template:
267267

268268
```Text
269269
<pipeline_name>/
270-
atlas-<label>_description.json
270+
atlases.tsv
271+
atlases.json
271272
tpl-<label>/
273+
[tpl-<label>_atlases.tsv]
274+
[tpl-<label>_atlases.json]
272275
[cohort-<label>/]
273276
[<datatype>/]
274277
tpl-<label>[_cohort-<label>][_<entities>]_<suffix>.<extension>
275278
```
276279

277-
### Atlas identification and metadata
280+
### Atlas identification and metadata (`atlases.tsv`)
278281

279-
The `atlas-<label>_description.json` file provides metadata to uniquely identify,
280-
describe and characterize the atlas, as well as give proper attribution to the creators.
281-
Atlases MUST include `atlas-<label>_description.json` files
282-
corresponding to the atlas or atlases in the structure.
282+
Template:
283283

284-
!!! tip "Recommendation"
284+
```Text
285+
<pipeline_name>/
286+
atlases.tsv
287+
atlases.json
288+
```
285289

286-
The selected `<label>` in the `atlas-<label>_description.json` file is RECOMMENDED
287-
for the [`atlas-<label>` entity](../appendices/entities.md#atlas)
288-
in downstream derivatives from this particular atlas (see previous section
289-
[Derivatives from atlases](imaging.md#derivatives-from-atlases)).
290+
or at the template level:
290291

291-
Atlas metadata fields:
292+
```Text
293+
<pipeline_name>/
294+
tpl-<label>/
295+
tpl-<label>_atlases.tsv
296+
tpl-<label>_atlases.json
297+
```
292298

293-
<!-- This block generates a metadata table.
299+
Optional: Yes
300+
301+
To keep a record of atlases in the dataset, an `atlases.tsv` file MAY be used.
302+
The `atlases.tsv` file consists of one row for each unique `atlas-<label>`
303+
entity used in the dataset and a set of REQUIRED, RECOMMENDED, and OPTIONAL columns:
304+
305+
<!-- This block generates a columns table.
294306
The definitions of these fields can be found in
295-
src/schema/objects/metadata.yaml
307+
src/schema/rules/tabular_data/*.yaml
296308
and a guide for using macros can be found at
297309
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
298310
-->
299-
{{ MACROS___make_json_table('dataset_metadata.atlas_description') }}
311+
{{ MACROS___make_columns_table("derivatives.common_derivatives.Atlases") }}
312+
313+
This file MAY be located at the root of the derivative dataset as `atlases.tsv`,
314+
or within a `tpl-<label>/` directory as `tpl-<label>_atlases.tsv`
315+
([Inheritance Principle](../common-principles.md#the-inheritance-principle)).
316+
317+
!!! note "Array fields"
318+
319+
For columns that represent arrays (such as `authors`, `curators`, `funding`,
320+
and `references_and_links`), the value MUST be a JSON-encoded array of strings.
321+
For example: `["Jane Doe", "John Doe"]`.
322+
323+
!!! tip "Recommendation"
324+
325+
The selected `<label>` in the `atlases.tsv` file is RECOMMENDED
326+
for the [`atlas-<label>` entity](../appendices/entities.md#atlas)
327+
in downstream derivatives from this particular atlas (see previous section
328+
[Derivatives from atlases](imaging.md#derivatives-from-atlases)).
329+
330+
`atlases.tsv` example:
331+
332+
```tsv
333+
atlas_id name license description authors species sample_size references_and_links
334+
atlas-Diedrichsen2009 A probabilistic MR atlas of the human cerebellum LICENSE file Probabilistic atlas of the human cerebellum ["Jörn Diedrichsen", "Joshua H Balsters", "Jonathan Flavell", "Emma Cussans", "Narender Ramnani"] human 20 ["https://doi.org/10.1016/j.neuroimage.2009.01.045"]
335+
atlas-Buckner2011 Atlas of the human cerebellum estimated by intrinsic functional connectivity LICENSE file Cerebellar atlas estimated by intrinsic functional connectivity ["Randy L Buckner", "Fenna M Krienen", "Angela Castellanos", "Julio C Diaz", "B T Thomas Yeo"] human 1000 ["https://doi.org/10.1152/jn.00339.2011"]
336+
```
337+
338+
It is RECOMMENDED to accompany each `atlases.tsv` file with a sidecar
339+
`atlases.json` file to describe the TSV column names and properties of their values
340+
(see also the [section on tabular files](../common-principles.md#tabular-files)).
300341

301-
Example `atlas-MyAtlas2025_description.json`:
342+
`atlases.json` example:
302343

303344
```JSON
304345
{
305-
"Name": "A new atlas of the human brain",
306-
"Authors": [
307-
"Jane Doe",
308-
"John Doe"
309-
],
310-
"License": "CC0",
311-
"RRID": "SCR_002823",
312-
"Species": "Human"
346+
"atlas_id": {
347+
"Description": "Atlas identifier matching the atlas-<label> entity"
348+
},
349+
"name": {
350+
"Description": "Name of the atlas"
351+
},
352+
"license": {
353+
"Description": "License for the atlas"
354+
},
355+
"description": {
356+
"Description": "Brief description of the atlas"
357+
},
358+
"authors": {
359+
"Description": "JSON-encoded array of authors who created the atlas"
360+
},
361+
"species": {
362+
"Description": "Species from which the atlas was derived"
363+
},
364+
"sample_size": {
365+
"Description": "Number of participants used to create the atlas"
366+
},
367+
"references_and_links": {
368+
"Description": "JSON-encoded array of references and links"
369+
}
313370
}
314371
```
315372

@@ -346,6 +403,7 @@ A guide for using macros can be found at
346403
-->
347404
{{ MACROS___make_filetree_example({
348405
"suit-pipeline": {
406+
"templates.tsv": "",
349407
"tpl-SUIT": {
350408
"anat": {
351409
"tpl-SUIT_T1w.nii.gz": "",
@@ -373,7 +431,8 @@ A guide for using macros can be found at
373431
-->
374432
{{ MACROS___make_filetree_example({
375433
"suit-pipeline": {
376-
"atlas-Diedrichsen2009_description.json": "",
434+
"atlases.tsv": "",
435+
"templates.tsv": "",
377436
"tpl-SUIT": {
378437
"anat": {
379438
"tpl-SUIT_T1w.nii.gz": "",
@@ -387,26 +446,11 @@ A guide for using macros can be found at
387446
})
388447
}}
389448

390-
where `atlas-Diedrichsen2009_description.json` could contain:
449+
where `atlases.tsv` could contain:
391450

392-
```JSON
393-
{
394-
"Name": "A probabilistic MR atlas of the human cerebellum",
395-
"Authors": [
396-
"Jörn Diedrichsen",
397-
"Joshua H Balsters",
398-
"Jonathan Flavell",
399-
"Emma Cussans",
400-
"Narender Ramnani"
401-
],
402-
"SampleSize": 20,
403-
"License": "LICENSE file",
404-
"ReferencesAndLinks": [
405-
"https://doi.org/10.1016/j.neuroimage.2009.01.045",
406-
"https://github.com/jdiedrichsen/suit"
407-
],
408-
"Species": "Human"
409-
}
451+
```tsv
452+
atlas_id name license description authors species sample_size references_and_links
453+
atlas-Diedrichsen2009 A probabilistic MR atlas of the human cerebellum LICENSE file Probabilistic atlas of the human cerebellum ["Jörn Diedrichsen", "Joshua H Balsters", "Jonathan Flavell", "Emma Cussans", "Narender Ramnani"] human 20 ["https://doi.org/10.1016/j.neuroimage.2009.01.045", "https://github.com/jdiedrichsen/suit"]
410454
```
411455

412456
Later, in 2011 a second atlas was developed integrating new segmentations,
@@ -418,8 +462,8 @@ A guide for using macros can be found at
418462
-->
419463
{{ MACROS___make_filetree_example({
420464
"suit-pipeline": {
421-
"atlas-Buckner2011_description.json": "",
422-
"atlas-Diedrichsen2009_description.json": "",
465+
"atlases.tsv": "",
466+
"templates.tsv": "",
423467
"tpl-SUIT": {
424468
"anat": {
425469
"tpl-SUIT_T1w.nii.gz": "",
@@ -440,27 +484,12 @@ A guide for using macros can be found at
440484
})
441485
}}
442486

443-
where `atlas-Diedrichsen2009_description.json` remains as above,
444-
and `atlas-Buckner2011_description.json` could contain:
487+
where `atlases.tsv` now contains both atlases:
445488

446-
```JSON
447-
{
448-
"Name": "Atlas of the human cerebellum estimated by intrinsic functional connectivity",
449-
"Authors": [
450-
"Randy L Buckner",
451-
"Fenna M Krienen",
452-
"Angela Castellanos",
453-
"Julio C Diaz",
454-
"B T Thomas Yeo"
455-
],
456-
"SampleSize": 1000,
457-
"License": "LICENSE file",
458-
"ReferencesAndLinks": [
459-
"https://doi.org/10.1152/jn.00339.2011",
460-
"https://github.com/jdiedrichsen/suit"
461-
],
462-
"Species": "Human"
463-
}
489+
```tsv
490+
atlas_id name license description authors species sample_size references_and_links
491+
atlas-Buckner2011 Atlas of the human cerebellum estimated by intrinsic functional connectivity LICENSE file Cerebellar atlas estimated by intrinsic functional connectivity ["Randy L Buckner", "Fenna M Krienen", "Angela Castellanos", "Julio C Diaz", "B T Thomas Yeo"] human 1000 ["https://doi.org/10.1152/jn.00339.2011", "https://github.com/jdiedrichsen/suit"]
492+
atlas-Diedrichsen2009 A probabilistic MR atlas of the human cerebellum LICENSE file Probabilistic atlas of the human cerebellum ["Jörn Diedrichsen", "Joshua H Balsters", "Jonathan Flavell", "Emma Cussans", "Narender Ramnani"] human 20 ["https://doi.org/10.1016/j.neuroimage.2009.01.045", "https://github.com/jdiedrichsen/suit"]
464493
```
465494

466495
### Example: Deriving a new atlas referenced in an existing template
@@ -475,7 +504,8 @@ A guide for using macros can be found at
475504
-->
476505
{{ MACROS___make_filetree_example({
477506
"mial67thalamicnuclei-pipeline": {
478-
"atlas-MIAL67ThalamicNuclei_description.json": "",
507+
"atlases.tsv": "",
508+
"templates.tsv": "",
479509
"sub-01": {
480510
"anat": {
481511
"sub-01_seg-ThalamicNuclei_dseg.json": "",
@@ -520,9 +550,10 @@ A guide for using macros can be found at
520550
-->
521551
{{ MACROS___make_filetree_example({
522552
"mial67thalamicnuclei-pipeline": {
523-
"atlas-MIAL67ThalamicNuclei_description.json": "",
553+
"atlases.tsv": "",
524554
"seg-ThalamicNuclei_dseg.json": "",
525555
"seg-ThalamicNuclei_dseg.tsv": "",
556+
"templates.tsv": "",
526557
"sub-01": {
527558
"anat": {
528559
"sub-01_seg-ThalamicNuclei_dseg.nii.gz": "",
@@ -560,11 +591,12 @@ A guide for using macros can be found at
560591
-->
561592
{{ MACROS___make_filetree_example({
562593
"mial67thalamicnuclei-pipeline": {
563-
"atlas-MIAL67ThalamicNuclei_description.json": "",
564594
"atlas-MIAL67ThalamicNuclei_dseg.json": "",
565595
"atlas-MIAL67ThalamicNuclei_dseg.tsv": "",
596+
"atlases.tsv": "",
566597
"seg-ThalamicNuclei_dseg.json": "",
567598
"seg-ThalamicNuclei_dseg.tsv": "",
599+
"templates.tsv": "",
568600
"sub-01": {
569601
"anat": {
570602
"sub-01_atlas-MIAL67ThalamicNuclei_dseg.nii.gz": "",
@@ -603,10 +635,11 @@ A guide for using macros can be found at
603635
-->
604636
{{ MACROS___make_filetree_example({
605637
"mial67thalamicnuclei-pipeline": {
606-
"atlas-MIAL67ThalamicNuclei_description.json": "",
607638
"atlas-MIAL67ThalamicNuclei_dseg.json": "",
608639
"atlas-MIAL67ThalamicNuclei_dseg.tsv": "",
609640
"atlas-MIAL67ThalamicNuclei_probseg.json": "",
641+
"atlases.tsv": "",
642+
"templates.tsv": "",
610643
"tpl-MNI152NLin2009cAsym": {
611644
"anat": {
612645
"tpl-MNI152NLin2009cAsym_atlas-MIAL67ThalamicNuclei_res-1_dseg.nii.gz": "",

src/schema/meta/associations.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,5 @@ coordsystems:
113113
- space
114114
inherit: true
115115

116-
atlas_description:
117-
selectors:
118-
- entities.atlas
119-
- extension != '.json'
120-
target:
121-
suffix: description
122-
extension: .json
116+
# atlas_description association has been replaced by atlases.tsv pattern
117+
# See src/derivatives/atlas.md for the specification.

src/schema/meta/context.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,8 @@ properties:
298298
type: array
299299
items:
300300
type: string
301-
atlas_description:
302-
description: 'Atlas description file'
303-
type: object
304-
required: [path]
305-
additionalProperties: false
306-
properties:
307-
path:
308-
description: 'Path to associated atlas description file'
309-
type: string
301+
# atlas_description association has been replaced by atlases.tsv pattern
302+
# See src/derivatives/atlas.md for the specification.
310303
# The following properties are populated if the current file is of an appropriate type
311304
columns:
312305
description: 'TSV columns, indexed by column header, values are arrays with column contents'

0 commit comments

Comments
 (0)