-
Notifications
You must be signed in to change notification settings - Fork 1
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
Scalars and properties #3
Comments
I now realize that a part of my design is impossible! Namely the "iteration" part. I forgot that
So I can't have a specific iteration for Knowing this, we simply need to go a little further into NiBabel. I already wrote about What's interesting is that this solves one of our problems.
* Yes, "just like NiBabel". |
I like it. |
"s/p" means "scalars and/or properties"
Premises
Read all
People calling
read_all
wants everything in one shot and they don't care about memory consumption. Hence we can change the definition ofread_all
toSo, always return
(streamlines, vec![], vec![])
whenreturn_all=false
. An emptyvec![]
doesn't allocate. The reading time should mostly stay the same whenfalse
. The usage stays pleasantOf course we modify
write_all
to receive those 3 arguments. They really should fit!Iteration
NiBabel::TractogramItem
and iteration make sense to me. In NiBabel, they return a struct on iteration, something likeI wonder though if we should offer 2 iterators.
I'm not sure about the naming. Maybe we should rename the fast one to
iter_points()
and keep the standarditer
for the complete one? If we only offer one, it should be the complete one, of course.Usage
s/p are
f32
. We can't avoid that and it's in fact ok. It's less fun for "grouped" s/p like colors. We should offer a tool to manage colors in a non-terrible way. Nothing complicated, just a method that try to find which properties are the color then returns an iterator oftuple(r, g, b)
. I want something likeSaving on iteration
We currently have 3 write methods:
write_all
(already been discussed),write
andwrite_from_iter
. They both write a single streamline. We can either change their signatures to receive 2Option<>
OR double them to have a "points" version and a "points and s/p" version.Here's a read + add colors example that will crash if there's already one or more s/p
TBH, I'm not too sure about the
write_from_iter
. Maybe it should stay exactly as it is. Maybe not. I'll probably have an opinion when I code it or when I use it.The text was updated successfully, but these errors were encountered: