unify json atlases, CLI segreg changes and CLI segcentroids new#11
Merged
unify json atlases, CLI segreg changes and CLI segcentroids new#11
Conversation
Member
m-reuter
commented
Apr 29, 2026
- Redesigned segreg into an LTA-focused centroid-registration CLI using --seg plus exactly one of --target-seg, --centroids, or --flipped as target.
- --centroids can either be path to a centroid JSON file or name of a provided atlas (fsaverage and min_icbm... see below).
- Switched centroids files to a single richer JSON format with required centroids and optional embedded geometry.
- Added new segcentroids CLI for writing centroid target JSON files from segmentations.
- Unified bundled targets onto that format and exposed both fsaverage and mni_icbm152_t1_tal_nlin_asym_09c.
- Added segcentroids --input ... --geometry ... mode to add or replace geometry in an existing target JSON without recomputing centroids.
- Updated tests and docs/README to cover the new CLI and target-file workflow.
- Validated with Ruff and the full pytest suite.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR redesigns segmentation-centroid registration workflows by standardizing centroid-target JSON files, updating the segreg CLI/API to focus on LTA output, and adding a dedicated segcentroids CLI for generating/editing centroid-target JSON files.
Changes:
- Unified bundled targets into a single “target JSON” format (required centroids + optional embedded geometry) and added an MNI centroid target alongside fsaverage.
- Refactored
segregAPI/CLI to use--segplus exactly one of--target-seg,--centroids, or--flipped, and to always write an LTA. - Added
segcentroidsCLI and updated tests/docs to cover the new target-file workflow.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_segreg.py |
Updates/extends tests for new target JSON format, new bundled targets, new segreg CLI contract, and new segcentroids CLI. |
pyproject.toml |
Registers the new segcentroids console script. |
neuroreg/segreg/register.py |
Refactors registration entrypoints to target-seg vs centroid-target sources and adds export_segmentation_target. |
neuroreg/segreg/labels.py |
Renames the label preset literal from fsaverage_centroids to target_centroids. |
neuroreg/segreg/io.py |
Introduces rich target JSON read/write with optional geometry + legacy centroid-only compatibility. |
neuroreg/segreg/data/mni_icbm152_t1_tal_nlin_asym_09c.json |
Adds bundled MNI centroid target (centroids-only, no geometry). |
neuroreg/segreg/data/fsaverage_data.json |
Removes old standalone fsaverage geometry resource (superseded by unified target JSON). |
neuroreg/segreg/data/fsaverage_centroids.json |
Removes old standalone fsaverage centroids resource (superseded by unified target JSON). |
neuroreg/segreg/data/fsaverage.json |
Adds unified fsaverage target JSON with centroids + embedded geometry. |
neuroreg/segreg/atlas.py |
Reworks atlas helpers to load unified target JSON bundles and expose load_atlas_target. |
neuroreg/cli/segreg.py |
Updates CLI args/behavior to new target selection model and LTA-only output. |
neuroreg/cli/segcentroids.py |
New CLI to generate/edit centroid target JSON files and optionally embed/replace geometry. |
neuroreg/cli/__init__.py |
Documents the new CLI entrypoint. |
doc/api/segreg.rst |
Updates API docs to match refactors (removes old exports, adds new one). |
README.md |
Updates user-facing CLI documentation and adds segcentroids section. |
Comments suppressed due to low confidence (1)
tests/test_segreg.py:537
- The indentation inside this
@pytest.mark.parametrizepayload is over-indented (e.g., the7,line). This is likely to trip Ruff/pycodestyle continuation-indentation rules (E12x) and makes the parameter table harder to read. Reformat the tuples so the values align with the surrounding parentheses indentation.
[
(
7,
np.array(
[
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.