Skip to content

[WIP/ENH] add babyseg and update babyAFQ - #210

Open
36000 wants to merge 1 commit into
tractometry:mainfrom
36000:add_babyseg
Open

[WIP/ENH] add babyseg and update babyAFQ#210
36000 wants to merge 1 commit into
tractometry:mainfrom
36000:add_babyseg

Conversation

@36000

@36000 36000 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 28, 2026 05:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

AFQ/tasks/tissue.py:154

  • The ValueError message is now out of sync with the supported string options. This function also accepts 'multiaxial+brainchop+synthseg' and 'babyseg', but the error text only lists 'synthseg' and 'multiaxial+brainchop', which can mislead users when they pass a valid value.
    raise ValueError(
        "pve must be a PVEImage, PVEImages, 'synthseg', or 'multiaxial+brainchop'"
    )

AFQ/nn/babyseg.py:16

  • Other AFQ.nn modules define all (e.g., AFQ/nn/brainchop.py and AFQ/nn/synthseg.py). Adding babyseg.py without all makes its public surface less explicit/inconsistent with the established pattern.
logger = logging.getLogger("AFQ")


AFQ/nn/babyseg.py:107

  • New BabySeg-specific logic (label mapping + mixed-label boundary handling) is introduced here, but there are no unit tests covering it. The repo already has AFQ/nn/tests/test_nn.py for NN utilities; adding a small synthetic-ndarray test for pve_from_babyseg (including at least one voxel per label group and one mixed-label boundary case) would help prevent regressions without requiring onnxruntime.
def pve_from_babyseg(babyseg_data):
    """
    Compute partial volume estimates from BabySeg segmentation.

    Parameters
    ----------
    babyseg_data : ndarray
        The output segmentation from BabySeg.

    Returns
    -------
    pve : ndarray
        PVE data with CSF, GM, and WM segmentations.
    """

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants