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

Failing on cortex 2x120k #41

Closed
ayan-b opened this issue Jun 16, 2020 · 3 comments · Fixed by #48 · May be fixed by #44
Closed

Failing on cortex 2x120k #41

ayan-b opened this issue Jun 16, 2020 · 3 comments · Fixed by #48 · May be fixed by #44
Assignees
Labels
Milestone

Comments

@ayan-b
Copy link
Member

ayan-b commented Jun 16, 2020

Dataset: https://github.com/the-virtual-brain/tvb-data/blob/master/tvb_data/surfaceData/cortex_2x120k.zip

Used code:

import numpy as np

import gdist


file = "cortex_2x120k"

for t in ['l', 'r']:
    print("Trying " + t)
    vertices = np.loadtxt("data/surface_data/" + file +
                        "/vertices" + t + ".txt", dtype=np.float64)
    triangles = np.loadtxt("data/surface_data/" + file +
                        "/triangles" + t + ".txt", dtype=np.int32)
    source = np.array([0, 1, 2, 3], dtype=np.int32)
    target = np.array([2, 5], dtype=np.int32)
    distance = gdist.compute_gdist(
        vertices,
        triangles,
        source,
        target,
    )
    print(distance)

Related to #22

While only using the C++ library:

Assertion failed!
File: geodesic_mesh.h, Line 158

Expression: vertex_index < num_vertices
@liadomide liadomide added this to the GSOC2020 milestone Jun 22, 2020
@liadomide liadomide added the bug label Jun 22, 2020
@ayan-b
Copy link
Member Author

ayan-b commented Jun 24, 2020

This is failing because the code expects the vertices indicated by the faces to be 0-indexed. However, it is 1-indexed for the cortex mesh and thus it is going out of bound for the last vertex.

@liadomide
Copy link
Member

Good finding. Could you pls add a unit-test on this?

@ayan-b
Copy link
Member Author

ayan-b commented Jun 25, 2020

Added in e6f6e19.

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