Skip to content
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

Reflects assumptions about streamlines fix recommended (and incoming) #16

Closed
DanNBullock opened this issue Apr 29, 2021 · 5 comments
Closed

Comments

@DanNBullock
Copy link

DanNBullock commented Apr 29, 2021

Lmm = cellfun('length',fg.fibers);

This computation assumes that (1) the nodes of streamlines are always 1mm spaced and (2) evenly spaced (such that each internode difference is equivalent).

Currently it is simply returning the number of nodes in all streamlines in an fg.

This is particularly a problem due to:

if notDefined('numberOfNodes'), numberOfNodes=100; end

if notDefined('numberOfNodes'), numberOfNodes=100; end

which resamples all streamlines to the same number of nodes

Recommended fix:

streamsTotal=fg.fibers;
Lmm =[];
for istreamlines=1:length(fg.fibers)
Lmm(istreamlines)=sum(sqrt(sum(diff(streamsTotal{istreamlines},1,2).^2)));
end

(or some cellfun variant thereof to avoid the streamsTotal reassignment)

@francopestilli
Copy link
Owner

@DanNBullock sounds good slower but geenral can you please make a pull request?
I accepted your previous pull, so update the repo.

@DanNBullock
Copy link
Author

ok, I should probably test it first though, will do that and then make request

@francopestilli
Copy link
Owner

yes pls
happy to test on my side too

@DanNBullock
Copy link
Author

resolved: #17

@DanNBullock
Copy link
Author

Interesting epilogue to this story:

Apparently a similar issue was also included in MRtrix for a while:

MRtrix3/mrtrix3@bbfdaea

But then they ended up getting a publication out of fixing it:

https://www.sciencedirect.com/science/article/pii/S105381192200859X

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

No branches or pull requests

2 participants