Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@effigies
Copy link
Member

@effigies effigies commented May 6, 2025

BIDSLayout does a natural_sort on all get() query results, which breaks ordering encoded in the query itself. This PR looks for the label entity in the query and re-sorts by the label list to ensure that values are returned as expected.

A more robust refactor might either carry around a list of tissue labels or re-order probsegs, but doing that right would be a nontrivial effort, and introduce opportunities for new bugs. This narrowly targets a known bug.

This is a bug-fix candidate PR.

Fixes #474.

@codecov
Copy link

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.37%. Comparing base (5292c7b) to head (2dab7eb).
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #478       +/-   ##
===========================================
+ Coverage   63.21%   74.37%   +11.15%     
===========================================
  Files          25       25               
  Lines        1952     1955        +3     
  Branches      244      247        +3     
===========================================
+ Hits         1234     1454      +220     
+ Misses        679      435      -244     
- Partials       39       66       +27     
Flag Coverage Δ
ds054 45.74% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@effigies effigies requested a review from mgxd May 6, 2025 19:54
@effigies
Copy link
Member Author

effigies commented May 6, 2025

I've confirmed that the issue is resolved in a local test.

Copy link
Collaborator

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

I'm fine with this since it's needed, though this feels like something that should be ultimately addressed in pybids.

@effigies
Copy link
Member Author

effigies commented May 6, 2025

I don't think pybids should make any particular commitment to an ordering. I'm okay removing the natural sort, or allowing for a sorting parameter, but I think it's best to code defensively on this end, regardless.

@effigies effigies merged commit 44c976f into nipreps:master May 6, 2025
21 checks passed
@effigies effigies deleted the fix/label-ordering branch May 6, 2025 22:06
effigies added a commit that referenced this pull request May 13, 2025
0.18.0 (May 08, 2025)

New feature release in the 0.18.x series.

This release patches the FSL FAST interface to disable bias field correction,
which is redundant with N4 and can cause problems in some populations.

* FIX: Respect label order in precomputed derivatives (#478)
* FIX: Set FAST bias_iters parameter to 0 (#472)
* ENH: Tag structural workflows (#476)
* MNT: Update pinned environment, use conda-forge connectome-workbench (#468)
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.

Incorrect normalized tissue probseg filenames when using precomputed native-space tissue probseg from CAT12

2 participants