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

show_aparc_aseg_with_new_values fails w/ -1 index #22

Open
maedoc opened this issue Feb 1, 2017 · 1 comment
Open

show_aparc_aseg_with_new_values fails w/ -1 index #22

maedoc opened this issue Feb 1, 2017 · 1 comment
Assignees
Labels

Comments

@maedoc
Copy link
Member

maedoc commented Feb 1, 2017

Testing locally, I see a failure in test_show_aparc_aseg_with_new_values(), where in

            for i in xrange(aparc_aseg_matrix.shape[0]):
                for j in xrange(aparc_aseg_matrix.shape[1]):
                    if aparc_aseg_matrix[i][j] > 0:
                        if fs_to_conn_indices_mapping.has_key(aparc_aseg_matrix[i][j]):
                            aparc_aseg_matrix[i][j] = conn_measure[
                                fs_to_conn_indices_mapping.get(aparc_aseg_matrix[i][j])]
                        else:
                            aparc_aseg_matrix[i][j] = -1

I've fs_to_conn_indices_mapping.get(aparc_aseg_matrix[i][j]) returning -1.0, which is not a valid index. I don't see why this would pass on Travis but not locally (macos 10 10).

@maedoc maedoc added the bug label Feb 1, 2017
@maedoc maedoc self-assigned this Feb 1, 2017
@maedoc
Copy link
Member Author

maedoc commented Feb 1, 2017

This seems equivalent do a labelconvert from mrtrix.

I'm also certain this should be rewritten a la

aa_nnz = aparc_aseg_mat > 0
aparc_aseg_mat = aparc_aseg_mat * (~aa_nnz) + fs_conn_map[aparc_aseg_mat] * aa_nzz

but the issue remains: fs_conn_map has negative values, which are invalid for indexing.

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

No branches or pull requests

1 participant