Skip to content

fix: improve side filtering to match tokens rather than substrings#10

Merged
teanijarv merged 2 commits into
teanijarv:mainfrom
gagnonanthony:fix/side_filtering
Apr 19, 2026
Merged

fix: improve side filtering to match tokens rather than substrings#10
teanijarv merged 2 commits into
teanijarv:mainfrom
gagnonanthony:fix/side_filtering

Conversation

@gagnonanthony
Copy link
Copy Markdown
Contributor

@gagnonanthony gagnonanthony commented Apr 9, 2026

I stumbled on a small issue with side filtering when plotting commissural bundles: when the bundle filename contained r_ or l_, it was incorrectly assigned to a hemisphere, whereas it should appear in both. See below for an example where the filename was CC_Fr_1.trk:
image

I simply changed how side filtering was performed: tokenize the filename, then match side patterns. It now does not catch trailing substrings (e.g., r_ or l_):
image

The filtering steps also still work for truly lateralized bundles (assuming either left, right, l, r, lh, or rh is in the filename).

@gagnonanthony gagnonanthony changed the title fix: improve side filtering to match tokens fix: improve side filtering to match tokens rather than substrings Apr 9, 2026
slight reformat + add also to plot_subcortical
@teanijarv teanijarv merged commit 0f5f90f into teanijarv:main Apr 19, 2026
3 checks passed
@teanijarv
Copy link
Copy Markdown
Owner

teanijarv commented Apr 19, 2026

Thanks! I did a minor edit to one line and also replicated same approach to plot_subcortical()

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