-
Notifications
You must be signed in to change notification settings - Fork 447
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
There was a problem hiding this 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.
dipy/tracking/utils.py
Outdated
|
||
Returns | ||
------- | ||
filtered_streamlines : list |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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()
dipy/tracking/utils.py
Outdated
@@ -108,6 +108,29 @@ def density_map(streamlines, affine, vol_dims): | |||
return counts | |||
|
|||
|
|||
def get_filtered_streamlines(streamlines, *, len=1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discard_streamlines_by_size
What is the status of this @deka27 ? |
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.