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

Matrix size wrong for tracking.utils.connectivity_matrix #361

Closed
AndrewLawrence opened this Issue May 6, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@AndrewLawrence
Contributor

AndrewLawrence commented May 6, 2014

Hi There,

Apologies if this would be better on a mailing list instead of github, but I spotted something funny in the tracking.utils.connectivity_matrix function.

I kept getting a smaller connectivity matrix than I expected for one given tractography set. This particular dataset it turns out was lacking any tracts with endpoints for the final ROI in the labels image. As the function sizes the matrix from the intersection of the labels and the endpoints it then outputs too small a matrix when this is passed to ndbincount.

as far as I can tell this can by fixed as follows (line 213 in _utils.py):

mx = endlabels.max() + 1

replace with:

mx = label_volume.max() + 1

In my test code this gives the correct output, but I'm very new to github so have no idea how to set up the fork/pull request to do this.

Could a dev test this and fix?

Thanks,

Andrew

@AndrewLawrence AndrewLawrence changed the title from tracking.utils.connectivity_matrix to Matrix size wrong for tracking.utils.connectivity_matrix May 6, 2014

@MrBago

This comment has been minimized.

Contributor

MrBago commented May 6, 2014

Good catch Andrew. This is obviously a pretty easy fix, but it's a good opportunity to get familiar with git, github and our workflow if you're interested in contributing more to dipy (or other projects) in the future.

If you're interested I'll assign this issue to you, and you can start by reading these pages.

http://git-scm.com/book/en/Getting-Started-Git-Basics
https://help.github.com/articles/fork-a-repo

AndrewLawrence added a commit to AndrewLawrence/dipy that referenced this issue May 6, 2014

@AndrewLawrence

This comment has been minimized.

Contributor

AndrewLawrence commented May 6, 2014

Thanks, that was easier than I thought! I have submitted a pull request.

MrBago added a commit that referenced this issue May 6, 2014

Merge pull request #362 from AndrewLawrence/master
Fix bug with connectivity matrix shape, issue #361.
@MrBago

This comment has been minimized.

Contributor

MrBago commented May 6, 2014

Closed by #362.

@MrBago MrBago closed this May 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment