diff --git a/CHANGES.rst b/CHANGES.rst index 04715f2..d593828 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -37,6 +37,23 @@ Unreleased joins names and content: a renamed file whose bytes change gets an ``n/a`` row, so its old name keeps its old bytes. The config's ``edits`` correct fields of JSON files. A test pins the ``res`` blocks of the migrated Archive (``tests/data/res-2.0.0.tsv``). +* The tables of the migration to TemplateFlow 2.0 (``tfmanager.migrate.lookups``): lookup + tables take the BIDS columns ``index``, ``name``, ``abbreviation``, ``color`` (``#rrggbb``) + and ``mapping``, in UTF-8 with tabs and ``n/a``, rows sorted by index (T01). The config's + ``tables.layouts`` say how each other layout converts and describe the columns it keeps + in the table's JSON sidecar; the fsaverage tables are rebuilt from the label tables of + their GIFTI files. ``tables.sources`` writes tables from cited upstream files (T02), and + ``participants`` converts participants tables to ``participant_id`` (``sub-`` and the + letters and digits of the original, kept in ``source_id``), merging the rows of a + participant imaged more than once (T03). Descriptions of columns no table has are + removed. +* Every lookup table is checked against its images: label values without a row (M206) and, + for 4D probabilistic segmentations, rows that are not the volumes 1 to N block a plan; + segmentations without a table (M202), rows that label nothing (M207) and values stored + as non-integers (M208) are notes. New command ``tfmgr migrate labels ARCHIVE [--needs] + -o DIR`` reads the label values of every segmentation, and the label tables of GIFTI + files, into two tables keyed by md5, shipped with tfmanager + (``migrate/data/labels-2.0.0.tsv``, ``labeltables-2.0.0.tsv``). * New warning TF118 redundant-entity: a ``desc``, ``seg`` or ``label`` that tells its file apart from no other file of the template (``res``, ``den``, ``hemi`` and ``cohort`` aside). Masks keep ``desc``, probabilistic segmentations keep ``label``, and diff --git a/tfmanager/cli.py b/tfmanager/cli.py index a8902c3..ea95eb8 100644 --- a/tfmanager/cli.py +++ b/tfmanager/cli.py @@ -307,6 +307,79 @@ def headers(archive, templates, needs, output): click.echo(text, nl=False) +@migrate.command() +@click.argument('archive', type=click.Path(exists=True, file_okay=False), default='.') +@click.option( + '-t', '--template', 'templates', multiple=True, help='Only this template (tpl-