From 1495370906187a9efd7f2ddc611b006cbad5a793 Mon Sep 17 00:00:00 2001 From: William Silversmith Date: Thu, 14 Apr 2022 16:50:09 -0400 Subject: [PATCH 1/3] feat: add gradient function --- dijkstra3d.hpp | 224 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 181 insertions(+), 43 deletions(-) diff --git a/dijkstra3d.hpp b/dijkstra3d.hpp index 0fd5c48..109f9c5 100644 --- a/dijkstra3d.hpp +++ b/dijkstra3d.hpp @@ -61,7 +61,7 @@ inline std::vector query_shortest_path(const OUT* parents, const OUT target } inline void compute_neighborhood_helper( - int *neighborhood, + int (&neighborhood)[26], const int x, const int y, const int z, const uint64_t sx, const uint64_t sy, const uint64_t sz, const int connectivity = 26) { @@ -110,7 +110,7 @@ inline void compute_neighborhood_helper( } inline void compute_neighborhood( - int *neighborhood, + int (&neighborhood)[NHOOD_SIZE], const int x, const int y, const int z, const uint64_t sx, const uint64_t sy, const uint64_t sz, const int connectivity = 26, const uint32_t* voxel_connectivity_graph = NULL) { @@ -168,6 +168,66 @@ inline void compute_neighborhood( neighborhood[25] *= ((graph & 0b00000001000000000000000000) > 0); // +x,+y,+z } +// helper function to compute 2D anisotropy ("_s" = "square") +inline float _s(const float wa, const float wb) { + return std::sqrt(wa * wa + wb * wb); +} + +// helper function to compute 3D anisotropy ("_c" = "cube") +inline float _c(const float wa, const float wb, const float wc) { + return std::sqrt(wa * wa + wb * wb + wc * wc); +} + +void compute_eucl_distance( + float (&eucl_distance)[NHOOD_SIZE], + const float wx, const float wy, const float wz +) { + + // 6-hood + eucl_distance[0] = sq(wx); // -x + eucl_distance[1] = sq(wx); // +x + eucl_distance[2] = sq(wy); // -y + eucl_distance[3] = sq(wy); // +y + eucl_distance[4] = sq(wz); // -z + eucl_distance[5] = sq(wz); // +z + + // 18-hood + + // xy diagonals + eucl_distance[6] = sq(_s(wx, wy)); // up-left + eucl_distance[7] = sq(_s(wx, wy)); // up-right + eucl_distance[8] = sq(_s(wx, wy)); // down-left + eucl_distance[9] = sq(_s(wx, wy)); // down-right + + + // yz diagonals + eucl_distance[10] = sq(_s(wy, wz)); // up-left + eucl_distance[11] = sq(_s(wy, wz)); // up-right + eucl_distance[12] = sq(_s(wy, wz)); // down-left + eucl_distance[13] = sq(_s(wy, wz)); // down-right + + + + // xz diagonals + eucl_distance[14] = sq(_s(wx, wz)); // up-left + eucl_distance[15] = sq(_s(wx, wz)); // up-right + eucl_distance[16] = sq(_s(wx, wz)); // down-left + eucl_distance[17] = sq(_s(wx, wz)); // down-right + + + // 26-hood + + // Now the eight corners of the cube + eucl_distance[18] = sq(_c(wx, wy, wz)); + eucl_distance[19] = sq(_c(wx, wy, wz)); + eucl_distance[20] = sq(_c(wx, wy, wz)); + eucl_distance[21] = sq(_c(wx, wy, wz)); + eucl_distance[22] = sq(_c(wx, wy, wz)); + eucl_distance[23] = sq(_c(wx, wy, wz)); + eucl_distance[24] = sq(_c(wx, wy, wz)); + eucl_distance[25] = sq(_c(wx, wy, wz)); +} + template class HeapNode { @@ -209,37 +269,14 @@ struct HeapNodeCompare { HEDLEYX_PREFETCH(reinterpret_cast(&field[(loc) + sx - 1]), 0, 1); \ HEDLEYX_PREFETCH(reinterpret_cast(&field[(loc) - sx - 1]), 0, 1); -/* Perform dijkstra's shortest path algorithm - * on a 3D image grid. Vertices are voxels and - * edges are the 26 nearest neighbors (except - * for the edges of the image where the number - * of edges is reduced). - * - * For given input voxels A and B, the edge - * weight from A to B is B and from B to A is - * A. All weights must be non-negative (incl. - * negative zero). - * - * I take advantage of negative weights to mean - * "visited". - * - * Parameters: - * T* field: Input weights. T can be be a floating or - * signed integer type, but not an unsigned int. - * sx, sy, sz: size of the volume along x,y,z axes in voxels. - * source: 1D index of starting voxel - * target: 1D index of target voxel - * - * Returns: vector containing 1D indices of the path from - * source to target including source and target. - */ -template -std::vector dijkstra3d( +template +std::vector dijkstra3d_loop( T* field, const size_t sx, const size_t sy, const size_t sz, const size_t source, const size_t target, - const int connectivity = 26, - const uint32_t* voxel_connectivity_graph = NULL + const int connectivity, + const uint32_t* voxel_connectivity_graph, + Fn &&distance_fn ) { connectivity_check(connectivity); @@ -308,7 +345,7 @@ std::vector dijkstra3d( } neighboridx = loc + neighborhood[i]; - delta = static_cast(field[neighboridx]); // high cache miss + delta = distance_fn(i, loc, neighboridx); // Visited nodes are negative and thus the current node // will always be less than as field is filled with non-negative @@ -345,6 +382,116 @@ std::vector dijkstra3d( return path; } +/* Perform dijkstra's shortest path algorithm + * on a 3D image grid. Vertices are voxels and + * edges are the 26 nearest neighbors (except + * for the edges of the image where the number + * of edges is reduced). + * + * For given input voxels A and B, the edge + * weight from A to B is B and from B to A is + * A. All weights must be non-negative (incl. + * negative zero). + * + * I take advantage of negative weights to mean + * "visited". + * + * Parameters: + * T* field: Input weights. T can be be a floating or + * signed integer type, but not an unsigned int. + * sx, sy, sz: size of the volume along x,y,z axes in voxels. + * source: 1D index of starting voxel + * target: 1D index of target voxel + * + * Returns: vector containing 1D indices of the path from + * source to target including source and target. + */ +template +std::vector dijkstra3d( + T* field, + const size_t sx, const size_t sy, const size_t sz, + const size_t source, const T target, + const int connectivity = 26, + const uint32_t* voxel_connectivity_graph = NULL + ) { + + return dijkstra3d_loop( + field, + sx, sy, sz, + source, target, + connectivity, voxel_connectivity_graph, + [&](int i, size_t loc, size_t neighboridx) { + return static_cast(field[neighboridx]); + } + ); +} + +/* Perform dijkstra's shortest path algorithm + * on a 3D image grid using the difference between + * neighbors as the distance function. + * This is the anisotropic euclidean distance with + * field intensity as the fourth variable. + * The weights w_dist and w_intensity are provided + * to allow you to emphasize the physical distance + * or intensity components (by default they are + * equally weighted). + * + * Vertices are voxels and + * edges are the 26 nearest neighbors (except + * for the edges of the image where the number + * of edges is reduced). + * + * For given input voxels A and B, the edge + * weight from A to B is B and from B to A is + * A. All weights must be non-negative (incl. + * negative zero). + * + * I take advantage of negative weights to mean + * "visited". + * + * Parameters: + * T* field: Input weights. T can be be a floating or + * signed integer type, but not an unsigned int. + * sx, sy, sz: size of the volume along x,y,z axes in voxels. + * wx, wy, wz: anisotropy (distance weights) in x, y, and z + * w_dist, w_intensity: multiplies the distance and intensity + * in the distance function. + * source: 1D index of starting voxel + * target: 1D index of target voxel + * connectivity: 6, 18, or 26 connected + * voxel_connectivity_graph: define impassible directions + * on a voxel. + * + * Returns: vector containing 1D indices of the path from + * source to target including source and target. + */ +template +std::vector dijkstra3d_gradient( + T* field, + const size_t sx, const size_t sy, const size_t sz, + const float wx, const float wy, const float wz, + const size_t source, const size_t target, + const float w_dist = 1.0, const float w_intensity = 1.0, + const int connectivity = 26, + const uint32_t* voxel_connectivity_graph = NULL +) { + + float eucl_distance[NHOOD_SIZE]; + compute_eucl_distance(eucl_distance, wx, wy, wz); + + return dijkstra3d_loop( + field, + sx, sy, sz, + source, target, + connectivity, voxel_connectivity_graph, + [&](int i, size_t loc, size_t neighboridx) { + float delta = sq(w_dist) * eucl_distance[i]; + delta += sq(w_intensity) * sq(static_cast(field[neighboridx]) - static_cast(field[loc])); // high cache miss + return std::sqrt(delta); + } + ); +} + /* Perform dijkstra's shortest path algorithm * on a 3D image grid where the source is specified * but the target is a value on the grid (typically 0) @@ -1199,16 +1346,6 @@ size_t edf_free_space( return max_loc; } -// helper function to compute 2D anisotropy ("_s" = "square") -inline float _s(const float wa, const float wb) { - return std::sqrt(wa * wa + wb * wb); -} - -// helper function to compute 3D anisotropy ("_c" = "cube") -inline float _c(const float wa, const float wb, const float wc) { - return std::sqrt(wa * wa + wb * wb + wc * wc); -} - // really a chamfer distance float* euclidean_distance_field3d( uint8_t* field, // really a boolean field @@ -1370,9 +1507,10 @@ float* euclidean_distance_field3d( ); } - +#undef sq +#undef NHOOD_SIZE #undef DIJKSTRA_3D_PREFETCH_26WAY -}; // namespace dijkstra3d +}; // namespace dijkstra #endif \ No newline at end of file From 47ce41bdd09f00048d3587743a23378cc7c2c91f Mon Sep 17 00:00:00 2001 From: William Silversmith Date: Thu, 14 Apr 2022 17:11:47 -0400 Subject: [PATCH 2/3] feat: adds gradient mode to dijkstra3d.dijkstra --- dijkstra3d.cpp | 9236 ++++++++++++++++++++++++++++++------------------ dijkstra3d.pyx | 214 +- 2 files changed, 6089 insertions(+), 3361 deletions(-) diff --git a/dijkstra3d.cpp b/dijkstra3d.cpp index d9f89c0..dfce033 100644 --- a/dijkstra3d.cpp +++ b/dijkstra3d.cpp @@ -630,6 +630,9 @@ static CYTHON_INLINE float __PYX_NAN() { #include "typeinfo" #include #include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" #include "numpy/ufuncobject.h" /* NumPy API declarations from "numpy/__init__.pxd" */ @@ -983,7 +986,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int; #define __Pyx_FastGilFuncInit() -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":689 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -992,7 +995,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int; */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":690 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":691 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1001,7 +1004,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":691 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":692 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1010,7 +1013,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":692 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":693 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1019,7 +1022,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":696 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1028,7 +1031,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":697 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":698 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1037,7 +1040,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":698 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":699 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1046,7 +1049,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":699 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":700 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1055,7 +1058,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":703 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1064,7 +1067,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":704 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":705 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1073,7 +1076,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":713 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":714 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1082,7 +1085,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":714 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":715 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1091,7 +1094,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":715 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":716 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1100,7 +1103,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":717 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1109,7 +1112,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":718 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":719 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1118,7 +1121,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":719 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":720 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1127,7 +1130,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":721 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1136,7 +1139,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":722 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":723 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1145,7 +1148,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":724 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1154,7 +1157,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":725 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":726 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1163,7 +1166,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":726 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":727 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1206,7 +1209,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":728 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1215,7 +1218,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":729 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":730 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1224,7 +1227,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":730 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":731 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1233,7 +1236,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":732 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1622,6 +1625,37 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* PyObjectFormatSimple.proto */ +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#elif PY_MAJOR_VERSION < 3 + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ + PyObject_Format(s, f)) +#elif CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_str(s) :\ + likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(s) :\ + PyObject_Format(s, f)) +#else + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#endif + /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -1851,15 +1885,6 @@ static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals @@ -2674,6 +2699,16 @@ static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_generic = 0; +static PyTypeObject *__pyx_ptype_5numpy_number = 0; +static PyTypeObject *__pyx_ptype_5numpy_integer = 0; +static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_inexact = 0; +static PyTypeObject *__pyx_ptype_5numpy_floating = 0; +static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0; +static PyTypeObject *__pyx_ptype_5numpy_flexible = 0; +static PyTypeObject *__pyx_ptype_5numpy_character = 0; static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; /* Module declarations from 'dijkstra3d' */ @@ -2748,8 +2783,8 @@ static const char __pyx_k_T[] = "T{"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_s[] = "s"; - static const char __pyx_k__4[] = "()"; - static const char __pyx_k__5[] = "|"; + static const char __pyx_k__6[] = "()"; + static const char __pyx_k__7[] = "|"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_pt[] = "pt"; @@ -2759,11 +2794,11 @@ static const char __pyx_k_T[] = "T{"; static const char __pyx_k_wx[] = "wx"; static const char __pyx_k_wy[] = "wy"; static const char __pyx_k_wz[] = "wz"; - static const char __pyx_k__30[] = "^"; - static const char __pyx_k__31[] = ""; - static const char __pyx_k__32[] = ":"; -static const char __pyx_k__33[] = "}"; -static const char __pyx_k__34[] = ","; + static const char __pyx_k__31[] = "^"; + static const char __pyx_k__32[] = ""; + static const char __pyx_k__33[] = ":"; +static const char __pyx_k__34[] = "}"; +static const char __pyx_k__35[] = ","; static const char __pyx_k_buf[] = "buf"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_max[] = "max"; @@ -2826,6 +2861,7 @@ static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_kwargs[] = "kwargs"; +static const char __pyx_k_metric[] = "metric"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_output[] = "output"; @@ -2841,6 +2877,7 @@ static const char __pyx_k_uint64[] = "uint64"; static const char __pyx_k_unpack[] = "unpack"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_voxels[] = "voxels"; +static const char __pyx_k_w_dist[] = "w_dist"; static const char __pyx_k_VERSION[] = "__VERSION__"; static const char __pyx_k_compass[] = "compass"; static const char __pyx_k_float32[] = "float32"; @@ -2859,6 +2896,7 @@ static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_defaults[] = "defaults"; static const char __pyx_k_dijkstra[] = "dijkstra"; static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_gradient[] = "gradient"; static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_output32[] = "output32"; static const char __pyx_k_output64[] = "output64"; @@ -2874,6 +2912,7 @@ static const char __pyx_k_vec_view[] = "vec_view"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_dist_view[] = "dist_view"; static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_intensity[] = "intensity"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_parents32[] = "parents32"; static const char __pyx_k_parents64[] = "parents64"; @@ -2895,7 +2934,9 @@ static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_arr_memview[] = "arr_memview"; +static const char __pyx_k_metric_args[] = "metric_args"; static const char __pyx_k_voxel_graph[] = "voxel_graph"; +static const char __pyx_k_w_intensity[] = "w_intensity"; static const char __pyx_k_arr_memview8[] = "arr_memview8"; static const char __pyx_k_compass_norm[] = "compass_norm"; static const char __pyx_k_connectivity[] = "connectivity"; @@ -2946,6 +2987,7 @@ static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type ' static const char __pyx_k_euclidean_distance_field[] = "euclidean_distance_field"; static const char __pyx_k_path_from_parents_helper[] = "_path_from_parents_helper"; static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static const char __pyx_k_execute_gradient_dijkstra[] = "_execute_gradient_dijkstra"; static const char __pyx_k_No_matching_signature_found[] = "No matching signature found"; static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; static const char __pyx_k_Type_not_currently_supported[] = "Type {} not currently supported."; @@ -2968,6 +3010,7 @@ static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible che static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; static const char __pyx_k_Only_2D_and_3D_image_sources_are[] = "Only 2D and 3D image sources are supported. Got: "; +static const char __pyx_k_Only_intensity_and_gradient_mode[] = "Only intensity and gradient modes are supported. Got: "; static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; static const char __pyx_k_Selected_voxel_was_not_located_i[] = "Selected voxel {} was not located inside the array."; static const char __pyx_k_Something_went_wrong_during_proc[] = "Something went wrong during processing. max_loc: "; @@ -3003,6 +3046,7 @@ static PyObject *__pyx_kp_s_No_matching_signature_found; static PyObject *__pyx_n_b_O; static PyObject *__pyx_kp_u_Only_2D_and_3D_image_sources_are; static PyObject *__pyx_kp_u_Only_6_18_and_26_connectivities; +static PyObject *__pyx_kp_u_Only_intensity_and_gradient_mode; static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_kp_u_Selected_voxel_was_not_located_i; @@ -3014,13 +3058,13 @@ static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; static PyObject *__pyx_n_s_VERSION; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_View_MemoryView; -static PyObject *__pyx_kp_b__30; static PyObject *__pyx_kp_b__31; static PyObject *__pyx_kp_b__32; static PyObject *__pyx_kp_b__33; -static PyObject *__pyx_kp_u__34; -static PyObject *__pyx_kp_s__4; -static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_b__34; +static PyObject *__pyx_kp_u__35; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_kp_s__7; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_anisotropy; static PyObject *__pyx_n_s_args; @@ -3070,6 +3114,7 @@ static PyObject *__pyx_n_s_euclidean_distance_field; static PyObject *__pyx_n_s_execute_dijkstra; static PyObject *__pyx_n_s_execute_distance_field; static PyObject *__pyx_n_s_execute_euclidean_distance_fiel; +static PyObject *__pyx_n_s_execute_gradient_dijkstra; static PyObject *__pyx_n_s_execute_parental_field; static PyObject *__pyx_n_s_execute_value_target_dijkstra; static PyObject *__pyx_n_s_field; @@ -3084,6 +3129,7 @@ static PyObject *__pyx_n_s_free_space_radius; static PyObject *__pyx_n_s_frombuffer; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_u_gradient; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_iinfo; @@ -3092,6 +3138,7 @@ static PyObject *__pyx_n_s_int16; static PyObject *__pyx_n_s_int32; static PyObject *__pyx_n_s_int64; static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_u_intensity; static PyObject *__pyx_n_s_issubdtype; static PyObject *__pyx_n_s_itemsize; static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; @@ -3103,6 +3150,8 @@ static PyObject *__pyx_n_s_max; static PyObject *__pyx_n_s_max_loc; static PyObject *__pyx_n_s_memview; static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_metric; +static PyObject *__pyx_n_s_metric_args; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_name; @@ -3207,29 +3256,32 @@ static PyObject *__pyx_n_s_voxel_graph; static PyObject *__pyx_n_s_voxel_graph_memview; static PyObject *__pyx_n_s_voxel_graph_ptr; static PyObject *__pyx_n_s_voxels; +static PyObject *__pyx_n_s_w_dist; +static PyObject *__pyx_n_s_w_intensity; static PyObject *__pyx_n_s_wx; static PyObject *__pyx_n_s_wy; static PyObject *__pyx_n_s_wz; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_voxel_graph); /* proto */ -static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, PyObject *__pyx_v_bidirectional, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_compass, PyObject *__pyx_v_compass_norm, PyObject *__pyx_v_voxel_graph); /* proto */ +static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, PyObject *__pyx_v_bidirectional, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_compass, PyObject *__pyx_v_compass_norm, PyObject *__pyx_v_voxel_graph, PyObject *__pyx_v_metric, PyObject *__pyx_v_metric_args, PyObject *__pyx_v_anisotropy); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph, PyObject *__pyx_v_return_max_location); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ -static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target); /* proto */ +static PyObject *__pyx_pf_10dijkstra3d_38_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_parents, PyObject *__pyx_v_target); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_anisotropy, PyObject *__pyx_v_free_space_radius, PyObject *__pyx_v_voxel_graph, PyObject *__pyx_v_return_max_location); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_coord); /* proto */ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_dims, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols); /* proto */ -static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, int __pyx_v_connectivity, PyObject *__pyx_v_voxel_graph); /* proto */ -static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, int __pyx_v_connectivity, PyObject *__pyx_v_bidirectional, PyObject *__pyx_v_compass, float __pyx_v_compass_norm, PyObject *__pyx_v_voxel_graph); /* proto */ -static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_sources, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph); /* proto */ -static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph); /* proto */ -static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_sources, PyObject *__pyx_v_anisotropy, float __pyx_v_free_space_radius, PyObject *__pyx_v_voxel_graph); /* proto */ +static PyObject *__pyx_pf_10dijkstra3d_20_execute_gradient_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, float __pyx_v_wx, float __pyx_v_wy, float __pyx_v_wz, float __pyx_v_w_dist, float __pyx_v_w_intensity, int __pyx_v_connectivity, PyObject *__pyx_v_voxel_graph); /* proto */ +static PyObject *__pyx_pf_10dijkstra3d_22_execute_value_target_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, int __pyx_v_connectivity, PyObject *__pyx_v_voxel_graph); /* proto */ +static PyObject *__pyx_pf_10dijkstra3d_24_execute_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, int __pyx_v_connectivity, PyObject *__pyx_v_bidirectional, PyObject *__pyx_v_compass, float __pyx_v_compass_norm, PyObject *__pyx_v_voxel_graph); /* proto */ +static PyObject *__pyx_pf_10dijkstra3d_26_execute_distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_sources, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph); /* proto */ +static PyObject *__pyx_pf_10dijkstra3d_28_execute_parental_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph); /* proto */ +static PyObject *__pyx_pf_10dijkstra3d_30_execute_euclidean_distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_sources, PyObject *__pyx_v_anisotropy, float __pyx_v_free_space_radius, PyObject *__pyx_v_voxel_graph); /* proto */ static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */ static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ @@ -3278,6 +3330,7 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_float_1_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; @@ -3289,14 +3342,14 @@ static PyObject *__pyx_int_18; static PyObject *__pyx_int_26; static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_tuple_; -static PyObject *__pyx_slice__2; -static PyObject *__pyx_slice__8; +static PyObject *__pyx_k_; +static PyObject *__pyx_slice__4; +static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__6; -static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_tuple__10; +static PyObject *__pyx_slice__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; @@ -3316,46 +3369,49 @@ static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; -static PyObject *__pyx_tuple__35; -static PyObject *__pyx_tuple__37; -static PyObject *__pyx_tuple__39; -static PyObject *__pyx_tuple__41; -static PyObject *__pyx_tuple__43; -static PyObject *__pyx_tuple__45; -static PyObject *__pyx_tuple__47; -static PyObject *__pyx_tuple__49; -static PyObject *__pyx_tuple__51; -static PyObject *__pyx_tuple__53; -static PyObject *__pyx_tuple__55; -static PyObject *__pyx_tuple__57; -static PyObject *__pyx_tuple__59; -static PyObject *__pyx_tuple__61; -static PyObject *__pyx_tuple__63; -static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__66; -static PyObject *__pyx_tuple__67; static PyObject *__pyx_tuple__68; static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__70; -static PyObject *__pyx_codeobj__36; -static PyObject *__pyx_codeobj__38; -static PyObject *__pyx_codeobj__40; -static PyObject *__pyx_codeobj__42; -static PyObject *__pyx_codeobj__44; -static PyObject *__pyx_codeobj__46; -static PyObject *__pyx_codeobj__48; -static PyObject *__pyx_codeobj__50; -static PyObject *__pyx_codeobj__52; -static PyObject *__pyx_codeobj__54; -static PyObject *__pyx_codeobj__56; -static PyObject *__pyx_codeobj__58; -static PyObject *__pyx_codeobj__60; -static PyObject *__pyx_codeobj__62; -static PyObject *__pyx_codeobj__64; -static PyObject *__pyx_codeobj__71; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +static PyObject *__pyx_codeobj__45; +static PyObject *__pyx_codeobj__47; +static PyObject *__pyx_codeobj__49; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; +static PyObject *__pyx_codeobj__55; +static PyObject *__pyx_codeobj__57; +static PyObject *__pyx_codeobj__59; +static PyObject *__pyx_codeobj__61; +static PyObject *__pyx_codeobj__63; +static PyObject *__pyx_codeobj__65; +static PyObject *__pyx_codeobj__67; +static PyObject *__pyx_codeobj__74; /* Late includes */ -/* "dijkstra3d.pyx":102 +/* "dijkstra3d.pyx":110 * ) * * def format_voxel_graph(voxel_graph): # <<<<<<<<<<<<<< @@ -3395,7 +3451,7 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject __Pyx_RefNannySetupContext("format_voxel_graph", 0); __Pyx_INCREF(__pyx_v_voxel_graph); - /* "dijkstra3d.pyx":103 + /* "dijkstra3d.pyx":111 * * def format_voxel_graph(voxel_graph): * while voxel_graph.ndim < 3: # <<<<<<<<<<<<<< @@ -3403,27 +3459,27 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject * */ while (1) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_voxel_graph, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_voxel_graph, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) break; - /* "dijkstra3d.pyx":104 + /* "dijkstra3d.pyx":112 * def format_voxel_graph(voxel_graph): * while voxel_graph.ndim < 3: * voxel_graph = voxel_graph[..., np.newaxis] # <<<<<<<<<<<<<< * * if not np.issubdtype(voxel_graph.dtype, np.uint32): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_Ellipsis); __Pyx_GIVEREF(Py_Ellipsis); @@ -3431,30 +3487,30 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_voxel_graph, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_voxel_graph, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_voxel_graph, __pyx_t_1); __pyx_t_1 = 0; } - /* "dijkstra3d.pyx":106 + /* "dijkstra3d.pyx":114 * voxel_graph = voxel_graph[..., np.newaxis] * * if not np.issubdtype(voxel_graph.dtype, np.uint32): # <<<<<<<<<<<<<< * voxel_graph = voxel_graph.astype(np.uint32, order="F") * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_voxel_graph, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_voxel_graph, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -3472,7 +3528,7 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3482,7 +3538,7 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3490,7 +3546,7 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -3501,39 +3557,39 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_6); __pyx_t_2 = 0; __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = ((!__pyx_t_3) != 0); if (__pyx_t_9) { - /* "dijkstra3d.pyx":107 + /* "dijkstra3d.pyx":115 * * if not np.issubdtype(voxel_graph.dtype, np.uint32): * voxel_graph = voxel_graph.astype(np.uint32, order="F") # <<<<<<<<<<<<<< * * return np.asfortranarray(voxel_graph) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_voxel_graph, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_voxel_graph, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 107, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -3541,7 +3597,7 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject __Pyx_DECREF_SET(__pyx_v_voxel_graph, __pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":106 + /* "dijkstra3d.pyx":114 * voxel_graph = voxel_graph[..., np.newaxis] * * if not np.issubdtype(voxel_graph.dtype, np.uint32): # <<<<<<<<<<<<<< @@ -3550,7 +3606,7 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject */ } - /* "dijkstra3d.pyx":109 + /* "dijkstra3d.pyx":117 * voxel_graph = voxel_graph.astype(np.uint32, order="F") * * return np.asfortranarray(voxel_graph) # <<<<<<<<<<<<<< @@ -3558,9 +3614,9 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject * def dijkstra( */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -3575,14 +3631,14 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_voxel_graph) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_voxel_graph); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 109, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":102 + /* "dijkstra3d.pyx":110 * ) * * def format_voxel_graph(voxel_graph): # <<<<<<<<<<<<<< @@ -3607,7 +3663,7 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject return __pyx_r; } -/* "dijkstra3d.pyx":111 +/* "dijkstra3d.pyx":119 * return np.asfortranarray(voxel_graph) * * def dijkstra( # <<<<<<<<<<<<<< @@ -3617,7 +3673,7 @@ static PyObject *__pyx_pf_10dijkstra3d_format_voxel_graph(CYTHON_UNUSED PyObject /* Python wrapper */ static PyObject *__pyx_pw_10dijkstra3d_3dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_10dijkstra3d_2dijkstra[] = "\n Perform dijkstra's shortest path algorithm\n on a 3D image grid. Vertices are voxels and\n edges are the 26 nearest neighbors (except\n for the edges of the image where the number\n of edges is reduced).\n \n For given input voxels A and B, the edge\n weight from A to B is B and from B to A is\n A. All weights must be non-negative (incl. \n negative zero).\n \n Parameters:\n Data: Input weights in a 2D or 3D numpy array. \n source: (x,y,z) coordinate of starting voxel\n target: (x,y,z) coordinate of target voxel\n bidirectional: If True, use more memory but conduct\n a bidirectional search, which has the potential to be \n much faster.\n connectivity: 6 (faces), 18 (faces + edges), and \n 26 (faces + edges + corners) voxel graph connectivities \n are supported. For 2D images, 4 gets translated to 6,\n 8 gets translated to 18.\n compass: If True, A* search using the chessboard \n distance to target as the heuristic. This has the \n effect of guiding the search like using a compass.\n This option has no effect when bidirectional search\n is enabled as it is not supported yet.\n compass_norm: Allows you to manipulate the relative\n greed of the A* search. By default set to -1, which\n means the norm will be the field minimum, but you \n can choose whatever you want if you know what you're\n doing.\n voxel_graph: a bitwise representation of the premitted\n directions of travel between voxels. Generated from\n cc3d.voxel_connectivity_graph. \n (See https://github.com/seung-lab/connected-components-3d)\n \n Returns: 1D numpy array containing indices of the path from\n source to target including source and target.\n "; +static char __pyx_doc_10dijkstra3d_2dijkstra[] = "\n Perform dijkstra's shortest path algorithm\n on a 3D image grid. Vertices are voxels and\n edges are the 26 nearest neighbors (except\n for the edges of the image where the number\n of edges is reduced).\n \n For given input voxels A and B, the edge\n weight from A to B is B and from B to A is\n A. All weights must be non-negative (incl. \n negative zero).\n \n Parameters:\n Data: Input weights in a 2D or 3D numpy array. \n source: (x,y,z) coordinate of starting voxel\n target: (x,y,z) coordinate of target voxel\n bidirectional: If True, use more memory but conduct\n a bidirectional search, which has the potential to be \n much faster.\n connectivity: 6 (faces), 18 (faces + edges), and \n 26 (faces + edges + corners) voxel graph connectivities \n are supported. For 2D images, 4 gets translated to 6,\n 8 gets translated to 18.\n compass: If True, A* search using the chessboard \n distance to target as the heuristic. This has the \n effect of guiding the search like using a compass.\n This option has no effect when bidirectional search\n is enabled as it is not supported yet.\n compass_norm: Allows you to manipulate the relative\n greed of the A* search. By default set to -1, which\n means the norm will be the field minimum, but you \n can choose whatever you want if you know what you're\n doing.\n voxel_graph: a bitwise representation of the premitted\n directions of travel between voxels. Generated from\n cc3d.voxel_connectivity_graph. \n (See https://github.com/seung-lab/connected-components-3d)\n metric: \"intensity\" or \"gradient\". \n intensity: each field value adds to distance.\n gradient: \n sqrt(w_dist^2 * (dx^2 + dy^2 + dz^2) + w_intensity^2 * dI^2)\n Use the neighboring gradient as the distance metric. The metric\n combines anisotropic euclidian distance and field intensity. The \n two weights w_dist and w_intensity can be used to toggle or \n m""odify the effect of either the physical distance or field \n intensity elements.\n metric_args: for gradient mode, you can supply distance and\n intensity weights as floats: [ w_dist, w_intensity ]\n anisotropy: (only affects gradient mode) weights of each\n voxel axis.\n \n Returns: 1D numpy array containing indices of the path from\n source to target including source and target.\n "; static PyMethodDef __pyx_mdef_10dijkstra3d_3dijkstra = {"dijkstra", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_3dijkstra, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10dijkstra3d_2dijkstra}; static PyObject *__pyx_pw_10dijkstra3d_3dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; @@ -3628,6 +3684,9 @@ static PyObject *__pyx_pw_10dijkstra3d_3dijkstra(PyObject *__pyx_self, PyObject PyObject *__pyx_v_compass = 0; PyObject *__pyx_v_compass_norm = 0; PyObject *__pyx_v_voxel_graph = 0; + PyObject *__pyx_v_metric = 0; + PyObject *__pyx_v_metric_args = 0; + PyObject *__pyx_v_anisotropy = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -3635,41 +3694,58 @@ static PyObject *__pyx_pw_10dijkstra3d_3dijkstra(PyObject *__pyx_self, PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dijkstra (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_source,&__pyx_n_s_target,&__pyx_n_s_bidirectional,&__pyx_n_s_connectivity,&__pyx_n_s_compass,&__pyx_n_s_compass_norm,&__pyx_n_s_voxel_graph,0}; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_source,&__pyx_n_s_target,&__pyx_n_s_bidirectional,&__pyx_n_s_connectivity,&__pyx_n_s_compass,&__pyx_n_s_compass_norm,&__pyx_n_s_voxel_graph,&__pyx_n_s_metric,&__pyx_n_s_metric_args,&__pyx_n_s_anisotropy,0}; + PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0}; - /* "dijkstra3d.pyx":113 + /* "dijkstra3d.pyx":121 * def dijkstra( * data, source, target, * bidirectional=False, connectivity=26, # <<<<<<<<<<<<<< * compass=False, compass_norm=-1, - * voxel_graph=None + * voxel_graph=None, */ values[3] = ((PyObject *)Py_False); values[4] = ((PyObject *)__pyx_int_26); - /* "dijkstra3d.pyx":114 + /* "dijkstra3d.pyx":122 * data, source, target, * bidirectional=False, connectivity=26, * compass=False, compass_norm=-1, # <<<<<<<<<<<<<< - * voxel_graph=None - * ): + * voxel_graph=None, + * metric="intensity", metric_args=[], */ values[5] = ((PyObject *)Py_False); values[6] = ((PyObject *)__pyx_int_neg_1); - /* "dijkstra3d.pyx":115 + /* "dijkstra3d.pyx":123 * bidirectional=False, connectivity=26, * compass=False, compass_norm=-1, - * voxel_graph=None # <<<<<<<<<<<<<< + * voxel_graph=None, # <<<<<<<<<<<<<< + * metric="intensity", metric_args=[], + * anisotropy=(1,1,1) + */ + values[7] = ((PyObject *)Py_None); + values[8] = ((PyObject *)__pyx_n_u_intensity); + values[9] = __pyx_k_; + + /* "dijkstra3d.pyx":125 + * voxel_graph=None, + * metric="intensity", metric_args=[], + * anisotropy=(1,1,1) # <<<<<<<<<<<<<< * ): * """ */ - values[7] = ((PyObject *)Py_None); + values[10] = ((PyObject *)__pyx_tuple__2); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); @@ -3698,13 +3774,13 @@ static PyObject *__pyx_pw_10dijkstra3d_3dijkstra(PyObject *__pyx_self, PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("dijkstra", 0, 3, 8, 1); __PYX_ERR(0, 111, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("dijkstra", 0, 3, 11, 1); __PYX_ERR(0, 119, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("dijkstra", 0, 3, 8, 2); __PYX_ERR(0, 111, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("dijkstra", 0, 3, 11, 2); __PYX_ERR(0, 119, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -3736,12 +3812,36 @@ static PyObject *__pyx_pw_10dijkstra3d_3dijkstra(PyObject *__pyx_self, PyObject PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_voxel_graph); if (value) { values[7] = value; kw_args--; } } + CYTHON_FALLTHROUGH; + case 8: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metric); + if (value) { values[8] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metric_args); + if (value) { values[9] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 10: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_anisotropy); + if (value) { values[10] = value; kw_args--; } + } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dijkstra") < 0)) __PYX_ERR(0, 111, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dijkstra") < 0)) __PYX_ERR(0, 119, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); @@ -3767,18 +3867,21 @@ static PyObject *__pyx_pw_10dijkstra3d_3dijkstra(PyObject *__pyx_self, PyObject __pyx_v_compass = values[5]; __pyx_v_compass_norm = values[6]; __pyx_v_voxel_graph = values[7]; + __pyx_v_metric = values[8]; + __pyx_v_metric_args = values[9]; + __pyx_v_anisotropy = values[10]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("dijkstra", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 111, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("dijkstra", 0, 3, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d.dijkstra", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10dijkstra3d_2dijkstra(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_v_bidirectional, __pyx_v_connectivity, __pyx_v_compass, __pyx_v_compass_norm, __pyx_v_voxel_graph); + __pyx_r = __pyx_pf_10dijkstra3d_2dijkstra(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_v_bidirectional, __pyx_v_connectivity, __pyx_v_compass, __pyx_v_compass_norm, __pyx_v_voxel_graph, __pyx_v_metric, __pyx_v_metric_args, __pyx_v_anisotropy); - /* "dijkstra3d.pyx":111 + /* "dijkstra3d.pyx":119 * return np.asfortranarray(voxel_graph) * * def dijkstra( # <<<<<<<<<<<<<< @@ -3791,12 +3894,14 @@ static PyObject *__pyx_pw_10dijkstra3d_3dijkstra(PyObject *__pyx_self, PyObject return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, PyObject *__pyx_v_bidirectional, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_compass, PyObject *__pyx_v_compass_norm, PyObject *__pyx_v_voxel_graph) { +static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, PyObject *__pyx_v_bidirectional, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_compass, PyObject *__pyx_v_compass_norm, PyObject *__pyx_v_voxel_graph, PyObject *__pyx_v_metric, PyObject *__pyx_v_metric_args, PyObject *__pyx_v_anisotropy) { PyObject *__pyx_v_dims = NULL; size_t __pyx_v_cols; size_t __pyx_v_rows; CYTHON_UNUSED size_t __pyx_v_depth; PyObject *__pyx_v_path = NULL; + PyObject *__pyx_v_w_dist = NULL; + PyObject *__pyx_v_w_intensity = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3810,6 +3915,7 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -3820,23 +3926,23 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_connectivity); __Pyx_INCREF(__pyx_v_voxel_graph); - /* "dijkstra3d.pyx":158 + /* "dijkstra3d.pyx":181 * source to target including source and target. * """ * dims = len(data.shape) # <<<<<<<<<<<<<< * if dims not in (2,3): * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dims = __pyx_t_1; __pyx_t_1 = 0; - /* "dijkstra3d.pyx":159 + /* "dijkstra3d.pyx":182 * """ * dims = len(data.shape) * if dims not in (2,3): # <<<<<<<<<<<<<< @@ -3845,18 +3951,18 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s */ __Pyx_INCREF(__pyx_v_dims); __pyx_t_1 = __pyx_v_dims; - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -3864,18 +3970,18 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_5 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_5)) { - /* "dijkstra3d.pyx":160 + /* "dijkstra3d.pyx":183 * dims = len(data.shape) * if dims not in (2,3): * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) # <<<<<<<<<<<<<< * * if dims == 2: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -3891,14 +3997,14 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 160, __pyx_L1_error) + __PYX_ERR(0, 183, __pyx_L1_error) - /* "dijkstra3d.pyx":159 + /* "dijkstra3d.pyx":182 * """ * dims = len(data.shape) * if dims not in (2,3): # <<<<<<<<<<<<<< @@ -3907,33 +4013,33 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":162 + /* "dijkstra3d.pyx":185 * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) * * if dims == 2: # <<<<<<<<<<<<<< * if connectivity == 4: * connectivity = 6 */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":163 + /* "dijkstra3d.pyx":186 * * if dims == 2: * if connectivity == 4: # <<<<<<<<<<<<<< * connectivity = 6 * elif connectivity == 8: */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":164 + /* "dijkstra3d.pyx":187 * if dims == 2: * if connectivity == 4: * connectivity = 6 # <<<<<<<<<<<<<< @@ -3943,7 +4049,7 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_int_6); __Pyx_DECREF_SET(__pyx_v_connectivity, __pyx_int_6); - /* "dijkstra3d.pyx":163 + /* "dijkstra3d.pyx":186 * * if dims == 2: * if connectivity == 4: # <<<<<<<<<<<<<< @@ -3953,20 +4059,20 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L7; } - /* "dijkstra3d.pyx":165 + /* "dijkstra3d.pyx":188 * if connectivity == 4: * connectivity = 6 * elif connectivity == 8: # <<<<<<<<<<<<<< * connectivity = 18 # or 26 but 18 might be faster * */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":166 + /* "dijkstra3d.pyx":189 * connectivity = 6 * elif connectivity == 8: * connectivity = 18 # or 26 but 18 might be faster # <<<<<<<<<<<<<< @@ -3976,7 +4082,7 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_int_18); __Pyx_DECREF_SET(__pyx_v_connectivity, __pyx_int_18); - /* "dijkstra3d.pyx":165 + /* "dijkstra3d.pyx":188 * if connectivity == 4: * connectivity = 6 * elif connectivity == 8: # <<<<<<<<<<<<<< @@ -3986,7 +4092,7 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s } __pyx_L7:; - /* "dijkstra3d.pyx":162 + /* "dijkstra3d.pyx":185 * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) * * if dims == 2: # <<<<<<<<<<<<<< @@ -3995,7 +4101,7 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":168 + /* "dijkstra3d.pyx":191 * connectivity = 18 # or 26 but 18 might be faster * * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -4004,27 +4110,27 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s */ __Pyx_INCREF(__pyx_v_connectivity); __pyx_t_1 = __pyx_v_connectivity; - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_18, 18, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_18, 18, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_26, 26, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_26, 26, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L9_bool_binop_done:; @@ -4032,34 +4138,34 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = (__pyx_t_5 != 0); if (unlikely(__pyx_t_3)) { - /* "dijkstra3d.pyx":170 + /* "dijkstra3d.pyx":193 * if connectivity not in (6, 18, 26): * raise ValueError( * "Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":169 + /* "dijkstra3d.pyx":192 * * if connectivity not in (6, 18, 26): * raise ValueError( # <<<<<<<<<<<<<< * "Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 169, __pyx_L1_error) + __PYX_ERR(0, 192, __pyx_L1_error) - /* "dijkstra3d.pyx":168 + /* "dijkstra3d.pyx":191 * connectivity = 18 # or 26 but 18 might be faster * * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -4068,23 +4174,73 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":173 + /* "dijkstra3d.pyx":196 * ) * + * if metric not in ("intensity", "gradient"): # <<<<<<<<<<<<<< + * raise ValueError(f"Only intensity and gradient modes are supported. Got: {metric}") + * + */ + __Pyx_INCREF(__pyx_v_metric); + __pyx_t_1 = __pyx_v_metric; + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_intensity, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 196, __pyx_L1_error) + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_gradient, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_3 = __pyx_t_5; + __pyx_L13_bool_binop_done:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_3 != 0); + if (unlikely(__pyx_t_5)) { + + /* "dijkstra3d.pyx":197 + * + * if metric not in ("intensity", "gradient"): + * raise ValueError(f"Only intensity and gradient modes are supported. Got: {metric}") # <<<<<<<<<<<<<< + * + * if data.size == 0: + */ + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_metric, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_intensity_and_gradient_mode, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 197, __pyx_L1_error) + + /* "dijkstra3d.pyx":196 + * ) + * + * if metric not in ("intensity", "gradient"): # <<<<<<<<<<<<<< + * raise ValueError(f"Only intensity and gradient modes are supported. Got: {metric}") + * + */ + } + + /* "dijkstra3d.pyx":199 + * raise ValueError(f"Only intensity and gradient modes are supported. Got: {metric}") + * * if data.size == 0: # <<<<<<<<<<<<<< * return np.zeros(shape=(0,), dtype=np.uint32, order='F') * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_3) { + if (__pyx_t_5) { - /* "dijkstra3d.pyx":174 + /* "dijkstra3d.pyx":200 * * if data.size == 0: * return np.zeros(shape=(0,), dtype=np.uint32, order='F') # <<<<<<<<<<<<<< @@ -4092,23 +4248,23 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s * _validate_coord(data, source) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple__3) < 0) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 174, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 174, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4116,8 +4272,8 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_6 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":173 - * ) + /* "dijkstra3d.pyx":199 + * raise ValueError(f"Only intensity and gradient modes are supported. Got: {metric}") * * if data.size == 0: # <<<<<<<<<<<<<< * return np.zeros(shape=(0,), dtype=np.uint32, order='F') @@ -4125,14 +4281,14 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":176 + /* "dijkstra3d.pyx":202 * return np.zeros(shape=(0,), dtype=np.uint32, order='F') * * _validate_coord(data, source) # <<<<<<<<<<<<<< * _validate_coord(data, target) * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_8 = 0; @@ -4149,7 +4305,7 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_source}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); } else @@ -4157,13 +4313,13 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_source}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -4174,21 +4330,21 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_source); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":177 + /* "dijkstra3d.pyx":203 * * _validate_coord(data, source) * _validate_coord(data, target) # <<<<<<<<<<<<<< * * if dims == 2: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -4205,7 +4361,7 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_data, __pyx_v_target}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_6); } else @@ -4213,13 +4369,13 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_data, __pyx_v_target}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { - __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -4230,98 +4386,98 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_target); __Pyx_GIVEREF(__pyx_v_target); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_v_target); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":179 + /* "dijkstra3d.pyx":205 * _validate_coord(data, target) * * if dims == 2: # <<<<<<<<<<<<<< * data = data[:, :, np.newaxis] * source = list(source) + [ 0 ] */ - __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_3) { + if (__pyx_t_5) { - /* "dijkstra3d.pyx":180 + /* "dijkstra3d.pyx":206 * * if dims == 2: * data = data[:, :, np.newaxis] # <<<<<<<<<<<<<< * source = list(source) + [ 0 ] * target = list(target) + [ 0 ] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__2); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__4); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":181 + /* "dijkstra3d.pyx":207 * if dims == 2: * data = data[:, :, np.newaxis] * source = list(source) + [ 0 ] # <<<<<<<<<<<<<< * target = list(target) + [ 0 ] * */ - __pyx_t_4 = PySequence_List(__pyx_v_source); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_4 = PySequence_List(__pyx_v_source); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":182 + /* "dijkstra3d.pyx":208 * data = data[:, :, np.newaxis] * source = list(source) + [ 0 ] * target = list(target) + [ 0 ] # <<<<<<<<<<<<<< * * if voxel_graph is not None: */ - __pyx_t_1 = PySequence_List(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0); - __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_target, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":179 + /* "dijkstra3d.pyx":205 * _validate_coord(data, target) * * if dims == 2: # <<<<<<<<<<<<<< @@ -4330,25 +4486,25 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":184 + /* "dijkstra3d.pyx":210 * target = list(target) + [ 0 ] * * if voxel_graph is not None: # <<<<<<<<<<<<<< * voxel_graph = format_voxel_graph(voxel_graph) * */ - __pyx_t_3 = (__pyx_v_voxel_graph != Py_None); - __pyx_t_5 = (__pyx_t_3 != 0); - if (__pyx_t_5) { + __pyx_t_5 = (__pyx_v_voxel_graph != Py_None); + __pyx_t_3 = (__pyx_t_5 != 0); + if (__pyx_t_3) { - /* "dijkstra3d.pyx":185 + /* "dijkstra3d.pyx":211 * * if voxel_graph is not None: * voxel_graph = format_voxel_graph(voxel_graph) # <<<<<<<<<<<<<< * * data = np.asfortranarray(data) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -4362,13 +4518,13 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_voxel_graph) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_voxel_graph); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_voxel_graph, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":184 + /* "dijkstra3d.pyx":210 * target = list(target) + [ 0 ] * * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -4377,16 +4533,16 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":187 + /* "dijkstra3d.pyx":213 * voxel_graph = format_voxel_graph(voxel_graph) * * data = np.asfortranarray(data) # <<<<<<<<<<<<<< * * cdef size_t cols = data.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -4401,164 +4557,336 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":189 + /* "dijkstra3d.pyx":215 * data = np.asfortranarray(data) * * cdef size_t cols = data.shape[0] # <<<<<<<<<<<<<< * cdef size_t rows = data.shape[1] * cdef size_t depth = data.shape[2] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cols = __pyx_t_9; - /* "dijkstra3d.pyx":190 + /* "dijkstra3d.pyx":216 * * cdef size_t cols = data.shape[0] * cdef size_t rows = data.shape[1] # <<<<<<<<<<<<<< * cdef size_t depth = data.shape[2] * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_rows = __pyx_t_9; - /* "dijkstra3d.pyx":191 + /* "dijkstra3d.pyx":217 * cdef size_t cols = data.shape[0] * cdef size_t rows = data.shape[1] * cdef size_t depth = data.shape[2] # <<<<<<<<<<<<<< * - * path = _execute_dijkstra( + * if metric == "intensity": */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_depth = __pyx_t_9; - /* "dijkstra3d.pyx":193 + /* "dijkstra3d.pyx":219 * cdef size_t depth = data.shape[2] * - * path = _execute_dijkstra( # <<<<<<<<<<<<<< - * data, source, target, connectivity, - * bidirectional, compass, compass_norm, + * if metric == "intensity": # <<<<<<<<<<<<<< + * path = _execute_dijkstra( + * data, source, target, connectivity, */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_execute_dijkstra); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_metric, __pyx_n_u_intensity, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 219, __pyx_L1_error) + if (__pyx_t_3) { - /* "dijkstra3d.pyx":196 - * data, source, target, connectivity, - * bidirectional, compass, compass_norm, - * voxel_graph # <<<<<<<<<<<<<< - * ) + /* "dijkstra3d.pyx":220 * + * if metric == "intensity": + * path = _execute_dijkstra( # <<<<<<<<<<<<<< + * data, source, target, connectivity, + * bidirectional, compass, compass_norm, */ - __pyx_t_6 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_8 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_execute_dijkstra); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "dijkstra3d.pyx":223 + * data, source, target, connectivity, + * bidirectional, compass, compass_norm, + * voxel_graph # <<<<<<<<<<<<<< + * ) + * else: + */ + __pyx_t_6 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_v_connectivity, __pyx_v_bidirectional, __pyx_v_compass, __pyx_v_compass_norm, __pyx_v_voxel_graph}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 8+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_v_connectivity, __pyx_v_bidirectional, __pyx_v_compass, __pyx_v_compass_norm, __pyx_v_voxel_graph}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 8+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(8+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_data); + __Pyx_GIVEREF(__pyx_v_data); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_data); + __Pyx_INCREF(__pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_source); + __Pyx_INCREF(__pyx_v_target); + __Pyx_GIVEREF(__pyx_v_target); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_target); + __Pyx_INCREF(__pyx_v_connectivity); + __Pyx_GIVEREF(__pyx_v_connectivity); + PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_connectivity); + __Pyx_INCREF(__pyx_v_bidirectional); + __Pyx_GIVEREF(__pyx_v_bidirectional); + PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_8, __pyx_v_bidirectional); + __Pyx_INCREF(__pyx_v_compass); + __Pyx_GIVEREF(__pyx_v_compass); + PyTuple_SET_ITEM(__pyx_t_7, 5+__pyx_t_8, __pyx_v_compass); + __Pyx_INCREF(__pyx_v_compass_norm); + __Pyx_GIVEREF(__pyx_v_compass_norm); + PyTuple_SET_ITEM(__pyx_t_7, 6+__pyx_t_8, __pyx_v_compass_norm); + __Pyx_INCREF(__pyx_v_voxel_graph); + __Pyx_GIVEREF(__pyx_v_voxel_graph); + PyTuple_SET_ITEM(__pyx_t_7, 7+__pyx_t_8, __pyx_v_voxel_graph); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_path = __pyx_t_1; + __pyx_t_1 = 0; + + /* "dijkstra3d.pyx":219 + * cdef size_t depth = data.shape[2] + * + * if metric == "intensity": # <<<<<<<<<<<<<< + * path = _execute_dijkstra( + * data, source, target, connectivity, + */ + goto __pyx_L18; } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_v_connectivity, __pyx_v_bidirectional, __pyx_v_compass, __pyx_v_compass_norm, __pyx_v_voxel_graph}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 8+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_v_connectivity, __pyx_v_bidirectional, __pyx_v_compass, __pyx_v_compass_norm, __pyx_v_voxel_graph}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 8+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - { - __pyx_t_7 = PyTuple_New(8+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __pyx_L1_error) + + /* "dijkstra3d.pyx":226 + * ) + * else: + * w_dist = 1.0 if not metric_args else metric_args[0] # <<<<<<<<<<<<<< + * w_intensity = 1.0 if not metric_args else metric_args[1] + * + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_metric_args); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 226, __pyx_L1_error) + if (((!__pyx_t_3) != 0)) { + __Pyx_INCREF(__pyx_float_1_0); + __pyx_t_1 = __pyx_float_1_0; + } else { + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_metric_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_v_w_dist = __pyx_t_1; + __pyx_t_1 = 0; + + /* "dijkstra3d.pyx":227 + * else: + * w_dist = 1.0 if not metric_args else metric_args[0] + * w_intensity = 1.0 if not metric_args else metric_args[1] # <<<<<<<<<<<<<< + * + * path = _execute_gradient_dijkstra( + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_metric_args); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 227, __pyx_L1_error) + if (((!__pyx_t_3) != 0)) { + __Pyx_INCREF(__pyx_float_1_0); + __pyx_t_1 = __pyx_float_1_0; + } else { + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_metric_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_v_w_intensity = __pyx_t_1; + __pyx_t_1 = 0; + + /* "dijkstra3d.pyx":229 + * w_intensity = 1.0 if not metric_args else metric_args[1] + * + * path = _execute_gradient_dijkstra( # <<<<<<<<<<<<<< + * data, source, target, + * anisotropy[0], anisotropy[1], anisotropy[2], + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_execute_gradient_dijkstra); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "dijkstra3d.pyx":231 + * path = _execute_gradient_dijkstra( + * data, source, target, + * anisotropy[0], anisotropy[1], anisotropy[2], # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph + */ + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_anisotropy, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_anisotropy, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_anisotropy, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "dijkstra3d.pyx":233 + * anisotropy[0], anisotropy[1], anisotropy[2], + * w_dist, w_intensity, + * connectivity, voxel_graph # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_11 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_8 = 1; + } } - __Pyx_INCREF(__pyx_v_data); - __Pyx_GIVEREF(__pyx_v_data); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_data); - __Pyx_INCREF(__pyx_v_source); - __Pyx_GIVEREF(__pyx_v_source); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_source); - __Pyx_INCREF(__pyx_v_target); - __Pyx_GIVEREF(__pyx_v_target); - PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_target); - __Pyx_INCREF(__pyx_v_connectivity); - __Pyx_GIVEREF(__pyx_v_connectivity); - PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_connectivity); - __Pyx_INCREF(__pyx_v_bidirectional); - __Pyx_GIVEREF(__pyx_v_bidirectional); - PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_8, __pyx_v_bidirectional); - __Pyx_INCREF(__pyx_v_compass); - __Pyx_GIVEREF(__pyx_v_compass); - PyTuple_SET_ITEM(__pyx_t_7, 5+__pyx_t_8, __pyx_v_compass); - __Pyx_INCREF(__pyx_v_compass_norm); - __Pyx_GIVEREF(__pyx_v_compass_norm); - PyTuple_SET_ITEM(__pyx_t_7, 6+__pyx_t_8, __pyx_v_compass_norm); - __Pyx_INCREF(__pyx_v_voxel_graph); - __Pyx_GIVEREF(__pyx_v_voxel_graph); - PyTuple_SET_ITEM(__pyx_t_7, 7+__pyx_t_8, __pyx_v_voxel_graph); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[11] = {__pyx_t_11, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_t_7, __pyx_t_6, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 10+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[11] = {__pyx_t_11, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_t_7, __pyx_t_6, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 10+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + { + __pyx_t_12 = PyTuple_New(10+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (__pyx_t_11) { + __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; + } + __Pyx_INCREF(__pyx_v_data); + __Pyx_GIVEREF(__pyx_v_data); + PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_data); + __Pyx_INCREF(__pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_source); + __Pyx_INCREF(__pyx_v_target); + __Pyx_GIVEREF(__pyx_v_target); + PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_8, __pyx_v_target); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_8, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_8, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_8, __pyx_t_10); + __Pyx_INCREF(__pyx_v_w_dist); + __Pyx_GIVEREF(__pyx_v_w_dist); + PyTuple_SET_ITEM(__pyx_t_12, 6+__pyx_t_8, __pyx_v_w_dist); + __Pyx_INCREF(__pyx_v_w_intensity); + __Pyx_GIVEREF(__pyx_v_w_intensity); + PyTuple_SET_ITEM(__pyx_t_12, 7+__pyx_t_8, __pyx_v_w_intensity); + __Pyx_INCREF(__pyx_v_connectivity); + __Pyx_GIVEREF(__pyx_v_connectivity); + PyTuple_SET_ITEM(__pyx_t_12, 8+__pyx_t_8, __pyx_v_connectivity); + __Pyx_INCREF(__pyx_v_voxel_graph); + __Pyx_GIVEREF(__pyx_v_voxel_graph); + PyTuple_SET_ITEM(__pyx_t_12, 9+__pyx_t_8, __pyx_v_voxel_graph); + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_path = __pyx_t_1; + __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_path = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_L18:; - /* "dijkstra3d.pyx":199 - * ) + /* "dijkstra3d.pyx":236 + * ) * * return _path_to_point_cloud(path, dims, rows, cols) # <<<<<<<<<<<<<< * * def railroad( */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_path_to_point_cloud); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_path_to_point_cloud); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_rows); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_cols); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = NULL; + __pyx_t_12 = __Pyx_PyInt_FromSize_t(__pyx_v_rows); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_cols); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_10)) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; @@ -4566,52 +4894,52 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_path, __pyx_v_dims, __pyx_t_7, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_path, __pyx_v_dims, __pyx_t_12, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_path, __pyx_v_dims, __pyx_t_7, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_path, __pyx_v_dims, __pyx_t_12, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__pyx_t_10) { - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; + __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); - PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_path); __Pyx_INCREF(__pyx_v_dims); __Pyx_GIVEREF(__pyx_v_dims); - PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_v_dims); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_8, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_8, __pyx_t_6); - __pyx_t_7 = 0; - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_dims); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_t_10); + __pyx_t_12 = 0; + __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":111 + /* "dijkstra3d.pyx":119 * return np.asfortranarray(voxel_graph) * * def dijkstra( # <<<<<<<<<<<<<< @@ -4627,11 +4955,14 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("dijkstra3d.dijkstra", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dims); __Pyx_XDECREF(__pyx_v_path); + __Pyx_XDECREF(__pyx_v_w_dist); + __Pyx_XDECREF(__pyx_v_w_intensity); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_source); __Pyx_XDECREF(__pyx_v_target); @@ -4642,7 +4973,7 @@ static PyObject *__pyx_pf_10dijkstra3d_2dijkstra(CYTHON_UNUSED PyObject *__pyx_s return __pyx_r; } -/* "dijkstra3d.pyx":201 +/* "dijkstra3d.pyx":238 * return _path_to_point_cloud(path, dims, rows, cols) * * def railroad( # <<<<<<<<<<<<<< @@ -4670,7 +5001,7 @@ static PyObject *__pyx_pw_10dijkstra3d_5railroad(PyObject *__pyx_self, PyObject PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)__pyx_int_26); - /* "dijkstra3d.pyx":203 + /* "dijkstra3d.pyx":240 * def railroad( * data, source, * connectivity=26, voxel_graph=None # <<<<<<<<<<<<<< @@ -4702,7 +5033,7 @@ static PyObject *__pyx_pw_10dijkstra3d_5railroad(PyObject *__pyx_self, PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("railroad", 0, 2, 4, 1); __PYX_ERR(0, 201, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("railroad", 0, 2, 4, 1); __PYX_ERR(0, 238, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -4718,7 +5049,7 @@ static PyObject *__pyx_pw_10dijkstra3d_5railroad(PyObject *__pyx_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "railroad") < 0)) __PYX_ERR(0, 201, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "railroad") < 0)) __PYX_ERR(0, 238, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4739,7 +5070,7 @@ static PyObject *__pyx_pw_10dijkstra3d_5railroad(PyObject *__pyx_self, PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("railroad", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 201, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("railroad", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 238, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d.railroad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4747,7 +5078,7 @@ static PyObject *__pyx_pw_10dijkstra3d_5railroad(PyObject *__pyx_self, PyObject __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_10dijkstra3d_4railroad(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph); - /* "dijkstra3d.pyx":201 + /* "dijkstra3d.pyx":238 * return _path_to_point_cloud(path, dims, rows, cols) * * def railroad( # <<<<<<<<<<<<<< @@ -4787,23 +5118,23 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_connectivity); __Pyx_INCREF(__pyx_v_voxel_graph); - /* "dijkstra3d.pyx":235 + /* "dijkstra3d.pyx":272 * source to target including source and destination. * """ * dims = len(data.shape) # <<<<<<<<<<<<<< * if dims not in (2,3): * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dims = __pyx_t_1; __pyx_t_1 = 0; - /* "dijkstra3d.pyx":236 + /* "dijkstra3d.pyx":273 * """ * dims = len(data.shape) * if dims not in (2,3): # <<<<<<<<<<<<<< @@ -4812,18 +5143,18 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s */ __Pyx_INCREF(__pyx_v_dims); __pyx_t_1 = __pyx_v_dims; - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -4831,18 +5162,18 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_5 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_5)) { - /* "dijkstra3d.pyx":237 + /* "dijkstra3d.pyx":274 * dims = len(data.shape) * if dims not in (2,3): * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) # <<<<<<<<<<<<<< * * if dims == 2: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -4858,14 +5189,14 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 274, __pyx_L1_error) - /* "dijkstra3d.pyx":236 + /* "dijkstra3d.pyx":273 * """ * dims = len(data.shape) * if dims not in (2,3): # <<<<<<<<<<<<<< @@ -4874,33 +5205,33 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":239 + /* "dijkstra3d.pyx":276 * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) * * if dims == 2: # <<<<<<<<<<<<<< * if connectivity == 4: * connectivity = 6 */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":240 + /* "dijkstra3d.pyx":277 * * if dims == 2: * if connectivity == 4: # <<<<<<<<<<<<<< * connectivity = 6 * elif connectivity == 8: */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":241 + /* "dijkstra3d.pyx":278 * if dims == 2: * if connectivity == 4: * connectivity = 6 # <<<<<<<<<<<<<< @@ -4910,7 +5241,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_int_6); __Pyx_DECREF_SET(__pyx_v_connectivity, __pyx_int_6); - /* "dijkstra3d.pyx":240 + /* "dijkstra3d.pyx":277 * * if dims == 2: * if connectivity == 4: # <<<<<<<<<<<<<< @@ -4920,20 +5251,20 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L7; } - /* "dijkstra3d.pyx":242 + /* "dijkstra3d.pyx":279 * if connectivity == 4: * connectivity = 6 * elif connectivity == 8: # <<<<<<<<<<<<<< * connectivity = 18 # or 26 but 18 might be faster * */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":243 + /* "dijkstra3d.pyx":280 * connectivity = 6 * elif connectivity == 8: * connectivity = 18 # or 26 but 18 might be faster # <<<<<<<<<<<<<< @@ -4943,7 +5274,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_int_18); __Pyx_DECREF_SET(__pyx_v_connectivity, __pyx_int_18); - /* "dijkstra3d.pyx":242 + /* "dijkstra3d.pyx":279 * if connectivity == 4: * connectivity = 6 * elif connectivity == 8: # <<<<<<<<<<<<<< @@ -4953,7 +5284,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s } __pyx_L7:; - /* "dijkstra3d.pyx":239 + /* "dijkstra3d.pyx":276 * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) * * if dims == 2: # <<<<<<<<<<<<<< @@ -4962,7 +5293,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":245 + /* "dijkstra3d.pyx":282 * connectivity = 18 # or 26 but 18 might be faster * * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -4971,27 +5302,27 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s */ __Pyx_INCREF(__pyx_v_connectivity); __pyx_t_1 = __pyx_v_connectivity; - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_18, 18, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_18, 18, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_26, 26, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_26, 26, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L9_bool_binop_done:; @@ -4999,34 +5330,34 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = (__pyx_t_5 != 0); if (unlikely(__pyx_t_3)) { - /* "dijkstra3d.pyx":247 + /* "dijkstra3d.pyx":284 * if connectivity not in (6, 18, 26): * raise ValueError( * "Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":246 + /* "dijkstra3d.pyx":283 * * if connectivity not in (6, 18, 26): * raise ValueError( # <<<<<<<<<<<<<< * "Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 246, __pyx_L1_error) + __PYX_ERR(0, 283, __pyx_L1_error) - /* "dijkstra3d.pyx":245 + /* "dijkstra3d.pyx":282 * connectivity = 18 # or 26 but 18 might be faster * * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -5035,23 +5366,23 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":250 + /* "dijkstra3d.pyx":287 * ) * * if data.size == 0: # <<<<<<<<<<<<<< * return np.zeros(shape=(0,), dtype=np.uint32, order='F') * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":251 + /* "dijkstra3d.pyx":288 * * if data.size == 0: * return np.zeros(shape=(0,), dtype=np.uint32, order='F') # <<<<<<<<<<<<<< @@ -5059,23 +5390,23 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s * _validate_coord(data, source) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple__3) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 251, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5083,7 +5414,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_6 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":250 + /* "dijkstra3d.pyx":287 * ) * * if data.size == 0: # <<<<<<<<<<<<<< @@ -5092,14 +5423,14 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":253 + /* "dijkstra3d.pyx":290 * return np.zeros(shape=(0,), dtype=np.uint32, order='F') * * _validate_coord(data, source) # <<<<<<<<<<<<<< * * if dims == 2: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_8 = 0; @@ -5116,7 +5447,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_source}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); } else @@ -5124,13 +5455,13 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_source}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -5141,77 +5472,77 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_source); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":255 + /* "dijkstra3d.pyx":292 * _validate_coord(data, source) * * if dims == 2: # <<<<<<<<<<<<<< * data = data[:, :, np.newaxis] * source = list(source) + [ 0 ] */ - __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":256 + /* "dijkstra3d.pyx":293 * * if dims == 2: * data = data[:, :, np.newaxis] # <<<<<<<<<<<<<< * source = list(source) + [ 0 ] * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__2); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__4); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":257 + /* "dijkstra3d.pyx":294 * if dims == 2: * data = data[:, :, np.newaxis] * source = list(source) + [ 0 ] # <<<<<<<<<<<<<< * * if voxel_graph is not None: */ - __pyx_t_4 = PySequence_List(__pyx_v_source); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_4 = PySequence_List(__pyx_v_source); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0); - __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_7); __pyx_t_7 = 0; - /* "dijkstra3d.pyx":255 + /* "dijkstra3d.pyx":292 * _validate_coord(data, source) * * if dims == 2: # <<<<<<<<<<<<<< @@ -5220,7 +5551,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":259 + /* "dijkstra3d.pyx":296 * source = list(source) + [ 0 ] * * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -5231,14 +5562,14 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { - /* "dijkstra3d.pyx":260 + /* "dijkstra3d.pyx":297 * * if voxel_graph is not None: * voxel_graph = format_voxel_graph(voxel_graph) # <<<<<<<<<<<<<< * * data = np.asfortranarray(data) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -5252,13 +5583,13 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_voxel_graph) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_voxel_graph); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_voxel_graph, __pyx_t_7); __pyx_t_7 = 0; - /* "dijkstra3d.pyx":259 + /* "dijkstra3d.pyx":296 * source = list(source) + [ 0 ] * * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -5267,16 +5598,16 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "dijkstra3d.pyx":262 + /* "dijkstra3d.pyx":299 * voxel_graph = format_voxel_graph(voxel_graph) * * data = np.asfortranarray(data) # <<<<<<<<<<<<<< * * cdef size_t cols = data.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -5291,55 +5622,55 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_data); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7); __pyx_t_7 = 0; - /* "dijkstra3d.pyx":264 + /* "dijkstra3d.pyx":301 * data = np.asfortranarray(data) * * cdef size_t cols = data.shape[0] # <<<<<<<<<<<<<< * cdef size_t rows = data.shape[1] * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_cols = __pyx_t_9; - /* "dijkstra3d.pyx":265 + /* "dijkstra3d.pyx":302 * * cdef size_t cols = data.shape[0] * cdef size_t rows = data.shape[1] # <<<<<<<<<<<<<< * * path = _execute_value_target_dijkstra( */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_7); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_7); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_rows = __pyx_t_9; - /* "dijkstra3d.pyx":267 + /* "dijkstra3d.pyx":304 * cdef size_t rows = data.shape[1] * * path = _execute_value_target_dijkstra( # <<<<<<<<<<<<<< * data, source, * connectivity, voxel_graph */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_execute_value_target_dijkstra); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_execute_value_target_dijkstra); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "dijkstra3d.pyx":269 + /* "dijkstra3d.pyx":306 * path = _execute_value_target_dijkstra( * data, source, * connectivity, voxel_graph # <<<<<<<<<<<<<< @@ -5361,7 +5692,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_7); } else @@ -5369,13 +5700,13 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_7); } else #endif { - __pyx_t_1 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -5392,7 +5723,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_voxel_graph); __Pyx_GIVEREF(__pyx_v_voxel_graph); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_8, __pyx_v_voxel_graph); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -5400,7 +5731,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_path = __pyx_t_7; __pyx_t_7 = 0; - /* "dijkstra3d.pyx":272 + /* "dijkstra3d.pyx":309 * ) * * return _path_to_point_cloud(path, dims, rows, cols) # <<<<<<<<<<<<<< @@ -5408,11 +5739,11 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s * def distance_field( */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_path_to_point_cloud); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_path_to_point_cloud); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_cols); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_cols); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = NULL; __pyx_t_8 = 0; @@ -5429,7 +5760,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_path, __pyx_v_dims, __pyx_t_1, __pyx_t_6}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5439,7 +5770,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_path, __pyx_v_dims, __pyx_t_1, __pyx_t_6}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5447,7 +5778,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s } else #endif { - __pyx_t_11 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; @@ -5464,7 +5795,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_8, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -5473,7 +5804,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_7 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":201 + /* "dijkstra3d.pyx":238 * return _path_to_point_cloud(path, dims, rows, cols) * * def railroad( # <<<<<<<<<<<<<< @@ -5503,7 +5834,7 @@ static PyObject *__pyx_pf_10dijkstra3d_4railroad(CYTHON_UNUSED PyObject *__pyx_s return __pyx_r; } -/* "dijkstra3d.pyx":274 +/* "dijkstra3d.pyx":311 * return _path_to_point_cloud(path, dims, rows, cols) * * def distance_field( # <<<<<<<<<<<<<< @@ -5532,7 +5863,7 @@ static PyObject *__pyx_pw_10dijkstra3d_7distance_field(PyObject *__pyx_self, PyO PyObject* values[5] = {0,0,0,0,0}; values[2] = ((PyObject *)__pyx_int_26); - /* "dijkstra3d.pyx":276 + /* "dijkstra3d.pyx":313 * def distance_field( * data, source, connectivity=26, * voxel_graph=None, return_max_location=False # <<<<<<<<<<<<<< @@ -5567,7 +5898,7 @@ static PyObject *__pyx_pw_10dijkstra3d_7distance_field(PyObject *__pyx_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("distance_field", 0, 2, 5, 1); __PYX_ERR(0, 274, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("distance_field", 0, 2, 5, 1); __PYX_ERR(0, 311, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -5589,7 +5920,7 @@ static PyObject *__pyx_pw_10dijkstra3d_7distance_field(PyObject *__pyx_self, PyO } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "distance_field") < 0)) __PYX_ERR(0, 274, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "distance_field") < 0)) __PYX_ERR(0, 311, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5613,7 +5944,7 @@ static PyObject *__pyx_pw_10dijkstra3d_7distance_field(PyObject *__pyx_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("distance_field", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 274, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("distance_field", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 311, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d.distance_field", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5621,7 +5952,7 @@ static PyObject *__pyx_pw_10dijkstra3d_7distance_field(PyObject *__pyx_self, PyO __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_10dijkstra3d_6distance_field(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph, __pyx_v_return_max_location); - /* "dijkstra3d.pyx":274 + /* "dijkstra3d.pyx":311 * return _path_to_point_cloud(path, dims, rows, cols) * * def distance_field( # <<<<<<<<<<<<<< @@ -5662,23 +5993,23 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_v_connectivity); __Pyx_INCREF(__pyx_v_voxel_graph); - /* "dijkstra3d.pyx":308 + /* "dijkstra3d.pyx":345 * return field * """ * dims = len(data.shape) # <<<<<<<<<<<<<< * if dims not in (2,3): * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dims = __pyx_t_1; __pyx_t_1 = 0; - /* "dijkstra3d.pyx":309 + /* "dijkstra3d.pyx":346 * """ * dims = len(data.shape) * if dims not in (2,3): # <<<<<<<<<<<<<< @@ -5687,18 +6018,18 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ __Pyx_INCREF(__pyx_v_dims); __pyx_t_1 = __pyx_v_dims; - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -5706,18 +6037,18 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __pyx_t_5 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_5)) { - /* "dijkstra3d.pyx":310 + /* "dijkstra3d.pyx":347 * dims = len(data.shape) * if dims not in (2,3): * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) # <<<<<<<<<<<<<< * * if dims == 2: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -5733,14 +6064,14 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 310, __pyx_L1_error) + __PYX_ERR(0, 347, __pyx_L1_error) - /* "dijkstra3d.pyx":309 + /* "dijkstra3d.pyx":346 * """ * dims = len(data.shape) * if dims not in (2,3): # <<<<<<<<<<<<<< @@ -5749,33 +6080,33 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":312 + /* "dijkstra3d.pyx":349 * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) * * if dims == 2: # <<<<<<<<<<<<<< * if connectivity == 4: * connectivity = 6 */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":313 + /* "dijkstra3d.pyx":350 * * if dims == 2: * if connectivity == 4: # <<<<<<<<<<<<<< * connectivity = 6 * elif connectivity == 8: */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":314 + /* "dijkstra3d.pyx":351 * if dims == 2: * if connectivity == 4: * connectivity = 6 # <<<<<<<<<<<<<< @@ -5785,7 +6116,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_int_6); __Pyx_DECREF_SET(__pyx_v_connectivity, __pyx_int_6); - /* "dijkstra3d.pyx":313 + /* "dijkstra3d.pyx":350 * * if dims == 2: * if connectivity == 4: # <<<<<<<<<<<<<< @@ -5795,20 +6126,20 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ goto __pyx_L7; } - /* "dijkstra3d.pyx":315 + /* "dijkstra3d.pyx":352 * if connectivity == 4: * connectivity = 6 * elif connectivity == 8: # <<<<<<<<<<<<<< * connectivity = 18 # or 26 but 18 might be faster * */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":316 + /* "dijkstra3d.pyx":353 * connectivity = 6 * elif connectivity == 8: * connectivity = 18 # or 26 but 18 might be faster # <<<<<<<<<<<<<< @@ -5818,7 +6149,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_int_18); __Pyx_DECREF_SET(__pyx_v_connectivity, __pyx_int_18); - /* "dijkstra3d.pyx":315 + /* "dijkstra3d.pyx":352 * if connectivity == 4: * connectivity = 6 * elif connectivity == 8: # <<<<<<<<<<<<<< @@ -5828,7 +6159,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ } __pyx_L7:; - /* "dijkstra3d.pyx":312 + /* "dijkstra3d.pyx":349 * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) * * if dims == 2: # <<<<<<<<<<<<<< @@ -5837,7 +6168,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":318 + /* "dijkstra3d.pyx":355 * connectivity = 18 # or 26 but 18 might be faster * * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -5846,27 +6177,27 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ __Pyx_INCREF(__pyx_v_connectivity); __pyx_t_1 = __pyx_v_connectivity; - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_18, 18, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_18, 18, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_26, 26, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_26, 26, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L9_bool_binop_done:; @@ -5874,34 +6205,34 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_t_5 != 0); if (unlikely(__pyx_t_3)) { - /* "dijkstra3d.pyx":320 + /* "dijkstra3d.pyx":357 * if connectivity not in (6, 18, 26): * raise ValueError( * "Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":319 + /* "dijkstra3d.pyx":356 * * if connectivity not in (6, 18, 26): * raise ValueError( # <<<<<<<<<<<<<< * "Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 319, __pyx_L1_error) + __PYX_ERR(0, 356, __pyx_L1_error) - /* "dijkstra3d.pyx":318 + /* "dijkstra3d.pyx":355 * connectivity = 18 # or 26 but 18 might be faster * * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -5910,23 +6241,23 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":323 + /* "dijkstra3d.pyx":360 * ) * * if data.size == 0: # <<<<<<<<<<<<<< * return np.zeros(shape=(0,), dtype=np.float32) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":324 + /* "dijkstra3d.pyx":361 * * if data.size == 0: * return np.zeros(shape=(0,), dtype=np.float32) # <<<<<<<<<<<<<< @@ -5934,22 +6265,22 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ * source = np.array(source, dtype=np.uint64) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple__3) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 324, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5957,7 +6288,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __pyx_t_6 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":323 + /* "dijkstra3d.pyx":360 * ) * * if data.size == 0: # <<<<<<<<<<<<<< @@ -5966,33 +6297,33 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":326 + /* "dijkstra3d.pyx":363 * return np.zeros(shape=(0,), dtype=np.float32) * * source = np.array(source, dtype=np.uint64) # <<<<<<<<<<<<<< * if source.ndim == 1: * source = source[np.newaxis, :] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 326, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -6000,49 +6331,49 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_8); __pyx_t_8 = 0; - /* "dijkstra3d.pyx":327 + /* "dijkstra3d.pyx":364 * * source = np.array(source, dtype=np.uint64) * if source.ndim == 1: # <<<<<<<<<<<<<< * source = source[np.newaxis, :] * */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":328 + /* "dijkstra3d.pyx":365 * source = np.array(source, dtype=np.uint64) * if source.ndim == 1: * source = source[np.newaxis, :] # <<<<<<<<<<<<<< * * for src in source: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__4); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_source, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_source, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_8); __pyx_t_8 = 0; - /* "dijkstra3d.pyx":327 + /* "dijkstra3d.pyx":364 * * source = np.array(source, dtype=np.uint64) * if source.ndim == 1: # <<<<<<<<<<<<<< @@ -6051,7 +6382,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":330 + /* "dijkstra3d.pyx":367 * source = source[np.newaxis, :] * * for src in source: # <<<<<<<<<<<<<< @@ -6062,26 +6393,26 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __pyx_t_8 = __pyx_v_source; __Pyx_INCREF(__pyx_t_8); __pyx_t_2 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_source); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_source); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 367, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 367, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 367, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -6091,7 +6422,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 330, __pyx_L1_error) + else __PYX_ERR(0, 367, __pyx_L1_error) } break; } @@ -6100,14 +6431,14 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF_SET(__pyx_v_src, __pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":331 + /* "dijkstra3d.pyx":368 * * for src in source: * _validate_coord(data, src) # <<<<<<<<<<<<<< * * if source.shape[1] < 3: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; __pyx_t_10 = 0; @@ -6124,7 +6455,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_data, __pyx_v_src}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -6132,13 +6463,13 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_data, __pyx_v_src}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -6149,14 +6480,14 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_v_src); __Pyx_GIVEREF(__pyx_v_src); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_v_src); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":330 + /* "dijkstra3d.pyx":367 * source = source[np.newaxis, :] * * for src in source: # <<<<<<<<<<<<<< @@ -6166,42 +6497,42 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dijkstra3d.pyx":333 + /* "dijkstra3d.pyx":370 * _validate_coord(data, src) * * if source.shape[1] < 3: # <<<<<<<<<<<<<< * tmp = np.zeros((source.shape[0], 3), dtype=np.uint64) * tmp[:, :source.shape[1]] = source[:,:] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":334 + /* "dijkstra3d.pyx":371 * * if source.shape[1] < 3: * tmp = np.zeros((source.shape[0], 3), dtype=np.uint64) # <<<<<<<<<<<<<< * tmp[:, :source.shape[1]] = source[:,:] * source = tmp */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); @@ -6209,21 +6540,21 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 334, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -6231,36 +6562,36 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __pyx_v_tmp = __pyx_t_4; __pyx_t_4 = 0; - /* "dijkstra3d.pyx":335 + /* "dijkstra3d.pyx":372 * if source.shape[1] < 3: * tmp = np.zeros((source.shape[0], 3), dtype=np.uint64) * tmp[:, :source.shape[1]] = source[:,:] # <<<<<<<<<<<<<< * source = tmp * */ - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_source, __pyx_tuple__3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_source, __pyx_tuple__5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_8 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8); __pyx_t_8 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_tmp, __pyx_t_6, __pyx_t_4) < 0)) __PYX_ERR(0, 335, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_tmp, __pyx_t_6, __pyx_t_4) < 0)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":336 + /* "dijkstra3d.pyx":373 * tmp = np.zeros((source.shape[0], 3), dtype=np.uint64) * tmp[:, :source.shape[1]] = source[:,:] * source = tmp # <<<<<<<<<<<<<< @@ -6270,7 +6601,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_v_tmp); __Pyx_DECREF_SET(__pyx_v_source, __pyx_v_tmp); - /* "dijkstra3d.pyx":333 + /* "dijkstra3d.pyx":370 * _validate_coord(data, src) * * if source.shape[1] < 3: # <<<<<<<<<<<<<< @@ -6279,7 +6610,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":338 + /* "dijkstra3d.pyx":375 * source = tmp * * while data.ndim < 3: # <<<<<<<<<<<<<< @@ -6287,27 +6618,27 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ * */ while (1) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) break; - /* "dijkstra3d.pyx":339 + /* "dijkstra3d.pyx":376 * * while data.ndim < 3: * data = data[..., np.newaxis] # <<<<<<<<<<<<<< * * if voxel_graph is not None: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(Py_Ellipsis); __Pyx_GIVEREF(Py_Ellipsis); @@ -6315,14 +6646,14 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; } - /* "dijkstra3d.pyx":341 + /* "dijkstra3d.pyx":378 * data = data[..., np.newaxis] * * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -6333,14 +6664,14 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { - /* "dijkstra3d.pyx":342 + /* "dijkstra3d.pyx":379 * * if voxel_graph is not None: * voxel_graph = format_voxel_graph(voxel_graph) # <<<<<<<<<<<<<< * * data = np.asfortranarray(data) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -6354,13 +6685,13 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ } __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_v_voxel_graph) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_voxel_graph); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_voxel_graph, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":341 + /* "dijkstra3d.pyx":378 * data = data[..., np.newaxis] * * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -6369,16 +6700,16 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":344 + /* "dijkstra3d.pyx":381 * voxel_graph = format_voxel_graph(voxel_graph) * * data = np.asfortranarray(data) # <<<<<<<<<<<<<< * * field, max_loc = _execute_distance_field(data, source, connectivity, voxel_graph) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -6393,20 +6724,20 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_data); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":346 + /* "dijkstra3d.pyx":383 * data = np.asfortranarray(data) * * field, max_loc = _execute_distance_field(data, source, connectivity, voxel_graph) # <<<<<<<<<<<<<< * if dims < 3: * field = np.squeeze(field, axis=2) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_execute_distance_field); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_execute_distance_field); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = NULL; __pyx_t_10 = 0; @@ -6423,7 +6754,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else @@ -6431,13 +6762,13 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_1 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -6454,7 +6785,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_v_voxel_graph); __Pyx_GIVEREF(__pyx_v_voxel_graph); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_10, __pyx_v_voxel_graph); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -6465,7 +6796,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 346, __pyx_L1_error) + __PYX_ERR(0, 383, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -6478,15 +6809,15 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; @@ -6494,7 +6825,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) __PYX_ERR(0, 346, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) __PYX_ERR(0, 383, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L21_unpacking_done; @@ -6502,7 +6833,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 346, __pyx_L1_error) + __PYX_ERR(0, 383, __pyx_L1_error) __pyx_L21_unpacking_done:; } __pyx_v_field = __pyx_t_8; @@ -6510,39 +6841,39 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __pyx_v_max_loc = __pyx_t_1; __pyx_t_1 = 0; - /* "dijkstra3d.pyx":347 + /* "dijkstra3d.pyx":384 * * field, max_loc = _execute_distance_field(data, source, connectivity, voxel_graph) * if dims < 3: # <<<<<<<<<<<<<< * field = np.squeeze(field, axis=2) * if dims < 2: */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_dims, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_dims, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":348 + /* "dijkstra3d.pyx":385 * field, max_loc = _execute_distance_field(data, source, connectivity, voxel_graph) * if dims < 3: * field = np.squeeze(field, axis=2) # <<<<<<<<<<<<<< * if dims < 2: * field = np.squeeze(field, axis=1) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_field); - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 348, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 385, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6550,7 +6881,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":347 + /* "dijkstra3d.pyx":384 * * field, max_loc = _execute_distance_field(data, source, connectivity, voxel_graph) * if dims < 3: # <<<<<<<<<<<<<< @@ -6559,39 +6890,39 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":349 + /* "dijkstra3d.pyx":386 * if dims < 3: * field = np.squeeze(field, axis=2) * if dims < 2: # <<<<<<<<<<<<<< * field = np.squeeze(field, axis=1) * */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_dims, __pyx_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_dims, __pyx_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":350 + /* "dijkstra3d.pyx":387 * field = np.squeeze(field, axis=2) * if dims < 2: * field = np.squeeze(field, axis=1) # <<<<<<<<<<<<<< * * if return_max_location: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_field); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -6599,7 +6930,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":349 + /* "dijkstra3d.pyx":386 * if dims < 3: * field = np.squeeze(field, axis=2) * if dims < 2: # <<<<<<<<<<<<<< @@ -6608,17 +6939,17 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":352 + /* "dijkstra3d.pyx":389 * field = np.squeeze(field, axis=1) * * if return_max_location: # <<<<<<<<<<<<<< * return field, np.unravel_index(max_loc, data.shape, order="F")[:dims] * else: */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_return_max_location); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_return_max_location); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 389, __pyx_L1_error) if (__pyx_t_5) { - /* "dijkstra3d.pyx":353 + /* "dijkstra3d.pyx":390 * * if return_max_location: * return field, np.unravel_index(max_loc, data.shape, order="F")[:dims] # <<<<<<<<<<<<<< @@ -6626,14 +6957,14 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ * return field */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unravel_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unravel_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_max_loc); __Pyx_GIVEREF(__pyx_v_max_loc); @@ -6641,18 +6972,18 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 353, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, NULL, &__pyx_v_dims, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, NULL, &__pyx_v_dims, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); @@ -6664,7 +6995,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":352 + /* "dijkstra3d.pyx":389 * field = np.squeeze(field, axis=1) * * if return_max_location: # <<<<<<<<<<<<<< @@ -6673,7 +7004,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ */ } - /* "dijkstra3d.pyx":355 + /* "dijkstra3d.pyx":392 * return field, np.unravel_index(max_loc, data.shape, order="F")[:dims] * else: * return field # <<<<<<<<<<<<<< @@ -6687,7 +7018,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ goto __pyx_L0; } - /* "dijkstra3d.pyx":274 + /* "dijkstra3d.pyx":311 * return _path_to_point_cloud(path, dims, rows, cols) * * def distance_field( # <<<<<<<<<<<<<< @@ -6719,7 +7050,7 @@ static PyObject *__pyx_pf_10dijkstra3d_6distance_field(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "dijkstra3d.pyx":358 +/* "dijkstra3d.pyx":395 * * # parents is either uint32 or uint64 * def _path_from_parents_helper(cnp.ndarray[UINT, ndim=3] parents, target): # <<<<<<<<<<<<<< @@ -6768,23 +7099,23 @@ static PyObject *__pyx_pw_10dijkstra3d_9_path_from_parents_helper(PyObject *__py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 395, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 395, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 395, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 358, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 395, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -6801,7 +7132,7 @@ static PyObject *__pyx_pw_10dijkstra3d_9_path_from_parents_helper(PyObject *__py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 395, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6859,7 +7190,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_path_from_parents_helper", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -6873,7 +7204,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -6881,7 +7212,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -6892,16 +7223,16 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_v____pyx_uint64_t_is_signed = (!((((uint64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -6916,18 +7247,18 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_parents, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_parents, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_parents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_parents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -6936,12 +7267,12 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 358, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); @@ -6952,15 +7283,15 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -6970,7 +7301,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -6979,14 +7310,14 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -7008,14 +7339,14 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -7028,9 +7359,9 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -7042,7 +7373,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -7051,9 +7382,9 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -7065,7 +7396,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -7074,9 +7405,9 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -7088,7 +7419,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -7097,9 +7428,9 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -7111,7 +7442,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -7140,7 +7471,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -7162,7 +7493,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -7184,7 +7515,7 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -7206,27 +7537,27 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -7234,12 +7565,12 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -7251,12 +7582,12 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_t_13, function); } } - __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__4) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__4); + __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__6) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__6); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -7269,29 +7600,29 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_t_13, function); } } - __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__5) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__5); + __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__7) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__7); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -7307,37 +7638,37 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED __pyx_L50_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 395, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_13; @@ -7371,9 +7702,9 @@ static PyObject *__pyx_pf_10dijkstra3d_8_path_from_parents_helper(CYTHON_UNUSED } /* Python wrapper */ -static PyObject *__pyx_fuse_0__pyx_pw_10dijkstra3d_31_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_fuse_0__pyx_mdef_10dijkstra3d_31_path_from_parents_helper = {"__pyx_fuse_0_path_from_parents_helper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_0__pyx_pw_10dijkstra3d_31_path_from_parents_helper, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_fuse_0__pyx_pw_10dijkstra3d_31_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_fuse_0__pyx_pw_10dijkstra3d_33_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_0__pyx_mdef_10dijkstra3d_33_path_from_parents_helper = {"__pyx_fuse_0_path_from_parents_helper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_0__pyx_pw_10dijkstra3d_33_path_from_parents_helper, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_fuse_0__pyx_pw_10dijkstra3d_33_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_parents = 0; PyObject *__pyx_v_target = 0; int __pyx_lineno = 0; @@ -7405,11 +7736,11 @@ static PyObject *__pyx_fuse_0__pyx_pw_10dijkstra3d_31_path_from_parents_helper(P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, 1); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, 1); __PYX_ERR(0, 395, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_from_parents_helper") < 0)) __PYX_ERR(0, 358, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_from_parents_helper") < 0)) __PYX_ERR(0, 395, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -7422,14 +7753,14 @@ static PyObject *__pyx_fuse_0__pyx_pw_10dijkstra3d_31_path_from_parents_helper(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 395, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._path_from_parents_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parents), __pyx_ptype_5numpy_ndarray, 1, "parents", 0))) __PYX_ERR(0, 358, __pyx_L1_error) - __pyx_r = __pyx_pf_10dijkstra3d_30_path_from_parents_helper(__pyx_self, __pyx_v_parents, __pyx_v_target); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parents), __pyx_ptype_5numpy_ndarray, 1, "parents", 0))) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_r = __pyx_pf_10dijkstra3d_32_path_from_parents_helper(__pyx_self, __pyx_v_parents, __pyx_v_target); /* function exit code */ goto __pyx_L0; @@ -7440,7 +7771,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_10dijkstra3d_31_path_from_parents_helper(P return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target) { +static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target) { __Pyx_memviewslice __pyx_v_arr_memview = { 0, 0, { 0 }, { 0 }, { 0 } }; std::vector __pyx_v_path; uint8_t *__pyx_v_path_ptr; @@ -7478,11 +7809,11 @@ static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED __pyx_pybuffernd_parents.rcbuffer = &__pyx_pybuffer_parents; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parents.rcbuffer->pybuffer, (PyObject*)__pyx_v_parents, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parents.rcbuffer->pybuffer, (PyObject*)__pyx_v_parents, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 395, __pyx_L1_error) } __pyx_pybuffernd_parents.diminfo[0].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parents.diminfo[0].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_parents.diminfo[1].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_parents.diminfo[1].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_parents.diminfo[2].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_parents.diminfo[2].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[2]; - /* "dijkstra3d.pyx":364 + /* "dijkstra3d.pyx":401 * cdef UINT[:] vec_view * * cdef size_t sx = parents.shape[0] # <<<<<<<<<<<<<< @@ -7491,7 +7822,7 @@ static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sx = (__pyx_v_parents->dimensions[0]); - /* "dijkstra3d.pyx":365 + /* "dijkstra3d.pyx":402 * * cdef size_t sx = parents.shape[0] * cdef size_t sy = parents.shape[1] # <<<<<<<<<<<<<< @@ -7500,7 +7831,7 @@ static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sy = (__pyx_v_parents->dimensions[1]); - /* "dijkstra3d.pyx":366 + /* "dijkstra3d.pyx":403 * cdef size_t sx = parents.shape[0] * cdef size_t sy = parents.shape[1] * cdef size_t sz = parents.shape[2] # <<<<<<<<<<<<<< @@ -7509,56 +7840,56 @@ static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sz = (__pyx_v_parents->dimensions[2]); - /* "dijkstra3d.pyx":368 + /* "dijkstra3d.pyx":405 * cdef size_t sz = parents.shape[2] * * cdef UINT targ = target[0] + sx * (target[1] + sy * target[2]) # <<<<<<<<<<<<<< * * arr_memview = parents */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_targ = __pyx_t_7; - /* "dijkstra3d.pyx":370 + /* "dijkstra3d.pyx":407 * cdef UINT targ = target[0] + sx * (target[1] + sy * target[2]) * * arr_memview = parents # <<<<<<<<<<<<<< * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(((PyObject *)__pyx_v_parents), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(((PyObject *)__pyx_v_parents), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_v_arr_memview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "dijkstra3d.pyx":371 + /* "dijkstra3d.pyx":408 * * arr_memview = parents * path = query_shortest_path(&arr_memview[0,0,0], targ) # <<<<<<<<<<<<<< @@ -7583,11 +7914,11 @@ static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED } else if (unlikely(__pyx_t_11 >= __pyx_v_arr_memview.shape[2])) __pyx_t_12 = 2; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 371, __pyx_L1_error) + __PYX_ERR(0, 408, __pyx_L1_error) } __pyx_v_path = ((std::vector )dijkstra::query_shortest_path((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview.data + __pyx_t_9 * __pyx_v_arr_memview.strides[0]) ) + __pyx_t_10 * __pyx_v_arr_memview.strides[1]) ) + __pyx_t_11 * __pyx_v_arr_memview.strides[2]) )))), __pyx_v_targ)); - /* "dijkstra3d.pyx":372 + /* "dijkstra3d.pyx":409 * arr_memview = parents * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] # <<<<<<<<<<<<<< @@ -7596,7 +7927,7 @@ static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_path_ptr = ((uint8_t *)(&(__pyx_v_path[0]))); - /* "dijkstra3d.pyx":373 + /* "dijkstra3d.pyx":410 * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] * vec_view = path_ptr # <<<<<<<<<<<<<< @@ -7605,39 +7936,39 @@ static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED */ if (!__pyx_v_path_ptr) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 373, __pyx_L1_error) + __PYX_ERR(0, 410, __pyx_L1_error) } - __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint8_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint8_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_path.size())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_path.size())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __pyx_array_new(__pyx_t_5, sizeof(uint8_t), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_path_ptr); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 373, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_t_13), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_t_13), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; __pyx_v_vec_view = __pyx_t_14; __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL; - /* "dijkstra3d.pyx":374 + /* "dijkstra3d.pyx":411 * path_ptr = &path[0] * vec_view = path_ptr * buf = bytearray(vec_view[:]) # <<<<<<<<<<<<<< * return np.frombuffer(buf, dtype=parents.dtype)[::-1] * */ - __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vec_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint8_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vec_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint8_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_buf = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "dijkstra3d.pyx":375 + /* "dijkstra3d.pyx":412 * vec_view = path_ptr * buf = bytearray(vec_view[:]) * return np.frombuffer(buf, dtype=parents.dtype)[::-1] # <<<<<<<<<<<<<< @@ -7645,35 +7976,35 @@ static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED * def path_from_parents(parents, target): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_buf); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parents), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parents), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":358 + /* "dijkstra3d.pyx":395 * * # parents is either uint32 or uint64 * def _path_from_parents_helper(cnp.ndarray[UINT, ndim=3] parents, target): # <<<<<<<<<<<<<< @@ -7713,9 +8044,9 @@ static PyObject *__pyx_pf_10dijkstra3d_30_path_from_parents_helper(CYTHON_UNUSED } /* Python wrapper */ -static PyObject *__pyx_fuse_1__pyx_pw_10dijkstra3d_33_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_fuse_1__pyx_mdef_10dijkstra3d_33_path_from_parents_helper = {"__pyx_fuse_1_path_from_parents_helper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_1__pyx_pw_10dijkstra3d_33_path_from_parents_helper, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_fuse_1__pyx_pw_10dijkstra3d_33_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_fuse_1__pyx_pw_10dijkstra3d_35_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_1__pyx_mdef_10dijkstra3d_35_path_from_parents_helper = {"__pyx_fuse_1_path_from_parents_helper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_1__pyx_pw_10dijkstra3d_35_path_from_parents_helper, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_fuse_1__pyx_pw_10dijkstra3d_35_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_parents = 0; PyObject *__pyx_v_target = 0; int __pyx_lineno = 0; @@ -7747,11 +8078,11 @@ static PyObject *__pyx_fuse_1__pyx_pw_10dijkstra3d_33_path_from_parents_helper(P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, 1); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, 1); __PYX_ERR(0, 395, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_from_parents_helper") < 0)) __PYX_ERR(0, 358, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_from_parents_helper") < 0)) __PYX_ERR(0, 395, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -7764,14 +8095,14 @@ static PyObject *__pyx_fuse_1__pyx_pw_10dijkstra3d_33_path_from_parents_helper(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 395, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._path_from_parents_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parents), __pyx_ptype_5numpy_ndarray, 1, "parents", 0))) __PYX_ERR(0, 358, __pyx_L1_error) - __pyx_r = __pyx_pf_10dijkstra3d_32_path_from_parents_helper(__pyx_self, __pyx_v_parents, __pyx_v_target); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parents), __pyx_ptype_5numpy_ndarray, 1, "parents", 0))) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_r = __pyx_pf_10dijkstra3d_34_path_from_parents_helper(__pyx_self, __pyx_v_parents, __pyx_v_target); /* function exit code */ goto __pyx_L0; @@ -7782,7 +8113,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_10dijkstra3d_33_path_from_parents_helper(P return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target) { +static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target) { __Pyx_memviewslice __pyx_v_arr_memview = { 0, 0, { 0 }, { 0 }, { 0 } }; std::vector __pyx_v_path; uint16_t *__pyx_v_path_ptr; @@ -7820,11 +8151,11 @@ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED __pyx_pybuffernd_parents.rcbuffer = &__pyx_pybuffer_parents; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parents.rcbuffer->pybuffer, (PyObject*)__pyx_v_parents, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parents.rcbuffer->pybuffer, (PyObject*)__pyx_v_parents, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 395, __pyx_L1_error) } __pyx_pybuffernd_parents.diminfo[0].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parents.diminfo[0].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_parents.diminfo[1].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_parents.diminfo[1].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_parents.diminfo[2].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_parents.diminfo[2].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[2]; - /* "dijkstra3d.pyx":364 + /* "dijkstra3d.pyx":401 * cdef UINT[:] vec_view * * cdef size_t sx = parents.shape[0] # <<<<<<<<<<<<<< @@ -7833,7 +8164,7 @@ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sx = (__pyx_v_parents->dimensions[0]); - /* "dijkstra3d.pyx":365 + /* "dijkstra3d.pyx":402 * * cdef size_t sx = parents.shape[0] * cdef size_t sy = parents.shape[1] # <<<<<<<<<<<<<< @@ -7842,7 +8173,7 @@ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sy = (__pyx_v_parents->dimensions[1]); - /* "dijkstra3d.pyx":366 + /* "dijkstra3d.pyx":403 * cdef size_t sx = parents.shape[0] * cdef size_t sy = parents.shape[1] * cdef size_t sz = parents.shape[2] # <<<<<<<<<<<<<< @@ -7851,56 +8182,56 @@ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sz = (__pyx_v_parents->dimensions[2]); - /* "dijkstra3d.pyx":368 + /* "dijkstra3d.pyx":405 * cdef size_t sz = parents.shape[2] * * cdef UINT targ = target[0] + sx * (target[1] + sy * target[2]) # <<<<<<<<<<<<<< * * arr_memview = parents */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyInt_As_uint16_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_uint16_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_targ = __pyx_t_7; - /* "dijkstra3d.pyx":370 + /* "dijkstra3d.pyx":407 * cdef UINT targ = target[0] + sx * (target[1] + sy * target[2]) * * arr_memview = parents # <<<<<<<<<<<<<< * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(((PyObject *)__pyx_v_parents), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(((PyObject *)__pyx_v_parents), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_v_arr_memview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "dijkstra3d.pyx":371 + /* "dijkstra3d.pyx":408 * * arr_memview = parents * path = query_shortest_path(&arr_memview[0,0,0], targ) # <<<<<<<<<<<<<< @@ -7925,11 +8256,11 @@ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED } else if (unlikely(__pyx_t_11 >= __pyx_v_arr_memview.shape[2])) __pyx_t_12 = 2; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 371, __pyx_L1_error) + __PYX_ERR(0, 408, __pyx_L1_error) } __pyx_v_path = ((std::vector )dijkstra::query_shortest_path((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview.data + __pyx_t_9 * __pyx_v_arr_memview.strides[0]) ) + __pyx_t_10 * __pyx_v_arr_memview.strides[1]) ) + __pyx_t_11 * __pyx_v_arr_memview.strides[2]) )))), __pyx_v_targ)); - /* "dijkstra3d.pyx":372 + /* "dijkstra3d.pyx":409 * arr_memview = parents * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] # <<<<<<<<<<<<<< @@ -7938,7 +8269,7 @@ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_path_ptr = ((uint16_t *)(&(__pyx_v_path[0]))); - /* "dijkstra3d.pyx":373 + /* "dijkstra3d.pyx":410 * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] * vec_view = path_ptr # <<<<<<<<<<<<<< @@ -7947,39 +8278,39 @@ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED */ if (!__pyx_v_path_ptr) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 373, __pyx_L1_error) + __PYX_ERR(0, 410, __pyx_L1_error) } - __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint16_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint16_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_path.size())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_path.size())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __pyx_array_new(__pyx_t_5, sizeof(uint16_t), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_path_ptr); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 373, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_t_13), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_t_13), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; __pyx_v_vec_view = __pyx_t_14; __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL; - /* "dijkstra3d.pyx":374 + /* "dijkstra3d.pyx":411 * path_ptr = &path[0] * vec_view = path_ptr * buf = bytearray(vec_view[:]) # <<<<<<<<<<<<<< * return np.frombuffer(buf, dtype=parents.dtype)[::-1] * */ - __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vec_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint16_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vec_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint16_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_buf = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "dijkstra3d.pyx":375 + /* "dijkstra3d.pyx":412 * vec_view = path_ptr * buf = bytearray(vec_view[:]) * return np.frombuffer(buf, dtype=parents.dtype)[::-1] # <<<<<<<<<<<<<< @@ -7987,35 +8318,35 @@ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED * def path_from_parents(parents, target): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_buf); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parents), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parents), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":358 + /* "dijkstra3d.pyx":395 * * # parents is either uint32 or uint64 * def _path_from_parents_helper(cnp.ndarray[UINT, ndim=3] parents, target): # <<<<<<<<<<<<<< @@ -8055,9 +8386,9 @@ static PyObject *__pyx_pf_10dijkstra3d_32_path_from_parents_helper(CYTHON_UNUSED } /* Python wrapper */ -static PyObject *__pyx_fuse_2__pyx_pw_10dijkstra3d_35_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_fuse_2__pyx_mdef_10dijkstra3d_35_path_from_parents_helper = {"__pyx_fuse_2_path_from_parents_helper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_2__pyx_pw_10dijkstra3d_35_path_from_parents_helper, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_fuse_2__pyx_pw_10dijkstra3d_35_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_fuse_2__pyx_pw_10dijkstra3d_37_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_2__pyx_mdef_10dijkstra3d_37_path_from_parents_helper = {"__pyx_fuse_2_path_from_parents_helper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_2__pyx_pw_10dijkstra3d_37_path_from_parents_helper, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_fuse_2__pyx_pw_10dijkstra3d_37_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_parents = 0; PyObject *__pyx_v_target = 0; int __pyx_lineno = 0; @@ -8089,11 +8420,11 @@ static PyObject *__pyx_fuse_2__pyx_pw_10dijkstra3d_35_path_from_parents_helper(P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, 1); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, 1); __PYX_ERR(0, 395, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_from_parents_helper") < 0)) __PYX_ERR(0, 358, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_from_parents_helper") < 0)) __PYX_ERR(0, 395, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -8106,14 +8437,14 @@ static PyObject *__pyx_fuse_2__pyx_pw_10dijkstra3d_35_path_from_parents_helper(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 395, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._path_from_parents_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parents), __pyx_ptype_5numpy_ndarray, 1, "parents", 0))) __PYX_ERR(0, 358, __pyx_L1_error) - __pyx_r = __pyx_pf_10dijkstra3d_34_path_from_parents_helper(__pyx_self, __pyx_v_parents, __pyx_v_target); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parents), __pyx_ptype_5numpy_ndarray, 1, "parents", 0))) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_r = __pyx_pf_10dijkstra3d_36_path_from_parents_helper(__pyx_self, __pyx_v_parents, __pyx_v_target); /* function exit code */ goto __pyx_L0; @@ -8124,7 +8455,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_10dijkstra3d_35_path_from_parents_helper(P return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target) { +static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target) { __Pyx_memviewslice __pyx_v_arr_memview = { 0, 0, { 0 }, { 0 }, { 0 } }; std::vector __pyx_v_path; uint32_t *__pyx_v_path_ptr; @@ -8162,11 +8493,11 @@ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED __pyx_pybuffernd_parents.rcbuffer = &__pyx_pybuffer_parents; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parents.rcbuffer->pybuffer, (PyObject*)__pyx_v_parents, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parents.rcbuffer->pybuffer, (PyObject*)__pyx_v_parents, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 395, __pyx_L1_error) } __pyx_pybuffernd_parents.diminfo[0].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parents.diminfo[0].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_parents.diminfo[1].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_parents.diminfo[1].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_parents.diminfo[2].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_parents.diminfo[2].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[2]; - /* "dijkstra3d.pyx":364 + /* "dijkstra3d.pyx":401 * cdef UINT[:] vec_view * * cdef size_t sx = parents.shape[0] # <<<<<<<<<<<<<< @@ -8175,7 +8506,7 @@ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sx = (__pyx_v_parents->dimensions[0]); - /* "dijkstra3d.pyx":365 + /* "dijkstra3d.pyx":402 * * cdef size_t sx = parents.shape[0] * cdef size_t sy = parents.shape[1] # <<<<<<<<<<<<<< @@ -8184,7 +8515,7 @@ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sy = (__pyx_v_parents->dimensions[1]); - /* "dijkstra3d.pyx":366 + /* "dijkstra3d.pyx":403 * cdef size_t sx = parents.shape[0] * cdef size_t sy = parents.shape[1] * cdef size_t sz = parents.shape[2] # <<<<<<<<<<<<<< @@ -8193,56 +8524,56 @@ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sz = (__pyx_v_parents->dimensions[2]); - /* "dijkstra3d.pyx":368 + /* "dijkstra3d.pyx":405 * cdef size_t sz = parents.shape[2] * * cdef UINT targ = target[0] + sx * (target[1] + sy * target[2]) # <<<<<<<<<<<<<< * * arr_memview = parents */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_targ = __pyx_t_7; - /* "dijkstra3d.pyx":370 + /* "dijkstra3d.pyx":407 * cdef UINT targ = target[0] + sx * (target[1] + sy * target[2]) * * arr_memview = parents # <<<<<<<<<<<<<< * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(((PyObject *)__pyx_v_parents), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(((PyObject *)__pyx_v_parents), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_v_arr_memview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "dijkstra3d.pyx":371 + /* "dijkstra3d.pyx":408 * * arr_memview = parents * path = query_shortest_path(&arr_memview[0,0,0], targ) # <<<<<<<<<<<<<< @@ -8267,11 +8598,11 @@ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED } else if (unlikely(__pyx_t_11 >= __pyx_v_arr_memview.shape[2])) __pyx_t_12 = 2; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 371, __pyx_L1_error) + __PYX_ERR(0, 408, __pyx_L1_error) } __pyx_v_path = ((std::vector )dijkstra::query_shortest_path((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview.data + __pyx_t_9 * __pyx_v_arr_memview.strides[0]) ) + __pyx_t_10 * __pyx_v_arr_memview.strides[1]) ) + __pyx_t_11 * __pyx_v_arr_memview.strides[2]) )))), __pyx_v_targ)); - /* "dijkstra3d.pyx":372 + /* "dijkstra3d.pyx":409 * arr_memview = parents * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] # <<<<<<<<<<<<<< @@ -8280,7 +8611,7 @@ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_path_ptr = ((uint32_t *)(&(__pyx_v_path[0]))); - /* "dijkstra3d.pyx":373 + /* "dijkstra3d.pyx":410 * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] * vec_view = path_ptr # <<<<<<<<<<<<<< @@ -8289,39 +8620,39 @@ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED */ if (!__pyx_v_path_ptr) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 373, __pyx_L1_error) + __PYX_ERR(0, 410, __pyx_L1_error) } - __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint32_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint32_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_path.size())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_path.size())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __pyx_array_new(__pyx_t_5, sizeof(uint32_t), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_path_ptr); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 373, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_t_13), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_t_13), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; __pyx_v_vec_view = __pyx_t_14; __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL; - /* "dijkstra3d.pyx":374 + /* "dijkstra3d.pyx":411 * path_ptr = &path[0] * vec_view = path_ptr * buf = bytearray(vec_view[:]) # <<<<<<<<<<<<<< * return np.frombuffer(buf, dtype=parents.dtype)[::-1] * */ - __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vec_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint32_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vec_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint32_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_buf = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "dijkstra3d.pyx":375 + /* "dijkstra3d.pyx":412 * vec_view = path_ptr * buf = bytearray(vec_view[:]) * return np.frombuffer(buf, dtype=parents.dtype)[::-1] # <<<<<<<<<<<<<< @@ -8329,35 +8660,35 @@ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED * def path_from_parents(parents, target): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_buf); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parents), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parents), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":358 + /* "dijkstra3d.pyx":395 * * # parents is either uint32 or uint64 * def _path_from_parents_helper(cnp.ndarray[UINT, ndim=3] parents, target): # <<<<<<<<<<<<<< @@ -8397,9 +8728,9 @@ static PyObject *__pyx_pf_10dijkstra3d_34_path_from_parents_helper(CYTHON_UNUSED } /* Python wrapper */ -static PyObject *__pyx_fuse_3__pyx_pw_10dijkstra3d_37_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_fuse_3__pyx_mdef_10dijkstra3d_37_path_from_parents_helper = {"__pyx_fuse_3_path_from_parents_helper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_3__pyx_pw_10dijkstra3d_37_path_from_parents_helper, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_fuse_3__pyx_pw_10dijkstra3d_37_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_fuse_3__pyx_pw_10dijkstra3d_39_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_3__pyx_mdef_10dijkstra3d_39_path_from_parents_helper = {"__pyx_fuse_3_path_from_parents_helper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_3__pyx_pw_10dijkstra3d_39_path_from_parents_helper, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_fuse_3__pyx_pw_10dijkstra3d_39_path_from_parents_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_parents = 0; PyObject *__pyx_v_target = 0; int __pyx_lineno = 0; @@ -8431,11 +8762,11 @@ static PyObject *__pyx_fuse_3__pyx_pw_10dijkstra3d_37_path_from_parents_helper(P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, 1); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, 1); __PYX_ERR(0, 395, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_from_parents_helper") < 0)) __PYX_ERR(0, 358, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_from_parents_helper") < 0)) __PYX_ERR(0, 395, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -8448,14 +8779,14 @@ static PyObject *__pyx_fuse_3__pyx_pw_10dijkstra3d_37_path_from_parents_helper(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 358, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_from_parents_helper", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 395, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._path_from_parents_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parents), __pyx_ptype_5numpy_ndarray, 1, "parents", 0))) __PYX_ERR(0, 358, __pyx_L1_error) - __pyx_r = __pyx_pf_10dijkstra3d_36_path_from_parents_helper(__pyx_self, __pyx_v_parents, __pyx_v_target); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parents), __pyx_ptype_5numpy_ndarray, 1, "parents", 0))) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_r = __pyx_pf_10dijkstra3d_38_path_from_parents_helper(__pyx_self, __pyx_v_parents, __pyx_v_target); /* function exit code */ goto __pyx_L0; @@ -8466,7 +8797,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_10dijkstra3d_37_path_from_parents_helper(P return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target) { +static PyObject *__pyx_pf_10dijkstra3d_38_path_from_parents_helper(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_parents, PyObject *__pyx_v_target) { __Pyx_memviewslice __pyx_v_arr_memview = { 0, 0, { 0 }, { 0 }, { 0 } }; std::vector __pyx_v_path; uint64_t *__pyx_v_path_ptr; @@ -8504,11 +8835,11 @@ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED __pyx_pybuffernd_parents.rcbuffer = &__pyx_pybuffer_parents; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parents.rcbuffer->pybuffer, (PyObject*)__pyx_v_parents, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parents.rcbuffer->pybuffer, (PyObject*)__pyx_v_parents, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 395, __pyx_L1_error) } __pyx_pybuffernd_parents.diminfo[0].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parents.diminfo[0].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_parents.diminfo[1].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_parents.diminfo[1].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_parents.diminfo[2].strides = __pyx_pybuffernd_parents.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_parents.diminfo[2].shape = __pyx_pybuffernd_parents.rcbuffer->pybuffer.shape[2]; - /* "dijkstra3d.pyx":364 + /* "dijkstra3d.pyx":401 * cdef UINT[:] vec_view * * cdef size_t sx = parents.shape[0] # <<<<<<<<<<<<<< @@ -8517,7 +8848,7 @@ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sx = (__pyx_v_parents->dimensions[0]); - /* "dijkstra3d.pyx":365 + /* "dijkstra3d.pyx":402 * * cdef size_t sx = parents.shape[0] * cdef size_t sy = parents.shape[1] # <<<<<<<<<<<<<< @@ -8526,7 +8857,7 @@ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sy = (__pyx_v_parents->dimensions[1]); - /* "dijkstra3d.pyx":366 + /* "dijkstra3d.pyx":403 * cdef size_t sx = parents.shape[0] * cdef size_t sy = parents.shape[1] * cdef size_t sz = parents.shape[2] # <<<<<<<<<<<<<< @@ -8535,56 +8866,56 @@ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_sz = (__pyx_v_parents->dimensions[2]); - /* "dijkstra3d.pyx":368 + /* "dijkstra3d.pyx":405 * cdef size_t sz = parents.shape[2] * * cdef UINT targ = target[0] + sx * (target[1] + sy * target[2]) # <<<<<<<<<<<<<< * * arr_memview = parents */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_targ = __pyx_t_7; - /* "dijkstra3d.pyx":370 + /* "dijkstra3d.pyx":407 * cdef UINT targ = target[0] + sx * (target[1] + sy * target[2]) * * arr_memview = parents # <<<<<<<<<<<<<< * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(((PyObject *)__pyx_v_parents), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(((PyObject *)__pyx_v_parents), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_v_arr_memview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "dijkstra3d.pyx":371 + /* "dijkstra3d.pyx":408 * * arr_memview = parents * path = query_shortest_path(&arr_memview[0,0,0], targ) # <<<<<<<<<<<<<< @@ -8609,11 +8940,11 @@ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED } else if (unlikely(__pyx_t_11 >= __pyx_v_arr_memview.shape[2])) __pyx_t_12 = 2; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 371, __pyx_L1_error) + __PYX_ERR(0, 408, __pyx_L1_error) } __pyx_v_path = ((std::vector )dijkstra::query_shortest_path((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview.data + __pyx_t_9 * __pyx_v_arr_memview.strides[0]) ) + __pyx_t_10 * __pyx_v_arr_memview.strides[1]) ) + __pyx_t_11 * __pyx_v_arr_memview.strides[2]) )))), __pyx_v_targ)); - /* "dijkstra3d.pyx":372 + /* "dijkstra3d.pyx":409 * arr_memview = parents * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] # <<<<<<<<<<<<<< @@ -8622,7 +8953,7 @@ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED */ __pyx_v_path_ptr = ((uint64_t *)(&(__pyx_v_path[0]))); - /* "dijkstra3d.pyx":373 + /* "dijkstra3d.pyx":410 * path = query_shortest_path(&arr_memview[0,0,0], targ) * path_ptr = &path[0] * vec_view = path_ptr # <<<<<<<<<<<<<< @@ -8631,39 +8962,39 @@ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED */ if (!__pyx_v_path_ptr) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 373, __pyx_L1_error) + __PYX_ERR(0, 410, __pyx_L1_error) } - __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint64_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint64_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_path.size())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_path.size())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __pyx_array_new(__pyx_t_5, sizeof(uint64_t), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_path_ptr); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 373, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_t_13), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_t_13), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; __pyx_v_vec_view = __pyx_t_14; __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL; - /* "dijkstra3d.pyx":374 + /* "dijkstra3d.pyx":411 * path_ptr = &path[0] * vec_view = path_ptr * buf = bytearray(vec_view[:]) # <<<<<<<<<<<<<< * return np.frombuffer(buf, dtype=parents.dtype)[::-1] * */ - __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vec_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vec_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_buf = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "dijkstra3d.pyx":375 + /* "dijkstra3d.pyx":412 * vec_view = path_ptr * buf = bytearray(vec_view[:]) * return np.frombuffer(buf, dtype=parents.dtype)[::-1] # <<<<<<<<<<<<<< @@ -8671,35 +9002,35 @@ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED * def path_from_parents(parents, target): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_buf); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parents), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parents), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_slice__10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":358 + /* "dijkstra3d.pyx":395 * * # parents is either uint32 or uint64 * def _path_from_parents_helper(cnp.ndarray[UINT, ndim=3] parents, target): # <<<<<<<<<<<<<< @@ -8738,7 +9069,7 @@ static PyObject *__pyx_pf_10dijkstra3d_36_path_from_parents_helper(CYTHON_UNUSED return __pyx_r; } -/* "dijkstra3d.pyx":377 +/* "dijkstra3d.pyx":414 * return np.frombuffer(buf, dtype=parents.dtype)[::-1] * * def path_from_parents(parents, target): # <<<<<<<<<<<<<< @@ -8781,11 +9112,11 @@ static PyObject *__pyx_pw_10dijkstra3d_11path_from_parents(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("path_from_parents", 1, 2, 2, 1); __PYX_ERR(0, 377, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("path_from_parents", 1, 2, 2, 1); __PYX_ERR(0, 414, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "path_from_parents") < 0)) __PYX_ERR(0, 377, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "path_from_parents") < 0)) __PYX_ERR(0, 414, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -8798,7 +9129,7 @@ static PyObject *__pyx_pw_10dijkstra3d_11path_from_parents(PyObject *__pyx_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("path_from_parents", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 377, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("path_from_parents", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 414, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d.path_from_parents", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -8836,19 +9167,19 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec __Pyx_INCREF(__pyx_v_parents); __Pyx_INCREF(__pyx_v_target); - /* "dijkstra3d.pyx":378 + /* "dijkstra3d.pyx":415 * * def path_from_parents(parents, target): * ndim = parents.ndim # <<<<<<<<<<<<<< * while parents.ndim < 3: * parents = parents[..., np.newaxis] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parents, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parents, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndim = __pyx_t_1; __pyx_t_1 = 0; - /* "dijkstra3d.pyx":379 + /* "dijkstra3d.pyx":416 * def path_from_parents(parents, target): * ndim = parents.ndim * while parents.ndim < 3: # <<<<<<<<<<<<<< @@ -8856,27 +9187,27 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec * */ while (1) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parents, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parents, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 379, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) break; - /* "dijkstra3d.pyx":380 + /* "dijkstra3d.pyx":417 * ndim = parents.ndim * while parents.ndim < 3: * parents = parents[..., np.newaxis] # <<<<<<<<<<<<<< * * while len(target) < 3: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_Ellipsis); __Pyx_GIVEREF(Py_Ellipsis); @@ -8884,14 +9215,14 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_parents, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_parents, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_parents, __pyx_t_1); __pyx_t_1 = 0; } - /* "dijkstra3d.pyx":382 + /* "dijkstra3d.pyx":419 * parents = parents[..., np.newaxis] * * while len(target) < 3: # <<<<<<<<<<<<<< @@ -8899,63 +9230,63 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec * */ while (1) { - __pyx_t_4 = PyObject_Length(__pyx_v_target); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_v_target); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 419, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_4 < 3) != 0); if (!__pyx_t_3) break; - /* "dijkstra3d.pyx":383 + /* "dijkstra3d.pyx":420 * * while len(target) < 3: * target += (0,) # <<<<<<<<<<<<<< * * cdef size_t sx = parents.shape[0] */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_target, __pyx_tuple_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_target, __pyx_tuple__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_target, __pyx_t_1); __pyx_t_1 = 0; } - /* "dijkstra3d.pyx":385 + /* "dijkstra3d.pyx":422 * target += (0,) * * cdef size_t sx = parents.shape[0] # <<<<<<<<<<<<<< * cdef size_t sy = parents.shape[1] * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parents, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parents, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_sx = __pyx_t_5; - /* "dijkstra3d.pyx":386 + /* "dijkstra3d.pyx":423 * * cdef size_t sx = parents.shape[0] * cdef size_t sy = parents.shape[1] # <<<<<<<<<<<<<< * * numpy_path = _path_from_parents_helper(parents, target) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_parents, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_parents, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sy = __pyx_t_5; - /* "dijkstra3d.pyx":388 + /* "dijkstra3d.pyx":425 * cdef size_t sy = parents.shape[1] * * numpy_path = _path_from_parents_helper(parents, target) # <<<<<<<<<<<<<< * ptlist = _path_to_point_cloud(numpy_path, 3, sy, sx) * return ptlist[:, :ndim] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_path_from_parents_helper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_path_from_parents_helper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -8972,7 +9303,7 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_parents, __pyx_v_target}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -8980,13 +9311,13 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_parents, __pyx_v_target}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -8997,7 +9328,7 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec __Pyx_INCREF(__pyx_v_target); __Pyx_GIVEREF(__pyx_v_target); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_target); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -9005,18 +9336,18 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec __pyx_v_numpy_path = __pyx_t_1; __pyx_t_1 = 0; - /* "dijkstra3d.pyx":389 + /* "dijkstra3d.pyx":426 * * numpy_path = _path_from_parents_helper(parents, target) * ptlist = _path_to_point_cloud(numpy_path, 3, sy, sx) # <<<<<<<<<<<<<< * return ptlist[:, :ndim] * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_path_to_point_cloud); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_path_to_point_cloud); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = NULL; __pyx_t_7 = 0; @@ -9033,7 +9364,7 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_v_numpy_path, __pyx_int_3, __pyx_t_8, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -9043,7 +9374,7 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_v_numpy_path, __pyx_int_3, __pyx_t_8, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -9051,7 +9382,7 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec } else #endif { - __pyx_t_10 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -9068,7 +9399,7 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_7, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -9076,7 +9407,7 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec __pyx_v_ptlist = __pyx_t_1; __pyx_t_1 = 0; - /* "dijkstra3d.pyx":390 + /* "dijkstra3d.pyx":427 * numpy_path = _path_from_parents_helper(parents, target) * ptlist = _path_to_point_cloud(numpy_path, 3, sy, sx) * return ptlist[:, :ndim] # <<<<<<<<<<<<<< @@ -9084,24 +9415,24 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec * def parental_field(data, source, connectivity=26, voxel_graph=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PySlice_New(Py_None, __pyx_v_ndim, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_1 = PySlice_New(Py_None, __pyx_v_ndim, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_ptlist, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_ptlist, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":377 + /* "dijkstra3d.pyx":414 * return np.frombuffer(buf, dtype=parents.dtype)[::-1] * * def path_from_parents(parents, target): # <<<<<<<<<<<<<< @@ -9130,7 +9461,7 @@ static PyObject *__pyx_pf_10dijkstra3d_10path_from_parents(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "dijkstra3d.pyx":392 +/* "dijkstra3d.pyx":429 * return ptlist[:, :ndim] * * def parental_field(data, source, connectivity=26, voxel_graph=None): # <<<<<<<<<<<<<< @@ -9182,7 +9513,7 @@ static PyObject *__pyx_pw_10dijkstra3d_13parental_field(PyObject *__pyx_self, Py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("parental_field", 0, 2, 4, 1); __PYX_ERR(0, 392, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("parental_field", 0, 2, 4, 1); __PYX_ERR(0, 429, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -9198,7 +9529,7 @@ static PyObject *__pyx_pw_10dijkstra3d_13parental_field(PyObject *__pyx_self, Py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parental_field") < 0)) __PYX_ERR(0, 392, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parental_field") < 0)) __PYX_ERR(0, 429, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -9219,7 +9550,7 @@ static PyObject *__pyx_pw_10dijkstra3d_13parental_field(PyObject *__pyx_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("parental_field", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 392, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("parental_field", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 429, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d.parental_field", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9254,23 +9585,23 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_v_connectivity); __Pyx_INCREF(__pyx_v_voxel_graph); - /* "dijkstra3d.pyx":414 + /* "dijkstra3d.pyx":451 * of a path has index 0. * """ * dims = len(data.shape) # <<<<<<<<<<<<<< * if dims not in (2,3): * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dims = __pyx_t_1; __pyx_t_1 = 0; - /* "dijkstra3d.pyx":415 + /* "dijkstra3d.pyx":452 * """ * dims = len(data.shape) * if dims not in (2,3): # <<<<<<<<<<<<<< @@ -9279,18 +9610,18 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ __Pyx_INCREF(__pyx_v_dims); __pyx_t_1 = __pyx_v_dims; - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -9298,18 +9629,18 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __pyx_t_5 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_5)) { - /* "dijkstra3d.pyx":416 + /* "dijkstra3d.pyx":453 * dims = len(data.shape) * if dims not in (2,3): * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) # <<<<<<<<<<<<<< * * if dims == 2: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -9325,14 +9656,14 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 416, __pyx_L1_error) + __PYX_ERR(0, 453, __pyx_L1_error) - /* "dijkstra3d.pyx":415 + /* "dijkstra3d.pyx":452 * """ * dims = len(data.shape) * if dims not in (2,3): # <<<<<<<<<<<<<< @@ -9341,33 +9672,33 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ } - /* "dijkstra3d.pyx":418 + /* "dijkstra3d.pyx":455 * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) * * if dims == 2: # <<<<<<<<<<<<<< * if connectivity == 4: * connectivity = 6 */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":419 + /* "dijkstra3d.pyx":456 * * if dims == 2: * if connectivity == 4: # <<<<<<<<<<<<<< * connectivity = 6 * elif connectivity == 8: */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":420 + /* "dijkstra3d.pyx":457 * if dims == 2: * if connectivity == 4: * connectivity = 6 # <<<<<<<<<<<<<< @@ -9377,7 +9708,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_int_6); __Pyx_DECREF_SET(__pyx_v_connectivity, __pyx_int_6); - /* "dijkstra3d.pyx":419 + /* "dijkstra3d.pyx":456 * * if dims == 2: * if connectivity == 4: # <<<<<<<<<<<<<< @@ -9387,20 +9718,20 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * goto __pyx_L7; } - /* "dijkstra3d.pyx":421 + /* "dijkstra3d.pyx":458 * if connectivity == 4: * connectivity = 6 * elif connectivity == 8: # <<<<<<<<<<<<<< * connectivity = 18 # or 26 but 18 might be faster * */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_connectivity, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":422 + /* "dijkstra3d.pyx":459 * connectivity = 6 * elif connectivity == 8: * connectivity = 18 # or 26 but 18 might be faster # <<<<<<<<<<<<<< @@ -9410,7 +9741,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_int_18); __Pyx_DECREF_SET(__pyx_v_connectivity, __pyx_int_18); - /* "dijkstra3d.pyx":421 + /* "dijkstra3d.pyx":458 * if connectivity == 4: * connectivity = 6 * elif connectivity == 8: # <<<<<<<<<<<<<< @@ -9420,7 +9751,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * } __pyx_L7:; - /* "dijkstra3d.pyx":418 + /* "dijkstra3d.pyx":455 * raise DimensionError("Only 2D and 3D image sources are supported. Got: " + str(dims)) * * if dims == 2: # <<<<<<<<<<<<<< @@ -9429,7 +9760,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ } - /* "dijkstra3d.pyx":424 + /* "dijkstra3d.pyx":461 * connectivity = 18 # or 26 but 18 might be faster * * if connectivity not in (6,18,26): # <<<<<<<<<<<<<< @@ -9438,27 +9769,27 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ __Pyx_INCREF(__pyx_v_connectivity); __pyx_t_1 = __pyx_v_connectivity; - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_18, 18, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_18, 18, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_26, 26, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_26, 26, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L9_bool_binop_done:; @@ -9466,34 +9797,34 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_t_5 != 0); if (unlikely(__pyx_t_3)) { - /* "dijkstra3d.pyx":426 + /* "dijkstra3d.pyx":463 * if connectivity not in (6,18,26): * raise ValueError( * "Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":425 + /* "dijkstra3d.pyx":462 * * if connectivity not in (6,18,26): * raise ValueError( # <<<<<<<<<<<<<< * "Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 425, __pyx_L1_error) + __PYX_ERR(0, 462, __pyx_L1_error) - /* "dijkstra3d.pyx":424 + /* "dijkstra3d.pyx":461 * connectivity = 18 # or 26 but 18 might be faster * * if connectivity not in (6,18,26): # <<<<<<<<<<<<<< @@ -9502,23 +9833,23 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ } - /* "dijkstra3d.pyx":429 + /* "dijkstra3d.pyx":466 * ) * * if data.size == 0: # <<<<<<<<<<<<<< * return np.zeros(shape=(0,), dtype=np.float32) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":430 + /* "dijkstra3d.pyx":467 * * if data.size == 0: * return np.zeros(shape=(0,), dtype=np.float32) # <<<<<<<<<<<<<< @@ -9526,22 +9857,22 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * * if dims == 1: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple__3) < 0) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 430, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -9549,7 +9880,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __pyx_t_6 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":429 + /* "dijkstra3d.pyx":466 * ) * * if data.size == 0: # <<<<<<<<<<<<<< @@ -9558,63 +9889,63 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ } - /* "dijkstra3d.pyx":432 + /* "dijkstra3d.pyx":469 * return np.zeros(shape=(0,), dtype=np.float32) * * if dims == 1: # <<<<<<<<<<<<<< * data = data[:, np.newaxis, np.newaxis] * source = ( source[0], 0, 0 ) */ - __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":433 + /* "dijkstra3d.pyx":470 * * if dims == 1: * data = data[:, np.newaxis, np.newaxis] # <<<<<<<<<<<<<< * source = ( source[0], 0, 0 ) * if dims == 2: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_4 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":434 + /* "dijkstra3d.pyx":471 * if dims == 1: * data = data[:, np.newaxis, np.newaxis] * source = ( source[0], 0, 0 ) # <<<<<<<<<<<<<< * if dims == 2: * data = data[:, :, np.newaxis] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -9628,7 +9959,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":432 + /* "dijkstra3d.pyx":469 * return np.zeros(shape=(0,), dtype=np.float32) * * if dims == 1: # <<<<<<<<<<<<<< @@ -9637,60 +9968,60 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ } - /* "dijkstra3d.pyx":435 + /* "dijkstra3d.pyx":472 * data = data[:, np.newaxis, np.newaxis] * source = ( source[0], 0, 0 ) * if dims == 2: # <<<<<<<<<<<<<< * data = data[:, :, np.newaxis] * source = ( source[0], source[1], 0 ) */ - __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":436 + /* "dijkstra3d.pyx":473 * source = ( source[0], 0, 0 ) * if dims == 2: * data = data[:, :, np.newaxis] # <<<<<<<<<<<<<< * source = ( source[0], source[1], 0 ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__2); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__4); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":437 + /* "dijkstra3d.pyx":474 * if dims == 2: * data = data[:, :, np.newaxis] * source = ( source[0], source[1], 0 ) # <<<<<<<<<<<<<< * * if voxel_graph is not None: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -9704,7 +10035,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":435 + /* "dijkstra3d.pyx":472 * data = data[:, np.newaxis, np.newaxis] * source = ( source[0], 0, 0 ) * if dims == 2: # <<<<<<<<<<<<<< @@ -9713,7 +10044,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ } - /* "dijkstra3d.pyx":439 + /* "dijkstra3d.pyx":476 * source = ( source[0], source[1], 0 ) * * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -9724,14 +10055,14 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { - /* "dijkstra3d.pyx":440 + /* "dijkstra3d.pyx":477 * * if voxel_graph is not None: * voxel_graph = format_voxel_graph(voxel_graph) # <<<<<<<<<<<<<< * * _validate_coord(data, source) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -9745,13 +10076,13 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_voxel_graph) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_voxel_graph); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_voxel_graph, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":439 + /* "dijkstra3d.pyx":476 * source = ( source[0], source[1], 0 ) * * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -9760,14 +10091,14 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ } - /* "dijkstra3d.pyx":442 + /* "dijkstra3d.pyx":479 * voxel_graph = format_voxel_graph(voxel_graph) * * _validate_coord(data, source) # <<<<<<<<<<<<<< * * data = np.asfortranarray(data) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; __pyx_t_8 = 0; @@ -9784,7 +10115,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_source}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_4); } else @@ -9792,13 +10123,13 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_source}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -9809,23 +10140,23 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_source); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":444 + /* "dijkstra3d.pyx":481 * _validate_coord(data, source) * * data = np.asfortranarray(data) # <<<<<<<<<<<<<< * * field = _execute_parental_field(data, source, connectivity, voxel_graph) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -9840,20 +10171,20 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":446 + /* "dijkstra3d.pyx":483 * data = np.asfortranarray(data) * * field = _execute_parental_field(data, source, connectivity, voxel_graph) # <<<<<<<<<<<<<< * if dims < 3: * field = np.squeeze(field, axis=2) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_execute_parental_field); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_execute_parental_field); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; __pyx_t_8 = 0; @@ -9870,7 +10201,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else @@ -9878,13 +10209,13 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_1 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -9901,7 +10232,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_v_voxel_graph); __Pyx_GIVEREF(__pyx_v_voxel_graph); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_8, __pyx_v_voxel_graph); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -9909,39 +10240,39 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __pyx_v_field = __pyx_t_4; __pyx_t_4 = 0; - /* "dijkstra3d.pyx":447 + /* "dijkstra3d.pyx":484 * * field = _execute_parental_field(data, source, connectivity, voxel_graph) * if dims < 3: # <<<<<<<<<<<<<< * field = np.squeeze(field, axis=2) * if dims < 2: */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_dims, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_dims, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":448 + /* "dijkstra3d.pyx":485 * field = _execute_parental_field(data, source, connectivity, voxel_graph) * if dims < 3: * field = np.squeeze(field, axis=2) # <<<<<<<<<<<<<< * if dims < 2: * field = np.squeeze(field, axis=1) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_field); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 448, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 448, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -9949,7 +10280,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":447 + /* "dijkstra3d.pyx":484 * * field = _execute_parental_field(data, source, connectivity, voxel_graph) * if dims < 3: # <<<<<<<<<<<<<< @@ -9958,39 +10289,39 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ } - /* "dijkstra3d.pyx":449 + /* "dijkstra3d.pyx":486 * if dims < 3: * field = np.squeeze(field, axis=2) * if dims < 2: # <<<<<<<<<<<<<< * field = np.squeeze(field, axis=1) * */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_dims, __pyx_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_dims, __pyx_int_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "dijkstra3d.pyx":450 + /* "dijkstra3d.pyx":487 * field = np.squeeze(field, axis=2) * if dims < 2: * field = np.squeeze(field, axis=1) # <<<<<<<<<<<<<< * * return field */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_field); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 450, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -9998,7 +10329,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_7); __pyx_t_7 = 0; - /* "dijkstra3d.pyx":449 + /* "dijkstra3d.pyx":486 * if dims < 3: * field = np.squeeze(field, axis=2) * if dims < 2: # <<<<<<<<<<<<<< @@ -10007,7 +10338,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * */ } - /* "dijkstra3d.pyx":452 + /* "dijkstra3d.pyx":489 * field = np.squeeze(field, axis=1) * * return field # <<<<<<<<<<<<<< @@ -10019,7 +10350,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * __pyx_r = __pyx_v_field; goto __pyx_L0; - /* "dijkstra3d.pyx":392 + /* "dijkstra3d.pyx":429 * return ptlist[:, :ndim] * * def parental_field(data, source, connectivity=26, voxel_graph=None): # <<<<<<<<<<<<<< @@ -10047,7 +10378,7 @@ static PyObject *__pyx_pf_10dijkstra3d_12parental_field(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "dijkstra3d.pyx":454 +/* "dijkstra3d.pyx":491 * return field * * def euclidean_distance_field( # <<<<<<<<<<<<<< @@ -10076,17 +10407,17 @@ static PyObject *__pyx_pw_10dijkstra3d_15euclidean_distance_field(PyObject *__py static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_source,&__pyx_n_s_anisotropy,&__pyx_n_s_free_space_radius,&__pyx_n_s_voxel_graph,&__pyx_n_s_return_max_location,0}; PyObject* values[6] = {0,0,0,0,0,0}; - /* "dijkstra3d.pyx":455 + /* "dijkstra3d.pyx":492 * * def euclidean_distance_field( * data, source, anisotropy=(1,1,1), # <<<<<<<<<<<<<< * free_space_radius=0, voxel_graph=None, * return_max_location=False */ - values[2] = ((PyObject *)__pyx_tuple__9); + values[2] = ((PyObject *)__pyx_tuple__2); values[3] = ((PyObject *)__pyx_int_0); - /* "dijkstra3d.pyx":456 + /* "dijkstra3d.pyx":493 * def euclidean_distance_field( * data, source, anisotropy=(1,1,1), * free_space_radius=0, voxel_graph=None, # <<<<<<<<<<<<<< @@ -10095,7 +10426,7 @@ static PyObject *__pyx_pw_10dijkstra3d_15euclidean_distance_field(PyObject *__py */ values[4] = ((PyObject *)Py_None); - /* "dijkstra3d.pyx":457 + /* "dijkstra3d.pyx":494 * data, source, anisotropy=(1,1,1), * free_space_radius=0, voxel_graph=None, * return_max_location=False # <<<<<<<<<<<<<< @@ -10131,7 +10462,7 @@ static PyObject *__pyx_pw_10dijkstra3d_15euclidean_distance_field(PyObject *__py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("euclidean_distance_field", 0, 2, 6, 1); __PYX_ERR(0, 454, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("euclidean_distance_field", 0, 2, 6, 1); __PYX_ERR(0, 491, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -10159,7 +10490,7 @@ static PyObject *__pyx_pw_10dijkstra3d_15euclidean_distance_field(PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "euclidean_distance_field") < 0)) __PYX_ERR(0, 454, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "euclidean_distance_field") < 0)) __PYX_ERR(0, 491, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -10186,7 +10517,7 @@ static PyObject *__pyx_pw_10dijkstra3d_15euclidean_distance_field(PyObject *__py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("euclidean_distance_field", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 454, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("euclidean_distance_field", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 491, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d.euclidean_distance_field", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -10194,7 +10525,7 @@ static PyObject *__pyx_pw_10dijkstra3d_15euclidean_distance_field(PyObject *__py __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_10dijkstra3d_14euclidean_distance_field(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_anisotropy, __pyx_v_free_space_radius, __pyx_v_voxel_graph, __pyx_v_return_max_location); - /* "dijkstra3d.pyx":454 + /* "dijkstra3d.pyx":491 * return field * * def euclidean_distance_field( # <<<<<<<<<<<<<< @@ -10234,20 +10565,20 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_INCREF(__pyx_v_source); __Pyx_INCREF(__pyx_v_voxel_graph); - /* "dijkstra3d.pyx":493 + /* "dijkstra3d.pyx":530 * return field * """ * dims = len(data.shape) # <<<<<<<<<<<<<< * if dims > 3: * raise DimensionError(f"Only 2D and 3D image sources are supported. Got: {dims}") */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dims = __pyx_t_2; - /* "dijkstra3d.pyx":494 + /* "dijkstra3d.pyx":531 * """ * dims = len(data.shape) * if dims > 3: # <<<<<<<<<<<<<< @@ -10257,18 +10588,18 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_t_3 = ((__pyx_v_dims > 3) != 0); if (unlikely(__pyx_t_3)) { - /* "dijkstra3d.pyx":495 + /* "dijkstra3d.pyx":532 * dims = len(data.shape) * if dims > 3: * raise DimensionError(f"Only 2D and 3D image sources are supported. Got: {dims}") # <<<<<<<<<<<<<< * * if data.size == 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dims, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dims, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -10284,14 +10615,14 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 495, __pyx_L1_error) + __PYX_ERR(0, 532, __pyx_L1_error) - /* "dijkstra3d.pyx":494 + /* "dijkstra3d.pyx":531 * """ * dims = len(data.shape) * if dims > 3: # <<<<<<<<<<<<<< @@ -10300,23 +10631,23 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED */ } - /* "dijkstra3d.pyx":497 + /* "dijkstra3d.pyx":534 * raise DimensionError(f"Only 2D and 3D image sources are supported. Got: {dims}") * * if data.size == 0: # <<<<<<<<<<<<<< * return np.zeros(shape=(0,), dtype=np.float32) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":498 + /* "dijkstra3d.pyx":535 * * if data.size == 0: * return np.zeros(shape=(0,), dtype=np.float32) # <<<<<<<<<<<<<< @@ -10324,22 +10655,22 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED * source = np.array(source, dtype=np.uint64) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 498, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 498, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_tuple__3) < 0) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 498, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -10347,7 +10678,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_t_5 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":497 + /* "dijkstra3d.pyx":534 * raise DimensionError(f"Only 2D and 3D image sources are supported. Got: {dims}") * * if data.size == 0: # <<<<<<<<<<<<<< @@ -10356,33 +10687,33 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED */ } - /* "dijkstra3d.pyx":500 + /* "dijkstra3d.pyx":537 * return np.zeros(shape=(0,), dtype=np.float32) * * source = np.array(source, dtype=np.uint64) # <<<<<<<<<<<<<< * if source.ndim == 1: * source = source[np.newaxis, :] */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_source); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 500, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -10390,49 +10721,49 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_7); __pyx_t_7 = 0; - /* "dijkstra3d.pyx":501 + /* "dijkstra3d.pyx":538 * * source = np.array(source, dtype=np.uint64) * if source.ndim == 1: # <<<<<<<<<<<<<< * source = source[np.newaxis, :] * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":502 + /* "dijkstra3d.pyx":539 * source = np.array(source, dtype=np.uint64) * if source.ndim == 1: * source = source[np.newaxis, :] # <<<<<<<<<<<<<< * * if source.shape[1] < 3: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__4); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_source, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_source, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_7); __pyx_t_7 = 0; - /* "dijkstra3d.pyx":501 + /* "dijkstra3d.pyx":538 * * source = np.array(source, dtype=np.uint64) * if source.ndim == 1: # <<<<<<<<<<<<<< @@ -10441,42 +10772,42 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED */ } - /* "dijkstra3d.pyx":504 + /* "dijkstra3d.pyx":541 * source = source[np.newaxis, :] * * if source.shape[1] < 3: # <<<<<<<<<<<<<< * tmp = np.zeros((source.shape[0], 3), dtype=np.uint64) * tmp[:, :source.shape[1]] = source[:,:] */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { - /* "dijkstra3d.pyx":505 + /* "dijkstra3d.pyx":542 * * if source.shape[1] < 3: * tmp = np.zeros((source.shape[0], 3), dtype=np.uint64) # <<<<<<<<<<<<<< * tmp[:, :source.shape[1]] = source[:,:] * source = tmp */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); @@ -10484,21 +10815,21 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_3); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 505, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -10506,36 +10837,36 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_v_tmp = __pyx_t_6; __pyx_t_6 = 0; - /* "dijkstra3d.pyx":506 + /* "dijkstra3d.pyx":543 * if source.shape[1] < 3: * tmp = np.zeros((source.shape[0], 3), dtype=np.uint64) * tmp[:, :source.shape[1]] = source[:,:] # <<<<<<<<<<<<<< * source = tmp * */ - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_source, __pyx_tuple__3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_source, __pyx_tuple__5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PySlice_New(Py_None, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_7 = PySlice_New(Py_None, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7); __pyx_t_7 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_tmp, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 506, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_tmp, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":507 + /* "dijkstra3d.pyx":544 * tmp = np.zeros((source.shape[0], 3), dtype=np.uint64) * tmp[:, :source.shape[1]] = source[:,:] * source = tmp # <<<<<<<<<<<<<< @@ -10545,7 +10876,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_INCREF(__pyx_v_tmp); __Pyx_DECREF_SET(__pyx_v_source, __pyx_v_tmp); - /* "dijkstra3d.pyx":504 + /* "dijkstra3d.pyx":541 * source = source[np.newaxis, :] * * if source.shape[1] < 3: # <<<<<<<<<<<<<< @@ -10554,7 +10885,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED */ } - /* "dijkstra3d.pyx":509 + /* "dijkstra3d.pyx":546 * source = tmp * * while data.ndim < 3: # <<<<<<<<<<<<<< @@ -10562,27 +10893,27 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED * */ while (1) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_3) break; - /* "dijkstra3d.pyx":510 + /* "dijkstra3d.pyx":547 * * while data.ndim < 3: * data = data[..., np.newaxis] # <<<<<<<<<<<<<< * * for src in source: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(Py_Ellipsis); __Pyx_GIVEREF(Py_Ellipsis); @@ -10590,14 +10921,14 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6); __pyx_t_6 = 0; } - /* "dijkstra3d.pyx":512 + /* "dijkstra3d.pyx":549 * data = data[..., np.newaxis] * * for src in source: # <<<<<<<<<<<<<< @@ -10608,26 +10939,26 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_t_6 = __pyx_v_source; __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_source); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_source); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 549, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 549, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 549, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -10637,7 +10968,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 512, __pyx_L1_error) + else __PYX_ERR(0, 549, __pyx_L1_error) } break; } @@ -10646,14 +10977,14 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_XDECREF_SET(__pyx_v_src, __pyx_t_5); __pyx_t_5 = 0; - /* "dijkstra3d.pyx":513 + /* "dijkstra3d.pyx":550 * * for src in source: * _validate_coord(data, src) # <<<<<<<<<<<<<< * * if voxel_graph is not None: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_validate_coord); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = NULL; __pyx_t_9 = 0; @@ -10670,7 +11001,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_src}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else @@ -10678,13 +11009,13 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_v_src}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { - __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -10695,14 +11026,14 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_INCREF(__pyx_v_src); __Pyx_GIVEREF(__pyx_v_src); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_v_src); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dijkstra3d.pyx":512 + /* "dijkstra3d.pyx":549 * data = data[..., np.newaxis] * * for src in source: # <<<<<<<<<<<<<< @@ -10712,7 +11043,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":515 + /* "dijkstra3d.pyx":552 * _validate_coord(data, src) * * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -10723,14 +11054,14 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_t_10 = (__pyx_t_3 != 0); if (__pyx_t_10) { - /* "dijkstra3d.pyx":516 + /* "dijkstra3d.pyx":553 * * if voxel_graph is not None: * voxel_graph = format_voxel_graph(voxel_graph) # <<<<<<<<<<<<<< * * data = np.asfortranarray(data) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_format_voxel_graph); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -10744,13 +11075,13 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED } __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_v_voxel_graph) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_voxel_graph); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_voxel_graph, __pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":515 + /* "dijkstra3d.pyx":552 * _validate_coord(data, src) * * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -10759,16 +11090,16 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED */ } - /* "dijkstra3d.pyx":518 + /* "dijkstra3d.pyx":555 * voxel_graph = format_voxel_graph(voxel_graph) * * data = np.asfortranarray(data) # <<<<<<<<<<<<<< * * field, max_loc = _execute_euclidean_distance_field( */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -10783,23 +11114,23 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED } __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6); __pyx_t_6 = 0; - /* "dijkstra3d.pyx":520 + /* "dijkstra3d.pyx":557 * data = np.asfortranarray(data) * * field, max_loc = _execute_euclidean_distance_field( # <<<<<<<<<<<<<< * data, source, anisotropy, * free_space_radius, voxel_graph */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_execute_euclidean_distance_fiel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_execute_euclidean_distance_fiel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "dijkstra3d.pyx":522 + /* "dijkstra3d.pyx":559 * field, max_loc = _execute_euclidean_distance_field( * data, source, anisotropy, * free_space_radius, voxel_graph # <<<<<<<<<<<<<< @@ -10821,7 +11152,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[6] = {__pyx_t_5, __pyx_v_data, __pyx_v_source, __pyx_v_anisotropy, __pyx_v_free_space_radius, __pyx_v_voxel_graph}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); } else @@ -10829,13 +11160,13 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[6] = {__pyx_t_5, __pyx_v_data, __pyx_v_source, __pyx_v_anisotropy, __pyx_v_free_space_radius, __pyx_v_voxel_graph}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { - __pyx_t_4 = PyTuple_New(5+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(5+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -10855,7 +11186,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_INCREF(__pyx_v_voxel_graph); __Pyx_GIVEREF(__pyx_v_voxel_graph); PyTuple_SET_ITEM(__pyx_t_4, 4+__pyx_t_9, __pyx_v_voxel_graph); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -10866,7 +11197,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 520, __pyx_L1_error) + __PYX_ERR(0, 557, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -10879,15 +11210,15 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; @@ -10895,7 +11226,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L13_unpacking_done; @@ -10903,11 +11234,11 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 520, __pyx_L1_error) + __PYX_ERR(0, 557, __pyx_L1_error) __pyx_L13_unpacking_done:; } - /* "dijkstra3d.pyx":520 + /* "dijkstra3d.pyx":557 * data = np.asfortranarray(data) * * field, max_loc = _execute_euclidean_distance_field( # <<<<<<<<<<<<<< @@ -10919,7 +11250,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_v_max_loc = __pyx_t_4; __pyx_t_4 = 0; - /* "dijkstra3d.pyx":524 + /* "dijkstra3d.pyx":561 * free_space_radius, voxel_graph * ) * if dims < 3: # <<<<<<<<<<<<<< @@ -10929,27 +11260,27 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_t_10 = ((__pyx_v_dims < 3) != 0); if (__pyx_t_10) { - /* "dijkstra3d.pyx":525 + /* "dijkstra3d.pyx":562 * ) * if dims < 3: * field = np.squeeze(field, axis=2) # <<<<<<<<<<<<<< * if dims < 2: * field = np.squeeze(field, axis=1) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_field); - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -10957,7 +11288,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_5); __pyx_t_5 = 0; - /* "dijkstra3d.pyx":524 + /* "dijkstra3d.pyx":561 * free_space_radius, voxel_graph * ) * if dims < 3: # <<<<<<<<<<<<<< @@ -10966,7 +11297,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED */ } - /* "dijkstra3d.pyx":526 + /* "dijkstra3d.pyx":563 * if dims < 3: * field = np.squeeze(field, axis=2) * if dims < 2: # <<<<<<<<<<<<<< @@ -10976,27 +11307,27 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_t_10 = ((__pyx_v_dims < 2) != 0); if (__pyx_t_10) { - /* "dijkstra3d.pyx":527 + /* "dijkstra3d.pyx":564 * field = np.squeeze(field, axis=2) * if dims < 2: * field = np.squeeze(field, axis=1) # <<<<<<<<<<<<<< * * if return_max_location: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_field); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 527, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -11004,7 +11335,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":526 + /* "dijkstra3d.pyx":563 * if dims < 3: * field = np.squeeze(field, axis=2) * if dims < 2: # <<<<<<<<<<<<<< @@ -11013,17 +11344,17 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED */ } - /* "dijkstra3d.pyx":529 + /* "dijkstra3d.pyx":566 * field = np.squeeze(field, axis=1) * * if return_max_location: # <<<<<<<<<<<<<< * return field, np.unravel_index(max_loc, data.shape, order="F")[:dims] * else: */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_return_max_location); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_return_max_location); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 566, __pyx_L1_error) if (__pyx_t_10) { - /* "dijkstra3d.pyx":530 + /* "dijkstra3d.pyx":567 * * if return_max_location: * return field, np.unravel_index(max_loc, data.shape, order="F")[:dims] # <<<<<<<<<<<<<< @@ -11031,14 +11362,14 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED * return field */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unravel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unravel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_max_loc); __Pyx_GIVEREF(__pyx_v_max_loc); @@ -11046,18 +11377,18 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 530, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 530, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, __pyx_v_dims, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, __pyx_v_dims, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); @@ -11069,7 +11400,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED __pyx_t_7 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":529 + /* "dijkstra3d.pyx":566 * field = np.squeeze(field, axis=1) * * if return_max_location: # <<<<<<<<<<<<<< @@ -11078,7 +11409,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED */ } - /* "dijkstra3d.pyx":532 + /* "dijkstra3d.pyx":569 * return field, np.unravel_index(max_loc, data.shape, order="F")[:dims] * else: * return field # <<<<<<<<<<<<<< @@ -11092,7 +11423,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED goto __pyx_L0; } - /* "dijkstra3d.pyx":454 + /* "dijkstra3d.pyx":491 * return field * * def euclidean_distance_field( # <<<<<<<<<<<<<< @@ -11122,7 +11453,7 @@ static PyObject *__pyx_pf_10dijkstra3d_14euclidean_distance_field(CYTHON_UNUSED return __pyx_r; } -/* "dijkstra3d.pyx":534 +/* "dijkstra3d.pyx":571 * return field * * def _validate_coord(data, coord): # <<<<<<<<<<<<<< @@ -11165,11 +11496,11 @@ static PyObject *__pyx_pw_10dijkstra3d_17_validate_coord(PyObject *__pyx_self, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coord)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_validate_coord", 1, 2, 2, 1); __PYX_ERR(0, 534, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_validate_coord", 1, 2, 2, 1); __PYX_ERR(0, 571, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_validate_coord") < 0)) __PYX_ERR(0, 534, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_validate_coord") < 0)) __PYX_ERR(0, 571, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -11182,7 +11513,7 @@ static PyObject *__pyx_pw_10dijkstra3d_17_validate_coord(PyObject *__pyx_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_validate_coord", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 534, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_validate_coord", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 571, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._validate_coord", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11216,40 +11547,40 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_validate_coord", 0); - /* "dijkstra3d.pyx":535 + /* "dijkstra3d.pyx":572 * * def _validate_coord(data, coord): * dims = len(data.shape) # <<<<<<<<<<<<<< * * if len(coord) != dims: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dims = __pyx_t_2; - /* "dijkstra3d.pyx":537 + /* "dijkstra3d.pyx":574 * dims = len(data.shape) * * if len(coord) != dims: # <<<<<<<<<<<<<< * raise IndexError( * "Coordinates must have the same dimension as the data. coord: {}, data shape: {}" */ - __pyx_t_2 = PyObject_Length(__pyx_v_coord); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_coord); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 574, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_2 != __pyx_v_dims) != 0); if (unlikely(__pyx_t_3)) { - /* "dijkstra3d.pyx":540 + /* "dijkstra3d.pyx":577 * raise IndexError( * "Coordinates must have the same dimension as the data. coord: {}, data shape: {}" * .format(coord, data.shape) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Coordinates_must_have_the_same_d, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Coordinates_must_have_the_same_d, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -11266,7 +11597,7 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_coord, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -11275,14 +11606,14 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_coord, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -11293,27 +11624,27 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":538 + /* "dijkstra3d.pyx":575 * * if len(coord) != dims: * raise IndexError( # <<<<<<<<<<<<<< * "Coordinates must have the same dimension as the data. coord: {}, data shape: {}" * .format(coord, data.shape) */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 538, __pyx_L1_error) + __PYX_ERR(0, 575, __pyx_L1_error) - /* "dijkstra3d.pyx":537 + /* "dijkstra3d.pyx":574 * dims = len(data.shape) * * if len(coord) != dims: # <<<<<<<<<<<<<< @@ -11322,7 +11653,7 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject */ } - /* "dijkstra3d.pyx":543 + /* "dijkstra3d.pyx":580 * ) * * for i, size in enumerate(data.shape): # <<<<<<<<<<<<<< @@ -11331,15 +11662,15 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject */ __Pyx_INCREF(__pyx_int_0); __pyx_t_4 = __pyx_int_0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_2 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 580, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -11347,17 +11678,17 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 580, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 580, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -11367,7 +11698,7 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 543, __pyx_L1_error) + else __PYX_ERR(0, 580, __pyx_L1_error) } break; } @@ -11377,48 +11708,48 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject __pyx_t_1 = 0; __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_1; __pyx_t_1 = 0; - /* "dijkstra3d.pyx":544 + /* "dijkstra3d.pyx":581 * * for i, size in enumerate(data.shape): * if coord[i] < 0 or coord[i] >= size: # <<<<<<<<<<<<<< * raise IndexError("Selected voxel {} was not located inside the array.".format(coord)) * */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_coord, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_coord, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_10) { } else { __pyx_t_3 = __pyx_t_10; goto __pyx_L7_bool_binop_done; } - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_coord, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_coord, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_size, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_size, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_10; __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "dijkstra3d.pyx":545 + /* "dijkstra3d.pyx":582 * for i, size in enumerate(data.shape): * if coord[i] < 0 or coord[i] >= size: * raise IndexError("Selected voxel {} was not located inside the array.".format(coord)) # <<<<<<<<<<<<<< * * def _path_to_point_cloud(path, dims, rows, cols): */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Selected_voxel_was_not_located_i, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Selected_voxel_was_not_located_i, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -11432,17 +11763,17 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_coord) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_coord); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 545, __pyx_L1_error) + __PYX_ERR(0, 582, __pyx_L1_error) - /* "dijkstra3d.pyx":544 + /* "dijkstra3d.pyx":581 * * for i, size in enumerate(data.shape): * if coord[i] < 0 or coord[i] >= size: # <<<<<<<<<<<<<< @@ -11451,7 +11782,7 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject */ } - /* "dijkstra3d.pyx":543 + /* "dijkstra3d.pyx":580 * ) * * for i, size in enumerate(data.shape): # <<<<<<<<<<<<<< @@ -11462,7 +11793,7 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dijkstra3d.pyx":534 + /* "dijkstra3d.pyx":571 * return field * * def _validate_coord(data, coord): # <<<<<<<<<<<<<< @@ -11489,7 +11820,7 @@ static PyObject *__pyx_pf_10dijkstra3d_16_validate_coord(CYTHON_UNUSED PyObject return __pyx_r; } -/* "dijkstra3d.pyx":547 +/* "dijkstra3d.pyx":584 * raise IndexError("Selected voxel {} was not located inside the array.".format(coord)) * * def _path_to_point_cloud(path, dims, rows, cols): # <<<<<<<<<<<<<< @@ -11538,23 +11869,23 @@ static PyObject *__pyx_pw_10dijkstra3d_19_path_to_point_cloud(PyObject *__pyx_se case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dims)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_path_to_point_cloud", 1, 4, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_to_point_cloud", 1, 4, 4, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_path_to_point_cloud", 1, 4, 4, 2); __PYX_ERR(0, 547, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_to_point_cloud", 1, 4, 4, 2); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_path_to_point_cloud", 1, 4, 4, 3); __PYX_ERR(0, 547, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_to_point_cloud", 1, 4, 4, 3); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_to_point_cloud") < 0)) __PYX_ERR(0, 547, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_path_to_point_cloud") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -11571,7 +11902,7 @@ static PyObject *__pyx_pw_10dijkstra3d_19_path_to_point_cloud(PyObject *__pyx_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_path_to_point_cloud", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_path_to_point_cloud", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._path_to_point_cloud", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11605,24 +11936,24 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_path_to_point_cloud", 0); - /* "dijkstra3d.pyx":548 + /* "dijkstra3d.pyx":585 * * def _path_to_point_cloud(path, dims, rows, cols): * ptlist = np.zeros((path.shape[0], dims), dtype=np.uint32) # <<<<<<<<<<<<<< * * cdef size_t sxy = rows * cols */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); @@ -11630,21 +11961,21 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_v_dims); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dims); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 548, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11652,20 +11983,20 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __pyx_v_ptlist = __pyx_t_5; __pyx_t_5 = 0; - /* "dijkstra3d.pyx":550 + /* "dijkstra3d.pyx":587 * ptlist = np.zeros((path.shape[0], dims), dtype=np.uint32) * * cdef size_t sxy = rows * cols # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = PyNumber_Multiply(__pyx_v_rows, __pyx_v_cols); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_v_rows, __pyx_v_cols); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_sxy = __pyx_t_6; - /* "dijkstra3d.pyx":551 + /* "dijkstra3d.pyx":588 * * cdef size_t sxy = rows * cols * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -11674,20 +12005,20 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb */ __pyx_v_i = 0; - /* "dijkstra3d.pyx":553 + /* "dijkstra3d.pyx":590 * cdef size_t i = 0 * * if dims == 3: # <<<<<<<<<<<<<< * for i, pt in enumerate(path): * ptlist[ i, 0 ] = pt % cols */ - __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_7) { - /* "dijkstra3d.pyx":554 + /* "dijkstra3d.pyx":591 * * if dims == 3: * for i, pt in enumerate(path): # <<<<<<<<<<<<<< @@ -11699,26 +12030,26 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __pyx_t_5 = __pyx_v_path; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 591, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 591, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 591, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -11728,7 +12059,7 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 554, __pyx_L1_error) + else __PYX_ERR(0, 591, __pyx_L1_error) } break; } @@ -11739,18 +12070,18 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __pyx_v_i = __pyx_t_6; __pyx_t_6 = (__pyx_t_6 + 1); - /* "dijkstra3d.pyx":555 + /* "dijkstra3d.pyx":592 * if dims == 3: * for i, pt in enumerate(path): * ptlist[ i, 0 ] = pt % cols # <<<<<<<<<<<<<< * ptlist[ i, 1 ] = (pt % sxy) / cols * ptlist[ i, 2 ] = pt / sxy */ - __pyx_t_1 = PyNumber_Remainder(__pyx_v_pt, __pyx_v_cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_1 = PyNumber_Remainder(__pyx_v_pt, __pyx_v_cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); @@ -11758,28 +12089,28 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __pyx_t_3 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 555, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":556 + /* "dijkstra3d.pyx":593 * for i, pt in enumerate(path): * ptlist[ i, 0 ] = pt % cols * ptlist[ i, 1 ] = (pt % sxy) / cols # <<<<<<<<<<<<<< * ptlist[ i, 2 ] = pt / sxy * else: */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_sxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_sxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Remainder(__pyx_v_pt, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_2 = PyNumber_Remainder(__pyx_v_pt, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); @@ -11787,25 +12118,25 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(0, 556, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":557 + /* "dijkstra3d.pyx":594 * ptlist[ i, 0 ] = pt % cols * ptlist[ i, 1 ] = (pt % sxy) / cols * ptlist[ i, 2 ] = pt / sxy # <<<<<<<<<<<<<< * else: * for i, pt in enumerate(path): */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_sxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_sxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_pt, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_pt, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -11813,11 +12144,11 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_int_2); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_2); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(0, 557, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dijkstra3d.pyx":554 + /* "dijkstra3d.pyx":591 * * if dims == 3: * for i, pt in enumerate(path): # <<<<<<<<<<<<<< @@ -11827,7 +12158,7 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dijkstra3d.pyx":553 + /* "dijkstra3d.pyx":590 * cdef size_t i = 0 * * if dims == 3: # <<<<<<<<<<<<<< @@ -11837,7 +12168,7 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb goto __pyx_L3; } - /* "dijkstra3d.pyx":559 + /* "dijkstra3d.pyx":596 * ptlist[ i, 2 ] = pt / sxy * else: * for i, pt in enumerate(path): # <<<<<<<<<<<<<< @@ -11850,26 +12181,26 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __pyx_t_5 = __pyx_v_path; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 596, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 596, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 596, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -11879,7 +12210,7 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 559, __pyx_L1_error) + else __PYX_ERR(0, 596, __pyx_L1_error) } break; } @@ -11890,18 +12221,18 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __pyx_v_i = __pyx_t_6; __pyx_t_6 = (__pyx_t_6 + 1); - /* "dijkstra3d.pyx":560 + /* "dijkstra3d.pyx":597 * else: * for i, pt in enumerate(path): * ptlist[ i, 0 ] = pt % cols # <<<<<<<<<<<<<< * ptlist[ i, 1 ] = (pt % sxy) / cols * */ - __pyx_t_3 = PyNumber_Remainder(__pyx_v_pt, __pyx_v_cols); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_3 = PyNumber_Remainder(__pyx_v_pt, __pyx_v_cols); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -11909,28 +12240,28 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_1, __pyx_t_3) < 0)) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_1, __pyx_t_3) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dijkstra3d.pyx":561 + /* "dijkstra3d.pyx":598 * for i, pt in enumerate(path): * ptlist[ i, 0 ] = pt % cols * ptlist[ i, 1 ] = (pt % sxy) / cols # <<<<<<<<<<<<<< * * return ptlist */ - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_sxy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_sxy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Remainder(__pyx_v_pt, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_1 = PyNumber_Remainder(__pyx_v_pt, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_cols); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_cols); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -11938,11 +12269,11 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(0, 561, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_ptlist, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dijkstra3d.pyx":559 + /* "dijkstra3d.pyx":596 * ptlist[ i, 2 ] = pt / sxy * else: * for i, pt in enumerate(path): # <<<<<<<<<<<<<< @@ -11954,19 +12285,19 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb } __pyx_L3:; - /* "dijkstra3d.pyx":563 + /* "dijkstra3d.pyx":600 * ptlist[ i, 1 ] = (pt % sxy) / cols * * return ptlist # <<<<<<<<<<<<<< * - * def _execute_value_target_dijkstra( + * def _execute_gradient_dijkstra( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ptlist); __pyx_r = __pyx_v_ptlist; goto __pyx_L0; - /* "dijkstra3d.pyx":547 + /* "dijkstra3d.pyx":584 * raise IndexError("Selected voxel {} was not located inside the array.".format(coord)) * * def _path_to_point_cloud(path, dims, rows, cols): # <<<<<<<<<<<<<< @@ -11991,20 +12322,26 @@ static PyObject *__pyx_pf_10dijkstra3d_18_path_to_point_cloud(CYTHON_UNUSED PyOb return __pyx_r; } -/* "dijkstra3d.pyx":565 +/* "dijkstra3d.pyx":602 * return ptlist * - * def _execute_value_target_dijkstra( # <<<<<<<<<<<<<< - * data, source, - * int connectivity, voxel_graph=None + * def _execute_gradient_dijkstra( # <<<<<<<<<<<<<< + * data, source, target, + * float wx, float wy, float wz, */ /* Python wrapper */ -static PyObject *__pyx_pw_10dijkstra3d_21_execute_value_target_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_10dijkstra3d_21_execute_value_target_dijkstra = {"_execute_value_target_dijkstra", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_21_execute_value_target_dijkstra, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10dijkstra3d_21_execute_value_target_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_10dijkstra3d_21_execute_gradient_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_10dijkstra3d_21_execute_gradient_dijkstra = {"_execute_gradient_dijkstra", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_21_execute_gradient_dijkstra, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10dijkstra3d_21_execute_gradient_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_source = 0; + PyObject *__pyx_v_target = 0; + float __pyx_v_wx; + float __pyx_v_wy; + float __pyx_v_wz; + float __pyx_v_w_dist; + float __pyx_v_w_intensity; int __pyx_v_connectivity; PyObject *__pyx_v_voxel_graph = 0; int __pyx_lineno = 0; @@ -12012,23 +12349,35 @@ static PyObject *__pyx_pw_10dijkstra3d_21_execute_value_target_dijkstra(PyObject int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_execute_value_target_dijkstra (wrapper)", 0); + __Pyx_RefNannySetupContext("_execute_gradient_dijkstra (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_source,&__pyx_n_s_connectivity,&__pyx_n_s_voxel_graph,0}; - PyObject* values[4] = {0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_source,&__pyx_n_s_target,&__pyx_n_s_wx,&__pyx_n_s_wy,&__pyx_n_s_wz,&__pyx_n_s_w_dist,&__pyx_n_s_w_intensity,&__pyx_n_s_connectivity,&__pyx_n_s_voxel_graph,0}; + PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; - /* "dijkstra3d.pyx":567 - * def _execute_value_target_dijkstra( - * data, source, - * int connectivity, voxel_graph=None # <<<<<<<<<<<<<< + /* "dijkstra3d.pyx":606 + * float wx, float wy, float wz, + * float w_dist, float w_intensity, + * int connectivity, voxel_graph=None, # <<<<<<<<<<<<<< * ): * cdef uint8_t[:,:,:] arr_memview8 */ - values[3] = ((PyObject *)Py_None); + values[9] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -12049,29 +12398,71 @@ static PyObject *__pyx_pw_10dijkstra3d_21_execute_value_target_dijkstra(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_value_target_dijkstra", 0, 3, 4, 1); __PYX_ERR(0, 565, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_gradient_dijkstra", 0, 9, 10, 1); __PYX_ERR(0, 602, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connectivity)) != 0)) kw_args--; + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_value_target_dijkstra", 0, 3, 4, 2); __PYX_ERR(0, 565, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_gradient_dijkstra", 0, 9, 10, 2); __PYX_ERR(0, 602, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wx)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_execute_gradient_dijkstra", 0, 9, 10, 3); __PYX_ERR(0, 602, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wy)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_execute_gradient_dijkstra", 0, 9, 10, 4); __PYX_ERR(0, 602, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wz)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_execute_gradient_dijkstra", 0, 9, 10, 5); __PYX_ERR(0, 602, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w_dist)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_execute_gradient_dijkstra", 0, 9, 10, 6); __PYX_ERR(0, 602, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w_intensity)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_execute_gradient_dijkstra", 0, 9, 10, 7); __PYX_ERR(0, 602, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connectivity)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_execute_gradient_dijkstra", 0, 9, 10, 8); __PYX_ERR(0, 602, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_voxel_graph); - if (value) { values[3] = value; kw_args--; } + if (value) { values[9] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_value_target_dijkstra") < 0)) __PYX_ERR(0, 565, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_gradient_dijkstra") < 0)) __PYX_ERR(0, 602, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; @@ -12080,25 +12471,31 @@ static PyObject *__pyx_pw_10dijkstra3d_21_execute_value_target_dijkstra(PyObject } __pyx_v_data = values[0]; __pyx_v_source = values[1]; - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_voxel_graph = values[3]; + __pyx_v_target = values[2]; + __pyx_v_wx = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_wx == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L3_error) + __pyx_v_wy = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_wy == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L3_error) + __pyx_v_wz = __pyx_PyFloat_AsFloat(values[5]); if (unlikely((__pyx_v_wz == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L3_error) + __pyx_v_w_dist = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_w_dist == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L3_error) + __pyx_v_w_intensity = __pyx_PyFloat_AsFloat(values[7]); if (unlikely((__pyx_v_w_intensity == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 606, __pyx_L3_error) + __pyx_v_voxel_graph = values[9]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_execute_value_target_dijkstra", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 565, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_gradient_dijkstra", 0, 9, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 602, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("dijkstra3d._execute_value_target_dijkstra", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("dijkstra3d._execute_gradient_dijkstra", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph); + __pyx_r = __pyx_pf_10dijkstra3d_20_execute_gradient_dijkstra(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph); - /* "dijkstra3d.pyx":565 + /* "dijkstra3d.pyx":602 * return ptlist * - * def _execute_value_target_dijkstra( # <<<<<<<<<<<<<< - * data, source, - * int connectivity, voxel_graph=None + * def _execute_gradient_dijkstra( # <<<<<<<<<<<<<< + * data, source, target, + * float wx, float wy, float wz, */ /* function exit code */ @@ -12106,7 +12503,7 @@ static PyObject *__pyx_pw_10dijkstra3d_21_execute_value_target_dijkstra(PyObject return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, int __pyx_v_connectivity, PyObject *__pyx_v_voxel_graph) { +static PyObject *__pyx_pf_10dijkstra3d_20_execute_gradient_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, float __pyx_v_wx, float __pyx_v_wy, float __pyx_v_wz, float __pyx_v_w_dist, float __pyx_v_w_intensity, int __pyx_v_connectivity, PyObject *__pyx_v_voxel_graph) { __Pyx_memviewslice __pyx_v_arr_memview8 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arr_memview16 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arr_memview32 = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -12156,9 +12553,9 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_execute_value_target_dijkstra", 0); + __Pyx_RefNannySetupContext("_execute_gradient_dijkstra", 0); - /* "dijkstra3d.pyx":577 + /* "dijkstra3d.pyx":616 * * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL # <<<<<<<<<<<<<< @@ -12167,7 +12564,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ __pyx_v_voxel_graph_ptr = NULL; - /* "dijkstra3d.pyx":578 + /* "dijkstra3d.pyx":617 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -12178,19 +12575,19 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":579 + /* "dijkstra3d.pyx":618 * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: * voxel_graph_memview = voxel_graph # <<<<<<<<<<<<<< * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * */ - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 618, __pyx_L1_error) __pyx_v_voxel_graph_memview = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "dijkstra3d.pyx":580 + /* "dijkstra3d.pyx":619 * if voxel_graph is not None: * voxel_graph_memview = voxel_graph * voxel_graph_ptr = &voxel_graph_memview[0,0,0] # <<<<<<<<<<<<<< @@ -12215,11 +12612,11 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_6 >= __pyx_v_voxel_graph_memview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 580, __pyx_L1_error) + __PYX_ERR(0, 619, __pyx_L1_error) } __pyx_v_voxel_graph_ptr = ((uint32_t *)(&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_voxel_graph_memview.data + __pyx_t_4 * __pyx_v_voxel_graph_memview.strides[0]) ) + __pyx_t_5 * __pyx_v_voxel_graph_memview.strides[1]) ) + __pyx_t_6 * __pyx_v_voxel_graph_memview.strides[2]) ))))); - /* "dijkstra3d.pyx":578 + /* "dijkstra3d.pyx":617 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -12228,108 +12625,108 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ } - /* "dijkstra3d.pyx":582 + /* "dijkstra3d.pyx":621 * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * * cdef size_t sx = data.shape[0] # <<<<<<<<<<<<<< * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sx = __pyx_t_10; - /* "dijkstra3d.pyx":583 + /* "dijkstra3d.pyx":622 * * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] # <<<<<<<<<<<<<< * cdef size_t sz = data.shape[2] * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_sy = __pyx_t_10; - /* "dijkstra3d.pyx":584 + /* "dijkstra3d.pyx":623 * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] # <<<<<<<<<<<<<< * * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sz = __pyx_t_10; - /* "dijkstra3d.pyx":586 + /* "dijkstra3d.pyx":625 * cdef size_t sz = data.shape[2] * * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) # <<<<<<<<<<<<<< * * cdef vector[uint32_t] output32 */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Multiply(__pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_14 = PyNumber_Multiply(__pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_13); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_13); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_v_src = __pyx_t_10; - /* "dijkstra3d.pyx":591 + /* "dijkstra3d.pyx":630 * cdef vector[uint64_t] output64 * * sixtyfourbit = data.size > np.iinfo(np.uint32).max # <<<<<<<<<<<<<< * * dtype = data.dtype */ - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -12345,76 +12742,76 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 591, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_13, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_13, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_sixtyfourbit = __pyx_t_14; __pyx_t_14 = 0; - /* "dijkstra3d.pyx":593 + /* "dijkstra3d.pyx":632 * sixtyfourbit = data.size > np.iinfo(np.uint32).max * * dtype = data.dtype # <<<<<<<<<<<<<< * * if dtype == np.float32: */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_v_dtype = __pyx_t_14; __pyx_t_14 = 0; - /* "dijkstra3d.pyx":595 + /* "dijkstra3d.pyx":634 * dtype = data.dtype * * if dtype == np.float32: # <<<<<<<<<<<<<< * arr_memviewfloat = data * if sixtyfourbit: */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_2) { - /* "dijkstra3d.pyx":596 + /* "dijkstra3d.pyx":635 * * if dtype == np.float32: * arr_memviewfloat = data # <<<<<<<<<<<<<< * if sixtyfourbit: - * output64 = value_target_dijkstra3d[float, uint64_t]( + * output64 = dijkstra3d_gradient[float, uint64_t]( */ - __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 635, __pyx_L1_error) __pyx_v_arr_memviewfloat = __pyx_t_15; __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL; - /* "dijkstra3d.pyx":597 + /* "dijkstra3d.pyx":636 * if dtype == np.float32: * arr_memviewfloat = data * if sixtyfourbit: # <<<<<<<<<<<<<< - * output64 = value_target_dijkstra3d[float, uint64_t]( + * output64 = dijkstra3d_gradient[float, uint64_t]( * &arr_memviewfloat[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 636, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":599 + /* "dijkstra3d.pyx":638 * if sixtyfourbit: - * output64 = value_target_dijkstra3d[float, uint64_t]( + * output64 = dijkstra3d_gradient[float, uint64_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< - * sx, sy, sz, - * src, 0, connectivity, + * sx, sy, sz, wx, wy, wz, + * src, target, */ __pyx_t_6 = 0; __pyx_t_5 = 0; @@ -12434,43 +12831,52 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 599, __pyx_L1_error) + __PYX_ERR(0, 638, __pyx_L1_error) } - /* "dijkstra3d.pyx":598 + /* "dijkstra3d.pyx":640 + * &arr_memviewfloat[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error) + + /* "dijkstra3d.pyx":637 * arr_memviewfloat = data * if sixtyfourbit: - * output64 = value_target_dijkstra3d[float, uint64_t]( # <<<<<<<<<<<<<< + * output64 = dijkstra3d_gradient[float, uint64_t]( # <<<<<<<<<<<<<< * &arr_memviewfloat[0,0,0], - * sx, sy, sz, + * sx, sy, sz, wx, wy, wz, */ - __pyx_v_output64 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0.0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":597 + /* "dijkstra3d.pyx":636 * if dtype == np.float32: * arr_memviewfloat = data * if sixtyfourbit: # <<<<<<<<<<<<<< - * output64 = value_target_dijkstra3d[float, uint64_t]( + * output64 = dijkstra3d_gradient[float, uint64_t]( * &arr_memviewfloat[0,0,0], */ goto __pyx_L5; } - /* "dijkstra3d.pyx":605 + /* "dijkstra3d.pyx":645 * ) * else: - * output32 = value_target_dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< + * output32 = dijkstra3d_gradient[float, uint32_t]( # <<<<<<<<<<<<<< * &arr_memviewfloat[0,0,0], - * sx, sy, sz, + * sx, sy, sz, wx, wy, wz, */ /*else*/ { - /* "dijkstra3d.pyx":606 + /* "dijkstra3d.pyx":646 * else: - * output32 = value_target_dijkstra3d[float, uint32_t]( + * output32 = dijkstra3d_gradient[float, uint32_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< - * sx, sy, sz, - * src, 0, connectivity, + * sx, sy, sz, wx, wy, wz, + * src, target, */ __pyx_t_4 = 0; __pyx_t_5 = 0; @@ -12490,21 +12896,30 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 606, __pyx_L1_error) + __PYX_ERR(0, 646, __pyx_L1_error) } - /* "dijkstra3d.pyx":605 + /* "dijkstra3d.pyx":648 + * &arr_memviewfloat[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error) + + /* "dijkstra3d.pyx":645 * ) * else: - * output32 = value_target_dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< + * output32 = dijkstra3d_gradient[float, uint32_t]( # <<<<<<<<<<<<<< * &arr_memviewfloat[0,0,0], - * sx, sy, sz, + * sx, sy, sz, wx, wy, wz, */ - __pyx_v_output32 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0.0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + __pyx_v_output32 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); } __pyx_L5:; - /* "dijkstra3d.pyx":595 + /* "dijkstra3d.pyx":634 * dtype = data.dtype * * if dtype == np.float32: # <<<<<<<<<<<<<< @@ -12514,52 +12929,52 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U goto __pyx_L4; } - /* "dijkstra3d.pyx":611 - * voxel_graph_ptr + /* "dijkstra3d.pyx":652 + * connectivity, voxel_graph_ptr * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< * arr_memviewdouble = data * if sixtyfourbit: */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_2) { - /* "dijkstra3d.pyx":612 + /* "dijkstra3d.pyx":653 * ) * elif dtype == np.float64: * arr_memviewdouble = data # <<<<<<<<<<<<<< * if sixtyfourbit: - * output64 = value_target_dijkstra3d[double, uint64_t]( + * output64 = dijkstra3d_gradient[double, uint64_t]( */ - __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 653, __pyx_L1_error) __pyx_v_arr_memviewdouble = __pyx_t_16; __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL; - /* "dijkstra3d.pyx":613 + /* "dijkstra3d.pyx":654 * elif dtype == np.float64: * arr_memviewdouble = data * if sixtyfourbit: # <<<<<<<<<<<<<< - * output64 = value_target_dijkstra3d[double, uint64_t]( + * output64 = dijkstra3d_gradient[double, uint64_t]( * &arr_memviewdouble[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 654, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":615 + /* "dijkstra3d.pyx":656 * if sixtyfourbit: - * output64 = value_target_dijkstra3d[double, uint64_t]( + * output64 = dijkstra3d_gradient[double, uint64_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< - * sx, sy, sz, - * src, 0, connectivity, + * sx, sy, sz, wx, wy, wz, + * src, target, */ __pyx_t_6 = 0; __pyx_t_5 = 0; @@ -12579,43 +12994,52 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 615, __pyx_L1_error) + __PYX_ERR(0, 656, __pyx_L1_error) } - /* "dijkstra3d.pyx":614 + /* "dijkstra3d.pyx":658 + * &arr_memviewdouble[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error) + + /* "dijkstra3d.pyx":655 * arr_memviewdouble = data * if sixtyfourbit: - * output64 = value_target_dijkstra3d[double, uint64_t]( # <<<<<<<<<<<<<< + * output64 = dijkstra3d_gradient[double, uint64_t]( # <<<<<<<<<<<<<< * &arr_memviewdouble[0,0,0], - * sx, sy, sz, + * sx, sy, sz, wx, wy, wz, */ - __pyx_v_output64 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0.0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":613 + /* "dijkstra3d.pyx":654 * elif dtype == np.float64: * arr_memviewdouble = data * if sixtyfourbit: # <<<<<<<<<<<<<< - * output64 = value_target_dijkstra3d[double, uint64_t]( + * output64 = dijkstra3d_gradient[double, uint64_t]( * &arr_memviewdouble[0,0,0], */ goto __pyx_L6; } - /* "dijkstra3d.pyx":621 + /* "dijkstra3d.pyx":663 * ) * else: - * output32 = value_target_dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< + * output32 = dijkstra3d_gradient[double, uint32_t]( # <<<<<<<<<<<<<< * &arr_memviewdouble[0,0,0], - * sx, sy, sz, + * sx, sy, sz, wx, wy, wz, */ /*else*/ { - /* "dijkstra3d.pyx":622 + /* "dijkstra3d.pyx":664 * else: - * output32 = value_target_dijkstra3d[double, uint32_t]( + * output32 = dijkstra3d_gradient[double, uint32_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< - * sx, sy, sz, - * src, 0, connectivity, + * sx, sy, sz, wx, wy, wz, + * src, target, */ __pyx_t_4 = 0; __pyx_t_5 = 0; @@ -12635,22 +13059,31 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 622, __pyx_L1_error) + __PYX_ERR(0, 664, __pyx_L1_error) } - /* "dijkstra3d.pyx":621 + /* "dijkstra3d.pyx":666 + * &arr_memviewdouble[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) + + /* "dijkstra3d.pyx":663 * ) * else: - * output32 = value_target_dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< + * output32 = dijkstra3d_gradient[double, uint32_t]( # <<<<<<<<<<<<<< * &arr_memviewdouble[0,0,0], - * sx, sy, sz, + * sx, sy, sz, wx, wy, wz, */ - __pyx_v_output32 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0.0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + __pyx_v_output32 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); } __pyx_L6:; - /* "dijkstra3d.pyx":611 - * voxel_graph_ptr + /* "dijkstra3d.pyx":652 + * connectivity, voxel_graph_ptr * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< * arr_memviewdouble = data @@ -12659,8 +13092,8 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U goto __pyx_L4; } - /* "dijkstra3d.pyx":627 - * voxel_graph_ptr + /* "dijkstra3d.pyx":670 + * connectivity, voxel_graph_ptr * ) * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< * arr_memview64 = data.astype(np.uint64) @@ -12668,28 +13101,28 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_14 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 627, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L7_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 627, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L7_bool_binop_done:; @@ -12697,18 +13130,18 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "dijkstra3d.pyx":628 + /* "dijkstra3d.pyx":671 * ) * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) # <<<<<<<<<<<<<< * if sixtyfourbit: - * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( + * output64 = dijkstra3d_gradient[uint64_t, uint64_t]( */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; @@ -12724,31 +13157,31 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_arr_memview64 = __pyx_t_17; __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL; - /* "dijkstra3d.pyx":629 + /* "dijkstra3d.pyx":672 * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) * if sixtyfourbit: # <<<<<<<<<<<<<< - * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( + * output64 = dijkstra3d_gradient[uint64_t, uint64_t]( * &arr_memview64[0,0,0], */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 672, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":631 + /* "dijkstra3d.pyx":674 * if sixtyfourbit: - * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( + * output64 = dijkstra3d_gradient[uint64_t, uint64_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< - * sx, sy, sz, - * src, 0, connectivity, + * sx, sy, sz, wx, wy, wz, + * src, target, */ __pyx_t_6 = 0; __pyx_t_5 = 0; @@ -12768,43 +13201,52 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 631, __pyx_L1_error) + __PYX_ERR(0, 674, __pyx_L1_error) } - /* "dijkstra3d.pyx":630 + /* "dijkstra3d.pyx":676 + * &arr_memview64[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 676, __pyx_L1_error) + + /* "dijkstra3d.pyx":673 * arr_memview64 = data.astype(np.uint64) * if sixtyfourbit: - * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( # <<<<<<<<<<<<<< + * output64 = dijkstra3d_gradient[uint64_t, uint64_t]( # <<<<<<<<<<<<<< * &arr_memview64[0,0,0], - * sx, sy, sz, + * sx, sy, sz, wx, wy, wz, */ - __pyx_v_output64 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_6 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_6 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":629 + /* "dijkstra3d.pyx":672 * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) * if sixtyfourbit: # <<<<<<<<<<<<<< - * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( + * output64 = dijkstra3d_gradient[uint64_t, uint64_t]( * &arr_memview64[0,0,0], */ goto __pyx_L9; } - /* "dijkstra3d.pyx":637 + /* "dijkstra3d.pyx":681 * ) * else: - * output32 = value_target_dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< + * output32 = dijkstra3d_gradient[uint64_t, uint32_t]( # <<<<<<<<<<<<<< * &arr_memview64[0,0,0], - * sx, sy, sz, + * sx, sy, sz, wx, wy, wz, */ /*else*/ { - /* "dijkstra3d.pyx":638 + /* "dijkstra3d.pyx":682 * else: - * output32 = value_target_dijkstra3d[uint64_t, uint32_t]( + * output32 = dijkstra3d_gradient[uint64_t, uint32_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< - * sx, sy, sz, - * src, 0, connectivity, + * sx, sy, sz, wx, wy, wz, + * src, target, */ __pyx_t_4 = 0; __pyx_t_5 = 0; @@ -12824,22 +13266,31 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 638, __pyx_L1_error) + __PYX_ERR(0, 682, __pyx_L1_error) } - /* "dijkstra3d.pyx":637 + /* "dijkstra3d.pyx":684 + * &arr_memview64[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L1_error) + + /* "dijkstra3d.pyx":681 * ) * else: - * output32 = value_target_dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< + * output32 = dijkstra3d_gradient[uint64_t, uint32_t]( # <<<<<<<<<<<<<< * &arr_memview64[0,0,0], - * sx, sy, sz, + * sx, sy, sz, wx, wy, wz, */ - __pyx_v_output32 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_4 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + __pyx_v_output32 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_4 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); } __pyx_L9:; - /* "dijkstra3d.pyx":627 - * voxel_graph_ptr + /* "dijkstra3d.pyx":670 + * connectivity, voxel_graph_ptr * ) * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< * arr_memview64 = data.astype(np.uint64) @@ -12848,8 +13299,8 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U goto __pyx_L4; } - /* "dijkstra3d.pyx":643 - * voxel_graph_ptr + /* "dijkstra3d.pyx":688 + * connectivity, voxel_graph_ptr * ) * elif dtype in (np.int32, np.uint32): # <<<<<<<<<<<<<< * arr_memview32 = data.astype(np.uint32) @@ -12857,28 +13308,28 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_14 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L10_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L10_bool_binop_done:; @@ -12886,18 +13337,18 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":644 + /* "dijkstra3d.pyx":689 * ) * elif dtype in (np.int32, np.uint32): * arr_memview32 = data.astype(np.uint32) # <<<<<<<<<<<<<< * if sixtyfourbit: - * output64 = value_target_dijkstra3d[uint32_t, uint64_t]( + * output64 = dijkstra3d_gradient[uint32_t, uint64_t]( */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 644, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -12913,31 +13364,31 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_14 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 644, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_arr_memview32 = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "dijkstra3d.pyx":645 + /* "dijkstra3d.pyx":690 * elif dtype in (np.int32, np.uint32): * arr_memview32 = data.astype(np.uint32) * if sixtyfourbit: # <<<<<<<<<<<<<< - * output64 = value_target_dijkstra3d[uint32_t, uint64_t]( + * output64 = dijkstra3d_gradient[uint32_t, uint64_t]( * &arr_memview32[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 690, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":647 + /* "dijkstra3d.pyx":692 * if sixtyfourbit: - * output64 = value_target_dijkstra3d[uint32_t, uint64_t]( + * output64 = dijkstra3d_gradient[uint32_t, uint64_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< - * sx, sy, sz, - * src, 0, connectivity, + * sx, sy, sz, wx, wy, wz, + * src, target, */ __pyx_t_6 = 0; __pyx_t_5 = 0; @@ -12957,10 +13408,1845 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 647, __pyx_L1_error) + __PYX_ERR(0, 692, __pyx_L1_error) } - /* "dijkstra3d.pyx":646 + /* "dijkstra3d.pyx":694 + * &arr_memview32[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 694, __pyx_L1_error) + + /* "dijkstra3d.pyx":691 + * arr_memview32 = data.astype(np.uint32) + * if sixtyfourbit: + * output64 = dijkstra3d_gradient[uint32_t, uint64_t]( # <<<<<<<<<<<<<< + * &arr_memview32[0,0,0], + * sx, sy, sz, wx, wy, wz, + */ + __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32.data + __pyx_t_6 * __pyx_v_arr_memview32.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview32.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview32.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + + /* "dijkstra3d.pyx":690 + * elif dtype in (np.int32, np.uint32): + * arr_memview32 = data.astype(np.uint32) + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = dijkstra3d_gradient[uint32_t, uint64_t]( + * &arr_memview32[0,0,0], + */ + goto __pyx_L12; + } + + /* "dijkstra3d.pyx":699 + * ) + * else: + * output32 = dijkstra3d_gradient[uint32_t, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memview32[0,0,0], + * sx, sy, sz, wx, wy, wz, + */ + /*else*/ { + + /* "dijkstra3d.pyx":700 + * else: + * output32 = dijkstra3d_gradient[uint32_t, uint32_t]( + * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, wx, wy, wz, + * src, target, + */ + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memview32.shape[0]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview32.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memview32.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memview32.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memview32.shape[2]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 700, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":702 + * &arr_memview32[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error) + + /* "dijkstra3d.pyx":699 + * ) + * else: + * output32 = dijkstra3d_gradient[uint32_t, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memview32[0,0,0], + * sx, sy, sz, wx, wy, wz, + */ + __pyx_v_output32 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32.data + __pyx_t_4 * __pyx_v_arr_memview32.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview32.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memview32.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + } + __pyx_L12:; + + /* "dijkstra3d.pyx":688 + * connectivity, voxel_graph_ptr + * ) + * elif dtype in (np.int32, np.uint32): # <<<<<<<<<<<<<< + * arr_memview32 = data.astype(np.uint32) + * if sixtyfourbit: + */ + goto __pyx_L4; + } + + /* "dijkstra3d.pyx":706 + * connectivity, voxel_graph_ptr + * ) + * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< + * arr_memview16 = data.astype(np.uint16) + * if sixtyfourbit: + */ + __Pyx_INCREF(__pyx_v_dtype); + __pyx_t_14 = __pyx_v_dtype; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L13_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __pyx_t_1; + __pyx_L13_bool_binop_done:; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "dijkstra3d.pyx":707 + * ) + * elif dtype in (np.int16, np.uint16): + * arr_memview16 = data.astype(np.uint16) # <<<<<<<<<<<<<< + * if sixtyfourbit: + * output64 = dijkstra3d_gradient[uint16_t, uint64_t]( + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_v_arr_memview16 = __pyx_t_18; + __pyx_t_18.memview = NULL; + __pyx_t_18.data = NULL; + + /* "dijkstra3d.pyx":708 + * elif dtype in (np.int16, np.uint16): + * arr_memview16 = data.astype(np.uint16) + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = dijkstra3d_gradient[uint16_t, uint64_t]( + * &arr_memview16[0,0,0], + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 708, __pyx_L1_error) + if (__pyx_t_1) { + + /* "dijkstra3d.pyx":710 + * if sixtyfourbit: + * output64 = dijkstra3d_gradient[uint16_t, uint64_t]( + * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, wx, wy, wz, + * src, target, + */ + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memview16.shape[0]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview16.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memview16.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memview16.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memview16.shape[2]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 710, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":712 + * &arr_memview16[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L1_error) + + /* "dijkstra3d.pyx":709 + * arr_memview16 = data.astype(np.uint16) + * if sixtyfourbit: + * output64 = dijkstra3d_gradient[uint16_t, uint64_t]( # <<<<<<<<<<<<<< + * &arr_memview16[0,0,0], + * sx, sy, sz, wx, wy, wz, + */ + __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16.data + __pyx_t_6 * __pyx_v_arr_memview16.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview16.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview16.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + + /* "dijkstra3d.pyx":708 + * elif dtype in (np.int16, np.uint16): + * arr_memview16 = data.astype(np.uint16) + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = dijkstra3d_gradient[uint16_t, uint64_t]( + * &arr_memview16[0,0,0], + */ + goto __pyx_L15; + } + + /* "dijkstra3d.pyx":717 + * ) + * else: + * output32 = dijkstra3d_gradient[uint16_t, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memview16[0,0,0], + * sx, sy, sz, wx, wy, wz, + */ + /*else*/ { + + /* "dijkstra3d.pyx":718 + * else: + * output32 = dijkstra3d_gradient[uint16_t, uint32_t]( + * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, wx, wy, wz, + * src, target, + */ + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memview16.shape[0]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview16.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memview16.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memview16.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memview16.shape[2]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 718, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":720 + * &arr_memview16[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 720, __pyx_L1_error) + + /* "dijkstra3d.pyx":717 + * ) + * else: + * output32 = dijkstra3d_gradient[uint16_t, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memview16[0,0,0], + * sx, sy, sz, wx, wy, wz, + */ + __pyx_v_output32 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16.data + __pyx_t_4 * __pyx_v_arr_memview16.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview16.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memview16.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + } + __pyx_L15:; + + /* "dijkstra3d.pyx":706 + * connectivity, voxel_graph_ptr + * ) + * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< + * arr_memview16 = data.astype(np.uint16) + * if sixtyfourbit: + */ + goto __pyx_L4; + } + + /* "dijkstra3d.pyx":724 + * connectivity, voxel_graph_ptr + * ) + * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< + * arr_memview8 = data.astype(np.uint8) + * if sixtyfourbit: + */ + __Pyx_INCREF(__pyx_v_dtype); + __pyx_t_14 = __pyx_v_dtype; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L16_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __pyx_t_2; + __pyx_L16_bool_binop_done:; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":725 + * ) + * elif dtype in (np.int8, np.uint8, bool): + * arr_memview8 = data.astype(np.uint8) # <<<<<<<<<<<<<< + * if sixtyfourbit: + * output64 = dijkstra3d_gradient[uint8_t, uint64_t]( + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_14 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_v_arr_memview8 = __pyx_t_19; + __pyx_t_19.memview = NULL; + __pyx_t_19.data = NULL; + + /* "dijkstra3d.pyx":726 + * elif dtype in (np.int8, np.uint8, bool): + * arr_memview8 = data.astype(np.uint8) + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = dijkstra3d_gradient[uint8_t, uint64_t]( + * &arr_memview8[0,0,0], + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 726, __pyx_L1_error) + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":728 + * if sixtyfourbit: + * output64 = dijkstra3d_gradient[uint8_t, uint64_t]( + * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, wx, wy, wz, + * src, target, + */ + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memview8.shape[0]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview8.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memview8.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memview8.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memview8.shape[2]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 728, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":730 + * &arr_memview8[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 730, __pyx_L1_error) + + /* "dijkstra3d.pyx":727 + * arr_memview8 = data.astype(np.uint8) + * if sixtyfourbit: + * output64 = dijkstra3d_gradient[uint8_t, uint64_t]( # <<<<<<<<<<<<<< + * &arr_memview8[0,0,0], + * sx, sy, sz, wx, wy, wz, + */ + __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8.data + __pyx_t_6 * __pyx_v_arr_memview8.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview8.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview8.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + + /* "dijkstra3d.pyx":726 + * elif dtype in (np.int8, np.uint8, bool): + * arr_memview8 = data.astype(np.uint8) + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = dijkstra3d_gradient[uint8_t, uint64_t]( + * &arr_memview8[0,0,0], + */ + goto __pyx_L19; + } + + /* "dijkstra3d.pyx":735 + * ) + * else: + * output32 = dijkstra3d_gradient[uint8_t, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memview8[0,0,0], + * sx, sy, sz, wx, wy, wz, + */ + /*else*/ { + + /* "dijkstra3d.pyx":736 + * else: + * output32 = dijkstra3d_gradient[uint8_t, uint32_t]( + * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, wx, wy, wz, + * src, target, + */ + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memview8.shape[0]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview8.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memview8.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memview8.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memview8.shape[2]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 736, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":738 + * &arr_memview8[0,0,0], + * sx, sy, sz, wx, wy, wz, + * src, target, # <<<<<<<<<<<<<< + * w_dist, w_intensity, + * connectivity, voxel_graph_ptr + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_target); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L1_error) + + /* "dijkstra3d.pyx":735 + * ) + * else: + * output32 = dijkstra3d_gradient[uint8_t, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memview8[0,0,0], + * sx, sy, sz, wx, wy, wz, + */ + __pyx_v_output32 = ((std::vector )dijkstra::dijkstra3d_gradient((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8.data + __pyx_t_4 * __pyx_v_arr_memview8.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview8.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memview8.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_t_10, __pyx_v_w_dist, __pyx_v_w_intensity, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + } + __pyx_L19:; + + /* "dijkstra3d.pyx":724 + * connectivity, voxel_graph_ptr + * ) + * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< + * arr_memview8 = data.astype(np.uint8) + * if sixtyfourbit: + */ + } + __pyx_L4:; + + /* "dijkstra3d.pyx":749 + * cdef uint64_t[:] vec_view64 + * + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output_ptr64 = &output64[0] + * if output64.size() == 0: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 749, __pyx_L1_error) + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":750 + * + * if sixtyfourbit: + * output_ptr64 = &output64[0] # <<<<<<<<<<<<<< + * if output64.size() == 0: + * return np.zeros((0,), dtype=np.uint64) + */ + __pyx_v_output_ptr64 = ((uint64_t *)(&(__pyx_v_output64[0]))); + + /* "dijkstra3d.pyx":751 + * if sixtyfourbit: + * output_ptr64 = &output64[0] + * if output64.size() == 0: # <<<<<<<<<<<<<< + * return np.zeros((0,), dtype=np.uint64) + * vec_view64 = output_ptr64 + */ + __pyx_t_2 = ((__pyx_v_output64.size() == 0) != 0); + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":752 + * output_ptr64 = &output64[0] + * if output64.size() == 0: + * return np.zeros((0,), dtype=np.uint64) # <<<<<<<<<<<<<< + * vec_view64 = output_ptr64 + * buf = bytearray(vec_view64[:]) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__11, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "dijkstra3d.pyx":751 + * if sixtyfourbit: + * output_ptr64 = &output64[0] + * if output64.size() == 0: # <<<<<<<<<<<<<< + * return np.zeros((0,), dtype=np.uint64) + * vec_view64 = output_ptr64 + */ + } + + /* "dijkstra3d.pyx":753 + * if output64.size() == 0: + * return np.zeros((0,), dtype=np.uint64) + * vec_view64 = output_ptr64 # <<<<<<<<<<<<<< + * buf = bytearray(vec_view64[:]) + * output = np.frombuffer(buf, dtype=np.uint64) + */ + if (!__pyx_v_output_ptr64) { + PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); + __PYX_ERR(0, 753, __pyx_L1_error) + } + __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint64_t); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output64.size())); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_20 = __pyx_array_new(__pyx_t_11, sizeof(uint64_t), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_v_output_ptr64); + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; + __pyx_v_vec_view64 = __pyx_t_21; + __pyx_t_21.memview = NULL; + __pyx_t_21.data = NULL; + + /* "dijkstra3d.pyx":754 + * return np.zeros((0,), dtype=np.uint64) + * vec_view64 = output_ptr64 + * buf = bytearray(vec_view64[:]) # <<<<<<<<<<<<<< + * output = np.frombuffer(buf, dtype=np.uint64) + * else: + */ + __pyx_t_14 = __pyx_memoryview_fromslice(__pyx_v_vec_view64, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint64_t, 0);; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_v_buf = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; + + /* "dijkstra3d.pyx":755 + * vec_view64 = output_ptr64 + * buf = bytearray(vec_view64[:]) + * output = np.frombuffer(buf, dtype=np.uint64) # <<<<<<<<<<<<<< + * else: + * output_ptr32 = &output32[0] + */ + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_buf); + __Pyx_GIVEREF(__pyx_v_buf); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_buf); + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_output = __pyx_t_9; + __pyx_t_9 = 0; + + /* "dijkstra3d.pyx":749 + * cdef uint64_t[:] vec_view64 + * + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output_ptr64 = &output64[0] + * if output64.size() == 0: + */ + goto __pyx_L20; + } + + /* "dijkstra3d.pyx":757 + * output = np.frombuffer(buf, dtype=np.uint64) + * else: + * output_ptr32 = &output32[0] # <<<<<<<<<<<<<< + * if output32.size() == 0: + * return np.zeros((0,), dtype=np.uint32) + */ + /*else*/ { + __pyx_v_output_ptr32 = ((uint32_t *)(&(__pyx_v_output32[0]))); + + /* "dijkstra3d.pyx":758 + * else: + * output_ptr32 = &output32[0] + * if output32.size() == 0: # <<<<<<<<<<<<<< + * return np.zeros((0,), dtype=np.uint32) + * vec_view32 = output_ptr32 + */ + __pyx_t_2 = ((__pyx_v_output32.size() == 0) != 0); + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":759 + * output_ptr32 = &output32[0] + * if output32.size() == 0: + * return np.zeros((0,), dtype=np.uint32) # <<<<<<<<<<<<<< + * vec_view32 = output_ptr32 + * buf = bytearray(vec_view32[:]) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__11, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + + /* "dijkstra3d.pyx":758 + * else: + * output_ptr32 = &output32[0] + * if output32.size() == 0: # <<<<<<<<<<<<<< + * return np.zeros((0,), dtype=np.uint32) + * vec_view32 = output_ptr32 + */ + } + + /* "dijkstra3d.pyx":760 + * if output32.size() == 0: + * return np.zeros((0,), dtype=np.uint32) + * vec_view32 = output_ptr32 # <<<<<<<<<<<<<< + * buf = bytearray(vec_view32[:]) + * output = np.frombuffer(buf, dtype=np.uint32) + */ + if (!__pyx_v_output_ptr32) { + PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); + __PYX_ERR(0, 760, __pyx_L1_error) + } + __pyx_t_9 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint32_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output32.size())); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_20 = __pyx_array_new(__pyx_t_14, sizeof(uint32_t), PyBytes_AS_STRING(__pyx_t_9), (char *) "c", (char *) __pyx_v_output_ptr32); + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; + __pyx_v_vec_view32 = __pyx_t_22; + __pyx_t_22.memview = NULL; + __pyx_t_22.data = NULL; + + /* "dijkstra3d.pyx":761 + * return np.zeros((0,), dtype=np.uint32) + * vec_view32 = output_ptr32 + * buf = bytearray(vec_view32[:]) # <<<<<<<<<<<<<< + * output = np.frombuffer(buf, dtype=np.uint32) + * + */ + __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_vec_view32, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint32_t, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_buf = ((PyObject*)__pyx_t_14); + __pyx_t_14 = 0; + + /* "dijkstra3d.pyx":762 + * vec_view32 = output_ptr32 + * buf = bytearray(vec_view32[:]) + * output = np.frombuffer(buf, dtype=np.uint32) # <<<<<<<<<<<<<< + * + * return output[::-1] + */ + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_buf); + __Pyx_GIVEREF(__pyx_v_buf); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_buf); + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 762, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_14, __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_output = __pyx_t_13; + __pyx_t_13 = 0; + } + __pyx_L20:; + + /* "dijkstra3d.pyx":764 + * output = np.frombuffer(buf, dtype=np.uint32) + * + * return output[::-1] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_slice__10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + + /* "dijkstra3d.pyx":602 + * return ptlist + * + * def _execute_gradient_dijkstra( # <<<<<<<<<<<<<< + * data, source, target, + * float wx, float wy, float wz, + */ + + /* function exit code */ + __pyx_L1_error:; + __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1); + __Pyx_XDECREF(((PyObject *)__pyx_t_20)); + __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1); + __Pyx_AddTraceback("dijkstra3d._execute_gradient_dijkstra", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr_memview8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_arr_memview16, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_arr_memview32, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_arr_memview64, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_arr_memviewfloat, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_arr_memviewdouble, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_voxel_graph_memview, 1); + __Pyx_XDECREF(__pyx_v_sixtyfourbit); + __Pyx_XDECREF(__pyx_v_dtype); + __PYX_XDEC_MEMVIEW(&__pyx_v_vec_view32, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_vec_view64, 1); + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "dijkstra3d.pyx":767 + * + * + * def _execute_value_target_dijkstra( # <<<<<<<<<<<<<< + * data, source, + * int connectivity, voxel_graph=None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10dijkstra3d_23_execute_value_target_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_10dijkstra3d_23_execute_value_target_dijkstra = {"_execute_value_target_dijkstra", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_23_execute_value_target_dijkstra, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10dijkstra3d_23_execute_value_target_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_data = 0; + PyObject *__pyx_v_source = 0; + int __pyx_v_connectivity; + PyObject *__pyx_v_voxel_graph = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_execute_value_target_dijkstra (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_source,&__pyx_n_s_connectivity,&__pyx_n_s_voxel_graph,0}; + PyObject* values[4] = {0,0,0,0}; + + /* "dijkstra3d.pyx":769 + * def _execute_value_target_dijkstra( + * data, source, + * int connectivity, voxel_graph=None # <<<<<<<<<<<<<< + * ): + * cdef uint8_t[:,:,:] arr_memview8 + */ + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_execute_value_target_dijkstra", 0, 3, 4, 1); __PYX_ERR(0, 767, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connectivity)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_execute_value_target_dijkstra", 0, 3, 4, 2); __PYX_ERR(0, 767, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_voxel_graph); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_value_target_dijkstra") < 0)) __PYX_ERR(0, 767, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_data = values[0]; + __pyx_v_source = values[1]; + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 769, __pyx_L3_error) + __pyx_v_voxel_graph = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_execute_value_target_dijkstra", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 767, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("dijkstra3d._execute_value_target_dijkstra", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10dijkstra3d_22_execute_value_target_dijkstra(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph); + + /* "dijkstra3d.pyx":767 + * + * + * def _execute_value_target_dijkstra( # <<<<<<<<<<<<<< + * data, source, + * int connectivity, voxel_graph=None + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10dijkstra3d_22_execute_value_target_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, int __pyx_v_connectivity, PyObject *__pyx_v_voxel_graph) { + __Pyx_memviewslice __pyx_v_arr_memview8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_arr_memview16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_arr_memview32 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_arr_memview64 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_arr_memviewfloat = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_arr_memviewdouble = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_voxel_graph_memview = { 0, 0, { 0 }, { 0 }, { 0 } }; + uint32_t *__pyx_v_voxel_graph_ptr; + size_t __pyx_v_sx; + size_t __pyx_v_sy; + size_t __pyx_v_sz; + size_t __pyx_v_src; + std::vector __pyx_v_output32; + std::vector __pyx_v_output64; + PyObject *__pyx_v_sixtyfourbit = NULL; + PyObject *__pyx_v_dtype = NULL; + uint32_t *__pyx_v_output_ptr32; + uint64_t *__pyx_v_output_ptr64; + __Pyx_memviewslice __pyx_v_vec_view32 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_vec_view64 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_buf = NULL; + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_array_obj *__pyx_t_20 = NULL; + __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_22 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_execute_value_target_dijkstra", 0); + + /* "dijkstra3d.pyx":779 + * + * cdef uint32_t[:,:,:] voxel_graph_memview + * cdef uint32_t* voxel_graph_ptr = NULL # <<<<<<<<<<<<<< + * if voxel_graph is not None: + * voxel_graph_memview = voxel_graph + */ + __pyx_v_voxel_graph_ptr = NULL; + + /* "dijkstra3d.pyx":780 + * cdef uint32_t[:,:,:] voxel_graph_memview + * cdef uint32_t* voxel_graph_ptr = NULL + * if voxel_graph is not None: # <<<<<<<<<<<<<< + * voxel_graph_memview = voxel_graph + * voxel_graph_ptr = &voxel_graph_memview[0,0,0] + */ + __pyx_t_1 = (__pyx_v_voxel_graph != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":781 + * cdef uint32_t* voxel_graph_ptr = NULL + * if voxel_graph is not None: + * voxel_graph_memview = voxel_graph # <<<<<<<<<<<<<< + * voxel_graph_ptr = &voxel_graph_memview[0,0,0] + * + */ + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_v_voxel_graph_memview = __pyx_t_3; + __pyx_t_3.memview = NULL; + __pyx_t_3.data = NULL; + + /* "dijkstra3d.pyx":782 + * if voxel_graph is not None: + * voxel_graph_memview = voxel_graph + * voxel_graph_ptr = &voxel_graph_memview[0,0,0] # <<<<<<<<<<<<<< + * + * cdef size_t sx = data.shape[0] + */ + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_voxel_graph_memview.shape[0]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_v_voxel_graph_memview.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_voxel_graph_memview.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_voxel_graph_memview.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_voxel_graph_memview.shape[2]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_6 >= __pyx_v_voxel_graph_memview.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 782, __pyx_L1_error) + } + __pyx_v_voxel_graph_ptr = ((uint32_t *)(&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_voxel_graph_memview.data + __pyx_t_4 * __pyx_v_voxel_graph_memview.strides[0]) ) + __pyx_t_5 * __pyx_v_voxel_graph_memview.strides[1]) ) + __pyx_t_6 * __pyx_v_voxel_graph_memview.strides[2]) ))))); + + /* "dijkstra3d.pyx":780 + * cdef uint32_t[:,:,:] voxel_graph_memview + * cdef uint32_t* voxel_graph_ptr = NULL + * if voxel_graph is not None: # <<<<<<<<<<<<<< + * voxel_graph_memview = voxel_graph + * voxel_graph_ptr = &voxel_graph_memview[0,0,0] + */ + } + + /* "dijkstra3d.pyx":784 + * voxel_graph_ptr = &voxel_graph_memview[0,0,0] + * + * cdef size_t sx = data.shape[0] # <<<<<<<<<<<<<< + * cdef size_t sy = data.shape[1] + * cdef size_t sz = data.shape[2] + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_sx = __pyx_t_10; + + /* "dijkstra3d.pyx":785 + * + * cdef size_t sx = data.shape[0] + * cdef size_t sy = data.shape[1] # <<<<<<<<<<<<<< + * cdef size_t sz = data.shape[2] + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_sy = __pyx_t_10; + + /* "dijkstra3d.pyx":786 + * cdef size_t sx = data.shape[0] + * cdef size_t sy = data.shape[1] + * cdef size_t sz = data.shape[2] # <<<<<<<<<<<<<< + * + * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_sz = __pyx_t_10; + + /* "dijkstra3d.pyx":788 + * cdef size_t sz = data.shape[2] + * + * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) # <<<<<<<<<<<<<< + * + * cdef vector[uint32_t] output32 + */ + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyNumber_Multiply(__pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_13); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_src = __pyx_t_10; + + /* "dijkstra3d.pyx":793 + * cdef vector[uint64_t] output64 + * + * sixtyfourbit = data.size > np.iinfo(np.uint32).max # <<<<<<<<<<<<<< + * + * dtype = data.dtype + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyObject_RichCompare(__pyx_t_13, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_sixtyfourbit = __pyx_t_14; + __pyx_t_14 = 0; + + /* "dijkstra3d.pyx":795 + * sixtyfourbit = data.size > np.iinfo(np.uint32).max + * + * dtype = data.dtype # <<<<<<<<<<<<<< + * + * if dtype == np.float32: + */ + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_v_dtype = __pyx_t_14; + __pyx_t_14 = 0; + + /* "dijkstra3d.pyx":797 + * dtype = data.dtype + * + * if dtype == np.float32: # <<<<<<<<<<<<<< + * arr_memviewfloat = data + * if sixtyfourbit: + */ + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 797, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 797, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":798 + * + * if dtype == np.float32: + * arr_memviewfloat = data # <<<<<<<<<<<<<< + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[float, uint64_t]( + */ + __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_v_arr_memviewfloat = __pyx_t_15; + __pyx_t_15.memview = NULL; + __pyx_t_15.data = NULL; + + /* "dijkstra3d.pyx":799 + * if dtype == np.float32: + * arr_memviewfloat = data + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = value_target_dijkstra3d[float, uint64_t]( + * &arr_memviewfloat[0,0,0], + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 799, __pyx_L1_error) + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":801 + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[float, uint64_t]( + * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, + * src, 0, connectivity, + */ + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memviewfloat.shape[0]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewfloat.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memviewfloat.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memviewfloat.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memviewfloat.shape[2]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 801, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":800 + * arr_memviewfloat = data + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[float, uint64_t]( # <<<<<<<<<<<<<< + * &arr_memviewfloat[0,0,0], + * sx, sy, sz, + */ + __pyx_v_output64 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0.0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + + /* "dijkstra3d.pyx":799 + * if dtype == np.float32: + * arr_memviewfloat = data + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = value_target_dijkstra3d[float, uint64_t]( + * &arr_memviewfloat[0,0,0], + */ + goto __pyx_L5; + } + + /* "dijkstra3d.pyx":807 + * ) + * else: + * output32 = value_target_dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memviewfloat[0,0,0], + * sx, sy, sz, + */ + /*else*/ { + + /* "dijkstra3d.pyx":808 + * else: + * output32 = value_target_dijkstra3d[float, uint32_t]( + * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, + * src, 0, connectivity, + */ + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memviewfloat.shape[0]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewfloat.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memviewfloat.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memviewfloat.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memviewfloat.shape[2]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 808, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":807 + * ) + * else: + * output32 = value_target_dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memviewfloat[0,0,0], + * sx, sy, sz, + */ + __pyx_v_output32 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0.0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + } + __pyx_L5:; + + /* "dijkstra3d.pyx":797 + * dtype = data.dtype + * + * if dtype == np.float32: # <<<<<<<<<<<<<< + * arr_memviewfloat = data + * if sixtyfourbit: + */ + goto __pyx_L4; + } + + /* "dijkstra3d.pyx":813 + * voxel_graph_ptr + * ) + * elif dtype == np.float64: # <<<<<<<<<<<<<< + * arr_memviewdouble = data + * if sixtyfourbit: + */ + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":814 + * ) + * elif dtype == np.float64: + * arr_memviewdouble = data # <<<<<<<<<<<<<< + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[double, uint64_t]( + */ + __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_v_arr_memviewdouble = __pyx_t_16; + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + + /* "dijkstra3d.pyx":815 + * elif dtype == np.float64: + * arr_memviewdouble = data + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = value_target_dijkstra3d[double, uint64_t]( + * &arr_memviewdouble[0,0,0], + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 815, __pyx_L1_error) + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":817 + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[double, uint64_t]( + * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, + * src, 0, connectivity, + */ + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memviewdouble.shape[0]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewdouble.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memviewdouble.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memviewdouble.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memviewdouble.shape[2]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 817, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":816 + * arr_memviewdouble = data + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[double, uint64_t]( # <<<<<<<<<<<<<< + * &arr_memviewdouble[0,0,0], + * sx, sy, sz, + */ + __pyx_v_output64 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0.0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + + /* "dijkstra3d.pyx":815 + * elif dtype == np.float64: + * arr_memviewdouble = data + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = value_target_dijkstra3d[double, uint64_t]( + * &arr_memviewdouble[0,0,0], + */ + goto __pyx_L6; + } + + /* "dijkstra3d.pyx":823 + * ) + * else: + * output32 = value_target_dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memviewdouble[0,0,0], + * sx, sy, sz, + */ + /*else*/ { + + /* "dijkstra3d.pyx":824 + * else: + * output32 = value_target_dijkstra3d[double, uint32_t]( + * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, + * src, 0, connectivity, + */ + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memviewdouble.shape[0]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewdouble.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memviewdouble.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memviewdouble.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memviewdouble.shape[2]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 824, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":823 + * ) + * else: + * output32 = value_target_dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memviewdouble[0,0,0], + * sx, sy, sz, + */ + __pyx_v_output32 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0.0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + } + __pyx_L6:; + + /* "dijkstra3d.pyx":813 + * voxel_graph_ptr + * ) + * elif dtype == np.float64: # <<<<<<<<<<<<<< + * arr_memviewdouble = data + * if sixtyfourbit: + */ + goto __pyx_L4; + } + + /* "dijkstra3d.pyx":829 + * voxel_graph_ptr + * ) + * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< + * arr_memview64 = data.astype(np.uint64) + * if sixtyfourbit: + */ + __Pyx_INCREF(__pyx_v_dtype); + __pyx_t_14 = __pyx_v_dtype; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L7_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __pyx_t_1; + __pyx_L7_bool_binop_done:; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "dijkstra3d.pyx":830 + * ) + * elif dtype in (np.int64, np.uint64): + * arr_memview64 = data.astype(np.uint64) # <<<<<<<<<<<<<< + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_v_arr_memview64 = __pyx_t_17; + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; + + /* "dijkstra3d.pyx":831 + * elif dtype in (np.int64, np.uint64): + * arr_memview64 = data.astype(np.uint64) + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( + * &arr_memview64[0,0,0], + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 831, __pyx_L1_error) + if (__pyx_t_1) { + + /* "dijkstra3d.pyx":833 + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( + * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, + * src, 0, connectivity, + */ + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memview64.shape[0]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview64.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memview64.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memview64.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memview64.shape[2]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 833, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":832 + * arr_memview64 = data.astype(np.uint64) + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( # <<<<<<<<<<<<<< + * &arr_memview64[0,0,0], + * sx, sy, sz, + */ + __pyx_v_output64 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_6 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + + /* "dijkstra3d.pyx":831 + * elif dtype in (np.int64, np.uint64): + * arr_memview64 = data.astype(np.uint64) + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = value_target_dijkstra3d[uint64_t, uint64_t]( + * &arr_memview64[0,0,0], + */ + goto __pyx_L9; + } + + /* "dijkstra3d.pyx":839 + * ) + * else: + * output32 = value_target_dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memview64[0,0,0], + * sx, sy, sz, + */ + /*else*/ { + + /* "dijkstra3d.pyx":840 + * else: + * output32 = value_target_dijkstra3d[uint64_t, uint32_t]( + * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, + * src, 0, connectivity, + */ + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memview64.shape[0]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview64.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memview64.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memview64.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memview64.shape[2]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 840, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":839 + * ) + * else: + * output32 = value_target_dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< + * &arr_memview64[0,0,0], + * sx, sy, sz, + */ + __pyx_v_output32 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_4 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); + } + __pyx_L9:; + + /* "dijkstra3d.pyx":829 + * voxel_graph_ptr + * ) + * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< + * arr_memview64 = data.astype(np.uint64) + * if sixtyfourbit: + */ + goto __pyx_L4; + } + + /* "dijkstra3d.pyx":845 + * voxel_graph_ptr + * ) + * elif dtype in (np.int32, np.uint32): # <<<<<<<<<<<<<< + * arr_memview32 = data.astype(np.uint32) + * if sixtyfourbit: + */ + __Pyx_INCREF(__pyx_v_dtype); + __pyx_t_14 = __pyx_v_dtype; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L10_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __pyx_t_2; + __pyx_L10_bool_binop_done:; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":846 + * ) + * elif dtype in (np.int32, np.uint32): + * arr_memview32 = data.astype(np.uint32) # <<<<<<<<<<<<<< + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[uint32_t, uint64_t]( + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_14 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_v_arr_memview32 = __pyx_t_3; + __pyx_t_3.memview = NULL; + __pyx_t_3.data = NULL; + + /* "dijkstra3d.pyx":847 + * elif dtype in (np.int32, np.uint32): + * arr_memview32 = data.astype(np.uint32) + * if sixtyfourbit: # <<<<<<<<<<<<<< + * output64 = value_target_dijkstra3d[uint32_t, uint64_t]( + * &arr_memview32[0,0,0], + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 847, __pyx_L1_error) + if (__pyx_t_2) { + + /* "dijkstra3d.pyx":849 + * if sixtyfourbit: + * output64 = value_target_dijkstra3d[uint32_t, uint64_t]( + * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< + * sx, sy, sz, + * src, 0, connectivity, + */ + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_arr_memview32.shape[0]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview32.shape[0])) __pyx_t_7 = 0; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_arr_memview32.shape[1]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 1; + } else if (unlikely(__pyx_t_5 >= __pyx_v_arr_memview32.shape[1])) __pyx_t_7 = 1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_v_arr_memview32.shape[2]; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_7 = 2; + } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + __PYX_ERR(0, 849, __pyx_L1_error) + } + + /* "dijkstra3d.pyx":848 * arr_memview32 = data.astype(np.uint32) * if sixtyfourbit: * output64 = value_target_dijkstra3d[uint32_t, uint64_t]( # <<<<<<<<<<<<<< @@ -12969,7 +15255,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ __pyx_v_output64 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32.data + __pyx_t_6 * __pyx_v_arr_memview32.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview32.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview32.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":645 + /* "dijkstra3d.pyx":847 * elif dtype in (np.int32, np.uint32): * arr_memview32 = data.astype(np.uint32) * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -12979,7 +15265,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U goto __pyx_L12; } - /* "dijkstra3d.pyx":653 + /* "dijkstra3d.pyx":855 * ) * else: * output32 = value_target_dijkstra3d[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -12988,7 +15274,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ /*else*/ { - /* "dijkstra3d.pyx":654 + /* "dijkstra3d.pyx":856 * else: * output32 = value_target_dijkstra3d[uint32_t, uint32_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -13013,10 +15299,10 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 856, __pyx_L1_error) } - /* "dijkstra3d.pyx":653 + /* "dijkstra3d.pyx":855 * ) * else: * output32 = value_target_dijkstra3d[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -13027,7 +15313,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } __pyx_L12:; - /* "dijkstra3d.pyx":643 + /* "dijkstra3d.pyx":845 * voxel_graph_ptr * ) * elif dtype in (np.int32, np.uint32): # <<<<<<<<<<<<<< @@ -13037,7 +15323,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U goto __pyx_L4; } - /* "dijkstra3d.pyx":659 + /* "dijkstra3d.pyx":861 * voxel_graph_ptr * ) * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< @@ -13046,28 +15332,28 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_14 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L13_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L13_bool_binop_done:; @@ -13075,18 +15361,18 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "dijkstra3d.pyx":660 + /* "dijkstra3d.pyx":862 * ) * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = value_target_dijkstra3d[uint16_t, uint64_t]( */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; @@ -13102,26 +15388,26 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 660, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_arr_memview16 = __pyx_t_18; __pyx_t_18.memview = NULL; __pyx_t_18.data = NULL; - /* "dijkstra3d.pyx":661 + /* "dijkstra3d.pyx":863 * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = value_target_dijkstra3d[uint16_t, uint64_t]( * &arr_memview16[0,0,0], */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 863, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":663 + /* "dijkstra3d.pyx":865 * if sixtyfourbit: * output64 = value_target_dijkstra3d[uint16_t, uint64_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -13146,10 +15432,10 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 865, __pyx_L1_error) } - /* "dijkstra3d.pyx":662 + /* "dijkstra3d.pyx":864 * arr_memview16 = data.astype(np.uint16) * if sixtyfourbit: * output64 = value_target_dijkstra3d[uint16_t, uint64_t]( # <<<<<<<<<<<<<< @@ -13158,7 +15444,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ __pyx_v_output64 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16.data + __pyx_t_6 * __pyx_v_arr_memview16.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview16.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview16.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":661 + /* "dijkstra3d.pyx":863 * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -13168,7 +15454,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U goto __pyx_L15; } - /* "dijkstra3d.pyx":669 + /* "dijkstra3d.pyx":871 * ) * else: * output32 = value_target_dijkstra3d[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -13177,7 +15463,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ /*else*/ { - /* "dijkstra3d.pyx":670 + /* "dijkstra3d.pyx":872 * else: * output32 = value_target_dijkstra3d[uint16_t, uint32_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -13202,10 +15488,10 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 670, __pyx_L1_error) + __PYX_ERR(0, 872, __pyx_L1_error) } - /* "dijkstra3d.pyx":669 + /* "dijkstra3d.pyx":871 * ) * else: * output32 = value_target_dijkstra3d[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -13216,7 +15502,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } __pyx_L15:; - /* "dijkstra3d.pyx":659 + /* "dijkstra3d.pyx":861 * voxel_graph_ptr * ) * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< @@ -13226,7 +15512,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U goto __pyx_L4; } - /* "dijkstra3d.pyx":675 + /* "dijkstra3d.pyx":877 * voxel_graph_ptr * ) * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -13235,36 +15521,36 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_14 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L16_bool_binop_done:; @@ -13272,18 +15558,18 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":676 + /* "dijkstra3d.pyx":878 * ) * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = value_target_dijkstra3d[uint8_t, uint64_t]( */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 676, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -13299,26 +15585,26 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_14 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 676, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_arr_memview8 = __pyx_t_19; __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL; - /* "dijkstra3d.pyx":677 + /* "dijkstra3d.pyx":879 * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = value_target_dijkstra3d[uint8_t, uint64_t]( * &arr_memview8[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 677, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 879, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":679 + /* "dijkstra3d.pyx":881 * if sixtyfourbit: * output64 = value_target_dijkstra3d[uint8_t, uint64_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -13343,10 +15629,10 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 679, __pyx_L1_error) + __PYX_ERR(0, 881, __pyx_L1_error) } - /* "dijkstra3d.pyx":678 + /* "dijkstra3d.pyx":880 * arr_memview8 = data.astype(np.uint8) * if sixtyfourbit: * output64 = value_target_dijkstra3d[uint8_t, uint64_t]( # <<<<<<<<<<<<<< @@ -13355,7 +15641,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ __pyx_v_output64 = ((std::vector )dijkstra::value_target_dijkstra3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8.data + __pyx_t_6 * __pyx_v_arr_memview8.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview8.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview8.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, 0, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":677 + /* "dijkstra3d.pyx":879 * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -13365,7 +15651,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U goto __pyx_L19; } - /* "dijkstra3d.pyx":685 + /* "dijkstra3d.pyx":887 * ) * else: * output32 = value_target_dijkstra3d[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -13374,7 +15660,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ /*else*/ { - /* "dijkstra3d.pyx":686 + /* "dijkstra3d.pyx":888 * else: * output32 = value_target_dijkstra3d[uint8_t, uint32_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -13399,10 +15685,10 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 686, __pyx_L1_error) + __PYX_ERR(0, 888, __pyx_L1_error) } - /* "dijkstra3d.pyx":685 + /* "dijkstra3d.pyx":887 * ) * else: * output32 = value_target_dijkstra3d[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -13413,7 +15699,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } __pyx_L19:; - /* "dijkstra3d.pyx":675 + /* "dijkstra3d.pyx":877 * voxel_graph_ptr * ) * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -13423,17 +15709,17 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } __pyx_L4:; - /* "dijkstra3d.pyx":698 + /* "dijkstra3d.pyx":900 * cdef uint64_t[:] vec_view64 * * if sixtyfourbit: # <<<<<<<<<<<<<< * output_ptr64 = &output64[0] * if output64.size() == 0: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 900, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":699 + /* "dijkstra3d.pyx":901 * * if sixtyfourbit: * output_ptr64 = &output64[0] # <<<<<<<<<<<<<< @@ -13442,7 +15728,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ __pyx_v_output_ptr64 = ((uint64_t *)(&(__pyx_v_output64[0]))); - /* "dijkstra3d.pyx":700 + /* "dijkstra3d.pyx":902 * if sixtyfourbit: * output_ptr64 = &output64[0] * if output64.size() == 0: # <<<<<<<<<<<<<< @@ -13452,7 +15738,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_2 = ((__pyx_v_output64.size() == 0) != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":701 + /* "dijkstra3d.pyx":903 * output_ptr64 = &output64[0] * if output64.size() == 0: * return np.zeros((0,), dtype=np.uint64) # <<<<<<<<<<<<<< @@ -13460,21 +15746,21 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U * buf = bytearray(vec_view64[:]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 701, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__10, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__11, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; @@ -13482,7 +15768,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_11 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":700 + /* "dijkstra3d.pyx":902 * if sixtyfourbit: * output_ptr64 = &output64[0] * if output64.size() == 0: # <<<<<<<<<<<<<< @@ -13491,7 +15777,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ } - /* "dijkstra3d.pyx":702 + /* "dijkstra3d.pyx":904 * if output64.size() == 0: * return np.zeros((0,), dtype=np.uint64) * vec_view64 = output_ptr64 # <<<<<<<<<<<<<< @@ -13500,65 +15786,65 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ if (!__pyx_v_output_ptr64) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 702, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint64_t); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint64_t); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output64.size())); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output64.size())); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_20 = __pyx_array_new(__pyx_t_11, sizeof(uint64_t), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_v_output_ptr64); - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 702, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; __pyx_v_vec_view64 = __pyx_t_21; __pyx_t_21.memview = NULL; __pyx_t_21.data = NULL; - /* "dijkstra3d.pyx":703 + /* "dijkstra3d.pyx":905 * return np.zeros((0,), dtype=np.uint64) * vec_view64 = output_ptr64 * buf = bytearray(vec_view64[:]) # <<<<<<<<<<<<<< * output = np.frombuffer(buf, dtype=np.uint64) * else: */ - __pyx_t_14 = __pyx_memoryview_fromslice(__pyx_v_vec_view64, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint64_t, 0);; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_14 = __pyx_memoryview_fromslice(__pyx_v_vec_view64, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint64_t, 0);; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_buf = ((PyObject*)__pyx_t_11); __pyx_t_11 = 0; - /* "dijkstra3d.pyx":704 + /* "dijkstra3d.pyx":906 * vec_view64 = output_ptr64 * buf = bytearray(vec_view64[:]) * output = np.frombuffer(buf, dtype=np.uint64) # <<<<<<<<<<<<<< * else: * output_ptr32 = &output32[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_buf); - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 704, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -13566,7 +15852,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_v_output = __pyx_t_9; __pyx_t_9 = 0; - /* "dijkstra3d.pyx":698 + /* "dijkstra3d.pyx":900 * cdef uint64_t[:] vec_view64 * * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -13576,7 +15862,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U goto __pyx_L20; } - /* "dijkstra3d.pyx":706 + /* "dijkstra3d.pyx":908 * output = np.frombuffer(buf, dtype=np.uint64) * else: * output_ptr32 = &output32[0] # <<<<<<<<<<<<<< @@ -13586,7 +15872,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U /*else*/ { __pyx_v_output_ptr32 = ((uint32_t *)(&(__pyx_v_output32[0]))); - /* "dijkstra3d.pyx":707 + /* "dijkstra3d.pyx":909 * else: * output_ptr32 = &output32[0] * if output32.size() == 0: # <<<<<<<<<<<<<< @@ -13596,7 +15882,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_2 = ((__pyx_v_output32.size() == 0) != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":708 + /* "dijkstra3d.pyx":910 * output_ptr32 = &output32[0] * if output32.size() == 0: * return np.zeros((0,), dtype=np.uint32) # <<<<<<<<<<<<<< @@ -13604,21 +15890,21 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U * buf = bytearray(vec_view32[:]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 708, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 708, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 910, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__10, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__11, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -13626,7 +15912,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U __pyx_t_14 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":707 + /* "dijkstra3d.pyx":909 * else: * output_ptr32 = &output32[0] * if output32.size() == 0: # <<<<<<<<<<<<<< @@ -13635,7 +15921,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ } - /* "dijkstra3d.pyx":709 + /* "dijkstra3d.pyx":911 * if output32.size() == 0: * return np.zeros((0,), dtype=np.uint32) * vec_view32 = output_ptr32 # <<<<<<<<<<<<<< @@ -13644,65 +15930,65 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ if (!__pyx_v_output_ptr32) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 709, __pyx_L1_error) + __PYX_ERR(0, 911, __pyx_L1_error) } - __pyx_t_9 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint32_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_9 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint32_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output32.size())); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output32.size())); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_20 = __pyx_array_new(__pyx_t_14, sizeof(uint32_t), PyBytes_AS_STRING(__pyx_t_9), (char *) "c", (char *) __pyx_v_output_ptr32); - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 709, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; __pyx_v_vec_view32 = __pyx_t_22; __pyx_t_22.memview = NULL; __pyx_t_22.data = NULL; - /* "dijkstra3d.pyx":710 + /* "dijkstra3d.pyx":912 * return np.zeros((0,), dtype=np.uint32) * vec_view32 = output_ptr32 * buf = bytearray(vec_view32[:]) # <<<<<<<<<<<<<< * output = np.frombuffer(buf, dtype=np.uint32) * */ - __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_vec_view32, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint32_t, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_vec_view32, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint32_t, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_buf = ((PyObject*)__pyx_t_14); __pyx_t_14 = 0; - /* "dijkstra3d.pyx":711 + /* "dijkstra3d.pyx":913 * vec_view32 = output_ptr32 * buf = bytearray(vec_view32[:]) * output = np.frombuffer(buf, dtype=np.uint32) # <<<<<<<<<<<<<< * * return output[::-1] */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_buf); - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 711, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_14, __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_14, __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; @@ -13712,7 +15998,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U } __pyx_L20:; - /* "dijkstra3d.pyx":713 + /* "dijkstra3d.pyx":915 * output = np.frombuffer(buf, dtype=np.uint32) * * return output[::-1] # <<<<<<<<<<<<<< @@ -13720,14 +16006,14 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U * def _execute_dijkstra( */ __Pyx_XDECREF(__pyx_r); - __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_slice__8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_slice__10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_r = __pyx_t_13; __pyx_t_13 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":565 - * return ptlist + /* "dijkstra3d.pyx":767 + * * * def _execute_value_target_dijkstra( # <<<<<<<<<<<<<< * data, source, @@ -13772,7 +16058,7 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U return __pyx_r; } -/* "dijkstra3d.pyx":715 +/* "dijkstra3d.pyx":917 * return output[::-1] * * def _execute_dijkstra( # <<<<<<<<<<<<<< @@ -13781,9 +16067,9 @@ static PyObject *__pyx_pf_10dijkstra3d_20_execute_value_target_dijkstra(CYTHON_U */ /* Python wrapper */ -static PyObject *__pyx_pw_10dijkstra3d_23_execute_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_10dijkstra3d_23_execute_dijkstra = {"_execute_dijkstra", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_23_execute_dijkstra, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10dijkstra3d_23_execute_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_10dijkstra3d_25_execute_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_10dijkstra3d_25_execute_dijkstra = {"_execute_dijkstra", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_25_execute_dijkstra, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10dijkstra3d_25_execute_dijkstra(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_source = 0; PyObject *__pyx_v_target = 0; @@ -13802,7 +16088,7 @@ static PyObject *__pyx_pw_10dijkstra3d_23_execute_dijkstra(PyObject *__pyx_self, static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_source,&__pyx_n_s_target,&__pyx_n_s_connectivity,&__pyx_n_s_bidirectional,&__pyx_n_s_compass,&__pyx_n_s_compass_norm,&__pyx_n_s_voxel_graph,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; - /* "dijkstra3d.pyx":718 + /* "dijkstra3d.pyx":920 * data, source, target, int connectivity, * bidirectional, compass, float compass_norm=-1, * voxel_graph=None # <<<<<<<<<<<<<< @@ -13842,31 +16128,31 @@ static PyObject *__pyx_pw_10dijkstra3d_23_execute_dijkstra(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 1); __PYX_ERR(0, 715, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 1); __PYX_ERR(0, 917, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 2); __PYX_ERR(0, 715, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 2); __PYX_ERR(0, 917, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connectivity)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 3); __PYX_ERR(0, 715, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 3); __PYX_ERR(0, 917, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bidirectional)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 4); __PYX_ERR(0, 715, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 4); __PYX_ERR(0, 917, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compass)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 5); __PYX_ERR(0, 715, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, 5); __PYX_ERR(0, 917, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: @@ -13882,7 +16168,7 @@ static PyObject *__pyx_pw_10dijkstra3d_23_execute_dijkstra(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_dijkstra") < 0)) __PYX_ERR(0, 715, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_dijkstra") < 0)) __PYX_ERR(0, 917, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -13903,11 +16189,11 @@ static PyObject *__pyx_pw_10dijkstra3d_23_execute_dijkstra(PyObject *__pyx_self, __pyx_v_data = values[0]; __pyx_v_source = values[1]; __pyx_v_target = values[2]; - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 716, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 918, __pyx_L3_error) __pyx_v_bidirectional = values[4]; __pyx_v_compass = values[5]; if (values[6]) { - __pyx_v_compass_norm = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_compass_norm == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error) + __pyx_v_compass_norm = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_compass_norm == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 919, __pyx_L3_error) } else { __pyx_v_compass_norm = ((float)-1.0); } @@ -13915,15 +16201,15 @@ static PyObject *__pyx_pw_10dijkstra3d_23_execute_dijkstra(PyObject *__pyx_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 715, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_dijkstra", 0, 6, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 917, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._execute_dijkstra", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10dijkstra3d_22_execute_dijkstra(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_v_connectivity, __pyx_v_bidirectional, __pyx_v_compass, __pyx_v_compass_norm, __pyx_v_voxel_graph); + __pyx_r = __pyx_pf_10dijkstra3d_24_execute_dijkstra(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_target, __pyx_v_connectivity, __pyx_v_bidirectional, __pyx_v_compass, __pyx_v_compass_norm, __pyx_v_voxel_graph); - /* "dijkstra3d.pyx":715 + /* "dijkstra3d.pyx":917 * return output[::-1] * * def _execute_dijkstra( # <<<<<<<<<<<<<< @@ -13936,7 +16222,7 @@ static PyObject *__pyx_pw_10dijkstra3d_23_execute_dijkstra(PyObject *__pyx_self, return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, int __pyx_v_connectivity, PyObject *__pyx_v_bidirectional, PyObject *__pyx_v_compass, float __pyx_v_compass_norm, PyObject *__pyx_v_voxel_graph) { +static PyObject *__pyx_pf_10dijkstra3d_24_execute_dijkstra(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_target, int __pyx_v_connectivity, PyObject *__pyx_v_bidirectional, PyObject *__pyx_v_compass, float __pyx_v_compass_norm, PyObject *__pyx_v_voxel_graph) { __Pyx_memviewslice __pyx_v_arr_memview8 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arr_memview16 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arr_memview32 = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -13989,7 +16275,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_execute_dijkstra", 0); - /* "dijkstra3d.pyx":728 + /* "dijkstra3d.pyx":930 * * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL # <<<<<<<<<<<<<< @@ -13998,7 +16284,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_voxel_graph_ptr = NULL; - /* "dijkstra3d.pyx":729 + /* "dijkstra3d.pyx":931 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -14009,19 +16295,19 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":730 + /* "dijkstra3d.pyx":932 * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: * voxel_graph_memview = voxel_graph # <<<<<<<<<<<<<< * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * */ - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 932, __pyx_L1_error) __pyx_v_voxel_graph_memview = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "dijkstra3d.pyx":731 + /* "dijkstra3d.pyx":933 * if voxel_graph is not None: * voxel_graph_memview = voxel_graph * voxel_graph_ptr = &voxel_graph_memview[0,0,0] # <<<<<<<<<<<<<< @@ -14046,11 +16332,11 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_voxel_graph_memview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 731, __pyx_L1_error) + __PYX_ERR(0, 933, __pyx_L1_error) } __pyx_v_voxel_graph_ptr = ((uint32_t *)(&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_voxel_graph_memview.data + __pyx_t_4 * __pyx_v_voxel_graph_memview.strides[0]) ) + __pyx_t_5 * __pyx_v_voxel_graph_memview.strides[1]) ) + __pyx_t_6 * __pyx_v_voxel_graph_memview.strides[2]) ))))); - /* "dijkstra3d.pyx":729 + /* "dijkstra3d.pyx":931 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -14059,145 +16345,145 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ } - /* "dijkstra3d.pyx":733 + /* "dijkstra3d.pyx":935 * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * * cdef size_t sx = data.shape[0] # <<<<<<<<<<<<<< * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 733, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 733, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sx = __pyx_t_10; - /* "dijkstra3d.pyx":734 + /* "dijkstra3d.pyx":936 * * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] # <<<<<<<<<<<<<< * cdef size_t sz = data.shape[2] * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_sy = __pyx_t_10; - /* "dijkstra3d.pyx":735 + /* "dijkstra3d.pyx":937 * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] # <<<<<<<<<<<<<< * * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sz = __pyx_t_10; - /* "dijkstra3d.pyx":737 + /* "dijkstra3d.pyx":939 * cdef size_t sz = data.shape[2] * * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) # <<<<<<<<<<<<<< * cdef size_t sink = target[0] + sx * (target[1] + sy * target[2]) * */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Multiply(__pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_14 = PyNumber_Multiply(__pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_13); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_13); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_v_src = __pyx_t_10; - /* "dijkstra3d.pyx":738 + /* "dijkstra3d.pyx":940 * * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) * cdef size_t sink = target[0] + sx * (target[1] + sy * target[2]) # <<<<<<<<<<<<<< * * cdef vector[uint32_t] output32 */ - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_target, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_target, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_target, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyNumber_Multiply(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_12 = PyNumber_Multiply(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Multiply(__pyx_t_14, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_12 = PyNumber_Multiply(__pyx_t_14, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Add(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_11); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_11); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_sink = __pyx_t_10; - /* "dijkstra3d.pyx":743 + /* "dijkstra3d.pyx":945 * cdef vector[uint64_t] output64 * * sixtyfourbit = data.size > np.iinfo(np.uint32).max # <<<<<<<<<<<<<< * * dtype = data.dtype */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; @@ -14213,81 +16499,81 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_9); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 743, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_max); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_max); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_14, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_14, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_sixtyfourbit = __pyx_t_12; __pyx_t_12 = 0; - /* "dijkstra3d.pyx":745 + /* "dijkstra3d.pyx":947 * sixtyfourbit = data.size > np.iinfo(np.uint32).max * * dtype = data.dtype # <<<<<<<<<<<<<< * * if dtype == np.float32: */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_v_dtype = __pyx_t_12; __pyx_t_12 = 0; - /* "dijkstra3d.pyx":747 + /* "dijkstra3d.pyx":949 * dtype = data.dtype * * if dtype == np.float32: # <<<<<<<<<<<<<< * arr_memviewfloat = data * if bidirectional: */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_float32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_float32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_14, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_12 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_14, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_2) { - /* "dijkstra3d.pyx":748 + /* "dijkstra3d.pyx":950 * * if dtype == np.float32: * arr_memviewfloat = data # <<<<<<<<<<<<<< * if bidirectional: * if sixtyfourbit: */ - __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 748, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 950, __pyx_L1_error) __pyx_v_arr_memviewfloat = __pyx_t_15; __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL; - /* "dijkstra3d.pyx":749 + /* "dijkstra3d.pyx":951 * if dtype == np.float32: * arr_memviewfloat = data * if bidirectional: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[float, uint64_t]( */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 951, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":750 + /* "dijkstra3d.pyx":952 * arr_memviewfloat = data * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = bidirectional_dijkstra3d[float, uint64_t]( * &arr_memviewfloat[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 952, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":752 + /* "dijkstra3d.pyx":954 * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[float, uint64_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< @@ -14312,10 +16598,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 752, __pyx_L1_error) + __PYX_ERR(0, 954, __pyx_L1_error) } - /* "dijkstra3d.pyx":751 + /* "dijkstra3d.pyx":953 * if bidirectional: * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[float, uint64_t]( # <<<<<<<<<<<<<< @@ -14324,7 +16610,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::bidirectional_dijkstra3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":750 + /* "dijkstra3d.pyx":952 * arr_memviewfloat = data * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -14334,7 +16620,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L6; } - /* "dijkstra3d.pyx":758 + /* "dijkstra3d.pyx":960 * ) * else: * output32 = bidirectional_dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< @@ -14343,7 +16629,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":759 + /* "dijkstra3d.pyx":961 * else: * output32 = bidirectional_dijkstra3d[float, uint32_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< @@ -14368,10 +16654,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 759, __pyx_L1_error) + __PYX_ERR(0, 961, __pyx_L1_error) } - /* "dijkstra3d.pyx":758 + /* "dijkstra3d.pyx":960 * ) * else: * output32 = bidirectional_dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< @@ -14382,7 +16668,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L6:; - /* "dijkstra3d.pyx":749 + /* "dijkstra3d.pyx":951 * if dtype == np.float32: * arr_memviewfloat = data * if bidirectional: # <<<<<<<<<<<<<< @@ -14392,27 +16678,27 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L5; } - /* "dijkstra3d.pyx":764 + /* "dijkstra3d.pyx":966 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[float, uint64_t]( */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 966, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":765 + /* "dijkstra3d.pyx":967 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = compass_guided_dijkstra3d[float, uint64_t]( * &arr_memviewfloat[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 967, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":767 + /* "dijkstra3d.pyx":969 * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[float, uint64_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< @@ -14437,10 +16723,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 767, __pyx_L1_error) + __PYX_ERR(0, 969, __pyx_L1_error) } - /* "dijkstra3d.pyx":766 + /* "dijkstra3d.pyx":968 * elif compass: * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[float, uint64_t]( # <<<<<<<<<<<<<< @@ -14449,7 +16735,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::compass_guided_dijkstra3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_compass_norm, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":765 + /* "dijkstra3d.pyx":967 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -14459,7 +16745,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L7; } - /* "dijkstra3d.pyx":774 + /* "dijkstra3d.pyx":976 * ) * else: * output32 = compass_guided_dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< @@ -14468,7 +16754,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":775 + /* "dijkstra3d.pyx":977 * else: * output32 = compass_guided_dijkstra3d[float, uint32_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< @@ -14493,10 +16779,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 775, __pyx_L1_error) + __PYX_ERR(0, 977, __pyx_L1_error) } - /* "dijkstra3d.pyx":774 + /* "dijkstra3d.pyx":976 * ) * else: * output32 = compass_guided_dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< @@ -14507,7 +16793,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L7:; - /* "dijkstra3d.pyx":764 + /* "dijkstra3d.pyx":966 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< @@ -14517,7 +16803,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L5; } - /* "dijkstra3d.pyx":782 + /* "dijkstra3d.pyx":984 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -14525,10 +16811,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec * &arr_memviewfloat[0,0,0], */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 984, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":784 + /* "dijkstra3d.pyx":986 * if sixtyfourbit: * output64 = dijkstra3d[float, uint64_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< @@ -14553,10 +16839,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 784, __pyx_L1_error) + __PYX_ERR(0, 986, __pyx_L1_error) } - /* "dijkstra3d.pyx":783 + /* "dijkstra3d.pyx":985 * else: * if sixtyfourbit: * output64 = dijkstra3d[float, uint64_t]( # <<<<<<<<<<<<<< @@ -14565,7 +16851,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":782 + /* "dijkstra3d.pyx":984 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -14575,7 +16861,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L8; } - /* "dijkstra3d.pyx":790 + /* "dijkstra3d.pyx":992 * ) * else: * output32 = dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< @@ -14584,7 +16870,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":791 + /* "dijkstra3d.pyx":993 * else: * output32 = dijkstra3d[float, uint32_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< @@ -14609,10 +16895,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 791, __pyx_L1_error) + __PYX_ERR(0, 993, __pyx_L1_error) } - /* "dijkstra3d.pyx":790 + /* "dijkstra3d.pyx":992 * ) * else: * output32 = dijkstra3d[float, uint32_t]( # <<<<<<<<<<<<<< @@ -14625,7 +16911,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L5:; - /* "dijkstra3d.pyx":747 + /* "dijkstra3d.pyx":949 * dtype = data.dtype * * if dtype == np.float32: # <<<<<<<<<<<<<< @@ -14635,57 +16921,57 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L4; } - /* "dijkstra3d.pyx":796 + /* "dijkstra3d.pyx":998 * voxel_graph_ptr * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< * arr_memviewdouble = data * if bidirectional: */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 796, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_float64); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_float64); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_14, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_12 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_14, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_2) { - /* "dijkstra3d.pyx":797 + /* "dijkstra3d.pyx":999 * ) * elif dtype == np.float64: * arr_memviewdouble = data # <<<<<<<<<<<<<< * if bidirectional: * if sixtyfourbit: */ - __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 797, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 999, __pyx_L1_error) __pyx_v_arr_memviewdouble = __pyx_t_16; __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL; - /* "dijkstra3d.pyx":798 + /* "dijkstra3d.pyx":1000 * elif dtype == np.float64: * arr_memviewdouble = data * if bidirectional: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[double, uint64_t]( */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1000, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":799 + /* "dijkstra3d.pyx":1001 * arr_memviewdouble = data * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = bidirectional_dijkstra3d[double, uint64_t]( * &arr_memviewdouble[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 799, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1001, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":801 + /* "dijkstra3d.pyx":1003 * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[double, uint64_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< @@ -14710,10 +16996,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 801, __pyx_L1_error) + __PYX_ERR(0, 1003, __pyx_L1_error) } - /* "dijkstra3d.pyx":800 + /* "dijkstra3d.pyx":1002 * if bidirectional: * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[double, uint64_t]( # <<<<<<<<<<<<<< @@ -14722,7 +17008,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::bidirectional_dijkstra3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":799 + /* "dijkstra3d.pyx":1001 * arr_memviewdouble = data * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -14732,7 +17018,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L10; } - /* "dijkstra3d.pyx":807 + /* "dijkstra3d.pyx":1009 * ) * else: * output32 = bidirectional_dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< @@ -14741,7 +17027,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":808 + /* "dijkstra3d.pyx":1010 * else: * output32 = bidirectional_dijkstra3d[double, uint32_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< @@ -14766,10 +17052,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 808, __pyx_L1_error) + __PYX_ERR(0, 1010, __pyx_L1_error) } - /* "dijkstra3d.pyx":807 + /* "dijkstra3d.pyx":1009 * ) * else: * output32 = bidirectional_dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< @@ -14780,7 +17066,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L10:; - /* "dijkstra3d.pyx":798 + /* "dijkstra3d.pyx":1000 * elif dtype == np.float64: * arr_memviewdouble = data * if bidirectional: # <<<<<<<<<<<<<< @@ -14790,27 +17076,27 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L9; } - /* "dijkstra3d.pyx":813 + /* "dijkstra3d.pyx":1015 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[double, uint64_t]( */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 813, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1015, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":814 + /* "dijkstra3d.pyx":1016 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = compass_guided_dijkstra3d[double, uint64_t]( * &arr_memviewdouble[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1016, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":816 + /* "dijkstra3d.pyx":1018 * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[double, uint64_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< @@ -14835,10 +17121,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 1018, __pyx_L1_error) } - /* "dijkstra3d.pyx":815 + /* "dijkstra3d.pyx":1017 * elif compass: * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[double, uint64_t]( # <<<<<<<<<<<<<< @@ -14847,7 +17133,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::compass_guided_dijkstra3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_compass_norm, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":814 + /* "dijkstra3d.pyx":1016 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -14857,7 +17143,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L11; } - /* "dijkstra3d.pyx":823 + /* "dijkstra3d.pyx":1025 * ) * else: * output32 = compass_guided_dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< @@ -14866,7 +17152,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":824 + /* "dijkstra3d.pyx":1026 * else: * output32 = compass_guided_dijkstra3d[double, uint32_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< @@ -14891,10 +17177,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 824, __pyx_L1_error) + __PYX_ERR(0, 1026, __pyx_L1_error) } - /* "dijkstra3d.pyx":823 + /* "dijkstra3d.pyx":1025 * ) * else: * output32 = compass_guided_dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< @@ -14905,7 +17191,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L11:; - /* "dijkstra3d.pyx":813 + /* "dijkstra3d.pyx":1015 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< @@ -14915,7 +17201,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L9; } - /* "dijkstra3d.pyx":831 + /* "dijkstra3d.pyx":1033 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -14923,10 +17209,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec * &arr_memviewdouble[0,0,0], */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1033, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":833 + /* "dijkstra3d.pyx":1035 * if sixtyfourbit: * output64 = dijkstra3d[double, uint64_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< @@ -14951,10 +17237,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 833, __pyx_L1_error) + __PYX_ERR(0, 1035, __pyx_L1_error) } - /* "dijkstra3d.pyx":832 + /* "dijkstra3d.pyx":1034 * else: * if sixtyfourbit: * output64 = dijkstra3d[double, uint64_t]( # <<<<<<<<<<<<<< @@ -14963,7 +17249,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":831 + /* "dijkstra3d.pyx":1033 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -14973,7 +17259,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L12; } - /* "dijkstra3d.pyx":839 + /* "dijkstra3d.pyx":1041 * ) * else: * output32 = dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< @@ -14982,7 +17268,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":840 + /* "dijkstra3d.pyx":1042 * else: * output32 = dijkstra3d[double, uint32_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< @@ -15007,10 +17293,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 840, __pyx_L1_error) + __PYX_ERR(0, 1042, __pyx_L1_error) } - /* "dijkstra3d.pyx":839 + /* "dijkstra3d.pyx":1041 * ) * else: * output32 = dijkstra3d[double, uint32_t]( # <<<<<<<<<<<<<< @@ -15023,7 +17309,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L9:; - /* "dijkstra3d.pyx":796 + /* "dijkstra3d.pyx":998 * voxel_graph_ptr * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< @@ -15033,7 +17319,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L4; } - /* "dijkstra3d.pyx":845 + /* "dijkstra3d.pyx":1047 * voxel_graph_ptr * ) * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< @@ -15042,28 +17328,28 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_12 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 845, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 845, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L13_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 845, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 845, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L13_bool_binop_done:; @@ -15071,18 +17357,18 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "dijkstra3d.pyx":846 + /* "dijkstra3d.pyx":1048 * ) * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) # <<<<<<<<<<<<<< * if bidirectional: * if sixtyfourbit: */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -15098,36 +17384,36 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_12 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 846, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_12, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_12, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_v_arr_memview64 = __pyx_t_17; __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL; - /* "dijkstra3d.pyx":847 + /* "dijkstra3d.pyx":1049 * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) * if bidirectional: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint64_t, uint64_t]( */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1049, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":848 + /* "dijkstra3d.pyx":1050 * arr_memview64 = data.astype(np.uint64) * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = bidirectional_dijkstra3d[uint64_t, uint64_t]( * &arr_memview64[0,0,0], */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1050, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":850 + /* "dijkstra3d.pyx":1052 * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint64_t, uint64_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< @@ -15152,10 +17438,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 850, __pyx_L1_error) + __PYX_ERR(0, 1052, __pyx_L1_error) } - /* "dijkstra3d.pyx":849 + /* "dijkstra3d.pyx":1051 * if bidirectional: * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint64_t, uint64_t]( # <<<<<<<<<<<<<< @@ -15164,7 +17450,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::bidirectional_dijkstra3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_6 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":848 + /* "dijkstra3d.pyx":1050 * arr_memview64 = data.astype(np.uint64) * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -15174,7 +17460,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L16; } - /* "dijkstra3d.pyx":856 + /* "dijkstra3d.pyx":1058 * ) * else: * output32 = bidirectional_dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15183,7 +17469,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":857 + /* "dijkstra3d.pyx":1059 * else: * output32 = bidirectional_dijkstra3d[uint64_t, uint32_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< @@ -15208,10 +17494,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 857, __pyx_L1_error) + __PYX_ERR(0, 1059, __pyx_L1_error) } - /* "dijkstra3d.pyx":856 + /* "dijkstra3d.pyx":1058 * ) * else: * output32 = bidirectional_dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15222,7 +17508,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L16:; - /* "dijkstra3d.pyx":847 + /* "dijkstra3d.pyx":1049 * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) * if bidirectional: # <<<<<<<<<<<<<< @@ -15232,27 +17518,27 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L15; } - /* "dijkstra3d.pyx":862 + /* "dijkstra3d.pyx":1064 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint64_t, uint64_t]( */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1064, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":863 + /* "dijkstra3d.pyx":1065 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = compass_guided_dijkstra3d[uint64_t, uint64_t]( * &arr_memview64[0,0,0], */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 863, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1065, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":865 + /* "dijkstra3d.pyx":1067 * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint64_t, uint64_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< @@ -15277,10 +17563,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 865, __pyx_L1_error) + __PYX_ERR(0, 1067, __pyx_L1_error) } - /* "dijkstra3d.pyx":864 + /* "dijkstra3d.pyx":1066 * elif compass: * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint64_t, uint64_t]( # <<<<<<<<<<<<<< @@ -15289,7 +17575,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::compass_guided_dijkstra3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_6 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_compass_norm, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":863 + /* "dijkstra3d.pyx":1065 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -15299,7 +17585,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L17; } - /* "dijkstra3d.pyx":872 + /* "dijkstra3d.pyx":1074 * ) * else: * output32 = compass_guided_dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15308,7 +17594,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":873 + /* "dijkstra3d.pyx":1075 * else: * output32 = compass_guided_dijkstra3d[uint64_t, uint32_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< @@ -15333,10 +17619,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 873, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "dijkstra3d.pyx":872 + /* "dijkstra3d.pyx":1074 * ) * else: * output32 = compass_guided_dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15347,7 +17633,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L17:; - /* "dijkstra3d.pyx":862 + /* "dijkstra3d.pyx":1064 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< @@ -15357,7 +17643,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L15; } - /* "dijkstra3d.pyx":880 + /* "dijkstra3d.pyx":1082 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -15365,10 +17651,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec * &arr_memview64[0,0,0], */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1082, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":882 + /* "dijkstra3d.pyx":1084 * if sixtyfourbit: * output64 = dijkstra3d[uint64_t, uint64_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< @@ -15393,10 +17679,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 882, __pyx_L1_error) + __PYX_ERR(0, 1084, __pyx_L1_error) } - /* "dijkstra3d.pyx":881 + /* "dijkstra3d.pyx":1083 * else: * if sixtyfourbit: * output64 = dijkstra3d[uint64_t, uint64_t]( # <<<<<<<<<<<<<< @@ -15405,7 +17691,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_6 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":880 + /* "dijkstra3d.pyx":1082 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -15415,7 +17701,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L18; } - /* "dijkstra3d.pyx":888 + /* "dijkstra3d.pyx":1090 * ) * else: * output32 = dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15424,7 +17710,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":889 + /* "dijkstra3d.pyx":1091 * else: * output32 = dijkstra3d[uint64_t, uint32_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< @@ -15449,10 +17735,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 889, __pyx_L1_error) + __PYX_ERR(0, 1091, __pyx_L1_error) } - /* "dijkstra3d.pyx":888 + /* "dijkstra3d.pyx":1090 * ) * else: * output32 = dijkstra3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15465,7 +17751,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L15:; - /* "dijkstra3d.pyx":845 + /* "dijkstra3d.pyx":1047 * voxel_graph_ptr * ) * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< @@ -15475,7 +17761,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L4; } - /* "dijkstra3d.pyx":894 + /* "dijkstra3d.pyx":1096 * voxel_graph_ptr * ) * elif dtype in (np.int32, np.uint32): # <<<<<<<<<<<<<< @@ -15484,28 +17770,28 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_12 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L19_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_uint32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_uint32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; @@ -15513,18 +17799,18 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":895 + /* "dijkstra3d.pyx":1097 * ) * elif dtype in (np.int32, np.uint32): * arr_memview32 = data.astype(np.uint32) # <<<<<<<<<<<<<< * if bidirectional: * if sixtyfourbit: */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 895, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 895, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 895, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -15540,36 +17826,36 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_12 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 895, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_12, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 895, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_12, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_v_arr_memview32 = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "dijkstra3d.pyx":896 + /* "dijkstra3d.pyx":1098 * elif dtype in (np.int32, np.uint32): * arr_memview32 = data.astype(np.uint32) * if bidirectional: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint32_t, uint64_t]( */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1098, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":897 + /* "dijkstra3d.pyx":1099 * arr_memview32 = data.astype(np.uint32) * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = bidirectional_dijkstra3d[uint32_t, uint64_t]( * &arr_memview32[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 897, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1099, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":899 + /* "dijkstra3d.pyx":1101 * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint32_t, uint64_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -15594,10 +17880,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 899, __pyx_L1_error) + __PYX_ERR(0, 1101, __pyx_L1_error) } - /* "dijkstra3d.pyx":898 + /* "dijkstra3d.pyx":1100 * if bidirectional: * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint32_t, uint64_t]( # <<<<<<<<<<<<<< @@ -15606,7 +17892,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::bidirectional_dijkstra3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32.data + __pyx_t_6 * __pyx_v_arr_memview32.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview32.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview32.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":897 + /* "dijkstra3d.pyx":1099 * arr_memview32 = data.astype(np.uint32) * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -15616,7 +17902,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L22; } - /* "dijkstra3d.pyx":905 + /* "dijkstra3d.pyx":1107 * ) * else: * output32 = bidirectional_dijkstra3d[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15625,7 +17911,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":906 + /* "dijkstra3d.pyx":1108 * else: * output32 = bidirectional_dijkstra3d[uint32_t, uint32_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -15650,10 +17936,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 906, __pyx_L1_error) + __PYX_ERR(0, 1108, __pyx_L1_error) } - /* "dijkstra3d.pyx":905 + /* "dijkstra3d.pyx":1107 * ) * else: * output32 = bidirectional_dijkstra3d[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15664,7 +17950,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L22:; - /* "dijkstra3d.pyx":896 + /* "dijkstra3d.pyx":1098 * elif dtype in (np.int32, np.uint32): * arr_memview32 = data.astype(np.uint32) * if bidirectional: # <<<<<<<<<<<<<< @@ -15674,27 +17960,27 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L21; } - /* "dijkstra3d.pyx":911 + /* "dijkstra3d.pyx":1113 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint32_t, uint64_t]( */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 911, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1113, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":912 + /* "dijkstra3d.pyx":1114 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = compass_guided_dijkstra3d[uint32_t, uint64_t]( * &arr_memview32[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 912, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1114, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":914 + /* "dijkstra3d.pyx":1116 * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint32_t, uint64_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -15719,10 +18005,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 914, __pyx_L1_error) + __PYX_ERR(0, 1116, __pyx_L1_error) } - /* "dijkstra3d.pyx":913 + /* "dijkstra3d.pyx":1115 * elif compass: * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint32_t, uint64_t]( # <<<<<<<<<<<<<< @@ -15731,7 +18017,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::compass_guided_dijkstra3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32.data + __pyx_t_6 * __pyx_v_arr_memview32.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview32.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview32.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_compass_norm, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":912 + /* "dijkstra3d.pyx":1114 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -15741,7 +18027,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L23; } - /* "dijkstra3d.pyx":921 + /* "dijkstra3d.pyx":1123 * ) * else: * output32 = compass_guided_dijkstra3d[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15750,7 +18036,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":922 + /* "dijkstra3d.pyx":1124 * else: * output32 = compass_guided_dijkstra3d[uint32_t, uint32_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -15775,10 +18061,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 922, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "dijkstra3d.pyx":921 + /* "dijkstra3d.pyx":1123 * ) * else: * output32 = compass_guided_dijkstra3d[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15789,7 +18075,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L23:; - /* "dijkstra3d.pyx":911 + /* "dijkstra3d.pyx":1113 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< @@ -15799,7 +18085,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L21; } - /* "dijkstra3d.pyx":929 + /* "dijkstra3d.pyx":1131 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -15807,10 +18093,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec * &arr_memview32[0,0,0], */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1131, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":931 + /* "dijkstra3d.pyx":1133 * if sixtyfourbit: * output64 = dijkstra3d[uint32_t, uint64_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -15835,10 +18121,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 931, __pyx_L1_error) + __PYX_ERR(0, 1133, __pyx_L1_error) } - /* "dijkstra3d.pyx":930 + /* "dijkstra3d.pyx":1132 * else: * if sixtyfourbit: * output64 = dijkstra3d[uint32_t, uint64_t]( # <<<<<<<<<<<<<< @@ -15847,7 +18133,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32.data + __pyx_t_6 * __pyx_v_arr_memview32.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview32.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview32.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":929 + /* "dijkstra3d.pyx":1131 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -15857,7 +18143,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L24; } - /* "dijkstra3d.pyx":937 + /* "dijkstra3d.pyx":1139 * ) * else: * output32 = dijkstra3d[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15866,7 +18152,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":938 + /* "dijkstra3d.pyx":1140 * else: * output32 = dijkstra3d[uint32_t, uint32_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -15891,10 +18177,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 938, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } - /* "dijkstra3d.pyx":937 + /* "dijkstra3d.pyx":1139 * ) * else: * output32 = dijkstra3d[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -15907,7 +18193,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L21:; - /* "dijkstra3d.pyx":894 + /* "dijkstra3d.pyx":1096 * voxel_graph_ptr * ) * elif dtype in (np.int32, np.uint32): # <<<<<<<<<<<<<< @@ -15917,7 +18203,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L4; } - /* "dijkstra3d.pyx":943 + /* "dijkstra3d.pyx":1145 * voxel_graph_ptr * ) * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< @@ -15926,28 +18212,28 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_12 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 943, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_int16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_int16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L25_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 943, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L25_bool_binop_done:; @@ -15955,18 +18241,18 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "dijkstra3d.pyx":944 + /* "dijkstra3d.pyx":1146 * ) * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) # <<<<<<<<<<<<<< * if bidirectional: * if sixtyfourbit: */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 944, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 944, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 944, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -15982,36 +18268,36 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_12 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 944, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_12, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 944, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_12, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_v_arr_memview16 = __pyx_t_18; __pyx_t_18.memview = NULL; __pyx_t_18.data = NULL; - /* "dijkstra3d.pyx":945 + /* "dijkstra3d.pyx":1147 * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) * if bidirectional: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint16_t, uint64_t]( */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1147, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":946 + /* "dijkstra3d.pyx":1148 * arr_memview16 = data.astype(np.uint16) * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = bidirectional_dijkstra3d[uint16_t, uint64_t]( * &arr_memview16[0,0,0], */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":948 + /* "dijkstra3d.pyx":1150 * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint16_t, uint64_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -16036,10 +18322,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 948, __pyx_L1_error) + __PYX_ERR(0, 1150, __pyx_L1_error) } - /* "dijkstra3d.pyx":947 + /* "dijkstra3d.pyx":1149 * if bidirectional: * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint16_t, uint64_t]( # <<<<<<<<<<<<<< @@ -16048,7 +18334,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::bidirectional_dijkstra3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16.data + __pyx_t_6 * __pyx_v_arr_memview16.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview16.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview16.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":946 + /* "dijkstra3d.pyx":1148 * arr_memview16 = data.astype(np.uint16) * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -16058,7 +18344,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L28; } - /* "dijkstra3d.pyx":954 + /* "dijkstra3d.pyx":1156 * ) * else: * output32 = bidirectional_dijkstra3d[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16067,7 +18353,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":955 + /* "dijkstra3d.pyx":1157 * else: * output32 = bidirectional_dijkstra3d[uint16_t, uint32_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -16092,10 +18378,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 955, __pyx_L1_error) + __PYX_ERR(0, 1157, __pyx_L1_error) } - /* "dijkstra3d.pyx":954 + /* "dijkstra3d.pyx":1156 * ) * else: * output32 = bidirectional_dijkstra3d[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16106,7 +18392,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L28:; - /* "dijkstra3d.pyx":945 + /* "dijkstra3d.pyx":1147 * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) * if bidirectional: # <<<<<<<<<<<<<< @@ -16116,27 +18402,27 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L27; } - /* "dijkstra3d.pyx":960 + /* "dijkstra3d.pyx":1162 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint16_t, uint64_t]( */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1162, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":961 + /* "dijkstra3d.pyx":1163 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = compass_guided_dijkstra3d[uint16_t, uint64_t]( * &arr_memview16[0,0,0], */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 961, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1163, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":963 + /* "dijkstra3d.pyx":1165 * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint16_t, uint64_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -16161,10 +18447,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 963, __pyx_L1_error) + __PYX_ERR(0, 1165, __pyx_L1_error) } - /* "dijkstra3d.pyx":962 + /* "dijkstra3d.pyx":1164 * elif compass: * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint16_t, uint64_t]( # <<<<<<<<<<<<<< @@ -16173,7 +18459,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::compass_guided_dijkstra3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16.data + __pyx_t_6 * __pyx_v_arr_memview16.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview16.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview16.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_compass_norm, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":961 + /* "dijkstra3d.pyx":1163 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -16183,7 +18469,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L29; } - /* "dijkstra3d.pyx":970 + /* "dijkstra3d.pyx":1172 * ) * else: * output32 = compass_guided_dijkstra3d[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16192,7 +18478,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":971 + /* "dijkstra3d.pyx":1173 * else: * output32 = compass_guided_dijkstra3d[uint16_t, uint32_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -16217,10 +18503,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 971, __pyx_L1_error) + __PYX_ERR(0, 1173, __pyx_L1_error) } - /* "dijkstra3d.pyx":970 + /* "dijkstra3d.pyx":1172 * ) * else: * output32 = compass_guided_dijkstra3d[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16231,7 +18517,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L29:; - /* "dijkstra3d.pyx":960 + /* "dijkstra3d.pyx":1162 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< @@ -16241,7 +18527,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L27; } - /* "dijkstra3d.pyx":978 + /* "dijkstra3d.pyx":1180 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -16249,10 +18535,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec * &arr_memview16[0,0,0], */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 978, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1180, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":980 + /* "dijkstra3d.pyx":1182 * if sixtyfourbit: * output64 = dijkstra3d[uint16_t, uint64_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -16277,10 +18563,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 980, __pyx_L1_error) + __PYX_ERR(0, 1182, __pyx_L1_error) } - /* "dijkstra3d.pyx":979 + /* "dijkstra3d.pyx":1181 * else: * if sixtyfourbit: * output64 = dijkstra3d[uint16_t, uint64_t]( # <<<<<<<<<<<<<< @@ -16289,7 +18575,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16.data + __pyx_t_6 * __pyx_v_arr_memview16.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview16.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview16.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":978 + /* "dijkstra3d.pyx":1180 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -16299,7 +18585,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L30; } - /* "dijkstra3d.pyx":986 + /* "dijkstra3d.pyx":1188 * ) * else: * output32 = dijkstra3d[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16308,7 +18594,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":987 + /* "dijkstra3d.pyx":1189 * else: * output32 = dijkstra3d[uint16_t, uint32_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -16333,10 +18619,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 987, __pyx_L1_error) + __PYX_ERR(0, 1189, __pyx_L1_error) } - /* "dijkstra3d.pyx":986 + /* "dijkstra3d.pyx":1188 * ) * else: * output32 = dijkstra3d[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16349,7 +18635,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L27:; - /* "dijkstra3d.pyx":943 + /* "dijkstra3d.pyx":1145 * voxel_graph_ptr * ) * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< @@ -16359,7 +18645,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L4; } - /* "dijkstra3d.pyx":992 + /* "dijkstra3d.pyx":1194 * voxel_graph_ptr * ) * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -16368,36 +18654,36 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_12 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_int8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_int8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L31_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_uint8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_uint8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L31_bool_binop_done; } - __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 992, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_12, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L31_bool_binop_done:; @@ -16405,18 +18691,18 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":993 + /* "dijkstra3d.pyx":1195 * ) * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) # <<<<<<<<<<<<<< * if bidirectional: * if sixtyfourbit: */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -16432,36 +18718,36 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_12 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 993, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_12, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_12, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_v_arr_memview8 = __pyx_t_19; __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL; - /* "dijkstra3d.pyx":994 + /* "dijkstra3d.pyx":1196 * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) * if bidirectional: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint8_t, uint64_t]( */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 994, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1196, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":995 + /* "dijkstra3d.pyx":1197 * arr_memview8 = data.astype(np.uint8) * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = bidirectional_dijkstra3d[uint8_t, uint64_t]( * &arr_memview8[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 995, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":997 + /* "dijkstra3d.pyx":1199 * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint8_t, uint64_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -16486,10 +18772,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 997, __pyx_L1_error) + __PYX_ERR(0, 1199, __pyx_L1_error) } - /* "dijkstra3d.pyx":996 + /* "dijkstra3d.pyx":1198 * if bidirectional: * if sixtyfourbit: * output64 = bidirectional_dijkstra3d[uint8_t, uint64_t]( # <<<<<<<<<<<<<< @@ -16498,7 +18784,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::bidirectional_dijkstra3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8.data + __pyx_t_6 * __pyx_v_arr_memview8.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview8.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview8.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":995 + /* "dijkstra3d.pyx":1197 * arr_memview8 = data.astype(np.uint8) * if bidirectional: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -16508,7 +18794,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L35; } - /* "dijkstra3d.pyx":1003 + /* "dijkstra3d.pyx":1205 * ) * else: * output32 = bidirectional_dijkstra3d[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16517,7 +18803,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":1004 + /* "dijkstra3d.pyx":1206 * else: * output32 = bidirectional_dijkstra3d[uint8_t, uint32_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -16542,10 +18828,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1004, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } - /* "dijkstra3d.pyx":1003 + /* "dijkstra3d.pyx":1205 * ) * else: * output32 = bidirectional_dijkstra3d[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16556,7 +18842,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L35:; - /* "dijkstra3d.pyx":994 + /* "dijkstra3d.pyx":1196 * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) * if bidirectional: # <<<<<<<<<<<<<< @@ -16566,27 +18852,27 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L34; } - /* "dijkstra3d.pyx":1009 + /* "dijkstra3d.pyx":1211 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint8_t, uint64_t]( */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1009, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compass); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1211, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1010 + /* "dijkstra3d.pyx":1212 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< * output64 = compass_guided_dijkstra3d[uint8_t, uint64_t]( * &arr_memview8[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1010, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1212, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1012 + /* "dijkstra3d.pyx":1214 * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint8_t, uint64_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -16611,10 +18897,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1012, __pyx_L1_error) + __PYX_ERR(0, 1214, __pyx_L1_error) } - /* "dijkstra3d.pyx":1011 + /* "dijkstra3d.pyx":1213 * elif compass: * if sixtyfourbit: * output64 = compass_guided_dijkstra3d[uint8_t, uint64_t]( # <<<<<<<<<<<<<< @@ -16623,7 +18909,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::compass_guided_dijkstra3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8.data + __pyx_t_6 * __pyx_v_arr_memview8.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview8.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview8.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_compass_norm, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":1010 + /* "dijkstra3d.pyx":1212 * ) * elif compass: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -16633,7 +18919,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L36; } - /* "dijkstra3d.pyx":1019 + /* "dijkstra3d.pyx":1221 * ) * else: * output32 = compass_guided_dijkstra3d[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16642,7 +18928,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":1020 + /* "dijkstra3d.pyx":1222 * else: * output32 = compass_guided_dijkstra3d[uint8_t, uint32_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -16667,10 +18953,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1020, __pyx_L1_error) + __PYX_ERR(0, 1222, __pyx_L1_error) } - /* "dijkstra3d.pyx":1019 + /* "dijkstra3d.pyx":1221 * ) * else: * output32 = compass_guided_dijkstra3d[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16681,7 +18967,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L36:; - /* "dijkstra3d.pyx":1009 + /* "dijkstra3d.pyx":1211 * voxel_graph_ptr * ) * elif compass: # <<<<<<<<<<<<<< @@ -16691,7 +18977,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L34; } - /* "dijkstra3d.pyx":1027 + /* "dijkstra3d.pyx":1229 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -16699,10 +18985,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec * &arr_memview8[0,0,0], */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1029 + /* "dijkstra3d.pyx":1231 * if sixtyfourbit: * output64 = dijkstra3d[uint8_t, uint64_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -16727,10 +19013,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1029, __pyx_L1_error) + __PYX_ERR(0, 1231, __pyx_L1_error) } - /* "dijkstra3d.pyx":1028 + /* "dijkstra3d.pyx":1230 * else: * if sixtyfourbit: * output64 = dijkstra3d[uint8_t, uint64_t]( # <<<<<<<<<<<<<< @@ -16739,7 +19025,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output64 = ((std::vector )dijkstra::dijkstra3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8.data + __pyx_t_6 * __pyx_v_arr_memview8.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview8.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview8.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_v_sink, __pyx_v_connectivity, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":1027 + /* "dijkstra3d.pyx":1229 * ) * else: * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -16749,7 +19035,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L37; } - /* "dijkstra3d.pyx":1035 + /* "dijkstra3d.pyx":1237 * ) * else: * output32 = dijkstra3d[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16758,7 +19044,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "dijkstra3d.pyx":1036 + /* "dijkstra3d.pyx":1238 * else: * output32 = dijkstra3d[uint8_t, uint32_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -16783,10 +19069,10 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1036, __pyx_L1_error) + __PYX_ERR(0, 1238, __pyx_L1_error) } - /* "dijkstra3d.pyx":1035 + /* "dijkstra3d.pyx":1237 * ) * else: * output32 = dijkstra3d[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -16799,7 +19085,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L34:; - /* "dijkstra3d.pyx":992 + /* "dijkstra3d.pyx":1194 * voxel_graph_ptr * ) * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -16809,17 +19095,17 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L4:; - /* "dijkstra3d.pyx":1048 + /* "dijkstra3d.pyx":1250 * cdef uint64_t[:] vec_view64 * * if sixtyfourbit: # <<<<<<<<<<<<<< * output_ptr64 = &output64[0] * if output64.size() == 0: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1048, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1250, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1049 + /* "dijkstra3d.pyx":1251 * * if sixtyfourbit: * output_ptr64 = &output64[0] # <<<<<<<<<<<<<< @@ -16828,7 +19114,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ __pyx_v_output_ptr64 = ((uint64_t *)(&(__pyx_v_output64[0]))); - /* "dijkstra3d.pyx":1050 + /* "dijkstra3d.pyx":1252 * if sixtyfourbit: * output_ptr64 = &output64[0] * if output64.size() == 0: # <<<<<<<<<<<<<< @@ -16838,7 +19124,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_2 = ((__pyx_v_output64.size() == 0) != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":1051 + /* "dijkstra3d.pyx":1253 * output_ptr64 = &output64[0] * if output64.size() == 0: * return np.zeros((0,), dtype=np.uint64) # <<<<<<<<<<<<<< @@ -16846,21 +19132,21 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec * buf = bytearray(vec_view64[:]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_zeros); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1051, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_zeros); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1051, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1051, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 1051, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__10, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1051, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__11, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -16868,7 +19154,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_9 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":1050 + /* "dijkstra3d.pyx":1252 * if sixtyfourbit: * output_ptr64 = &output64[0] * if output64.size() == 0: # <<<<<<<<<<<<<< @@ -16877,7 +19163,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ } - /* "dijkstra3d.pyx":1052 + /* "dijkstra3d.pyx":1254 * if output64.size() == 0: * return np.zeros((0,), dtype=np.uint64) * vec_view64 = output_ptr64 # <<<<<<<<<<<<<< @@ -16886,65 +19172,65 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ if (!__pyx_v_output_ptr64) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 1052, __pyx_L1_error) + __PYX_ERR(0, 1254, __pyx_L1_error) } - __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint64_t); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint64_t); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output64.size())); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output64.size())); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_20 = __pyx_array_new(__pyx_t_9, sizeof(uint64_t), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_v_output_ptr64); - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 1254, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; __pyx_v_vec_view64 = __pyx_t_21; __pyx_t_21.memview = NULL; __pyx_t_21.data = NULL; - /* "dijkstra3d.pyx":1053 + /* "dijkstra3d.pyx":1255 * return np.zeros((0,), dtype=np.uint64) * vec_view64 = output_ptr64 * buf = bytearray(vec_view64[:]) # <<<<<<<<<<<<<< * output = np.frombuffer(buf, dtype=np.uint64) * else: */ - __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_vec_view64, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint64_t, 0);; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1053, __pyx_L1_error) + __pyx_t_12 = __pyx_memoryview_fromslice(__pyx_v_vec_view64, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint64_t, 0);; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1053, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_v_buf = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; - /* "dijkstra3d.pyx":1054 + /* "dijkstra3d.pyx":1256 * vec_view64 = output_ptr64 * buf = bytearray(vec_view64[:]) * output = np.frombuffer(buf, dtype=np.uint64) # <<<<<<<<<<<<<< * else: * output_ptr32 = &output32[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1054, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_buf); - __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1054, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 1054, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -16952,7 +19238,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_v_output = __pyx_t_13; __pyx_t_13 = 0; - /* "dijkstra3d.pyx":1048 + /* "dijkstra3d.pyx":1250 * cdef uint64_t[:] vec_view64 * * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -16962,7 +19248,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec goto __pyx_L38; } - /* "dijkstra3d.pyx":1056 + /* "dijkstra3d.pyx":1258 * output = np.frombuffer(buf, dtype=np.uint64) * else: * output_ptr32 = &output32[0] # <<<<<<<<<<<<<< @@ -16972,7 +19258,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec /*else*/ { __pyx_v_output_ptr32 = ((uint32_t *)(&(__pyx_v_output32[0]))); - /* "dijkstra3d.pyx":1057 + /* "dijkstra3d.pyx":1259 * else: * output_ptr32 = &output32[0] * if output32.size() == 0: # <<<<<<<<<<<<<< @@ -16982,7 +19268,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_2 = ((__pyx_v_output32.size() == 0) != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":1058 + /* "dijkstra3d.pyx":1260 * output_ptr32 = &output32[0] * if output32.size() == 0: * return np.zeros((0,), dtype=np.uint32) # <<<<<<<<<<<<<< @@ -16990,21 +19276,21 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec * buf = bytearray(vec_view32[:]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_zeros); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1058, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_zeros); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1058, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1058, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 1058, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__10, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1058, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__11, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; @@ -17012,7 +19298,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_t_12 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":1057 + /* "dijkstra3d.pyx":1259 * else: * output_ptr32 = &output32[0] * if output32.size() == 0: # <<<<<<<<<<<<<< @@ -17021,7 +19307,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ } - /* "dijkstra3d.pyx":1059 + /* "dijkstra3d.pyx":1261 * if output32.size() == 0: * return np.zeros((0,), dtype=np.uint32) * vec_view32 = output_ptr32 # <<<<<<<<<<<<<< @@ -17030,65 +19316,65 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ if (!__pyx_v_output_ptr32) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1261, __pyx_L1_error) } - __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint32_t); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1059, __pyx_L1_error) + __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_uint32_t); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output32.size())); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1059, __pyx_L1_error) + __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_output32.size())); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_20 = __pyx_array_new(__pyx_t_12, sizeof(uint32_t), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_v_output_ptr32); - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1059, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 1059, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_t_20), PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; __pyx_v_vec_view32 = __pyx_t_22; __pyx_t_22.memview = NULL; __pyx_t_22.data = NULL; - /* "dijkstra3d.pyx":1060 + /* "dijkstra3d.pyx":1262 * return np.zeros((0,), dtype=np.uint32) * vec_view32 = output_ptr32 * buf = bytearray(vec_view32[:]) # <<<<<<<<<<<<<< * output = np.frombuffer(buf, dtype=np.uint32) * */ - __pyx_t_13 = __pyx_memoryview_fromslice(__pyx_v_vec_view32, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint32_t, 0);; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1060, __pyx_L1_error) + __pyx_t_13 = __pyx_memoryview_fromslice(__pyx_v_vec_view32, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_uint32_t, 0);; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1060, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_v_buf = ((PyObject*)__pyx_t_12); __pyx_t_12 = 0; - /* "dijkstra3d.pyx":1061 + /* "dijkstra3d.pyx":1263 * vec_view32 = output_ptr32 * buf = bytearray(vec_view32[:]) * output = np.frombuffer(buf, dtype=np.uint32) # <<<<<<<<<<<<<< * * if bidirectional: */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1061, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1061, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1061, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_buf); - __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1061, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1061, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1061, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 1061, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1061, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -17098,17 +19384,17 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec } __pyx_L38:; - /* "dijkstra3d.pyx":1063 + /* "dijkstra3d.pyx":1265 * output = np.frombuffer(buf, dtype=np.uint32) * * if bidirectional: # <<<<<<<<<<<<<< * return output * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1063, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_bidirectional); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1265, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1064 + /* "dijkstra3d.pyx":1266 * * if bidirectional: * return output # <<<<<<<<<<<<<< @@ -17120,7 +19406,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "dijkstra3d.pyx":1063 + /* "dijkstra3d.pyx":1265 * output = np.frombuffer(buf, dtype=np.uint32) * * if bidirectional: # <<<<<<<<<<<<<< @@ -17129,7 +19415,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ } - /* "dijkstra3d.pyx":1066 + /* "dijkstra3d.pyx":1268 * return output * else: * return output[::-1] # <<<<<<<<<<<<<< @@ -17138,14 +19424,14 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_slice__8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_slice__10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_r = __pyx_t_11; __pyx_t_11 = 0; goto __pyx_L0; } - /* "dijkstra3d.pyx":715 + /* "dijkstra3d.pyx":917 * return output[::-1] * * def _execute_dijkstra( # <<<<<<<<<<<<<< @@ -17191,7 +19477,7 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "dijkstra3d.pyx":1068 +/* "dijkstra3d.pyx":1270 * return output[::-1] * * def _execute_distance_field(data, sources, connectivity, voxel_graph): # <<<<<<<<<<<<<< @@ -17200,9 +19486,9 @@ static PyObject *__pyx_pf_10dijkstra3d_22_execute_dijkstra(CYTHON_UNUSED PyObjec */ /* Python wrapper */ -static PyObject *__pyx_pw_10dijkstra3d_25_execute_distance_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_10dijkstra3d_25_execute_distance_field = {"_execute_distance_field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_25_execute_distance_field, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10dijkstra3d_25_execute_distance_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_10dijkstra3d_27_execute_distance_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_10dijkstra3d_27_execute_distance_field = {"_execute_distance_field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_27_execute_distance_field, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10dijkstra3d_27_execute_distance_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_sources = 0; PyObject *__pyx_v_connectivity = 0; @@ -17240,23 +19526,23 @@ static PyObject *__pyx_pw_10dijkstra3d_25_execute_distance_field(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sources)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_distance_field", 1, 4, 4, 1); __PYX_ERR(0, 1068, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_distance_field", 1, 4, 4, 1); __PYX_ERR(0, 1270, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connectivity)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_distance_field", 1, 4, 4, 2); __PYX_ERR(0, 1068, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_distance_field", 1, 4, 4, 2); __PYX_ERR(0, 1270, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_voxel_graph)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_distance_field", 1, 4, 4, 3); __PYX_ERR(0, 1068, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_distance_field", 1, 4, 4, 3); __PYX_ERR(0, 1270, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_distance_field") < 0)) __PYX_ERR(0, 1068, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_distance_field") < 0)) __PYX_ERR(0, 1270, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -17273,20 +19559,20 @@ static PyObject *__pyx_pw_10dijkstra3d_25_execute_distance_field(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_execute_distance_field", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1068, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_distance_field", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1270, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._execute_distance_field", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10dijkstra3d_24_execute_distance_field(__pyx_self, __pyx_v_data, __pyx_v_sources, __pyx_v_connectivity, __pyx_v_voxel_graph); + __pyx_r = __pyx_pf_10dijkstra3d_26_execute_distance_field(__pyx_self, __pyx_v_data, __pyx_v_sources, __pyx_v_connectivity, __pyx_v_voxel_graph); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_sources, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph) { +static PyObject *__pyx_pf_10dijkstra3d_26_execute_distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_sources, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph) { __Pyx_memviewslice __pyx_v_arr_memview8 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arr_memview16 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arr_memview32 = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -17337,7 +19623,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_execute_distance_field", 0); - /* "dijkstra3d.pyx":1077 + /* "dijkstra3d.pyx":1279 * * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL # <<<<<<<<<<<<<< @@ -17346,7 +19632,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __pyx_v_voxel_graph_ptr = NULL; - /* "dijkstra3d.pyx":1078 + /* "dijkstra3d.pyx":1280 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -17357,19 +19643,19 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":1079 + /* "dijkstra3d.pyx":1281 * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: * voxel_graph_memview = voxel_graph # <<<<<<<<<<<<<< * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * */ - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1281, __pyx_L1_error) __pyx_v_voxel_graph_memview = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "dijkstra3d.pyx":1080 + /* "dijkstra3d.pyx":1282 * if voxel_graph is not None: * voxel_graph_memview = voxel_graph * voxel_graph_ptr = &voxel_graph_memview[0,0,0] # <<<<<<<<<<<<<< @@ -17394,11 +19680,11 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_v_voxel_graph_memview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1282, __pyx_L1_error) } __pyx_v_voxel_graph_ptr = ((uint32_t *)(&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_voxel_graph_memview.data + __pyx_t_4 * __pyx_v_voxel_graph_memview.strides[0]) ) + __pyx_t_5 * __pyx_v_voxel_graph_memview.strides[1]) ) + __pyx_t_6 * __pyx_v_voxel_graph_memview.strides[2]) ))))); - /* "dijkstra3d.pyx":1078 + /* "dijkstra3d.pyx":1280 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -17407,55 +19693,55 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ } - /* "dijkstra3d.pyx":1082 + /* "dijkstra3d.pyx":1284 * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * * cdef size_t sx = data.shape[0] # <<<<<<<<<<<<<< * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1082, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1082, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1082, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sx = __pyx_t_10; - /* "dijkstra3d.pyx":1083 + /* "dijkstra3d.pyx":1285 * * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] # <<<<<<<<<<<<<< * cdef size_t sz = data.shape[2] * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_sy = __pyx_t_10; - /* "dijkstra3d.pyx":1084 + /* "dijkstra3d.pyx":1286 * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] # <<<<<<<<<<<<<< * * cdef vector[size_t] src */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sz = __pyx_t_10; - /* "dijkstra3d.pyx":1087 + /* "dijkstra3d.pyx":1289 * * cdef vector[size_t] src * for source in sources: # <<<<<<<<<<<<<< @@ -17466,26 +19752,26 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_9 = __pyx_v_sources; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_sources); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_sources); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1289, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1289, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1289, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -17495,7 +19781,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1087, __pyx_L1_error) + else __PYX_ERR(0, 1289, __pyx_L1_error) } break; } @@ -17504,49 +19790,49 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __Pyx_XDECREF_SET(__pyx_v_source, __pyx_t_8); __pyx_t_8 = 0; - /* "dijkstra3d.pyx":1088 + /* "dijkstra3d.pyx":1290 * cdef vector[size_t] src * for source in sources: * src.push_back(source[0] + sx * (source[1] + sy * source[2])) # <<<<<<<<<<<<<< * * cdef float* dist */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = PyNumber_Multiply(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_17 = PyNumber_Multiply(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_16 = PyNumber_Add(__pyx_t_14, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyNumber_Multiply(__pyx_t_13, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_17 = PyNumber_Multiply(__pyx_t_13, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyNumber_Add(__pyx_t_8, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_16 = PyNumber_Add(__pyx_t_8, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_16); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_16); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; try { __pyx_v_src.push_back(__pyx_t_10); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1088, __pyx_L1_error) + __PYX_ERR(0, 1290, __pyx_L1_error) } - /* "dijkstra3d.pyx":1087 + /* "dijkstra3d.pyx":1289 * * cdef vector[size_t] src * for source in sources: # <<<<<<<<<<<<<< @@ -17556,65 +19842,65 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dijkstra3d.pyx":1091 + /* "dijkstra3d.pyx":1293 * * cdef float* dist * cdef size_t max_loc = data.size + 1 # <<<<<<<<<<<<<< * * dtype = data.dtype */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_16); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_16); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_v_max_loc = __pyx_t_10; - /* "dijkstra3d.pyx":1093 + /* "dijkstra3d.pyx":1295 * cdef size_t max_loc = data.size + 1 * * dtype = data.dtype # <<<<<<<<<<<<<< * * if dtype == np.float32: */ - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1093, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_v_dtype = __pyx_t_16; __pyx_t_16 = 0; - /* "dijkstra3d.pyx":1095 + /* "dijkstra3d.pyx":1297 * dtype = data.dtype * * if dtype == np.float32: # <<<<<<<<<<<<<< * arr_memviewfloat = data * dist = distance_field3d[float]( */ - __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1095, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_16 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (__pyx_t_2) { - /* "dijkstra3d.pyx":1096 + /* "dijkstra3d.pyx":1298 * * if dtype == np.float32: * arr_memviewfloat = data # <<<<<<<<<<<<<< * dist = distance_field3d[float]( * &arr_memviewfloat[0,0,0], */ - __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 1298, __pyx_L1_error) __pyx_v_arr_memviewfloat = __pyx_t_18; __pyx_t_18.memview = NULL; __pyx_t_18.data = NULL; - /* "dijkstra3d.pyx":1098 + /* "dijkstra3d.pyx":1300 * arr_memviewfloat = data * dist = distance_field3d[float]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< @@ -17639,19 +19925,19 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1098, __pyx_L1_error) + __PYX_ERR(0, 1300, __pyx_L1_error) } - /* "dijkstra3d.pyx":1100 + /* "dijkstra3d.pyx":1302 * &arr_memviewfloat[0,0,0], * sx, sy, sz, * src, connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr, max_loc * ) */ - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1302, __pyx_L1_error) - /* "dijkstra3d.pyx":1097 + /* "dijkstra3d.pyx":1299 * if dtype == np.float32: * arr_memviewfloat = data * dist = distance_field3d[float]( # <<<<<<<<<<<<<< @@ -17660,7 +19946,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __pyx_v_dist = dijkstra::distance_field3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_t_10, __pyx_v_voxel_graph_ptr, __pyx_v_max_loc); - /* "dijkstra3d.pyx":1095 + /* "dijkstra3d.pyx":1297 * dtype = data.dtype * * if dtype == np.float32: # <<<<<<<<<<<<<< @@ -17670,37 +19956,37 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P goto __pyx_L6; } - /* "dijkstra3d.pyx":1103 + /* "dijkstra3d.pyx":1305 * voxel_graph_ptr, max_loc * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< * arr_memviewdouble = data * dist = distance_field3d[double]( */ - __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1103, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_16 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (__pyx_t_2) { - /* "dijkstra3d.pyx":1104 + /* "dijkstra3d.pyx":1306 * ) * elif dtype == np.float64: * arr_memviewdouble = data # <<<<<<<<<<<<<< * dist = distance_field3d[double]( * &arr_memviewdouble[0,0,0], */ - __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 1306, __pyx_L1_error) __pyx_v_arr_memviewdouble = __pyx_t_19; __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL; - /* "dijkstra3d.pyx":1106 + /* "dijkstra3d.pyx":1308 * arr_memviewdouble = data * dist = distance_field3d[double]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< @@ -17725,19 +20011,19 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1106, __pyx_L1_error) + __PYX_ERR(0, 1308, __pyx_L1_error) } - /* "dijkstra3d.pyx":1108 + /* "dijkstra3d.pyx":1310 * &arr_memviewdouble[0,0,0], * sx, sy, sz, * src, connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr, max_loc * ) */ - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1310, __pyx_L1_error) - /* "dijkstra3d.pyx":1105 + /* "dijkstra3d.pyx":1307 * elif dtype == np.float64: * arr_memviewdouble = data * dist = distance_field3d[double]( # <<<<<<<<<<<<<< @@ -17746,7 +20032,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __pyx_v_dist = dijkstra::distance_field3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_t_10, __pyx_v_voxel_graph_ptr, __pyx_v_max_loc); - /* "dijkstra3d.pyx":1103 + /* "dijkstra3d.pyx":1305 * voxel_graph_ptr, max_loc * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< @@ -17756,7 +20042,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P goto __pyx_L6; } - /* "dijkstra3d.pyx":1111 + /* "dijkstra3d.pyx":1313 * voxel_graph_ptr, max_loc * ) * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< @@ -17765,28 +20051,28 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_16 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1111, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L7_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1111, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint64); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint64); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L7_bool_binop_done:; @@ -17794,18 +20080,18 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "dijkstra3d.pyx":1112 + /* "dijkstra3d.pyx":1314 * ) * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) # <<<<<<<<<<<<<< * dist = distance_field3d[uint64_t]( * &arr_memview64[0,0,0], */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = NULL; @@ -17821,16 +20107,16 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_16 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_17, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1112, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 1314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_v_arr_memview64 = __pyx_t_20; __pyx_t_20.memview = NULL; __pyx_t_20.data = NULL; - /* "dijkstra3d.pyx":1114 + /* "dijkstra3d.pyx":1316 * arr_memview64 = data.astype(np.uint64) * dist = distance_field3d[uint64_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< @@ -17855,19 +20141,19 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1114, __pyx_L1_error) + __PYX_ERR(0, 1316, __pyx_L1_error) } - /* "dijkstra3d.pyx":1116 + /* "dijkstra3d.pyx":1318 * &arr_memview64[0,0,0], * sx, sy, sz, * src, connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr, max_loc * ) */ - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1318, __pyx_L1_error) - /* "dijkstra3d.pyx":1113 + /* "dijkstra3d.pyx":1315 * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) * dist = distance_field3d[uint64_t]( # <<<<<<<<<<<<<< @@ -17876,7 +20162,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __pyx_v_dist = dijkstra::distance_field3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_6 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_t_10, __pyx_v_voxel_graph_ptr, __pyx_v_max_loc); - /* "dijkstra3d.pyx":1111 + /* "dijkstra3d.pyx":1313 * voxel_graph_ptr, max_loc * ) * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< @@ -17886,7 +20172,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P goto __pyx_L6; } - /* "dijkstra3d.pyx":1119 + /* "dijkstra3d.pyx":1321 * voxel_graph_ptr, max_loc * ) * elif dtype in (np.uint32, np.int32): # <<<<<<<<<<<<<< @@ -17895,28 +20181,28 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_16 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1119, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1119, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; @@ -17924,18 +20210,18 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":1120 + /* "dijkstra3d.pyx":1322 * ) * elif dtype in (np.uint32, np.int32): * arr_memview32 = data.astype(np.uint32) # <<<<<<<<<<<<<< * dist = distance_field3d[uint32_t]( * &arr_memview32[0,0,0], */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1120, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1120, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint32); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1120, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint32); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -17951,16 +20237,16 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_16 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_t_17) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_17); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1120, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1120, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_v_arr_memview32 = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "dijkstra3d.pyx":1122 + /* "dijkstra3d.pyx":1324 * arr_memview32 = data.astype(np.uint32) * dist = distance_field3d[uint32_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -17985,19 +20271,19 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1122, __pyx_L1_error) + __PYX_ERR(0, 1324, __pyx_L1_error) } - /* "dijkstra3d.pyx":1124 + /* "dijkstra3d.pyx":1326 * &arr_memview32[0,0,0], * sx, sy, sz, * src, connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr, max_loc * ) */ - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1326, __pyx_L1_error) - /* "dijkstra3d.pyx":1121 + /* "dijkstra3d.pyx":1323 * elif dtype in (np.uint32, np.int32): * arr_memview32 = data.astype(np.uint32) * dist = distance_field3d[uint32_t]( # <<<<<<<<<<<<<< @@ -18006,7 +20292,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __pyx_v_dist = dijkstra::distance_field3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32.data + __pyx_t_4 * __pyx_v_arr_memview32.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview32.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memview32.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_t_10, __pyx_v_voxel_graph_ptr, __pyx_v_max_loc); - /* "dijkstra3d.pyx":1119 + /* "dijkstra3d.pyx":1321 * voxel_graph_ptr, max_loc * ) * elif dtype in (np.uint32, np.int32): # <<<<<<<<<<<<<< @@ -18016,7 +20302,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P goto __pyx_L6; } - /* "dijkstra3d.pyx":1127 + /* "dijkstra3d.pyx":1329 * voxel_graph_ptr, max_loc * ) * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< @@ -18025,28 +20311,28 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_16 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L11_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L11_bool_binop_done:; @@ -18054,18 +20340,18 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "dijkstra3d.pyx":1128 + /* "dijkstra3d.pyx":1330 * ) * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) # <<<<<<<<<<<<<< * dist = distance_field3d[uint16_t]( * &arr_memview16[0,0,0], */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1128, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = NULL; @@ -18081,16 +20367,16 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_16 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_17, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1128, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_v_arr_memview16 = __pyx_t_21; __pyx_t_21.memview = NULL; __pyx_t_21.data = NULL; - /* "dijkstra3d.pyx":1130 + /* "dijkstra3d.pyx":1332 * arr_memview16 = data.astype(np.uint16) * dist = distance_field3d[uint16_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -18115,19 +20401,19 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1130, __pyx_L1_error) + __PYX_ERR(0, 1332, __pyx_L1_error) } - /* "dijkstra3d.pyx":1132 + /* "dijkstra3d.pyx":1334 * &arr_memview16[0,0,0], * sx, sy, sz, * src, connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr, max_loc * ) */ - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1334, __pyx_L1_error) - /* "dijkstra3d.pyx":1129 + /* "dijkstra3d.pyx":1331 * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) * dist = distance_field3d[uint16_t]( # <<<<<<<<<<<<<< @@ -18136,7 +20422,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __pyx_v_dist = dijkstra::distance_field3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16.data + __pyx_t_6 * __pyx_v_arr_memview16.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview16.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview16.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_t_10, __pyx_v_voxel_graph_ptr, __pyx_v_max_loc); - /* "dijkstra3d.pyx":1127 + /* "dijkstra3d.pyx":1329 * voxel_graph_ptr, max_loc * ) * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< @@ -18146,7 +20432,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P goto __pyx_L6; } - /* "dijkstra3d.pyx":1135 + /* "dijkstra3d.pyx":1337 * voxel_graph_ptr, max_loc * ) * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -18155,36 +20441,36 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_16 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1135, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L13_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1135, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L13_bool_binop_done; } - __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1135, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_16, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L13_bool_binop_done:; @@ -18192,18 +20478,18 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_2 = (__pyx_t_1 != 0); if (likely(__pyx_t_2)) { - /* "dijkstra3d.pyx":1136 + /* "dijkstra3d.pyx":1338 * ) * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) # <<<<<<<<<<<<<< * dist = distance_field3d[uint8_t]( * &arr_memview8[0,0,0], */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1136, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1136, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -18219,16 +20505,16 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_16 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_t_17) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_17); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1136, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 1136, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_v_arr_memview8 = __pyx_t_22; __pyx_t_22.memview = NULL; __pyx_t_22.data = NULL; - /* "dijkstra3d.pyx":1138 + /* "dijkstra3d.pyx":1340 * arr_memview8 = data.astype(np.uint8) * dist = distance_field3d[uint8_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -18253,19 +20539,19 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1138, __pyx_L1_error) + __PYX_ERR(0, 1340, __pyx_L1_error) } - /* "dijkstra3d.pyx":1140 + /* "dijkstra3d.pyx":1342 * &arr_memview8[0,0,0], * sx, sy, sz, * src, connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr, max_loc * ) */ - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_connectivity); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1342, __pyx_L1_error) - /* "dijkstra3d.pyx":1137 + /* "dijkstra3d.pyx":1339 * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) * dist = distance_field3d[uint8_t]( # <<<<<<<<<<<<<< @@ -18274,7 +20560,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __pyx_v_dist = dijkstra::distance_field3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8.data + __pyx_t_4 * __pyx_v_arr_memview8.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview8.strides[1]) ) + __pyx_t_6 * __pyx_v_arr_memview8.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, __pyx_t_10, __pyx_v_voxel_graph_ptr, __pyx_v_max_loc); - /* "dijkstra3d.pyx":1135 + /* "dijkstra3d.pyx":1337 * voxel_graph_ptr, max_loc * ) * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -18284,7 +20570,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P goto __pyx_L6; } - /* "dijkstra3d.pyx":1144 + /* "dijkstra3d.pyx":1346 * ) * else: * raise TypeError("Type {} not currently supported.".format(dtype)) # <<<<<<<<<<<<<< @@ -18292,7 +20578,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P * cdef size_t voxels = sx * sy * sz */ /*else*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_17 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { @@ -18306,19 +20592,19 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P } __pyx_t_16 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_17, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1144, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 1144, __pyx_L1_error) + __PYX_ERR(0, 1346, __pyx_L1_error) } __pyx_L6:; - /* "dijkstra3d.pyx":1146 + /* "dijkstra3d.pyx":1348 * raise TypeError("Type {} not currently supported.".format(dtype)) * * cdef size_t voxels = sx * sy * sz # <<<<<<<<<<<<<< @@ -18327,7 +20613,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ __pyx_v_voxels = ((__pyx_v_sx * __pyx_v_sy) * __pyx_v_sz); - /* "dijkstra3d.pyx":1147 + /* "dijkstra3d.pyx":1349 * * cdef size_t voxels = sx * sy * sz * cdef float[:] dist_view = dist # <<<<<<<<<<<<<< @@ -18336,39 +20622,39 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ if (!__pyx_v_dist) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); - __PYX_ERR(0, 1147, __pyx_L1_error) + __PYX_ERR(0, 1349, __pyx_L1_error) } - __pyx_t_16 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_float); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1147, __pyx_L1_error) + __pyx_t_16 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_float); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_voxels)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1147, __pyx_L1_error) + __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_voxels)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_23 = __pyx_array_new(__pyx_t_9, sizeof(float), PyBytes_AS_STRING(__pyx_t_16), (char *) "c", (char *) __pyx_v_dist); - if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1147, __pyx_L1_error) + if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(((PyObject *)__pyx_t_23), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 1147, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(((PyObject *)__pyx_t_23), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_23)); __pyx_t_23 = 0; __pyx_v_dist_view = __pyx_t_24; __pyx_t_24.memview = NULL; __pyx_t_24.data = NULL; - /* "dijkstra3d.pyx":1151 + /* "dijkstra3d.pyx":1353 * # This construct is required by python 2. * # Python 3 can just do np.frombuffer(vec_view, ...) * buf = bytearray(dist_view[:]) # <<<<<<<<<<<<<< * free(dist) * buf = np.frombuffer(buf, dtype=np.float32).reshape(data.shape, order='F') */ - __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_dist_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1151, __pyx_L1_error) + __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_dist_view, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_v_buf = __pyx_t_9; __pyx_t_9 = 0; - /* "dijkstra3d.pyx":1152 + /* "dijkstra3d.pyx":1354 * # Python 3 can just do np.frombuffer(vec_view, ...) * buf = bytearray(dist_view[:]) * free(dist) # <<<<<<<<<<<<<< @@ -18377,51 +20663,51 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ free(__pyx_v_dist); - /* "dijkstra3d.pyx":1153 + /* "dijkstra3d.pyx":1355 * buf = bytearray(dist_view[:]) * free(dist) * buf = np.frombuffer(buf, dtype=np.float32).reshape(data.shape, order='F') # <<<<<<<<<<<<<< * return buf, max_loc * */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1153, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_buf); - __pyx_t_17 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1153, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 1153, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_9, __pyx_t_17); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_9, __pyx_t_17); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_reshape); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_reshape); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1153, __pyx_L1_error) - __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_9, __pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1153, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1355, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_9, __pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -18429,7 +20715,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_16); __pyx_t_16 = 0; - /* "dijkstra3d.pyx":1154 + /* "dijkstra3d.pyx":1356 * free(dist) * buf = np.frombuffer(buf, dtype=np.float32).reshape(data.shape, order='F') * return buf, max_loc # <<<<<<<<<<<<<< @@ -18437,9 +20723,9 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P * def _execute_parental_field(data, source, connectivity, voxel_graph): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_16 = __Pyx_PyInt_FromSize_t(__pyx_v_max_loc); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1154, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_FromSize_t(__pyx_v_max_loc); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1154, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); @@ -18451,7 +20737,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P __pyx_t_13 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":1068 + /* "dijkstra3d.pyx":1270 * return output[::-1] * * def _execute_distance_field(data, sources, connectivity, voxel_graph): # <<<<<<<<<<<<<< @@ -18495,7 +20781,7 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P return __pyx_r; } -/* "dijkstra3d.pyx":1156 +/* "dijkstra3d.pyx":1358 * return buf, max_loc * * def _execute_parental_field(data, source, connectivity, voxel_graph): # <<<<<<<<<<<<<< @@ -18504,9 +20790,9 @@ static PyObject *__pyx_pf_10dijkstra3d_24_execute_distance_field(CYTHON_UNUSED P */ /* Python wrapper */ -static PyObject *__pyx_pw_10dijkstra3d_27_execute_parental_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_10dijkstra3d_27_execute_parental_field = {"_execute_parental_field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_27_execute_parental_field, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10dijkstra3d_27_execute_parental_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_10dijkstra3d_29_execute_parental_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_10dijkstra3d_29_execute_parental_field = {"_execute_parental_field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_29_execute_parental_field, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10dijkstra3d_29_execute_parental_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_source = 0; PyObject *__pyx_v_connectivity = 0; @@ -18544,23 +20830,23 @@ static PyObject *__pyx_pw_10dijkstra3d_27_execute_parental_field(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_parental_field", 1, 4, 4, 1); __PYX_ERR(0, 1156, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_parental_field", 1, 4, 4, 1); __PYX_ERR(0, 1358, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connectivity)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_parental_field", 1, 4, 4, 2); __PYX_ERR(0, 1156, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_parental_field", 1, 4, 4, 2); __PYX_ERR(0, 1358, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_voxel_graph)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_parental_field", 1, 4, 4, 3); __PYX_ERR(0, 1156, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_parental_field", 1, 4, 4, 3); __PYX_ERR(0, 1358, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_parental_field") < 0)) __PYX_ERR(0, 1156, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_parental_field") < 0)) __PYX_ERR(0, 1358, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -18577,20 +20863,20 @@ static PyObject *__pyx_pw_10dijkstra3d_27_execute_parental_field(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_execute_parental_field", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1156, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_parental_field", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1358, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._execute_parental_field", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10dijkstra3d_26_execute_parental_field(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph); + __pyx_r = __pyx_pf_10dijkstra3d_28_execute_parental_field(__pyx_self, __pyx_v_data, __pyx_v_source, __pyx_v_connectivity, __pyx_v_voxel_graph); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph) { +static PyObject *__pyx_pf_10dijkstra3d_28_execute_parental_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_source, PyObject *__pyx_v_connectivity, PyObject *__pyx_v_voxel_graph) { __Pyx_memviewslice __pyx_v_arr_memview8 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arr_memview16 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arr_memview32 = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -18653,7 +20939,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_pybuffernd_parents64.data = NULL; __pyx_pybuffernd_parents64.rcbuffer = &__pyx_pybuffer_parents64; - /* "dijkstra3d.pyx":1165 + /* "dijkstra3d.pyx":1367 * * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL # <<<<<<<<<<<<<< @@ -18662,7 +20948,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ __pyx_v_voxel_graph_ptr = NULL; - /* "dijkstra3d.pyx":1166 + /* "dijkstra3d.pyx":1368 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -18673,19 +20959,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":1167 + /* "dijkstra3d.pyx":1369 * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: * voxel_graph_memview = voxel_graph # <<<<<<<<<<<<<< * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * */ - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1167, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1369, __pyx_L1_error) __pyx_v_voxel_graph_memview = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "dijkstra3d.pyx":1168 + /* "dijkstra3d.pyx":1370 * if voxel_graph is not None: * voxel_graph_memview = voxel_graph * voxel_graph_ptr = &voxel_graph_memview[0,0,0] # <<<<<<<<<<<<<< @@ -18710,11 +20996,11 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_v_voxel_graph_memview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1168, __pyx_L1_error) + __PYX_ERR(0, 1370, __pyx_L1_error) } __pyx_v_voxel_graph_ptr = ((uint32_t *)(&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_voxel_graph_memview.data + __pyx_t_4 * __pyx_v_voxel_graph_memview.strides[0]) ) + __pyx_t_5 * __pyx_v_voxel_graph_memview.strides[1]) ) + __pyx_t_6 * __pyx_v_voxel_graph_memview.strides[2]) ))))); - /* "dijkstra3d.pyx":1166 + /* "dijkstra3d.pyx":1368 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -18723,108 +21009,108 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ } - /* "dijkstra3d.pyx":1170 + /* "dijkstra3d.pyx":1372 * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * * cdef size_t sx = data.shape[0] # <<<<<<<<<<<<<< * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sx = __pyx_t_10; - /* "dijkstra3d.pyx":1171 + /* "dijkstra3d.pyx":1373 * * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] # <<<<<<<<<<<<<< * cdef size_t sz = data.shape[2] * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_sy = __pyx_t_10; - /* "dijkstra3d.pyx":1172 + /* "dijkstra3d.pyx":1374 * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] # <<<<<<<<<<<<<< * * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1172, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1172, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1172, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sz = __pyx_t_10; - /* "dijkstra3d.pyx":1174 + /* "dijkstra3d.pyx":1376 * cdef size_t sz = data.shape[2] * * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) # <<<<<<<<<<<<<< * * sixtyfourbit = data.size > np.iinfo(np.uint32).max */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Multiply(__pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_14 = PyNumber_Multiply(__pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_13); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_13); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_v_src = __pyx_t_10; - /* "dijkstra3d.pyx":1176 + /* "dijkstra3d.pyx":1378 * cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) * * sixtyfourbit = data.size > np.iinfo(np.uint32).max # <<<<<<<<<<<<<< * * cdef cnp.ndarray[uint32_t, ndim=3] parents32 */ - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1176, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1176, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1176, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1176, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1176, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -18840,47 +21126,47 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1176, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1176, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_13, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1176, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_13, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_sixtyfourbit = __pyx_t_14; __pyx_t_14 = 0; - /* "dijkstra3d.pyx":1181 + /* "dijkstra3d.pyx":1383 * cdef cnp.ndarray[uint64_t, ndim=3] parents64 * * if sixtyfourbit: # <<<<<<<<<<<<<< * parents64 = np.zeros( (sx,sy,sz), dtype=np.uint64, order='F' ) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1383, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1182 + /* "dijkstra3d.pyx":1384 * * if sixtyfourbit: * parents64 = np.zeros( (sx,sy,sz), dtype=np.uint64, order='F' ) # <<<<<<<<<<<<<< * else: * parents32 = np.zeros( (sx,sy,sz), dtype=np.uint32, order='F' ) */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_v_sz); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_v_sz); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_14); @@ -18891,27 +21177,27 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1182, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1384, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1182, __pyx_L1_error) + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1384, __pyx_L1_error) __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -18928,13 +21214,13 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; } __pyx_pybuffernd_parents64.diminfo[0].strides = __pyx_pybuffernd_parents64.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parents64.diminfo[0].shape = __pyx_pybuffernd_parents64.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_parents64.diminfo[1].strides = __pyx_pybuffernd_parents64.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_parents64.diminfo[1].shape = __pyx_pybuffernd_parents64.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_parents64.diminfo[2].strides = __pyx_pybuffernd_parents64.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_parents64.diminfo[2].shape = __pyx_pybuffernd_parents64.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1182, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1384, __pyx_L1_error) } __pyx_t_15 = 0; __pyx_v_parents64 = ((PyArrayObject *)__pyx_t_14); __pyx_t_14 = 0; - /* "dijkstra3d.pyx":1181 + /* "dijkstra3d.pyx":1383 * cdef cnp.ndarray[uint64_t, ndim=3] parents64 * * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -18944,7 +21230,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L4; } - /* "dijkstra3d.pyx":1184 + /* "dijkstra3d.pyx":1386 * parents64 = np.zeros( (sx,sy,sz), dtype=np.uint64, order='F' ) * else: * parents32 = np.zeros( (sx,sy,sz), dtype=np.uint32, order='F' ) # <<<<<<<<<<<<<< @@ -18952,18 +21238,18 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P * dtype = data.dtype */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); @@ -18974,27 +21260,27 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_14 = 0; __pyx_t_11 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 1184, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1184, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1184, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1386, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1184, __pyx_L1_error) + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1386, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_14); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -19011,7 +21297,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_18 = __pyx_t_17 = __pyx_t_16 = 0; } __pyx_pybuffernd_parents32.diminfo[0].strides = __pyx_pybuffernd_parents32.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parents32.diminfo[0].shape = __pyx_pybuffernd_parents32.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_parents32.diminfo[1].strides = __pyx_pybuffernd_parents32.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_parents32.diminfo[1].shape = __pyx_pybuffernd_parents32.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_parents32.diminfo[2].strides = __pyx_pybuffernd_parents32.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_parents32.diminfo[2].shape = __pyx_pybuffernd_parents32.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1184, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1386, __pyx_L1_error) } __pyx_t_19 = 0; __pyx_v_parents32 = ((PyArrayObject *)__pyx_t_14); @@ -19019,59 +21305,59 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } __pyx_L4:; - /* "dijkstra3d.pyx":1186 + /* "dijkstra3d.pyx":1388 * parents32 = np.zeros( (sx,sy,sz), dtype=np.uint32, order='F' ) * * dtype = data.dtype # <<<<<<<<<<<<<< * * if dtype == np.float32: */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1186, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_v_dtype = __pyx_t_14; __pyx_t_14 = 0; - /* "dijkstra3d.pyx":1188 + /* "dijkstra3d.pyx":1390 * dtype = data.dtype * * if dtype == np.float32: # <<<<<<<<<<<<<< * arr_memviewfloat = data * if sixtyfourbit: */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1188, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_2) { - /* "dijkstra3d.pyx":1189 + /* "dijkstra3d.pyx":1391 * * if dtype == np.float32: * arr_memviewfloat = data # <<<<<<<<<<<<<< * if sixtyfourbit: * parental_field3d[float,uint64_t]( */ - __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 1189, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 1391, __pyx_L1_error) __pyx_v_arr_memviewfloat = __pyx_t_20; __pyx_t_20.memview = NULL; __pyx_t_20.data = NULL; - /* "dijkstra3d.pyx":1190 + /* "dijkstra3d.pyx":1392 * if dtype == np.float32: * arr_memviewfloat = data * if sixtyfourbit: # <<<<<<<<<<<<<< * parental_field3d[float,uint64_t]( * &arr_memviewfloat[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1392, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1192 + /* "dijkstra3d.pyx":1394 * if sixtyfourbit: * parental_field3d[float,uint64_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< @@ -19096,10 +21382,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1192, __pyx_L1_error) + __PYX_ERR(0, 1394, __pyx_L1_error) } - /* "dijkstra3d.pyx":1194 + /* "dijkstra3d.pyx":1396 * &arr_memviewfloat[0,0,0], * sx, sy, sz, * src, &parents64[0,0,0], # <<<<<<<<<<<<<< @@ -19124,19 +21410,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_parents64.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1194, __pyx_L1_error) + __PYX_ERR(0, 1396, __pyx_L1_error) } - /* "dijkstra3d.pyx":1195 + /* "dijkstra3d.pyx":1397 * sx, sy, sz, * src, &parents64[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1397, __pyx_L1_error) - /* "dijkstra3d.pyx":1191 + /* "dijkstra3d.pyx":1393 * arr_memviewfloat = data * if sixtyfourbit: * parental_field3d[float,uint64_t]( # <<<<<<<<<<<<<< @@ -19145,7 +21431,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ (void)(dijkstra::parental_field3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewfloat.data + __pyx_t_6 * __pyx_v_arr_memviewfloat.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewfloat.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewfloat.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, (&(*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_parents64.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_parents64.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_parents64.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_parents64.diminfo[2].strides))), __pyx_t_7, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":1190 + /* "dijkstra3d.pyx":1392 * if dtype == np.float32: * arr_memviewfloat = data * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -19155,7 +21441,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L6; } - /* "dijkstra3d.pyx":1199 + /* "dijkstra3d.pyx":1401 * ) * else: * parental_field3d[float,uint32_t]( # <<<<<<<<<<<<<< @@ -19164,7 +21450,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ /*else*/ { - /* "dijkstra3d.pyx":1200 + /* "dijkstra3d.pyx":1402 * else: * parental_field3d[float,uint32_t]( * &arr_memviewfloat[0,0,0], # <<<<<<<<<<<<<< @@ -19189,10 +21475,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_21 >= __pyx_v_arr_memviewfloat.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1200, __pyx_L1_error) + __PYX_ERR(0, 1402, __pyx_L1_error) } - /* "dijkstra3d.pyx":1202 + /* "dijkstra3d.pyx":1404 * &arr_memviewfloat[0,0,0], * sx, sy, sz, * src, &parents32[0,0,0], # <<<<<<<<<<<<<< @@ -19217,19 +21503,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_parents32.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1202, __pyx_L1_error) + __PYX_ERR(0, 1404, __pyx_L1_error) } - /* "dijkstra3d.pyx":1203 + /* "dijkstra3d.pyx":1405 * sx, sy, sz, * src, &parents32[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1405, __pyx_L1_error) - /* "dijkstra3d.pyx":1199 + /* "dijkstra3d.pyx":1401 * ) * else: * parental_field3d[float,uint32_t]( # <<<<<<<<<<<<<< @@ -19240,7 +21526,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } __pyx_L6:; - /* "dijkstra3d.pyx":1188 + /* "dijkstra3d.pyx":1390 * dtype = data.dtype * * if dtype == np.float32: # <<<<<<<<<<<<<< @@ -19250,47 +21536,47 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L5; } - /* "dijkstra3d.pyx":1206 + /* "dijkstra3d.pyx":1408 * voxel_graph_ptr * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< * arr_memviewdouble = data * if sixtyfourbit: */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1206, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_float64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_2) { - /* "dijkstra3d.pyx":1207 + /* "dijkstra3d.pyx":1409 * ) * elif dtype == np.float64: * arr_memviewdouble = data # <<<<<<<<<<<<<< * if sixtyfourbit: * parental_field3d[double,uint64_t]( */ - __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 1207, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 1409, __pyx_L1_error) __pyx_v_arr_memviewdouble = __pyx_t_24; __pyx_t_24.memview = NULL; __pyx_t_24.data = NULL; - /* "dijkstra3d.pyx":1208 + /* "dijkstra3d.pyx":1410 * elif dtype == np.float64: * arr_memviewdouble = data * if sixtyfourbit: # <<<<<<<<<<<<<< * parental_field3d[double,uint64_t]( * &arr_memviewdouble[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1410, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1210 + /* "dijkstra3d.pyx":1412 * if sixtyfourbit: * parental_field3d[double,uint64_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< @@ -19315,10 +21601,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1412, __pyx_L1_error) } - /* "dijkstra3d.pyx":1212 + /* "dijkstra3d.pyx":1414 * &arr_memviewdouble[0,0,0], * sx, sy, sz, * src, &parents64[0,0,0], # <<<<<<<<<<<<<< @@ -19343,19 +21629,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_parents64.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1212, __pyx_L1_error) + __PYX_ERR(0, 1414, __pyx_L1_error) } - /* "dijkstra3d.pyx":1213 + /* "dijkstra3d.pyx":1415 * sx, sy, sz, * src, &parents64[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1213, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1415, __pyx_L1_error) - /* "dijkstra3d.pyx":1209 + /* "dijkstra3d.pyx":1411 * arr_memviewdouble = data * if sixtyfourbit: * parental_field3d[double,uint64_t]( # <<<<<<<<<<<<<< @@ -19364,7 +21650,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ (void)(dijkstra::parental_field3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewdouble.data + __pyx_t_6 * __pyx_v_arr_memviewdouble.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memviewdouble.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memviewdouble.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, (&(*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_parents64.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_parents64.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_parents64.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_parents64.diminfo[2].strides))), __pyx_t_7, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":1208 + /* "dijkstra3d.pyx":1410 * elif dtype == np.float64: * arr_memviewdouble = data * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -19374,7 +21660,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L7; } - /* "dijkstra3d.pyx":1217 + /* "dijkstra3d.pyx":1419 * ) * else: * parental_field3d[double,uint32_t]( # <<<<<<<<<<<<<< @@ -19383,7 +21669,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ /*else*/ { - /* "dijkstra3d.pyx":1218 + /* "dijkstra3d.pyx":1420 * else: * parental_field3d[double,uint32_t]( * &arr_memviewdouble[0,0,0], # <<<<<<<<<<<<<< @@ -19408,10 +21694,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_21 >= __pyx_v_arr_memviewdouble.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1218, __pyx_L1_error) + __PYX_ERR(0, 1420, __pyx_L1_error) } - /* "dijkstra3d.pyx":1220 + /* "dijkstra3d.pyx":1422 * &arr_memviewdouble[0,0,0], * sx, sy, sz, * src, &parents32[0,0,0], # <<<<<<<<<<<<<< @@ -19436,19 +21722,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_parents32.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1220, __pyx_L1_error) + __PYX_ERR(0, 1422, __pyx_L1_error) } - /* "dijkstra3d.pyx":1221 + /* "dijkstra3d.pyx":1423 * sx, sy, sz, * src, &parents32[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1221, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1423, __pyx_L1_error) - /* "dijkstra3d.pyx":1217 + /* "dijkstra3d.pyx":1419 * ) * else: * parental_field3d[double,uint32_t]( # <<<<<<<<<<<<<< @@ -19459,7 +21745,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } __pyx_L7:; - /* "dijkstra3d.pyx":1206 + /* "dijkstra3d.pyx":1408 * voxel_graph_ptr * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< @@ -19469,7 +21755,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L5; } - /* "dijkstra3d.pyx":1224 + /* "dijkstra3d.pyx":1426 * voxel_graph_ptr * ) * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< @@ -19478,28 +21764,28 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_14 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L8_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L8_bool_binop_done:; @@ -19507,18 +21793,18 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "dijkstra3d.pyx":1225 + /* "dijkstra3d.pyx":1427 * ) * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) # <<<<<<<<<<<<<< * if sixtyfourbit: * parental_field3d[uint64_t,uint64_t]( */ - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1225, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1225, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1225, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -19534,26 +21820,26 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_14 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1225, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_25 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_25.memview)) __PYX_ERR(0, 1225, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_25.memview)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_arr_memview64 = __pyx_t_25; __pyx_t_25.memview = NULL; __pyx_t_25.data = NULL; - /* "dijkstra3d.pyx":1226 + /* "dijkstra3d.pyx":1428 * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) * if sixtyfourbit: # <<<<<<<<<<<<<< * parental_field3d[uint64_t,uint64_t]( * &arr_memview64[0,0,0], */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1428, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":1228 + /* "dijkstra3d.pyx":1430 * if sixtyfourbit: * parental_field3d[uint64_t,uint64_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< @@ -19578,10 +21864,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1228, __pyx_L1_error) + __PYX_ERR(0, 1430, __pyx_L1_error) } - /* "dijkstra3d.pyx":1230 + /* "dijkstra3d.pyx":1432 * &arr_memview64[0,0,0], * sx, sy, sz, * src, &parents64[0,0,0], # <<<<<<<<<<<<<< @@ -19606,19 +21892,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_parents64.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1230, __pyx_L1_error) + __PYX_ERR(0, 1432, __pyx_L1_error) } - /* "dijkstra3d.pyx":1231 + /* "dijkstra3d.pyx":1433 * sx, sy, sz, * src, &parents64[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1433, __pyx_L1_error) - /* "dijkstra3d.pyx":1227 + /* "dijkstra3d.pyx":1429 * arr_memview64 = data.astype(np.uint64) * if sixtyfourbit: * parental_field3d[uint64_t,uint64_t]( # <<<<<<<<<<<<<< @@ -19627,7 +21913,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ (void)(dijkstra::parental_field3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64.data + __pyx_t_6 * __pyx_v_arr_memview64.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview64.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview64.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, (&(*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_parents64.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_parents64.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_parents64.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_parents64.diminfo[2].strides))), __pyx_t_7, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":1226 + /* "dijkstra3d.pyx":1428 * elif dtype in (np.int64, np.uint64): * arr_memview64 = data.astype(np.uint64) * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -19637,7 +21923,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L10; } - /* "dijkstra3d.pyx":1235 + /* "dijkstra3d.pyx":1437 * ) * else: * parental_field3d[uint64_t,uint32_t]( # <<<<<<<<<<<<<< @@ -19646,7 +21932,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ /*else*/ { - /* "dijkstra3d.pyx":1236 + /* "dijkstra3d.pyx":1438 * else: * parental_field3d[uint64_t,uint32_t]( * &arr_memview64[0,0,0], # <<<<<<<<<<<<<< @@ -19671,10 +21957,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_21 >= __pyx_v_arr_memview64.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1236, __pyx_L1_error) + __PYX_ERR(0, 1438, __pyx_L1_error) } - /* "dijkstra3d.pyx":1238 + /* "dijkstra3d.pyx":1440 * &arr_memview64[0,0,0], * sx, sy, sz, * src, &parents32[0,0,0], # <<<<<<<<<<<<<< @@ -19699,19 +21985,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_parents32.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1238, __pyx_L1_error) + __PYX_ERR(0, 1440, __pyx_L1_error) } - /* "dijkstra3d.pyx":1239 + /* "dijkstra3d.pyx":1441 * sx, sy, sz, * src, &parents32[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1441, __pyx_L1_error) - /* "dijkstra3d.pyx":1235 + /* "dijkstra3d.pyx":1437 * ) * else: * parental_field3d[uint64_t,uint32_t]( # <<<<<<<<<<<<<< @@ -19722,7 +22008,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } __pyx_L10:; - /* "dijkstra3d.pyx":1224 + /* "dijkstra3d.pyx":1426 * voxel_graph_ptr * ) * elif dtype in (np.int64, np.uint64): # <<<<<<<<<<<<<< @@ -19732,7 +22018,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L5; } - /* "dijkstra3d.pyx":1242 + /* "dijkstra3d.pyx":1444 * voxel_graph_ptr * ) * elif dtype in (np.uint32, np.int32): # <<<<<<<<<<<<<< @@ -19741,28 +22027,28 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_14 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1242, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1242, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; @@ -19770,18 +22056,18 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":1243 + /* "dijkstra3d.pyx":1445 * ) * elif dtype in (np.uint32, np.int32): * arr_memview32 = data.astype(np.uint32) # <<<<<<<<<<<<<< * if sixtyfourbit: * parental_field3d[uint32_t,uint64_t]( */ - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -19797,26 +22083,26 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1243, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_arr_memview32 = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "dijkstra3d.pyx":1244 + /* "dijkstra3d.pyx":1446 * elif dtype in (np.uint32, np.int32): * arr_memview32 = data.astype(np.uint32) * if sixtyfourbit: # <<<<<<<<<<<<<< * parental_field3d[uint32_t,uint64_t]( * &arr_memview32[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1244, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1446, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1246 + /* "dijkstra3d.pyx":1448 * if sixtyfourbit: * parental_field3d[uint32_t,uint64_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -19841,10 +22127,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1246, __pyx_L1_error) + __PYX_ERR(0, 1448, __pyx_L1_error) } - /* "dijkstra3d.pyx":1248 + /* "dijkstra3d.pyx":1450 * &arr_memview32[0,0,0], * sx, sy, sz, * src, &parents64[0,0,0], # <<<<<<<<<<<<<< @@ -19869,19 +22155,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_parents64.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1248, __pyx_L1_error) + __PYX_ERR(0, 1450, __pyx_L1_error) } - /* "dijkstra3d.pyx":1249 + /* "dijkstra3d.pyx":1451 * sx, sy, sz, * src, &parents64[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1249, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1451, __pyx_L1_error) - /* "dijkstra3d.pyx":1245 + /* "dijkstra3d.pyx":1447 * arr_memview32 = data.astype(np.uint32) * if sixtyfourbit: * parental_field3d[uint32_t,uint64_t]( # <<<<<<<<<<<<<< @@ -19890,7 +22176,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ (void)(dijkstra::parental_field3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32.data + __pyx_t_6 * __pyx_v_arr_memview32.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview32.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview32.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, (&(*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_parents64.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_parents64.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_parents64.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_parents64.diminfo[2].strides))), __pyx_t_7, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":1244 + /* "dijkstra3d.pyx":1446 * elif dtype in (np.uint32, np.int32): * arr_memview32 = data.astype(np.uint32) * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -19900,7 +22186,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L13; } - /* "dijkstra3d.pyx":1253 + /* "dijkstra3d.pyx":1455 * ) * else: * parental_field3d[uint32_t,uint32_t]( # <<<<<<<<<<<<<< @@ -19909,7 +22195,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ /*else*/ { - /* "dijkstra3d.pyx":1254 + /* "dijkstra3d.pyx":1456 * else: * parental_field3d[uint32_t,uint32_t]( * &arr_memview32[0,0,0], # <<<<<<<<<<<<<< @@ -19934,10 +22220,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_21 >= __pyx_v_arr_memview32.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1254, __pyx_L1_error) + __PYX_ERR(0, 1456, __pyx_L1_error) } - /* "dijkstra3d.pyx":1256 + /* "dijkstra3d.pyx":1458 * &arr_memview32[0,0,0], * sx, sy, sz, * src, &parents32[0,0,0], # <<<<<<<<<<<<<< @@ -19962,19 +22248,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_parents32.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1256, __pyx_L1_error) + __PYX_ERR(0, 1458, __pyx_L1_error) } - /* "dijkstra3d.pyx":1257 + /* "dijkstra3d.pyx":1459 * sx, sy, sz, * src, &parents32[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1459, __pyx_L1_error) - /* "dijkstra3d.pyx":1253 + /* "dijkstra3d.pyx":1455 * ) * else: * parental_field3d[uint32_t,uint32_t]( # <<<<<<<<<<<<<< @@ -19985,7 +22271,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } __pyx_L13:; - /* "dijkstra3d.pyx":1242 + /* "dijkstra3d.pyx":1444 * voxel_graph_ptr * ) * elif dtype in (np.uint32, np.int32): # <<<<<<<<<<<<<< @@ -19995,7 +22281,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L5; } - /* "dijkstra3d.pyx":1260 + /* "dijkstra3d.pyx":1462 * voxel_graph_ptr * ) * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< @@ -20004,28 +22290,28 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_14 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1260, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1260, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1260, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1260, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L14_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1260, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1260, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1260, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1260, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L14_bool_binop_done:; @@ -20033,18 +22319,18 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "dijkstra3d.pyx":1261 + /* "dijkstra3d.pyx":1463 * ) * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) # <<<<<<<<<<<<<< * if sixtyfourbit: * parental_field3d[uint16_t,uint64_t]( */ - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1261, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -20060,26 +22346,26 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_14 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1261, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_26 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_26.memview)) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_26.memview)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_arr_memview16 = __pyx_t_26; __pyx_t_26.memview = NULL; __pyx_t_26.data = NULL; - /* "dijkstra3d.pyx":1262 + /* "dijkstra3d.pyx":1464 * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) * if sixtyfourbit: # <<<<<<<<<<<<<< * parental_field3d[uint16_t,uint64_t]( * &arr_memview16[0,0,0], */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1262, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1464, __pyx_L1_error) if (__pyx_t_1) { - /* "dijkstra3d.pyx":1264 + /* "dijkstra3d.pyx":1466 * if sixtyfourbit: * parental_field3d[uint16_t,uint64_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -20104,10 +22390,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1264, __pyx_L1_error) + __PYX_ERR(0, 1466, __pyx_L1_error) } - /* "dijkstra3d.pyx":1266 + /* "dijkstra3d.pyx":1468 * &arr_memview16[0,0,0], * sx, sy, sz, * src, &parents64[0,0,0], # <<<<<<<<<<<<<< @@ -20132,19 +22418,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_parents64.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1266, __pyx_L1_error) + __PYX_ERR(0, 1468, __pyx_L1_error) } - /* "dijkstra3d.pyx":1267 + /* "dijkstra3d.pyx":1469 * sx, sy, sz, * src, &parents64[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1267, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1469, __pyx_L1_error) - /* "dijkstra3d.pyx":1263 + /* "dijkstra3d.pyx":1465 * arr_memview16 = data.astype(np.uint16) * if sixtyfourbit: * parental_field3d[uint16_t,uint64_t]( # <<<<<<<<<<<<<< @@ -20153,7 +22439,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ (void)(dijkstra::parental_field3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16.data + __pyx_t_6 * __pyx_v_arr_memview16.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview16.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview16.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, (&(*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_parents64.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_parents64.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_parents64.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_parents64.diminfo[2].strides))), __pyx_t_7, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":1262 + /* "dijkstra3d.pyx":1464 * elif dtype in (np.int16, np.uint16): * arr_memview16 = data.astype(np.uint16) * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -20163,7 +22449,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L16; } - /* "dijkstra3d.pyx":1271 + /* "dijkstra3d.pyx":1473 * ) * else: * parental_field3d[uint16_t,uint32_t]( # <<<<<<<<<<<<<< @@ -20172,7 +22458,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ /*else*/ { - /* "dijkstra3d.pyx":1272 + /* "dijkstra3d.pyx":1474 * else: * parental_field3d[uint16_t,uint32_t]( * &arr_memview16[0,0,0], # <<<<<<<<<<<<<< @@ -20197,10 +22483,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_21 >= __pyx_v_arr_memview16.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1272, __pyx_L1_error) + __PYX_ERR(0, 1474, __pyx_L1_error) } - /* "dijkstra3d.pyx":1274 + /* "dijkstra3d.pyx":1476 * &arr_memview16[0,0,0], * sx, sy, sz, * src, &parents32[0,0,0], # <<<<<<<<<<<<<< @@ -20225,19 +22511,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_parents32.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1274, __pyx_L1_error) + __PYX_ERR(0, 1476, __pyx_L1_error) } - /* "dijkstra3d.pyx":1275 + /* "dijkstra3d.pyx":1477 * sx, sy, sz, * src, &parents32[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1275, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1477, __pyx_L1_error) - /* "dijkstra3d.pyx":1271 + /* "dijkstra3d.pyx":1473 * ) * else: * parental_field3d[uint16_t,uint32_t]( # <<<<<<<<<<<<<< @@ -20248,7 +22534,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } __pyx_L16:; - /* "dijkstra3d.pyx":1260 + /* "dijkstra3d.pyx":1462 * voxel_graph_ptr * ) * elif dtype in (np.int16, np.uint16): # <<<<<<<<<<<<<< @@ -20258,7 +22544,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L5; } - /* "dijkstra3d.pyx":1278 + /* "dijkstra3d.pyx":1480 * voxel_graph_ptr * ) * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -20267,36 +22553,36 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_14 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1278, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L17_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1278, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_uint8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L17_bool_binop_done; } - __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1278, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1480, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L17_bool_binop_done:; @@ -20304,18 +22590,18 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_2 = (__pyx_t_1 != 0); if (likely(__pyx_t_2)) { - /* "dijkstra3d.pyx":1279 + /* "dijkstra3d.pyx":1481 * ) * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) # <<<<<<<<<<<<<< * if sixtyfourbit: * parental_field3d[uint8_t,uint64_t]( */ - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1279, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -20331,26 +22617,26 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1279, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_arr_memview8 = __pyx_t_27; __pyx_t_27.memview = NULL; __pyx_t_27.data = NULL; - /* "dijkstra3d.pyx":1280 + /* "dijkstra3d.pyx":1482 * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) * if sixtyfourbit: # <<<<<<<<<<<<<< * parental_field3d[uint8_t,uint64_t]( * &arr_memview8[0,0,0], */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1482, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1282 + /* "dijkstra3d.pyx":1484 * if sixtyfourbit: * parental_field3d[uint8_t,uint64_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -20375,10 +22661,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1282, __pyx_L1_error) + __PYX_ERR(0, 1484, __pyx_L1_error) } - /* "dijkstra3d.pyx":1284 + /* "dijkstra3d.pyx":1486 * &arr_memview8[0,0,0], * sx, sy, sz, * src, &parents64[0,0,0], # <<<<<<<<<<<<<< @@ -20403,19 +22689,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_parents64.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1284, __pyx_L1_error) + __PYX_ERR(0, 1486, __pyx_L1_error) } - /* "dijkstra3d.pyx":1285 + /* "dijkstra3d.pyx":1487 * sx, sy, sz, * src, &parents64[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1285, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1487, __pyx_L1_error) - /* "dijkstra3d.pyx":1281 + /* "dijkstra3d.pyx":1483 * arr_memview8 = data.astype(np.uint8) * if sixtyfourbit: * parental_field3d[uint8_t,uint64_t]( # <<<<<<<<<<<<<< @@ -20424,7 +22710,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ (void)(dijkstra::parental_field3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8.data + __pyx_t_6 * __pyx_v_arr_memview8.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview8.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview8.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_src, (&(*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_parents64.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_parents64.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_parents64.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_parents64.diminfo[2].strides))), __pyx_t_7, __pyx_v_voxel_graph_ptr)); - /* "dijkstra3d.pyx":1280 + /* "dijkstra3d.pyx":1482 * elif dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -20434,7 +22720,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L20; } - /* "dijkstra3d.pyx":1289 + /* "dijkstra3d.pyx":1491 * ) * else: * parental_field3d[uint8_t,uint32_t]( # <<<<<<<<<<<<<< @@ -20443,7 +22729,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ /*else*/ { - /* "dijkstra3d.pyx":1290 + /* "dijkstra3d.pyx":1492 * else: * parental_field3d[uint8_t,uint32_t]( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -20468,10 +22754,10 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_21 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1290, __pyx_L1_error) + __PYX_ERR(0, 1492, __pyx_L1_error) } - /* "dijkstra3d.pyx":1292 + /* "dijkstra3d.pyx":1494 * &arr_memview8[0,0,0], * sx, sy, sz, * src, &parents32[0,0,0], # <<<<<<<<<<<<<< @@ -20496,19 +22782,19 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_parents32.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1292, __pyx_L1_error) + __PYX_ERR(0, 1494, __pyx_L1_error) } - /* "dijkstra3d.pyx":1293 + /* "dijkstra3d.pyx":1495 * sx, sy, sz, * src, &parents32[0,0,0], * connectivity, # <<<<<<<<<<<<<< * voxel_graph_ptr * ) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1293, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_connectivity); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L1_error) - /* "dijkstra3d.pyx":1289 + /* "dijkstra3d.pyx":1491 * ) * else: * parental_field3d[uint8_t,uint32_t]( # <<<<<<<<<<<<<< @@ -20519,7 +22805,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } __pyx_L20:; - /* "dijkstra3d.pyx":1278 + /* "dijkstra3d.pyx":1480 * voxel_graph_ptr * ) * elif dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -20529,7 +22815,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L5; } - /* "dijkstra3d.pyx":1297 + /* "dijkstra3d.pyx":1499 * ) * else: * raise TypeError("Type {} not currently supported.".format(dtype)) # <<<<<<<<<<<<<< @@ -20537,7 +22823,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P * if sixtyfourbit: */ /*else*/ { - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -20551,29 +22837,29 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P } __pyx_t_14 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_8, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1297, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_Raise(__pyx_t_13, 0, 0, 0); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __PYX_ERR(0, 1297, __pyx_L1_error) + __PYX_ERR(0, 1499, __pyx_L1_error) } __pyx_L5:; - /* "dijkstra3d.pyx":1299 + /* "dijkstra3d.pyx":1501 * raise TypeError("Type {} not currently supported.".format(dtype)) * * if sixtyfourbit: # <<<<<<<<<<<<<< * return parents64 * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1299, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sixtyfourbit); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1501, __pyx_L1_error) if (__pyx_t_2) { - /* "dijkstra3d.pyx":1300 + /* "dijkstra3d.pyx":1502 * * if sixtyfourbit: * return parents64 # <<<<<<<<<<<<<< @@ -20585,7 +22871,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P __pyx_r = ((PyObject *)__pyx_v_parents64); goto __pyx_L0; - /* "dijkstra3d.pyx":1299 + /* "dijkstra3d.pyx":1501 * raise TypeError("Type {} not currently supported.".format(dtype)) * * if sixtyfourbit: # <<<<<<<<<<<<<< @@ -20594,7 +22880,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ } - /* "dijkstra3d.pyx":1302 + /* "dijkstra3d.pyx":1504 * return parents64 * else: * return parents32 # <<<<<<<<<<<<<< @@ -20608,7 +22894,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P goto __pyx_L0; } - /* "dijkstra3d.pyx":1156 + /* "dijkstra3d.pyx":1358 * return buf, max_loc * * def _execute_parental_field(data, source, connectivity, voxel_graph): # <<<<<<<<<<<<<< @@ -20660,7 +22946,7 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P return __pyx_r; } -/* "dijkstra3d.pyx":1304 +/* "dijkstra3d.pyx":1506 * return parents32 * * def _execute_euclidean_distance_field( # <<<<<<<<<<<<<< @@ -20669,9 +22955,9 @@ static PyObject *__pyx_pf_10dijkstra3d_26_execute_parental_field(CYTHON_UNUSED P */ /* Python wrapper */ -static PyObject *__pyx_pw_10dijkstra3d_29_execute_euclidean_distance_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_10dijkstra3d_29_execute_euclidean_distance_field = {"_execute_euclidean_distance_field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_29_execute_euclidean_distance_field, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10dijkstra3d_29_execute_euclidean_distance_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_10dijkstra3d_31_execute_euclidean_distance_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_10dijkstra3d_31_execute_euclidean_distance_field = {"_execute_euclidean_distance_field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10dijkstra3d_31_execute_euclidean_distance_field, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10dijkstra3d_31_execute_euclidean_distance_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_sources = 0; PyObject *__pyx_v_anisotropy = 0; @@ -20687,7 +22973,7 @@ static PyObject *__pyx_pw_10dijkstra3d_29_execute_euclidean_distance_field(PyObj static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_sources,&__pyx_n_s_anisotropy,&__pyx_n_s_free_space_radius,&__pyx_n_s_voxel_graph,0}; PyObject* values[5] = {0,0,0,0,0}; - /* "dijkstra3d.pyx":1306 + /* "dijkstra3d.pyx":1508 * def _execute_euclidean_distance_field( * data, sources, anisotropy, float free_space_radius=0, * voxel_graph=None # <<<<<<<<<<<<<< @@ -20721,13 +23007,13 @@ static PyObject *__pyx_pw_10dijkstra3d_29_execute_euclidean_distance_field(PyObj case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sources)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_euclidean_distance_field", 0, 3, 5, 1); __PYX_ERR(0, 1304, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_euclidean_distance_field", 0, 3, 5, 1); __PYX_ERR(0, 1506, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_anisotropy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_execute_euclidean_distance_field", 0, 3, 5, 2); __PYX_ERR(0, 1304, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_euclidean_distance_field", 0, 3, 5, 2); __PYX_ERR(0, 1506, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -20743,7 +23029,7 @@ static PyObject *__pyx_pw_10dijkstra3d_29_execute_euclidean_distance_field(PyObj } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_euclidean_distance_field") < 0)) __PYX_ERR(0, 1304, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_execute_euclidean_distance_field") < 0)) __PYX_ERR(0, 1506, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -20762,7 +23048,7 @@ static PyObject *__pyx_pw_10dijkstra3d_29_execute_euclidean_distance_field(PyObj __pyx_v_sources = values[1]; __pyx_v_anisotropy = values[2]; if (values[3]) { - __pyx_v_free_space_radius = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_free_space_radius == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1305, __pyx_L3_error) + __pyx_v_free_space_radius = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_free_space_radius == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1507, __pyx_L3_error) } else { __pyx_v_free_space_radius = ((float)0.0); } @@ -20770,15 +23056,15 @@ static PyObject *__pyx_pw_10dijkstra3d_29_execute_euclidean_distance_field(PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_execute_euclidean_distance_field", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1304, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_execute_euclidean_distance_field", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1506, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dijkstra3d._execute_euclidean_distance_field", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(__pyx_self, __pyx_v_data, __pyx_v_sources, __pyx_v_anisotropy, __pyx_v_free_space_radius, __pyx_v_voxel_graph); + __pyx_r = __pyx_pf_10dijkstra3d_30_execute_euclidean_distance_field(__pyx_self, __pyx_v_data, __pyx_v_sources, __pyx_v_anisotropy, __pyx_v_free_space_radius, __pyx_v_voxel_graph); - /* "dijkstra3d.pyx":1304 + /* "dijkstra3d.pyx":1506 * return parents32 * * def _execute_euclidean_distance_field( # <<<<<<<<<<<<<< @@ -20791,7 +23077,7 @@ static PyObject *__pyx_pw_10dijkstra3d_29_execute_euclidean_distance_field(PyObj return __pyx_r; } -static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_sources, PyObject *__pyx_v_anisotropy, float __pyx_v_free_space_radius, PyObject *__pyx_v_voxel_graph) { +static PyObject *__pyx_pf_10dijkstra3d_30_execute_euclidean_distance_field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_sources, PyObject *__pyx_v_anisotropy, float __pyx_v_free_space_radius, PyObject *__pyx_v_voxel_graph) { __Pyx_memviewslice __pyx_v_arr_memview8 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_voxel_graph_memview = { 0, 0, { 0 }, { 0 }, { 0 } }; uint32_t *__pyx_v_voxel_graph_ptr; @@ -20842,7 +23128,7 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO __pyx_pybuffernd_dist.data = NULL; __pyx_pybuffernd_dist.rcbuffer = &__pyx_pybuffer_dist; - /* "dijkstra3d.pyx":1311 + /* "dijkstra3d.pyx":1513 * * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL # <<<<<<<<<<<<<< @@ -20851,7 +23137,7 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO */ __pyx_v_voxel_graph_ptr = NULL; - /* "dijkstra3d.pyx":1312 + /* "dijkstra3d.pyx":1514 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -20862,19 +23148,19 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dijkstra3d.pyx":1313 + /* "dijkstra3d.pyx":1515 * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: * voxel_graph_memview = voxel_graph # <<<<<<<<<<<<<< * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * */ - __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_v_voxel_graph, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1515, __pyx_L1_error) __pyx_v_voxel_graph_memview = __pyx_t_3; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "dijkstra3d.pyx":1314 + /* "dijkstra3d.pyx":1516 * if voxel_graph is not None: * voxel_graph_memview = voxel_graph * voxel_graph_ptr = &voxel_graph_memview[0,0,0] # <<<<<<<<<<<<<< @@ -20899,11 +23185,11 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO } else if (unlikely(__pyx_t_6 >= __pyx_v_voxel_graph_memview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1314, __pyx_L1_error) + __PYX_ERR(0, 1516, __pyx_L1_error) } __pyx_v_voxel_graph_ptr = ((uint32_t *)(&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_voxel_graph_memview.data + __pyx_t_4 * __pyx_v_voxel_graph_memview.strides[0]) ) + __pyx_t_5 * __pyx_v_voxel_graph_memview.strides[1]) ) + __pyx_t_6 * __pyx_v_voxel_graph_memview.strides[2]) ))))); - /* "dijkstra3d.pyx":1312 + /* "dijkstra3d.pyx":1514 * cdef uint32_t[:,:,:] voxel_graph_memview * cdef uint32_t* voxel_graph_ptr = NULL * if voxel_graph is not None: # <<<<<<<<<<<<<< @@ -20912,94 +23198,94 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO */ } - /* "dijkstra3d.pyx":1316 + /* "dijkstra3d.pyx":1518 * voxel_graph_ptr = &voxel_graph_memview[0,0,0] * * cdef size_t sx = data.shape[0] # <<<<<<<<<<<<<< * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sx = __pyx_t_10; - /* "dijkstra3d.pyx":1317 + /* "dijkstra3d.pyx":1519 * * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] # <<<<<<<<<<<<<< * cdef size_t sz = data.shape[2] * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_sy = __pyx_t_10; - /* "dijkstra3d.pyx":1318 + /* "dijkstra3d.pyx":1520 * cdef size_t sx = data.shape[0] * cdef size_t sy = data.shape[1] * cdef size_t sz = data.shape[2] # <<<<<<<<<<<<<< * * cdef float wx = anisotropy[0] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1520, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_sz = __pyx_t_10; - /* "dijkstra3d.pyx":1320 + /* "dijkstra3d.pyx":1522 * cdef size_t sz = data.shape[2] * * cdef float wx = anisotropy[0] # <<<<<<<<<<<<<< * cdef float wy = anisotropy[1] * cdef float wz = anisotropy[2] */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_anisotropy, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_anisotropy, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_wx = __pyx_t_11; - /* "dijkstra3d.pyx":1321 + /* "dijkstra3d.pyx":1523 * * cdef float wx = anisotropy[0] * cdef float wy = anisotropy[1] # <<<<<<<<<<<<<< * cdef float wz = anisotropy[2] * */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_anisotropy, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_anisotropy, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_wy = __pyx_t_11; - /* "dijkstra3d.pyx":1322 + /* "dijkstra3d.pyx":1524 * cdef float wx = anisotropy[0] * cdef float wy = anisotropy[1] * cdef float wz = anisotropy[2] # <<<<<<<<<<<<<< * * cdef vector[size_t] src */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_anisotropy, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_anisotropy, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1524, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_wz = __pyx_t_11; - /* "dijkstra3d.pyx":1325 + /* "dijkstra3d.pyx":1527 * * cdef vector[size_t] src * for source in sources: # <<<<<<<<<<<<<< @@ -21010,26 +23296,26 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO __pyx_t_9 = __pyx_v_sources; __Pyx_INCREF(__pyx_t_9); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_sources); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1325, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_sources); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1325, __pyx_L1_error) + __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1527, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1325, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1527, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1325, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1325, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1527, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1325, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -21039,7 +23325,7 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1325, __pyx_L1_error) + else __PYX_ERR(0, 1527, __pyx_L1_error) } break; } @@ -21048,49 +23334,49 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO __Pyx_XDECREF_SET(__pyx_v_source, __pyx_t_8); __pyx_t_8 = 0; - /* "dijkstra3d.pyx":1326 + /* "dijkstra3d.pyx":1528 * cdef vector[size_t] src * for source in sources: * src.push_back(source[0] + sx * (source[1] + sy * source[2])) # <<<<<<<<<<<<<< * * cdef cnp.ndarray[float, ndim=3] dist = np.zeros( (sx,sy,sz), dtype=np.float32, order='F' ) */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_source, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_source, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_source, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_18 = PyNumber_Multiply(__pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_18 = PyNumber_Multiply(__pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyNumber_Add(__pyx_t_15, __pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_17 = PyNumber_Add(__pyx_t_15, __pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = PyNumber_Multiply(__pyx_t_14, __pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_18 = PyNumber_Multiply(__pyx_t_14, __pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyNumber_Add(__pyx_t_8, __pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_17 = PyNumber_Add(__pyx_t_8, __pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_17); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_17); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; try { __pyx_v_src.push_back(__pyx_t_10); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1326, __pyx_L1_error) + __PYX_ERR(0, 1528, __pyx_L1_error) } - /* "dijkstra3d.pyx":1325 + /* "dijkstra3d.pyx":1527 * * cdef vector[size_t] src * for source in sources: # <<<<<<<<<<<<<< @@ -21100,25 +23386,25 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dijkstra3d.pyx":1328 + /* "dijkstra3d.pyx":1530 * src.push_back(source[0] + sx * (source[1] + sy * source[2])) * * cdef cnp.ndarray[float, ndim=3] dist = np.zeros( (sx,sy,sz), dtype=np.float32, order='F' ) # <<<<<<<<<<<<<< * * dtype = data.dtype */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1328, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_sx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_18 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyInt_FromSize_t(__pyx_v_sy); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_sz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); @@ -21129,33 +23415,33 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1328, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1328, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 1328, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1328, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_8, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1328, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1530, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_8, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1328, __pyx_L1_error) + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1530, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_9); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dist.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) { __pyx_v_dist = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dist.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1328, __pyx_L1_error) + __PYX_ERR(0, 1530, __pyx_L1_error) } else {__pyx_pybuffernd_dist.diminfo[0].strides = __pyx_pybuffernd_dist.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dist.diminfo[0].shape = __pyx_pybuffernd_dist.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dist.diminfo[1].strides = __pyx_pybuffernd_dist.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dist.diminfo[1].shape = __pyx_pybuffernd_dist.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dist.diminfo[2].strides = __pyx_pybuffernd_dist.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dist.diminfo[2].shape = __pyx_pybuffernd_dist.rcbuffer->pybuffer.shape[2]; } } @@ -21163,35 +23449,35 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO __pyx_v_dist = ((PyArrayObject *)__pyx_t_9); __pyx_t_9 = 0; - /* "dijkstra3d.pyx":1330 + /* "dijkstra3d.pyx":1532 * cdef cnp.ndarray[float, ndim=3] dist = np.zeros( (sx,sy,sz), dtype=np.float32, order='F' ) * * dtype = data.dtype # <<<<<<<<<<<<<< * cdef size_t max_loc = data.size + 1 * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_dtype = __pyx_t_9; __pyx_t_9 = 0; - /* "dijkstra3d.pyx":1331 + /* "dijkstra3d.pyx":1533 * * dtype = data.dtype * cdef size_t max_loc = data.size + 1 # <<<<<<<<<<<<<< * * if dtype in (np.int8, np.uint8, bool): */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_14); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_14); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1533, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_max_loc = __pyx_t_10; - /* "dijkstra3d.pyx":1333 + /* "dijkstra3d.pyx":1535 * cdef size_t max_loc = data.size + 1 * * if dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -21200,36 +23486,36 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_14 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1333, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L7_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1333, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L7_bool_binop_done; } - __pyx_t_9 = PyObject_RichCompare(__pyx_t_14, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1333, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_14, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1535, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L7_bool_binop_done:; @@ -21237,18 +23523,18 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO __pyx_t_1 = (__pyx_t_2 != 0); if (likely(__pyx_t_1)) { - /* "dijkstra3d.pyx":1334 + /* "dijkstra3d.pyx":1536 * * if dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) # <<<<<<<<<<<<<< * euclidean_distance_field3d( * &arr_memview8[0,0,0], */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1334, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -21264,16 +23550,16 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO __pyx_t_14 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_t_17) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_17); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1334, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 1536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_v_arr_memview8 = __pyx_t_20; __pyx_t_20.memview = NULL; __pyx_t_20.data = NULL; - /* "dijkstra3d.pyx":1336 + /* "dijkstra3d.pyx":1538 * arr_memview8 = data.astype(np.uint8) * euclidean_distance_field3d( * &arr_memview8[0,0,0], # <<<<<<<<<<<<<< @@ -21298,10 +23584,10 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO } else if (unlikely(__pyx_t_4 >= __pyx_v_arr_memview8.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1336, __pyx_L1_error) + __PYX_ERR(0, 1538, __pyx_L1_error) } - /* "dijkstra3d.pyx":1340 + /* "dijkstra3d.pyx":1542 * wx, wy, wz, * src, free_space_radius, * &dist[0,0,0], # <<<<<<<<<<<<<< @@ -21326,10 +23612,10 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_dist.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1340, __pyx_L1_error) + __PYX_ERR(0, 1542, __pyx_L1_error) } - /* "dijkstra3d.pyx":1335 + /* "dijkstra3d.pyx":1537 * if dtype in (np.int8, np.uint8, bool): * arr_memview8 = data.astype(np.uint8) * euclidean_distance_field3d( # <<<<<<<<<<<<<< @@ -21338,7 +23624,7 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO */ (void)(dijkstra::euclidean_distance_field3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8.data + __pyx_t_6 * __pyx_v_arr_memview8.strides[0]) ) + __pyx_t_5 * __pyx_v_arr_memview8.strides[1]) ) + __pyx_t_4 * __pyx_v_arr_memview8.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_wx, __pyx_v_wy, __pyx_v_wz, __pyx_v_src, __pyx_v_free_space_radius, (&(*__Pyx_BufPtrStrided3d(float *, __pyx_pybuffernd_dist.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_dist.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_dist.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_dist.diminfo[2].strides))), __pyx_v_voxel_graph_ptr, __pyx_v_max_loc)); - /* "dijkstra3d.pyx":1333 + /* "dijkstra3d.pyx":1535 * cdef size_t max_loc = data.size + 1 * * if dtype in (np.int8, np.uint8, bool): # <<<<<<<<<<<<<< @@ -21348,7 +23634,7 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO goto __pyx_L6; } - /* "dijkstra3d.pyx":1345 + /* "dijkstra3d.pyx":1547 * ) * else: * raise TypeError("Type {} not currently supported.".format(dtype)) # <<<<<<<<<<<<<< @@ -21356,7 +23642,7 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO * if max_loc == data.size + 1: */ /*else*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1345, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_17 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { @@ -21370,59 +23656,59 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO } __pyx_t_14 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_17, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1345, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1345, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 1345, __pyx_L1_error) + __PYX_ERR(0, 1547, __pyx_L1_error) } __pyx_L6:; - /* "dijkstra3d.pyx":1347 + /* "dijkstra3d.pyx":1549 * raise TypeError("Type {} not currently supported.".format(dtype)) * * if max_loc == data.size + 1: # <<<<<<<<<<<<<< * raise ValueError(f"Something went wrong during processing. max_loc: {max_loc}") * */ - __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_max_loc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_max_loc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_17 = __Pyx_PyInt_AddObjC(__pyx_t_14, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyInt_AddObjC(__pyx_t_14, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_RichCompare(__pyx_t_9, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_9, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(__pyx_t_1)) { - /* "dijkstra3d.pyx":1348 + /* "dijkstra3d.pyx":1550 * * if max_loc == data.size + 1: * raise ValueError(f"Something went wrong during processing. max_loc: {max_loc}") # <<<<<<<<<<<<<< * * return dist, max_loc */ - __pyx_t_14 = __Pyx_PyUnicode_From_size_t(__pyx_v_max_loc, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyUnicode_From_size_t(__pyx_v_max_loc, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_17 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Something_went_wrong_during_proc, __pyx_t_14); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Something_went_wrong_during_proc, __pyx_t_14); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_17); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_17); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_Raise(__pyx_t_14, 0, 0, 0); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __PYX_ERR(0, 1348, __pyx_L1_error) + __PYX_ERR(0, 1550, __pyx_L1_error) - /* "dijkstra3d.pyx":1347 + /* "dijkstra3d.pyx":1549 * raise TypeError("Type {} not currently supported.".format(dtype)) * * if max_loc == data.size + 1: # <<<<<<<<<<<<<< @@ -21431,15 +23717,15 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO */ } - /* "dijkstra3d.pyx":1350 + /* "dijkstra3d.pyx":1552 * raise ValueError(f"Something went wrong during processing. max_loc: {max_loc}") * * return dist, max_loc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_max_loc); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_FromSize_t(__pyx_v_max_loc); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_INCREF(((PyObject *)__pyx_v_dist)); __Pyx_GIVEREF(((PyObject *)__pyx_v_dist)); @@ -21451,7 +23737,7 @@ static PyObject *__pyx_pf_10dijkstra3d_28_execute_euclidean_distance_field(CYTHO __pyx_t_17 = 0; goto __pyx_L0; - /* "dijkstra3d.pyx":1304 + /* "dijkstra3d.pyx":1506 * return parents32 * * def _execute_euclidean_distance_field( # <<<<<<<<<<<<<< @@ -22144,7 +24430,7 @@ static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self __Pyx_RefNannyFinishContext(); } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":734 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -22161,7 +24447,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":735 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":736 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -22169,13 +24455,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 735, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":734 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -22194,7 +24480,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":737 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -22211,7 +24497,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":738 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":739 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -22219,13 +24505,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 738, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":737 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -22244,7 +24530,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":740 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -22261,7 +24547,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":741 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":742 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -22269,13 +24555,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 741, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":740 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -22294,7 +24580,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":743 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -22311,7 +24597,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":744 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":745 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -22319,13 +24605,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 744, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":743 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -22344,7 +24630,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":746 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -22361,7 +24647,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":747 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":748 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -22369,13 +24655,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 747, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":746 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -22394,7 +24680,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":749 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -22408,7 +24694,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":750 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -22418,7 +24704,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":751 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":752 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -22430,7 +24716,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":750 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -22439,7 +24725,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":753 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":754 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -22453,7 +24739,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":749 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -22468,7 +24754,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":868 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -22480,7 +24766,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":869 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":930 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -22489,7 +24775,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":870 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":931 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -22498,7 +24784,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":868 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -22510,7 +24796,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":872 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -22525,7 +24811,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":873 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":934 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -22534,7 +24820,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":874 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":935 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -22544,7 +24830,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":875 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":936 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -22555,7 +24841,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":874 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":935 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -22564,7 +24850,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":876 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":937 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -22576,7 +24862,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":872 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -22591,7 +24877,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":880 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":941 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -22615,7 +24901,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":881 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -22631,16 +24917,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":882 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":943 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 882, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error) - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":881 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -22654,7 +24940,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":883 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":944 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -22664,28 +24950,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 883, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":884 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":945 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 884, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 884, __pyx_L5_except_error) + __PYX_ERR(2, 945, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":881 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -22700,7 +24986,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":880 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":941 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -22723,7 +25009,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":886 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -22747,7 +25033,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":887 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -22763,16 +25049,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":888 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":949 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 888, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error) - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":887 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -22786,7 +25072,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":889 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":950 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -22796,28 +25082,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 889, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":890 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":951 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 890, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 890, __pyx_L5_except_error) + __PYX_ERR(2, 951, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":887 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -22832,7 +25118,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":886 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -22855,7 +25141,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":892 +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -22879,7 +25165,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":893 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -22895,16 +25181,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":894 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":955 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 894, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error) - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":893 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -22918,7 +25204,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":895 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":956 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -22928,28 +25214,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 895, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":896 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":957 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef extern from *: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 896, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 896, __pyx_L5_except_error) + __PYX_ERR(2, 957, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":893 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -22964,7 +25250,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":892 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -22987,6 +25273,180 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":979 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":967 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":994 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":982 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":1004 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":997 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + +static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { + npy_timedelta __pyx_r; + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":1011 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":1007 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":1018 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< + */ + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; + + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":1014 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + /* "View.MemoryView":122 * cdef bint dtype_is_object * @@ -23190,7 +25650,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 133, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23222,7 +25682,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 136, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23349,7 +25809,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 148, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23623,7 +26083,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if self.dtype_is_object: */ - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 176, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -23867,7 +26327,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 192, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -24601,7 +27061,7 @@ static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __p * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -24657,7 +27117,7 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -26367,7 +28827,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 418, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27415,7 +29875,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 495, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 495, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -27777,7 +30237,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * * if flags & PyBUF_ND: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 520, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -28326,7 +30786,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 570, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -28443,7 +30903,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__24, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__25, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -29481,7 +31941,7 @@ static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struc * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -29537,7 +31997,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -29894,9 +32354,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__4); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 682, __pyx_L1_error) @@ -29929,7 +32389,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 685, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 685, __pyx_L1_error) } __pyx_L7:; @@ -30069,9 +32529,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__2); + __Pyx_INCREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__4); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 696, __pyx_L1_error) @@ -30198,7 +32658,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 703, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -32382,7 +34842,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -32438,7 +34898,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -36097,8 +38557,8 @@ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { * else: * alignment = b'' */ - __Pyx_INCREF(__pyx_kp_b__30); - __pyx_v_alignment = __pyx_kp_b__30; + __Pyx_INCREF(__pyx_kp_b__31); + __pyx_v_alignment = __pyx_kp_b__31; /* "BufferFormatFromTypeInfo":1472 * assert type.fields.type != NULL @@ -36118,8 +38578,8 @@ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { * parts = [b"T{"] */ /*else*/ { - __Pyx_INCREF(__pyx_kp_b__31); - __pyx_v_alignment = __pyx_kp_b__31; + __Pyx_INCREF(__pyx_kp_b__32); + __pyx_v_alignment = __pyx_kp_b__32; } __pyx_L4:; @@ -36178,7 +38638,7 @@ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { * field += 1 * */ - __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__32); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1482, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__33); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -36186,7 +38646,7 @@ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__32); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1482, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__33); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(3, 1482, __pyx_L1_error) @@ -36211,7 +38671,7 @@ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { */ __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__33); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1485, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__34); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 1485, __pyx_L1_error) @@ -36279,7 +38739,7 @@ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { * else: * result = fmt.string */ - __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__34, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1490, __pyx_L1_error) + __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__35, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s_2, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -37148,6 +39608,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, {&__pyx_kp_u_Only_2D_and_3D_image_sources_are, __pyx_k_Only_2D_and_3D_image_sources_are, sizeof(__pyx_k_Only_2D_and_3D_image_sources_are), 0, 1, 0, 0}, {&__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_k_Only_6_18_and_26_connectivities, sizeof(__pyx_k_Only_6_18_and_26_connectivities), 0, 1, 0, 0}, + {&__pyx_kp_u_Only_intensity_and_gradient_mode, __pyx_k_Only_intensity_and_gradient_mode, sizeof(__pyx_k_Only_intensity_and_gradient_mode), 0, 1, 0, 0}, {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_kp_u_Selected_voxel_was_not_located_i, __pyx_k_Selected_voxel_was_not_located_i, sizeof(__pyx_k_Selected_voxel_was_not_located_i), 0, 1, 0, 0}, @@ -37159,13 +39620,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_VERSION, __pyx_k_VERSION, sizeof(__pyx_k_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, - {&__pyx_kp_b__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 0, 0}, {&__pyx_kp_b__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 0, 0, 0}, {&__pyx_kp_b__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 0, 0}, {&__pyx_kp_b__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 0, 0}, - {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0}, - {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, - {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_b__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 0, 0}, + {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_anisotropy, __pyx_k_anisotropy, sizeof(__pyx_k_anisotropy), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, @@ -37215,6 +39676,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_execute_dijkstra, __pyx_k_execute_dijkstra, sizeof(__pyx_k_execute_dijkstra), 0, 0, 1, 1}, {&__pyx_n_s_execute_distance_field, __pyx_k_execute_distance_field, sizeof(__pyx_k_execute_distance_field), 0, 0, 1, 1}, {&__pyx_n_s_execute_euclidean_distance_fiel, __pyx_k_execute_euclidean_distance_fiel, sizeof(__pyx_k_execute_euclidean_distance_fiel), 0, 0, 1, 1}, + {&__pyx_n_s_execute_gradient_dijkstra, __pyx_k_execute_gradient_dijkstra, sizeof(__pyx_k_execute_gradient_dijkstra), 0, 0, 1, 1}, {&__pyx_n_s_execute_parental_field, __pyx_k_execute_parental_field, sizeof(__pyx_k_execute_parental_field), 0, 0, 1, 1}, {&__pyx_n_s_execute_value_target_dijkstra, __pyx_k_execute_value_target_dijkstra, sizeof(__pyx_k_execute_value_target_dijkstra), 0, 0, 1, 1}, {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, @@ -37229,6 +39691,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_frombuffer, __pyx_k_frombuffer, sizeof(__pyx_k_frombuffer), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_u_gradient, __pyx_k_gradient, sizeof(__pyx_k_gradient), 0, 1, 0, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_iinfo, __pyx_k_iinfo, sizeof(__pyx_k_iinfo), 0, 0, 1, 1}, @@ -37237,6 +39700,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_u_intensity, __pyx_k_intensity, sizeof(__pyx_k_intensity), 0, 1, 0, 1}, {&__pyx_n_s_issubdtype, __pyx_k_issubdtype, sizeof(__pyx_k_issubdtype), 0, 0, 1, 1}, {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, @@ -37248,6 +39712,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_max_loc, __pyx_k_max_loc, sizeof(__pyx_k_max_loc), 0, 0, 1, 1}, {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_metric, __pyx_k_metric, sizeof(__pyx_k_metric), 0, 0, 1, 1}, + {&__pyx_n_s_metric_args, __pyx_k_metric_args, sizeof(__pyx_k_metric_args), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, @@ -37352,6 +39818,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_voxel_graph_memview, __pyx_k_voxel_graph_memview, sizeof(__pyx_k_voxel_graph_memview), 0, 0, 1, 1}, {&__pyx_n_s_voxel_graph_ptr, __pyx_k_voxel_graph_ptr, sizeof(__pyx_k_voxel_graph_ptr), 0, 0, 1, 1}, {&__pyx_n_s_voxels, __pyx_k_voxels, sizeof(__pyx_k_voxels), 0, 0, 1, 1}, + {&__pyx_n_s_w_dist, __pyx_k_w_dist, sizeof(__pyx_k_w_dist), 0, 0, 1, 1}, + {&__pyx_n_s_w_intensity, __pyx_k_w_intensity, sizeof(__pyx_k_w_intensity), 0, 0, 1, 1}, {&__pyx_n_s_wx, __pyx_k_wx, sizeof(__pyx_k_wx), 0, 0, 1, 1}, {&__pyx_n_s_wy, __pyx_k_wy, sizeof(__pyx_k_wy), 0, 0, 1, 1}, {&__pyx_n_s_wz, __pyx_k_wz, sizeof(__pyx_k_wz), 0, 0, 1, 1}, @@ -37359,13 +39827,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 169, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 358, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 358, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 538, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 580, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 109, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 884, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error) __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 404, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(3, 613, __pyx_L1_error) return 0; @@ -37377,107 +39845,107 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "dijkstra3d.pyx":174 + /* "dijkstra3d.pyx":125 + * voxel_graph=None, + * metric="intensity", metric_args=[], + * anisotropy=(1,1,1) # <<<<<<<<<<<<<< + * ): + * """ + */ + __pyx_tuple__2 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "dijkstra3d.pyx":200 * * if data.size == 0: * return np.zeros(shape=(0,), dtype=np.uint32, order='F') # <<<<<<<<<<<<<< * * _validate_coord(data, source) */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); - /* "dijkstra3d.pyx":180 + /* "dijkstra3d.pyx":206 * * if dims == 2: * data = data[:, :, np.newaxis] # <<<<<<<<<<<<<< * source = list(source) + [ 0 ] * target = list(target) + [ 0 ] */ - __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); + __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); - /* "dijkstra3d.pyx":335 + /* "dijkstra3d.pyx":372 * if source.shape[1] < 3: * tmp = np.zeros((source.shape[0], 3), dtype=np.uint64) * tmp[:, :source.shape[1]] = source[:,:] # <<<<<<<<<<<<<< * source = tmp * */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_slice__2, __pyx_slice__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__5 = PyTuple_Pack(2, __pyx_slice__4, __pyx_slice__4); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); - /* "dijkstra3d.pyx":358 + /* "dijkstra3d.pyx":395 * * # parents is either uint32 or uint64 * def _path_from_parents_helper(cnp.ndarray[UINT, ndim=3] parents, target): # <<<<<<<<<<<<<< * cdef UINT[:,:,:] arr_memview * cdef vector[UINT] path */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); - /* "dijkstra3d.pyx":375 + /* "dijkstra3d.pyx":412 * vec_view = path_ptr * buf = bytearray(vec_view[:]) * return np.frombuffer(buf, dtype=parents.dtype)[::-1] # <<<<<<<<<<<<<< * * def path_from_parents(parents, target): */ - __pyx_slice__8 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__8); - __Pyx_GIVEREF(__pyx_slice__8); + __pyx_slice__10 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__10); + __Pyx_GIVEREF(__pyx_slice__10); - /* "dijkstra3d.pyx":455 - * - * def euclidean_distance_field( - * data, source, anisotropy=(1,1,1), # <<<<<<<<<<<<<< - * free_space_radius=0, voxel_graph=None, - * return_max_location=False - */ - __pyx_tuple__9 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - - /* "dijkstra3d.pyx":701 + /* "dijkstra3d.pyx":752 * output_ptr64 = &output64[0] * if output64.size() == 0: * return np.zeros((0,), dtype=np.uint64) # <<<<<<<<<<<<<< * vec_view64 = output_ptr64 * buf = bytearray(vec_view64[:]) */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_tuple_); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_tuple__3); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":884 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":945 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); - /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":890 + /* "../../.virtualenvs/dijkstra/lib/python3.9/site-packages/numpy/__init__.pxd":951 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "View.MemoryView":133 * @@ -37486,9 +39954,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if itemsize <= 0: */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "View.MemoryView":136 * @@ -37497,9 +39965,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if not isinstance(format, bytes): */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "View.MemoryView":148 * @@ -37508,9 +39976,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "View.MemoryView":176 * self.data = malloc(self.len) @@ -37519,9 +39987,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if self.dtype_is_object: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "View.MemoryView":192 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -37530,9 +39998,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * info.buf = self.data * info.len = self.len */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -37540,18 +40008,18 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "View.MemoryView":418 * def __setitem__(memoryview self, object index, object value): @@ -37560,9 +40028,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "View.MemoryView":495 * result = struct.unpack(self.view.format, bytesitem) @@ -37571,9 +40039,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * else: * if len(self.view.format) == 1: */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(3, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "View.MemoryView":520 * def __getbuffer__(self, Py_buffer *info, int flags): @@ -37582,9 +40050,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if flags & PyBUF_ND: */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(3, 520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "View.MemoryView":570 * if self.view.strides == NULL: @@ -37593,9 +40061,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "View.MemoryView":577 * def suboffsets(self): @@ -37604,12 +40072,12 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__24 = PyTuple_New(1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); + __pyx_tuple__25 = PyTuple_New(1); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__24, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__24); + PyTuple_SET_ITEM(__pyx_tuple__25, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__25); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -37617,18 +40085,18 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "View.MemoryView":703 * for suboffset in suboffsets[:ndim]: @@ -37637,9 +40105,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -37647,198 +40115,210 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); - /* "dijkstra3d.pyx":102 + /* "dijkstra3d.pyx":110 * ) * * def format_voxel_graph(voxel_graph): # <<<<<<<<<<<<<< * while voxel_graph.ndim < 3: * voxel_graph = voxel_graph[..., np.newaxis] */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_voxel_graph); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_format_voxel_graph, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_voxel_graph); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_format_voxel_graph, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 110, __pyx_L1_error) - /* "dijkstra3d.pyx":111 + /* "dijkstra3d.pyx":119 * return np.asfortranarray(voxel_graph) * * def dijkstra( # <<<<<<<<<<<<<< * data, source, target, * bidirectional=False, connectivity=26, */ - __pyx_tuple__37 = PyTuple_Pack(13, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_target, __pyx_n_s_bidirectional, __pyx_n_s_connectivity, __pyx_n_s_compass, __pyx_n_s_compass_norm, __pyx_n_s_voxel_graph, __pyx_n_s_dims, __pyx_n_s_cols, __pyx_n_s_rows, __pyx_n_s_depth, __pyx_n_s_path); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(8, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_dijkstra, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(18, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_target, __pyx_n_s_bidirectional, __pyx_n_s_connectivity, __pyx_n_s_compass, __pyx_n_s_compass_norm, __pyx_n_s_voxel_graph, __pyx_n_s_metric, __pyx_n_s_metric_args, __pyx_n_s_anisotropy, __pyx_n_s_dims, __pyx_n_s_cols, __pyx_n_s_rows, __pyx_n_s_depth, __pyx_n_s_path, __pyx_n_s_w_dist, __pyx_n_s_w_intensity); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(11, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_dijkstra, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 119, __pyx_L1_error) - /* "dijkstra3d.pyx":201 + /* "dijkstra3d.pyx":238 * return _path_to_point_cloud(path, dims, rows, cols) * * def railroad( # <<<<<<<<<<<<<< * data, source, * connectivity=26, voxel_graph=None */ - __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_dims, __pyx_n_s_cols, __pyx_n_s_rows, __pyx_n_s_path); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_railroad, 201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(8, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_dims, __pyx_n_s_cols, __pyx_n_s_rows, __pyx_n_s_path); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_railroad, 238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 238, __pyx_L1_error) - /* "dijkstra3d.pyx":274 + /* "dijkstra3d.pyx":311 * return _path_to_point_cloud(path, dims, rows, cols) * * def distance_field( # <<<<<<<<<<<<<< * data, source, connectivity=26, * voxel_graph=None, return_max_location=False */ - __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_return_max_location, __pyx_n_s_dims, __pyx_n_s_src, __pyx_n_s_tmp, __pyx_n_s_field, __pyx_n_s_max_loc); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_distance_field, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_tuple__42 = PyTuple_Pack(10, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_return_max_location, __pyx_n_s_dims, __pyx_n_s_src, __pyx_n_s_tmp, __pyx_n_s_field, __pyx_n_s_max_loc); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_distance_field, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 311, __pyx_L1_error) - /* "dijkstra3d.pyx":358 + /* "dijkstra3d.pyx":395 * * # parents is either uint32 or uint64 * def _path_from_parents_helper(cnp.ndarray[UINT, ndim=3] parents, target): # <<<<<<<<<<<<<< * cdef UINT[:,:,:] arr_memview * cdef vector[UINT] path */ - __pyx_tuple__43 = PyTuple_Pack(11, __pyx_n_s_parents, __pyx_n_s_target, __pyx_n_s_arr_memview, __pyx_n_s_path, __pyx_n_s_path_ptr, __pyx_n_s_vec_view, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_targ, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_path_from_parents_helper, 358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_tuple__44 = PyTuple_Pack(11, __pyx_n_s_parents, __pyx_n_s_target, __pyx_n_s_arr_memview, __pyx_n_s_path, __pyx_n_s_path_ptr, __pyx_n_s_vec_view, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_targ, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_path_from_parents_helper, 395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 395, __pyx_L1_error) - /* "dijkstra3d.pyx":377 + /* "dijkstra3d.pyx":414 * return np.frombuffer(buf, dtype=parents.dtype)[::-1] * * def path_from_parents(parents, target): # <<<<<<<<<<<<<< * ndim = parents.ndim * while parents.ndim < 3: */ - __pyx_tuple__45 = PyTuple_Pack(7, __pyx_n_s_parents, __pyx_n_s_target, __pyx_n_s_ndim, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_numpy_path, __pyx_n_s_ptlist); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 377, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_path_from_parents, 377, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_tuple__46 = PyTuple_Pack(7, __pyx_n_s_parents, __pyx_n_s_target, __pyx_n_s_ndim, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_numpy_path, __pyx_n_s_ptlist); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_path_from_parents, 414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 414, __pyx_L1_error) - /* "dijkstra3d.pyx":392 + /* "dijkstra3d.pyx":429 * return ptlist[:, :ndim] * * def parental_field(data, source, connectivity=26, voxel_graph=None): # <<<<<<<<<<<<<< * """ * Use dijkstra's shortest path algorithm */ - __pyx_tuple__47 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_dims, __pyx_n_s_field); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_parental_field, 392, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_tuple__48 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_dims, __pyx_n_s_field); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_parental_field, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 429, __pyx_L1_error) - /* "dijkstra3d.pyx":454 + /* "dijkstra3d.pyx":491 * return field * * def euclidean_distance_field( # <<<<<<<<<<<<<< * data, source, anisotropy=(1,1,1), * free_space_radius=0, voxel_graph=None, */ - __pyx_tuple__49 = PyTuple_Pack(11, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_anisotropy, __pyx_n_s_free_space_radius, __pyx_n_s_voxel_graph, __pyx_n_s_return_max_location, __pyx_n_s_dims, __pyx_n_s_tmp, __pyx_n_s_src, __pyx_n_s_field, __pyx_n_s_max_loc); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(6, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_euclidean_distance_field, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(11, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_anisotropy, __pyx_n_s_free_space_radius, __pyx_n_s_voxel_graph, __pyx_n_s_return_max_location, __pyx_n_s_dims, __pyx_n_s_tmp, __pyx_n_s_src, __pyx_n_s_field, __pyx_n_s_max_loc); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(6, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_euclidean_distance_field, 491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 491, __pyx_L1_error) - /* "dijkstra3d.pyx":534 + /* "dijkstra3d.pyx":571 * return field * * def _validate_coord(data, coord): # <<<<<<<<<<<<<< * dims = len(data.shape) * */ - __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_data, __pyx_n_s_coord, __pyx_n_s_dims, __pyx_n_s_i, __pyx_n_s_size); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_validate_coord, 534, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 534, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_data, __pyx_n_s_coord, __pyx_n_s_dims, __pyx_n_s_i, __pyx_n_s_size); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_validate_coord, 571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 571, __pyx_L1_error) - /* "dijkstra3d.pyx":547 + /* "dijkstra3d.pyx":584 * raise IndexError("Selected voxel {} was not located inside the array.".format(coord)) * * def _path_to_point_cloud(path, dims, rows, cols): # <<<<<<<<<<<<<< * ptlist = np.zeros((path.shape[0], dims), dtype=np.uint32) * */ - __pyx_tuple__53 = PyTuple_Pack(8, __pyx_n_s_path, __pyx_n_s_dims, __pyx_n_s_rows, __pyx_n_s_cols, __pyx_n_s_ptlist, __pyx_n_s_sxy, __pyx_n_s_i, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_path_to_point_cloud, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(8, __pyx_n_s_path, __pyx_n_s_dims, __pyx_n_s_rows, __pyx_n_s_cols, __pyx_n_s_ptlist, __pyx_n_s_sxy, __pyx_n_s_i, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_path_to_point_cloud, 584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 584, __pyx_L1_error) - /* "dijkstra3d.pyx":565 + /* "dijkstra3d.pyx":602 * return ptlist * + * def _execute_gradient_dijkstra( # <<<<<<<<<<<<<< + * data, source, target, + * float wx, float wy, float wz, + */ + __pyx_tuple__56 = PyTuple_Pack(32, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_target, __pyx_n_s_wx, __pyx_n_s_wy, __pyx_n_s_wz, __pyx_n_s_w_dist, __pyx_n_s_w_intensity, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_arr_memview16, __pyx_n_s_arr_memview32, __pyx_n_s_arr_memview64, __pyx_n_s_arr_memviewfloat, __pyx_n_s_arr_memviewdouble, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_src, __pyx_n_s_output32, __pyx_n_s_output64, __pyx_n_s_sixtyfourbit, __pyx_n_s_dtype, __pyx_n_s_output_ptr32, __pyx_n_s_output_ptr64, __pyx_n_s_vec_view32, __pyx_n_s_vec_view64, __pyx_n_s_buf, __pyx_n_s_output); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(10, 0, 32, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_gradient_dijkstra, 602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 602, __pyx_L1_error) + + /* "dijkstra3d.pyx":767 + * + * * def _execute_value_target_dijkstra( # <<<<<<<<<<<<<< * data, source, * int connectivity, voxel_graph=None */ - __pyx_tuple__55 = PyTuple_Pack(26, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_arr_memview16, __pyx_n_s_arr_memview32, __pyx_n_s_arr_memview64, __pyx_n_s_arr_memviewfloat, __pyx_n_s_arr_memviewdouble, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_src, __pyx_n_s_output32, __pyx_n_s_output64, __pyx_n_s_sixtyfourbit, __pyx_n_s_dtype, __pyx_n_s_output_ptr32, __pyx_n_s_output_ptr64, __pyx_n_s_vec_view32, __pyx_n_s_vec_view64, __pyx_n_s_buf, __pyx_n_s_output); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); - __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(4, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_value_target_dijkstra, 565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_tuple__58 = PyTuple_Pack(26, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_arr_memview16, __pyx_n_s_arr_memview32, __pyx_n_s_arr_memview64, __pyx_n_s_arr_memviewfloat, __pyx_n_s_arr_memviewdouble, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_src, __pyx_n_s_output32, __pyx_n_s_output64, __pyx_n_s_sixtyfourbit, __pyx_n_s_dtype, __pyx_n_s_output_ptr32, __pyx_n_s_output_ptr64, __pyx_n_s_vec_view32, __pyx_n_s_vec_view64, __pyx_n_s_buf, __pyx_n_s_output); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(4, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_value_target_dijkstra, 767, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 767, __pyx_L1_error) - /* "dijkstra3d.pyx":715 + /* "dijkstra3d.pyx":917 * return output[::-1] * * def _execute_dijkstra( # <<<<<<<<<<<<<< * data, source, target, int connectivity, * bidirectional, compass, float compass_norm=-1, */ - __pyx_tuple__57 = PyTuple_Pack(31, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_target, __pyx_n_s_connectivity, __pyx_n_s_bidirectional, __pyx_n_s_compass, __pyx_n_s_compass_norm, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_arr_memview16, __pyx_n_s_arr_memview32, __pyx_n_s_arr_memview64, __pyx_n_s_arr_memviewfloat, __pyx_n_s_arr_memviewdouble, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_src, __pyx_n_s_sink, __pyx_n_s_output32, __pyx_n_s_output64, __pyx_n_s_sixtyfourbit, __pyx_n_s_dtype, __pyx_n_s_output_ptr32, __pyx_n_s_output_ptr64, __pyx_n_s_vec_view32, __pyx_n_s_vec_view64, __pyx_n_s_buf, __pyx_n_s_output); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(8, 0, 31, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_dijkstra, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_tuple__60 = PyTuple_Pack(31, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_target, __pyx_n_s_connectivity, __pyx_n_s_bidirectional, __pyx_n_s_compass, __pyx_n_s_compass_norm, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_arr_memview16, __pyx_n_s_arr_memview32, __pyx_n_s_arr_memview64, __pyx_n_s_arr_memviewfloat, __pyx_n_s_arr_memviewdouble, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_src, __pyx_n_s_sink, __pyx_n_s_output32, __pyx_n_s_output64, __pyx_n_s_sixtyfourbit, __pyx_n_s_dtype, __pyx_n_s_output_ptr32, __pyx_n_s_output_ptr64, __pyx_n_s_vec_view32, __pyx_n_s_vec_view64, __pyx_n_s_buf, __pyx_n_s_output); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(8, 0, 31, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_dijkstra, 917, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 917, __pyx_L1_error) - /* "dijkstra3d.pyx":1068 + /* "dijkstra3d.pyx":1270 * return output[::-1] * * def _execute_distance_field(data, sources, connectivity, voxel_graph): # <<<<<<<<<<<<<< * cdef uint8_t[:,:,:] arr_memview8 * cdef uint16_t[:,:,:] arr_memview16 */ - __pyx_tuple__59 = PyTuple_Pack(23, __pyx_n_s_data, __pyx_n_s_sources, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_arr_memview16, __pyx_n_s_arr_memview32, __pyx_n_s_arr_memview64, __pyx_n_s_arr_memviewfloat, __pyx_n_s_arr_memviewdouble, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_src, __pyx_n_s_source, __pyx_n_s_dist, __pyx_n_s_max_loc, __pyx_n_s_dtype, __pyx_n_s_voxels, __pyx_n_s_dist_view, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(4, 0, 23, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_distance_field, 1068, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 1068, __pyx_L1_error) + __pyx_tuple__62 = PyTuple_Pack(23, __pyx_n_s_data, __pyx_n_s_sources, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_arr_memview16, __pyx_n_s_arr_memview32, __pyx_n_s_arr_memview64, __pyx_n_s_arr_memviewfloat, __pyx_n_s_arr_memviewdouble, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_src, __pyx_n_s_source, __pyx_n_s_dist, __pyx_n_s_max_loc, __pyx_n_s_dtype, __pyx_n_s_voxels, __pyx_n_s_dist_view, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 1270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(4, 0, 23, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_distance_field, 1270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 1270, __pyx_L1_error) - /* "dijkstra3d.pyx":1156 + /* "dijkstra3d.pyx":1358 * return buf, max_loc * * def _execute_parental_field(data, source, connectivity, voxel_graph): # <<<<<<<<<<<<<< * cdef uint8_t[:,:,:] arr_memview8 * cdef uint16_t[:,:,:] arr_memview16 */ - __pyx_tuple__61 = PyTuple_Pack(20, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_arr_memview16, __pyx_n_s_arr_memview32, __pyx_n_s_arr_memview64, __pyx_n_s_arr_memviewfloat, __pyx_n_s_arr_memviewdouble, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_src, __pyx_n_s_sixtyfourbit, __pyx_n_s_parents32, __pyx_n_s_parents64, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(4, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_parental_field, 1156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 1156, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(20, __pyx_n_s_data, __pyx_n_s_source, __pyx_n_s_connectivity, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_arr_memview16, __pyx_n_s_arr_memview32, __pyx_n_s_arr_memview64, __pyx_n_s_arr_memviewfloat, __pyx_n_s_arr_memviewdouble, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_src, __pyx_n_s_sixtyfourbit, __pyx_n_s_parents32, __pyx_n_s_parents64, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1358, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(4, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_parental_field, 1358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 1358, __pyx_L1_error) - /* "dijkstra3d.pyx":1304 + /* "dijkstra3d.pyx":1506 * return parents32 * * def _execute_euclidean_distance_field( # <<<<<<<<<<<<<< * data, sources, anisotropy, float free_space_radius=0, * voxel_graph=None */ - __pyx_tuple__63 = PyTuple_Pack(19, __pyx_n_s_data, __pyx_n_s_sources, __pyx_n_s_anisotropy, __pyx_n_s_free_space_radius, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_wx, __pyx_n_s_wy, __pyx_n_s_wz, __pyx_n_s_src, __pyx_n_s_source, __pyx_n_s_dist, __pyx_n_s_dtype, __pyx_n_s_max_loc); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_euclidean_distance_fiel, 1304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 1304, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(19, __pyx_n_s_data, __pyx_n_s_sources, __pyx_n_s_anisotropy, __pyx_n_s_free_space_radius, __pyx_n_s_voxel_graph, __pyx_n_s_arr_memview8, __pyx_n_s_voxel_graph_memview, __pyx_n_s_voxel_graph_ptr, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_wx, __pyx_n_s_wy, __pyx_n_s_wz, __pyx_n_s_src, __pyx_n_s_source, __pyx_n_s_dist, __pyx_n_s_dtype, __pyx_n_s_max_loc); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dijkstra3d_pyx, __pyx_n_s_execute_euclidean_distance_fiel, 1506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1506, __pyx_L1_error) /* "View.MemoryView":286 * return self.name @@ -37847,9 +40327,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(3, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(3, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); /* "View.MemoryView":287 * @@ -37858,9 +40338,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef indirect = Enum("") * */ - __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(3, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); /* "View.MemoryView":288 * cdef generic = Enum("") @@ -37869,9 +40349,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(3, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); /* "View.MemoryView":291 * @@ -37880,9 +40360,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(3, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(3, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); /* "View.MemoryView":292 * @@ -37891,19 +40371,19 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(3, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(3, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(3, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(3, 1, __pyx_L1_error) + __pyx_tuple__73 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(3, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(3, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -37913,6 +40393,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -38065,18 +40546,38 @@ static int __Pyx_modinit_type_import_code(void) { __pyx_ptype_7cpython_5array_array = __Pyx_ImportType(__pyx_t_1, "array", "array", sizeof(arrayobject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(1, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 199, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 199, __pyx_L1_error) + if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error) __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 222, __pyx_L1_error) + if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error) __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 226, __pyx_L1_error) + if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error) __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) + if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error) __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 764, __pyx_L1_error) + if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -38377,210 +40878,235 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":102 + /* "dijkstra3d.pyx":110 * ) * * def format_voxel_graph(voxel_graph): # <<<<<<<<<<<<<< * while voxel_graph.ndim < 3: * voxel_graph = voxel_graph[..., np.newaxis] */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_1format_voxel_graph, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_1format_voxel_graph, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_format_voxel_graph, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_format_voxel_graph, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":111 + /* "dijkstra3d.pyx":124 + * compass=False, compass_norm=-1, + * voxel_graph=None, + * metric="intensity", metric_args=[], # <<<<<<<<<<<<<< + * anisotropy=(1,1,1) + * ): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_ = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "dijkstra3d.pyx":119 * return np.asfortranarray(voxel_graph) * * def dijkstra( # <<<<<<<<<<<<<< * data, source, target, * bidirectional=False, connectivity=26, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_3dijkstra, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_3dijkstra, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dijkstra, __pyx_t_1) < 0) __PYX_ERR(0, 111, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dijkstra, __pyx_t_1) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":201 + /* "dijkstra3d.pyx":238 * return _path_to_point_cloud(path, dims, rows, cols) * * def railroad( # <<<<<<<<<<<<<< * data, source, * connectivity=26, voxel_graph=None */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_5railroad, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_5railroad, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_railroad, __pyx_t_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_railroad, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":274 + /* "dijkstra3d.pyx":311 * return _path_to_point_cloud(path, dims, rows, cols) * * def distance_field( # <<<<<<<<<<<<<< * data, source, connectivity=26, * voxel_graph=None, return_max_location=False */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_7distance_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_7distance_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_distance_field, __pyx_t_1) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_distance_field, __pyx_t_1) < 0) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dijkstra3d.pyx":358 + /* "dijkstra3d.pyx":395 * * # parents is either uint32 or uint64 * def _path_from_parents_helper(cnp.ndarray[UINT, ndim=3] parents, target): # <<<<<<<<<<<<<< * cdef UINT[:,:,:] arr_memview * cdef vector[UINT] path */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_10dijkstra3d_31_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_10dijkstra3d_33_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 358, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_10dijkstra3d_33_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_10dijkstra3d_35_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 358, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_10dijkstra3d_35_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_10dijkstra3d_37_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 358, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_10dijkstra3d_37_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_10dijkstra3d_39_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 358, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_10dijkstra3d_9_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_10dijkstra3d_9_path_from_parents_helper, 0, __pyx_n_s_path_from_parents_helper, NULL, __pyx_n_s_dijkstra3d, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_from_parents_helper, __pyx_t_2) < 0) __PYX_ERR(0, 358, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_from_parents_helper, __pyx_t_2) < 0) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":377 + /* "dijkstra3d.pyx":414 * return np.frombuffer(buf, dtype=parents.dtype)[::-1] * * def path_from_parents(parents, target): # <<<<<<<<<<<<<< * ndim = parents.ndim * while parents.ndim < 3: */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_11path_from_parents, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_11path_from_parents, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_from_parents, __pyx_t_2) < 0) __PYX_ERR(0, 377, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_from_parents, __pyx_t_2) < 0) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":392 + /* "dijkstra3d.pyx":429 * return ptlist[:, :ndim] * * def parental_field(data, source, connectivity=26, voxel_graph=None): # <<<<<<<<<<<<<< * """ * Use dijkstra's shortest path algorithm */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_13parental_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_13parental_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parental_field, __pyx_t_2) < 0) __PYX_ERR(0, 392, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parental_field, __pyx_t_2) < 0) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":454 + /* "dijkstra3d.pyx":491 * return field * * def euclidean_distance_field( # <<<<<<<<<<<<<< * data, source, anisotropy=(1,1,1), * free_space_radius=0, voxel_graph=None, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_15euclidean_distance_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_15euclidean_distance_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_euclidean_distance_field, __pyx_t_2) < 0) __PYX_ERR(0, 454, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_euclidean_distance_field, __pyx_t_2) < 0) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":534 + /* "dijkstra3d.pyx":571 * return field * * def _validate_coord(data, coord): # <<<<<<<<<<<<<< * dims = len(data.shape) * */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_17_validate_coord, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_17_validate_coord, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_validate_coord, __pyx_t_2) < 0) __PYX_ERR(0, 534, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_validate_coord, __pyx_t_2) < 0) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":547 + /* "dijkstra3d.pyx":584 * raise IndexError("Selected voxel {} was not located inside the array.".format(coord)) * * def _path_to_point_cloud(path, dims, rows, cols): # <<<<<<<<<<<<<< * ptlist = np.zeros((path.shape[0], dims), dtype=np.uint32) * */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_19_path_to_point_cloud, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_19_path_to_point_cloud, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_to_point_cloud, __pyx_t_2) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_path_to_point_cloud, __pyx_t_2) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":565 + /* "dijkstra3d.pyx":602 * return ptlist * + * def _execute_gradient_dijkstra( # <<<<<<<<<<<<<< + * data, source, target, + * float wx, float wy, float wz, + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_21_execute_gradient_dijkstra, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_gradient_dijkstra, __pyx_t_2) < 0) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "dijkstra3d.pyx":767 + * + * * def _execute_value_target_dijkstra( # <<<<<<<<<<<<<< * data, source, * int connectivity, voxel_graph=None */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_21_execute_value_target_dijkstra, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_23_execute_value_target_dijkstra, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_value_target_dijkstra, __pyx_t_2) < 0) __PYX_ERR(0, 565, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_value_target_dijkstra, __pyx_t_2) < 0) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":715 + /* "dijkstra3d.pyx":917 * return output[::-1] * * def _execute_dijkstra( # <<<<<<<<<<<<<< * data, source, target, int connectivity, * bidirectional, compass, float compass_norm=-1, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_23_execute_dijkstra, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_25_execute_dijkstra, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_dijkstra, __pyx_t_2) < 0) __PYX_ERR(0, 715, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_dijkstra, __pyx_t_2) < 0) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":1068 + /* "dijkstra3d.pyx":1270 * return output[::-1] * * def _execute_distance_field(data, sources, connectivity, voxel_graph): # <<<<<<<<<<<<<< * cdef uint8_t[:,:,:] arr_memview8 * cdef uint16_t[:,:,:] arr_memview16 */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_25_execute_distance_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_27_execute_distance_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_distance_field, __pyx_t_2) < 0) __PYX_ERR(0, 1068, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_distance_field, __pyx_t_2) < 0) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":1156 + /* "dijkstra3d.pyx":1358 * return buf, max_loc * * def _execute_parental_field(data, source, connectivity, voxel_graph): # <<<<<<<<<<<<<< * cdef uint8_t[:,:,:] arr_memview8 * cdef uint16_t[:,:,:] arr_memview16 */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_27_execute_parental_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_29_execute_parental_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_parental_field, __pyx_t_2) < 0) __PYX_ERR(0, 1156, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_parental_field, __pyx_t_2) < 0) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dijkstra3d.pyx":1304 + /* "dijkstra3d.pyx":1506 * return parents32 * * def _execute_euclidean_distance_field( # <<<<<<<<<<<<<< * data, sources, anisotropy, float free_space_radius=0, * voxel_graph=None */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_29_execute_euclidean_distance_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10dijkstra3d_31_execute_euclidean_distance_field, NULL, __pyx_n_s_dijkstra3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_euclidean_distance_fiel, __pyx_t_2) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_euclidean_distance_fiel, __pyx_t_2) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "dijkstra3d.pyx":1 @@ -38613,7 +41139,7 @@ if (!__Pyx_RefNanny) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 286, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_2); @@ -38627,7 +41153,7 @@ if (!__Pyx_RefNanny) { * cdef indirect = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 287, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_2); @@ -38641,7 +41167,7 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_2); @@ -38655,7 +41181,7 @@ if (!__Pyx_RefNanny) { * cdef indirect_contiguous = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_2); @@ -38669,7 +41195,7 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 292, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); @@ -39706,6 +42232,155 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, PyObject_RichCompare(op1, op2, Py_EQ)); } +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, @@ -41602,155 +44277,6 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) return -1; } -/* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result; -#if CYTHON_USE_UNICODE_INTERNALS - Py_hash_t hash1, hash2; - hash1 = ((PyBytesObject*)s1)->ob_shash; - hash2 = ((PyBytesObject*)s2)->ob_shash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - return (equals == Py_NE); - } -#endif - result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } -#if CYTHON_USE_UNICODE_INTERNALS - { - Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED - hash1 = ((PyASCIIObject*)s1)->hash; - hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - goto return_ne; - } - } -#endif - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - /* None */ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { Py_ssize_t q = a / b; diff --git a/dijkstra3d.pyx b/dijkstra3d.pyx index 844b4ed..28355f3 100644 --- a/dijkstra3d.pyx +++ b/dijkstra3d.pyx @@ -53,6 +53,14 @@ cdef extern from "dijkstra3d.hpp" namespace "dijkstra": size_t source, size_t target, int connectivity, uint32_t* voxel_graph ) + cdef vector[OUT] dijkstra3d_gradient[T,OUT]( + T* field, + size_t sx, size_t sy, size_t sz, + float wx, float wy, float wz, + size_t source, size_t target, + float w_dist, float w_intensity, + int connectivity, uint32_t* voxel_graph + ) cdef vector[OUT] bidirectional_dijkstra3d[T,OUT]( T* field, size_t sx, size_t sy, size_t sz, @@ -112,7 +120,9 @@ def dijkstra( data, source, target, bidirectional=False, connectivity=26, compass=False, compass_norm=-1, - voxel_graph=None + voxel_graph=None, + metric="intensity", metric_args=[], + anisotropy=(1,1,1) ): """ Perform dijkstra's shortest path algorithm @@ -151,6 +161,19 @@ def dijkstra( directions of travel between voxels. Generated from cc3d.voxel_connectivity_graph. (See https://github.com/seung-lab/connected-components-3d) + metric: "intensity" or "gradient". + intensity: each field value adds to distance. + gradient: + sqrt(w_dist^2 * (dx^2 + dy^2 + dz^2) + w_intensity^2 * dI^2) + Use the neighboring gradient as the distance metric. The metric + combines anisotropic euclidian distance and field intensity. The + two weights w_dist and w_intensity can be used to toggle or + modify the effect of either the physical distance or field + intensity elements. + metric_args: for gradient mode, you can supply distance and + intensity weights as floats: [ w_dist, w_intensity ] + anisotropy: (only affects gradient mode) weights of each + voxel axis. Returns: 1D numpy array containing indices of the path from source to target including source and target. @@ -170,6 +193,9 @@ def dijkstra( "Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity) ) + if metric not in ("intensity", "gradient"): + raise ValueError(f"Only intensity and gradient modes are supported. Got: {metric}") + if data.size == 0: return np.zeros(shape=(0,), dtype=np.uint32, order='F') @@ -190,11 +216,22 @@ def dijkstra( cdef size_t rows = data.shape[1] cdef size_t depth = data.shape[2] - path = _execute_dijkstra( - data, source, target, connectivity, - bidirectional, compass, compass_norm, - voxel_graph - ) + if metric == "intensity": + path = _execute_dijkstra( + data, source, target, connectivity, + bidirectional, compass, compass_norm, + voxel_graph + ) + else: + w_dist = 1.0 if not metric_args else metric_args[0] + w_intensity = 1.0 if not metric_args else metric_args[1] + + path = _execute_gradient_dijkstra( + data, source, target, + anisotropy[0], anisotropy[1], anisotropy[2], + w_dist, w_intensity, + connectivity, voxel_graph + ) return _path_to_point_cloud(path, dims, rows, cols) @@ -562,6 +599,171 @@ def _path_to_point_cloud(path, dims, rows, cols): return ptlist +def _execute_gradient_dijkstra( + data, source, target, + float wx, float wy, float wz, + float w_dist, float w_intensity, + int connectivity, voxel_graph=None, +): + cdef uint8_t[:,:,:] arr_memview8 + cdef uint16_t[:,:,:] arr_memview16 + cdef uint32_t[:,:,:] arr_memview32 + cdef uint64_t[:,:,:] arr_memview64 + cdef float[:,:,:] arr_memviewfloat + cdef double[:,:,:] arr_memviewdouble + + cdef uint32_t[:,:,:] voxel_graph_memview + cdef uint32_t* voxel_graph_ptr = NULL + if voxel_graph is not None: + voxel_graph_memview = voxel_graph + voxel_graph_ptr = &voxel_graph_memview[0,0,0] + + cdef size_t sx = data.shape[0] + cdef size_t sy = data.shape[1] + cdef size_t sz = data.shape[2] + + cdef size_t src = source[0] + sx * (source[1] + sy * source[2]) + + cdef vector[uint32_t] output32 + cdef vector[uint64_t] output64 + + sixtyfourbit = data.size > np.iinfo(np.uint32).max + + dtype = data.dtype + + if dtype == np.float32: + arr_memviewfloat = data + if sixtyfourbit: + output64 = dijkstra3d_gradient[float, uint64_t]( + &arr_memviewfloat[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + else: + output32 = dijkstra3d_gradient[float, uint32_t]( + &arr_memviewfloat[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + elif dtype == np.float64: + arr_memviewdouble = data + if sixtyfourbit: + output64 = dijkstra3d_gradient[double, uint64_t]( + &arr_memviewdouble[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + else: + output32 = dijkstra3d_gradient[double, uint32_t]( + &arr_memviewdouble[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + elif dtype in (np.int64, np.uint64): + arr_memview64 = data.astype(np.uint64) + if sixtyfourbit: + output64 = dijkstra3d_gradient[uint64_t, uint64_t]( + &arr_memview64[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + else: + output32 = dijkstra3d_gradient[uint64_t, uint32_t]( + &arr_memview64[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + elif dtype in (np.int32, np.uint32): + arr_memview32 = data.astype(np.uint32) + if sixtyfourbit: + output64 = dijkstra3d_gradient[uint32_t, uint64_t]( + &arr_memview32[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + else: + output32 = dijkstra3d_gradient[uint32_t, uint32_t]( + &arr_memview32[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + elif dtype in (np.int16, np.uint16): + arr_memview16 = data.astype(np.uint16) + if sixtyfourbit: + output64 = dijkstra3d_gradient[uint16_t, uint64_t]( + &arr_memview16[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + else: + output32 = dijkstra3d_gradient[uint16_t, uint32_t]( + &arr_memview16[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + elif dtype in (np.int8, np.uint8, bool): + arr_memview8 = data.astype(np.uint8) + if sixtyfourbit: + output64 = dijkstra3d_gradient[uint8_t, uint64_t]( + &arr_memview8[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + else: + output32 = dijkstra3d_gradient[uint8_t, uint32_t]( + &arr_memview8[0,0,0], + sx, sy, sz, wx, wy, wz, + src, target, + w_dist, w_intensity, + connectivity, voxel_graph_ptr + ) + + cdef uint32_t* output_ptr32 + cdef uint64_t* output_ptr64 + + cdef uint32_t[:] vec_view32 + cdef uint64_t[:] vec_view64 + + if sixtyfourbit: + output_ptr64 = &output64[0] + if output64.size() == 0: + return np.zeros((0,), dtype=np.uint64) + vec_view64 = output_ptr64 + buf = bytearray(vec_view64[:]) + output = np.frombuffer(buf, dtype=np.uint64) + else: + output_ptr32 = &output32[0] + if output32.size() == 0: + return np.zeros((0,), dtype=np.uint32) + vec_view32 = output_ptr32 + buf = bytearray(vec_view32[:]) + output = np.frombuffer(buf, dtype=np.uint32) + + return output[::-1] + + def _execute_value_target_dijkstra( data, source, int connectivity, voxel_graph=None From e675f88810334fdca8bb2469ba2c34e6e127ad96 Mon Sep 17 00:00:00 2001 From: William Silversmith Date: Tue, 2 Aug 2022 17:04:45 -0400 Subject: [PATCH 3/3] install: add numpy build isolation --- pyproject.toml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4ea4769 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,8 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel", + "oldest-supported-numpy", +] + +build-backend = "setuptools.build_meta"