Skip to content

[ENH/FIX] Changes for reward bundles and VOF#166

Open
36000 wants to merge 45 commits intotractometry:mainfrom
36000:reward_bundles
Open

[ENH/FIX] Changes for reward bundles and VOF#166
36000 wants to merge 45 commits intotractometry:mainfrom
36000:reward_bundles

Conversation

@36000
Copy link
Collaborator

@36000 36000 commented Jan 28, 2026

  1. Better ROI seeding on WMGMI
  2. Minor bug fixes
  3. Allow "mixed" bundle definitions - some ROIs from subject space, some from template space for the same bundle.
  4. Much needed efficiency gains in bundle recognition by making more extensive use of the resampled tractogram in endpoint/startpoint filtering and length filtering
  5. Improved participant montage including all angles now
  6. Changed the way SYN registration (the default) is saved. Previously, it was as a prealign and mapping file where you needed dipy to combine and handle them. Now, it is 2 displacement fields in two different files: one going template to subject, the other subject to template. This should be more straightforward for QC and for other software to read. As a part of this, all transform become transform_inverse and vice versa, because we are no longer dealing with the .is_inverse flag. Additionally, we can remove the conformedaffinemapping custom class we used to use.
  7. Added some vendored code from white matter analysis to cluster segmented tracts based on the ORG 800 atlas. This will be built upon in future PRs.
  8. Re-introduced code that will assign streamlines to bundles preferentially according to which bundle's inclusion ROI they are closest to. This was solely because it makes Callosum Orbital slightly better, the rest of the bundles are largely unaffected.

I am thinking of trying to get this merged now before it gets too out of hand, I am still using/working with these new systems though.

Also, this changes the mapping output files, so we should merge it before 3.0!

Copilot AI review requested due to automatic review settings January 28, 2026 01:35
@36000 36000 changed the title Reward bundles [WIP] Changes for reward bundles Jan 28, 2026
@36000 36000 added this to the pyAFQ 3.0 milestone Jan 28, 2026
Copy link
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 appears to add support for “reward bundles” by introducing new template assets and enabling more flexible ROI handling (including mixed-space ROI definitions and ROI dilation behavior used in recognition/tracking workflows).

Changes:

  • Add MassP template fetching/loading utilities and update bibliography references.
  • Extend BundleDict ROI handling to support mixed-space ROI specifications and update ROI transformation call sites to pass images (not affines).
  • Enhance RoiImage generation with optional ROI dilation and WM-only masking.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
docs/source/references.bib Adds two new literature references.
AFQ/tasks/utils.py Adjusts base filename generation to avoid unconditional trailing-char stripping.
AFQ/tasks/mapping.py Updates transform_rois call to pass the DWI image (aligning with new API).
AFQ/tasks/decorators.py Removes forced logger level configuration.
AFQ/recognition/utils.py Introduces shared tolerance_mm_to_vox utility.
AFQ/recognition/preprocess.py Refactors to delegate tolerance conversion to AFQ.recognition.utils.
AFQ/recognition/criteria.py Updates ROI transformation call to pass the image instead of the affine.
AFQ/nn/synthseg.py Updates label groupings used to derive PVE outputs.
AFQ/definitions/image.py Adds ROI dilation + WM-only masking options for ROI-derived images.
AFQ/data/fetch.py Adds MassP template fetcher/reader utilities.
AFQ/api/group.py Removes logger level forcing; docstring example was modified.
AFQ/api/bundle_dict.py Adds mixed-space ROI support and updates transformation helper signature to use an image object.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@36000 36000 changed the title [WIP] Changes for reward bundles [WIP] Changes for reward bundles and VOF Feb 12, 2026
@36000 36000 requested a review from Copilot February 12, 2026 06:11
@36000 36000 changed the title [WIP] Changes for reward bundles and VOF [ENH/FIX] Changes for reward bundles and VOF Feb 12, 2026
Copy link
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

Copilot reviewed 33 out of 33 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

Copilot reviewed 33 out of 33 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@36000
Copy link
Collaborator Author

36000 commented Feb 12, 2026

@arokem This is ready for review / merge. It is a grab bag of a bunch of minor features for pyAFQ that will be useful for VOF and reward stuff. I figured it was in a spot where we could try to merge and then start a new PR, just so the PR doesn't get too big, but some of the code (like the ORG stuff) is currently unused but will be used later. A description of the main things added in this PR is available in the first comment.

Also, copilot is super useful! Caught a few bugs.

@36000
Copy link
Collaborator Author

36000 commented Feb 13, 2026

Actually - go ahead and review this when you get the chance but don't merge it yet, I found a bug in streamline transformation.

@arokem
Copy link
Member

arokem commented Feb 13, 2026

OK - heads up that I have travel and deadlines in the next couple of weeks, so probably will not get to this before end of February.

@36000
Copy link
Collaborator Author

36000 commented Feb 13, 2026

OK - I will just keep adding changes to this PR then, no need to merge it soon.

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