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

Cannot create edgelist #2

Open
StatPal opened this issue Feb 14, 2022 · 0 comments
Open

Cannot create edgelist #2

StatPal opened this issue Feb 14, 2022 · 0 comments

Comments

@StatPal
Copy link

StatPal commented Feb 14, 2022

Trying to reproduce the results you provided as in SkeletonMatching.ipynb
Running on: Google Colab

The errors while creating edgelist using

_, edgeList1, _, _, _, _, _, _ = skeleton2Graph(s1,s1)

are as follows

/content/SkeletonMatching/skeleton2Graph.py:260: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  skeletonTemp[edgePoints.T.tolist()] = - edgeNumber
/content/SkeletonMatching/skeleton2Graph.py:288: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  skeletonTemp[edgePoints.T.tolist()] = - edgeNumber
/content/SkeletonMatching/skeleton2Graph.py:313: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  endGaussianValue = gaussianKernelMatrix[vector2EndGaussian.T.tolist()]
/content/SkeletonMatching/skeleton2Graph.py:314: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  endFluxValue = fluxMap[np.array(edgePoints).T.tolist()] * endGaussianValue
/content/SkeletonMatching/skeleton2Graph.py:318: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  startGaussianValue = gaussianKernelMatrix[vector2StartGaussian.T.tolist()]
/content/SkeletonMatching/skeleton2Graph.py:319: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  startFluxValue = fluxMap[np.array(edgePoints).T.tolist()] * startGaussianValue
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
[<ipython-input-6-ae6ce59447cc>](https://localhost:8080/#) in <module>()
      1 s1 = mat2gray(io.imread(os.path.join(os.getcwd(), 'SkeletonMatching/img/s1.png'),as_gray=True)).astype('float64')
      2 s2 = mat2gray(io.imread(os.path.join(os.getcwd(), 'SkeletonMatching/img/s2.png'),as_gray=True)).astype('float64')
----> 3 _, edgeList1, _, _, _, _, _, _ = skeleton2Graph(s1,s1)
      4 _, edgeList2, _, _, _, _, _, _ = skeleton2Graph(s2,s2)
      5 s1Tangent, s1PointsList = sc.skeletonTangentEstimate(edgeList1)

[/content/SkeletonMatching/skeleton2Graph.py](https://localhost:8080/#) in skeleton2Graph(skeleton, fluxMap, sigma)
    327         if (~ edgeLinkedNumber.any()):
    328             continue
--> 329         edgeLinkedLength = np.array(edgeLength)[map(int, list(np.abs(edgeLinkedNumber) - 1))].tolist()
    330         searchDepth = min(edgeLinkedLength)
    331         for el in edgeLinkedNumber:

IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
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

1 participant