8000 BF: get_filtered_streamlines by deka27 · Pull Request #3552 · dipy/dipy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

BF: get_filtered_streamlines #3552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

deka27
Copy link
Member
@deka27 deka27 commented May 23, 2025

This PR is a fix for Issue #2743.

Added a function to get filtered streamlines.
Test also added.

kudos to @Atharva-Shah-2298 for original groundwork.

Copy link
Member
@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

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

Hi @deka27,

Thank for this, here a first review

@deka27 deka27 changed the title BF: get_masked_streamlines BF: get_filtered_streamlines May 23, 2025
Copy link
Contributor
@Garyfallidis Garyfallidis left a comment

Choose a reason for hiding this comment

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

Here is a quick review.


Returns
-------
filtered_streamlines : list
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be ArraySequence (Streamlines Object).

Copy link
Member

Choose a reason for hiding this comment

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

if it is an ArraySequence, do not forget to take care of data_per_point and data_per_streamline.

dipy/tracking/utils.py 8000 Outdated
"""
res = np.array([s.shape[0] for s in streamlines])
res_mask = res > len
return [s for s, keep in zip(streamlines, res_mask) if keep]
Copy link
Contributor

Choose a reason for hiding this comment

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

return steamlines(res_mask) or steamlines(res_mask).copy()

@@ -108,6 +108,29 @@ def density_map(streamlines, affine, vol_dims):
return counts


def get_filtered_streamlines(streamlines, *, len=1):
Copy link
Contributor

Choose a reason for hiding this comment

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

discard_streamlines_by_size

@skoudoro
Copy link
Member
skoudoro commented Jun 3, 2025

What is the status of this @deka27 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0