[FIX] More reliable brain masking/FA#193
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates pyAFQ’s default structural masking and diffusion scalar outputs to improve robustness in common datasets (e.g., HCP), while also simplifying some model-fitting internals.
Changes:
- Switch default T1w brain masking to derive a binary mask from SynthSeg2 segmentations (instead of Brainchop/Mindgrab).
- Update default scalar list for multi-shell data to use DTI FA/MD and add MSDKI metrics (MSD/MSK), avoiding DKI FA by default.
- Remove unused/duplicative code paths (e.g., unused MS-MT intermediate, private DKI
_fithelper).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
AFQ/tasks/structural.py |
Uses SynthSeg2 output to construct the default T1w brain mask; updates SynthSeg task input to avoid masked-T1 dependency. |
AFQ/tasks/data.py |
Adjusts DKI fitting call site, adds MSDKI metrics to defaults, and adds thresholding to MSDKI outputs. |
AFQ/models/msmt.py |
Removes an unused A_outer computation. |
AFQ/models/dki.py |
Removes a private _fit helper no longer used by the tasks layer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
arokem
reviewed
May 24, 2026
Collaborator
Author
|
@arokem this is ready for review/merge, then we can make a 3.2 release! |
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.
(1) Currently, with DIPY defaults, DKI does not fit in many voxels in HCP subjects. I am looking into fixing this, but for now, let's just use DTI FA
(2) Adds MSDKI metrics to defaults. They calculate easily and provide some complementary information.
(3) Changes default brain mask from brainchop to synthseg. I have just noticed synthseg is more reliable.