-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add new_vol_like convenience function #60
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #60 +/- ##
==========================================
+ Coverage 52.27% 52.36% +0.08%
==========================================
Files 6 6
Lines 549 550 +1
==========================================
+ Hits 287 288 +1
Misses 262 262
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
After a bit of a hiatus Im back and reviewing stuff here. I have to think about this one a bit more because |
What exactly do you mean by that? Forgive me if I'm being naive, but since this is simply a wrapper for arrays + some metadata, wouldn't array optimizations still carry over to NIVolumes? I imagine that most heavy processing steps would begin with dumping out the raw data from the NIVolume anyways -- thus the convenience of having a new_vol_like() function. |
If you care for the long version take a look at this demonstration of poorly optimized wrapped arrays for a basic copy method. JuliaArrays/ArrayInterface.jl#235 (comment) You're right that 80% of the time it won't make a noticeable difference, especially compared to other languages, but I'm greedy and a bit lazy. I want all of my methods to be as fast as possible and I want to maintain as few array types as possible. More importantly, we want to use as many well maintained community packages so we can focus on the neuroscience. There are some other issues with the current approach but I would rather we focus on getting you a workable solution. Are you just trying to create new instances so you can save to a nifti file |
Added convenience function for creating new volumes, analogous to nilearn's image.new_img_like. This is perhaps too trivial to add as a function, but
new_img_like
is something that I reach for regularly when working with nilearn, and I think it would benefit NIfTI.jl as well.