Repository navigation
feat(migrate): lookup and participants tables (T01 to T03) and the label check - #23
Merged
Merged
Conversation
…bel check Lookup tables take the BIDS columns (index, name, abbreviation, color, mapping) and format, rows sorted by index (T01). The config's tables.layouts convert the 12 other layouts of the Archive and describe the columns they keep in the table's sidecar; the fsaverage tables are rebuilt from the label tables of their GIFTI files (the native 164k mesh wins where densities disagree). tables.sources writes tables from cited upstream files (T02, used by the next PR). participants converts the NKI and OASIS30ANTs tables to participant_id and source_id; OASIS30ANTs gets one row per subject and an images column, with the sex of OAS1_0379 and OAS1_0395 from OASIS-1 (T03). Every lookup table is checked against the label values of its images (M206 to M208, M202) from label facts read by the new `tfmgr migrate labels` and shipped as labels-2.0.0.tsv and labeltables-2.0.0.tsv. Strict errors of the planned Archive: 374 to 260. MNI152NLin6Asym stays blocked by its HOCPAL table until the next PR rebuilds it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oesteban
marked this pull request as ready for review
December 5, 2026 05:18
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c81222a0ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A row with a missing cell was padded with n/a, so a missing middle field shifted the later values into the wrong columns and the table still converted. Such rows are now a conversion problem (M209), like rows with too many cells. No table of the Archive has one, so no plan changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 5b of the migration to TemplateFlow 2.0: lookup and participants tables, and a check of every lookup table against its images. The 54 missing tables and the MNI152NLin6Asym HOCPAL table come next (PR 5b2), each from a cited upstream source.
T01: lookup tables take the BIDS columns (
index,name,abbreviation,coloras#rrggbb,mapping), in UTF-8 with tabs andn/a, rows sorted by index. 12 layouts convert the other headers and describe the columns they keep in the table's JSON sidecar, each with its evidence:NKI and OASIS30ANTs
mappingvalues move to BIDS 1.11.0 (CGM 8, SGM 9, BS 10, CBM 11).fsaverage: the old
indexcolumn held FreeSurfer annotation values. The tables are now rebuilt from the label tables of the.label.giifiles:Where densities disagree, the 164k mesh wins (Desikan2006: FreeSurfer's temporal pole color, M210 note).
T03:
participant_idissub-plus the letters and digits of the original ID, whichsource_idkeeps.imagescolumn (2 for the five subjects with both OASIS-1 sessions).oasis_cross-sectional.xlsxgives F for both sessions, and the config cites it.Label check:
tfmgr migrate labels ARCHIVE [--needs] -o DIR, which reads them from a checkout with the image data present. They are keyed by md5, so plans need no image data.Evidence
Planning the whole Archive from the pinned v2 skeleton (
test_archive):b30fd4e): 374 strict errors, including TF402 26, TF403 42, TF404 42 and TF406 4. No table checked against its images.After: 260 strict errors. Every TF402, TF403, TF404 and TF406 error is gone (114); TF401 (42, missing tables) and TF407 (12, 4D probseg) remain for PR 5b2.
tpl-MNI152NLin6AsymMNI152NLin6Asym is blocked by a real defect the check found: its six HOCPAL volumes carry 43 to 45 label values that
tpl-MNI152NLin6Asym_atlas-HOCPAL_dseg.tsvhas no row for. PR 5b2 rebuilds that table from its upstream source.Notes in the plans, for the WP5 template PRs:
desc-malf_dseg: 207 labels stored as uint8 with a scale factor of 0.8118, so the values cannot be recovered. NKI's WP5 PR re-exports it from upstream.desc-confidence_dseg: float confidence maps, not segmentations.Tests:
test_migrate_tables.py(21 tests) covers:test_migrate_snapshot.py.Merge Danger
Door: two-way
Library code, config and package data only; nothing in the Archive changes until a template's WP5 PR applies a plan.
Blast Radius: packaging
n/arows): 71 in the Archive, 31 of them fsaverage.