Skip to content

[FIX] More reliable brain masking/FA#193

Merged
arokem merged 7 commits into
tractometry:mainfrom
36000:tp_fixes
May 26, 2026
Merged

[FIX] More reliable brain masking/FA#193
arokem merged 7 commits into
tractometry:mainfrom
36000:tp_fixes

Conversation

@36000
Copy link
Copy Markdown
Collaborator

@36000 36000 commented May 23, 2026

(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.

Copilot AI review requested due to automatic review settings May 23, 2026 23:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 _fit helper).

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.

Comment thread AFQ/tasks/structural.py Outdated
Comment thread AFQ/tasks/data.py Outdated
Comment thread AFQ/tasks/data.py Outdated
Comment thread AFQ/tasks/data.py Outdated
Comment thread AFQ/tasks/structural.py
@36000
Copy link
Copy Markdown
Collaborator Author

36000 commented May 26, 2026

@arokem this is ready for review/merge, then we can make a 3.2 release!

@arokem arokem merged commit 1412bfa into tractometry:main May 26, 2026
9 checks passed
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.

3 participants