Skip to content

Cannot create edgelist #2

@StatPal

Description

@StatPal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions