-
Notifications
You must be signed in to change notification settings - Fork 60
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
ENH: remove sft._data
usage part 1 - tractogram coloring scripts + more
#1105
base: master
Are you sure you want to change the base?
Conversation
sft._data
usage part 1sft._data
usage part 1 - tractogram coloring scripts + more
# _lengths, so this feel kind of bad. However, the other way would be | ||
# to create a new ArraySequence and iterate over the streamlines, but | ||
# that would be way slower. | ||
data_as_arraysequence._data = data |
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.
Isn't there a way to hstack the data, or vstack, and then convert to array sequence?
In my PR #890 , I had done this. Is it really that much slower?
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.
Something I often do is that I create an array sequence with my streamlines like this:
dpp = sft.streamlines.copy()
dpp._data = my_array.copy()
That way everything is initialized with the right length, memory safe.
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.
@EmmaRenauld I feel like iterating over all streamlines would be problematic for large (>1M) tractograms.
@frheault the problem with your approach is the dpp is still "prealocated" using the streamlines, which is weird. I think this is a deeper problem stemming from the way ArraySequences work but I'd rather not have to preallocate data per points as the streamlines' points. Especially if more complicated processing is needed and some DPP may be left to the streamline's value by accident.
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.
@EmmaRenauld @frheault should be a bit cleaner now.
Hello @AntoineTheb, Thank you for updating ! There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2024-12-26 22:52:25 UTC |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1105 +/- ##
==========================================
+ Coverage 69.53% 69.55% +0.02%
==========================================
Files 448 448
Lines 24078 24088 +10
Branches 3291 3294 +3
==========================================
+ Hits 16742 16754 +12
+ Misses 5943 5941 -2
Partials 1393 1393
|
Quick description
As per #891, although does not fix it completely. In doing so , I ended up reworking
scil_tractogram_assign_custom_color.py
Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
No
Checklist