From 30d566001f20cf20051aae0703e00c693bd9d235 Mon Sep 17 00:00:00 2001 From: William Silversmith Date: Fri, 18 Feb 2022 17:28:31 -0500 Subject: [PATCH 1/2] feat: bring back out_dtype This addresses Philipp's comments in #6. He wants to write the inital CCL volume to a uint32 to avoid needing to upscale the image for the next step. --- automated_test.py | 25 + cc3d.cpp | 9591 ++++++++++++++++++++++++--------------------- cc3d.pyx | 25 +- 3 files changed, 5134 insertions(+), 4507 deletions(-) diff --git a/automated_test.py b/automated_test.py index b77ca5c..ad5a970 100644 --- a/automated_test.py +++ b/automated_test.py @@ -241,6 +241,31 @@ def test_3d_all_different(order, connectivity): assert np.unique(output_labels).shape[0] == 100*99*98 assert output_labels.shape == (100, 99, 98) +@pytest.mark.parametrize("out_dtype", (None, np.uint16, np.uint32, np.uint64)) +def test_out_dtype_empty(out_dtype): + labels = np.zeros((512,512,512), dtype=np.uint8) + out = cc3d.connected_components(labels, out_dtype=out_dtype) + if out_dtype is None: + assert out.dtype == np.uint16 + else: + assert out.dtype == out_dtype + +def test_out_dtype_invalid(): + labels = np.zeros((512,512,512), dtype=np.uint8) + try: + out = cc3d.connected_components(labels, out_dtype=np.uint8) + assert False + except ValueError: + pass + +def test_out_dtype_too_small(): + labels = np.arange(0, 41 ** 3).astype(np.uint32) + 1 + try: + out = cc3d.connected_components(labels, out_dtype=np.uint16) + assert False + except ValueError: + pass + @pytest.mark.parametrize("dtype", TEST_TYPES) def test_3d_cross(dtype): def test(order, ground_truth): diff --git a/cc3d.cpp b/cc3d.cpp index e2caef4..9f5b8b4 100644 --- a/cc3d.cpp +++ b/cc3d.cpp @@ -653,6 +653,9 @@ static CYTHON_INLINE float __PYX_NAN() { #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" */ @@ -1008,7 +1011,7 @@ typedef struct { #define __Pyx_FastGilFuncInit() -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":689 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1017,7 +1020,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":690 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":691 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1026,7 +1029,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":691 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":692 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1035,7 +1038,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":692 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":693 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1044,7 +1047,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":696 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1053,7 +1056,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":697 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":698 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1062,7 +1065,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":698 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":699 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1071,7 +1074,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":699 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":700 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1080,7 +1083,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":703 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1089,7 +1092,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":704 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":705 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1098,7 +1101,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":713 +/* "../../.virtualenvs/cc3d/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 # <<<<<<<<<<<<<< @@ -1107,7 +1110,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":714 +/* "../../.virtualenvs/cc3d/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 # <<<<<<<<<<<<<< @@ -1116,7 +1119,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":715 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":716 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1125,7 +1128,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":717 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1134,7 +1137,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":718 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":719 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1143,7 +1146,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":719 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":720 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1152,7 +1155,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":721 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1161,7 +1164,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":722 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":723 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1170,7 +1173,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":724 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1179,7 +1182,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":725 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":726 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1188,7 +1191,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":726 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":727 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1234,7 +1237,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":728 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1243,7 +1246,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":729 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":730 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1252,7 +1255,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":730 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":731 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1261,7 +1264,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":732 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1303,7 +1306,7 @@ typedef struct __pyx_defaults14 __pyx_defaults14; struct __pyx_defaults15; typedef struct __pyx_defaults15 __pyx_defaults15; -/* "cc3d.pyx":509 +/* "cc3d.pyx":526 * return out_labels * * cdef size_t epl_special_row( # <<<<<<<<<<<<<< @@ -1363,7 +1366,7 @@ struct __pyx_defaults15 { int __pyx_arg_connectivity; }; -/* "cc3d.pyx":907 +/* "cc3d.pyx":924 * return draw(0, runs, image) * * def each(labels, binary=False, in_place=False): # <<<<<<<<<<<<<< @@ -1379,7 +1382,7 @@ struct __pyx_obj_4cc3d___pyx_scope_struct__each { }; -/* "cc3d.pyx":933 +/* "cc3d.pyx":950 * def __len__(self): * return len(all_runs) - int(0 in all_runs) * def __iter__(self): # <<<<<<<<<<<<<< @@ -1400,7 +1403,7 @@ struct __pyx_obj_4cc3d___pyx_scope_struct_1___iter__ { }; -/* "cc3d.pyx":942 +/* "cc3d.pyx":959 * * class InPlaceImageIterator(ImageIterator): * def __iter__(self): # <<<<<<<<<<<<<< @@ -1944,6 +1947,32 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* None.proto */ static CYTHON_INLINE int64_t __Pyx_div_int64_t(int64_t, int64_t); +/* 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 + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + /* BufferFallbackError.proto */ static void __Pyx_RaiseBufferFallbackError(void); @@ -2041,28 +2070,6 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); -/* 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 - #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY @@ -2976,6 +2983,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 'cc3d' */ @@ -3071,9 +3088,10 @@ static const char __pyx_k_s[] = "s"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_z[] = "z"; -static const char __pyx_k__3[] = ""; -static const char __pyx_k__4[] = "()"; -static const char __pyx_k__5[] = "|"; +static const char __pyx_k__3[] = ")."; +static const char __pyx_k__4[] = ""; +static const char __pyx_k__5[] = "()"; +static const char __pyx_k__6[] = "|"; static const char __pyx_k_ct[] = "ct"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; @@ -3301,13 +3319,16 @@ static const char __pyx_k_each_locals_ImageIterator[] = "each..ImageIter static const char __pyx_k_No_matching_signature_found[] = "No matching signature found"; static const char __pyx_k_estimate_provisional_labels[] = "estimate_provisional_labels"; static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static const char __pyx_k_Explicitly_defined_out_dtype[] = "Explicitly defined out_dtype ("; static const char __pyx_k_Type_not_currently_supported[] = "Type {} not currently supported."; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; -static const char __pyx_k_Cython_binding_for_connected_co[] = "\nCython binding for connected components applied to 3D images\nwith 26-connectivity and handling for multiple labels.\n\nAuthor: William Silversmith\nAffiliation: Seung Lab, Princeton Neuroscience Institute\nDate: August 2018 - October 2020\n\n---\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n---\n\nIf you received a copy of this program in binary form, you can get \nthe source code for free here: \n\nhttps://github.com/seung-lab/connected-components-3d\n"; +static const char __pyx_k_Cython_binding_for_connected_co[] = "\nCython binding for connected components applied to 3D images\nwith 26-connectivity and handling for multiple labels.\n\nAuthor: William Silversmith\nAffiliation: Seung Lab, Princeton Neuroscience Institute\nDate: August 2018 - Februrary 2022\n\n---\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n---\n\nIf you received a copy of this program in binary form, you can get \nthe source code for free here: \n\nhttps://github.com/seung-lab/connected-components-3d\n"; static const char __pyx_k_Only_6_18_and_26_connectivities[] = "Only 6, 18, and 26 connectivities are supported for 3D images. Got: "; static const char __pyx_k_Statistics_can_only_be_computed[] = "Statistics can only be computed on volumes containing labels with values lower than the number of voxels. Max: "; static const char __pyx_k_each_locals_ImageIterator___len[] = "each..ImageIterator.__len__"; +static const char __pyx_k_is_too_small_to_contain_the_est[] = ") is too small to contain the estimated maximum number of labels ("; +static const char __pyx_k_must_be_one_of_np_uint16_np_uin[] = ") must be one of: np.uint16, np.uint32, np.uint64"; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; @@ -3345,6 +3366,7 @@ static PyObject *__pyx_n_s_DimensionError; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; static PyObject *__pyx_kp_s_Expected_at_least_d_argument_s_g; +static PyObject *__pyx_kp_u_Explicitly_defined_out_dtype; static PyObject *__pyx_n_u_F; static PyObject *__pyx_n_u_F_CONTIGUOUS; static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg; @@ -3378,9 +3400,10 @@ static PyObject *__pyx_kp_u_Unsupported_type; static PyObject *__pyx_n_s_VERSION; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_View_MemoryView; -static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_kp_u__3; static PyObject *__pyx_kp_s__4; static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__6; static PyObject *__pyx_n_s_all_runs; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_args; @@ -3470,6 +3493,7 @@ static PyObject *__pyx_n_s_int64; static PyObject *__pyx_n_s_int64_t; static PyObject *__pyx_n_s_int8; static PyObject *__pyx_n_s_int8_t; +static PyObject *__pyx_kp_u_is_too_small_to_contain_the_est; static PyObject *__pyx_n_s_items; static PyObject *__pyx_n_s_itemsize; static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; @@ -3495,6 +3519,7 @@ static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_mul; +static PyObject *__pyx_kp_u_must_be_one_of_np_uint16_np_uin; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; static PyObject *__pyx_n_s_nbytes; @@ -3609,7 +3634,7 @@ static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_n_s_zs; static PyObject *__pyx_pf_4cc3d_reshape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_shape, PyObject *__pyx_v_order); /* proto */ static PyObject *__pyx_pf_4cc3d_2estimate_provisional_labels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ -static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int64_t __pyx_v_max_labels, int64_t __pyx_v_connectivity, bool __pyx_v_return_N, PyObject *__pyx_v_delta); /* proto */ +static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int64_t __pyx_v_max_labels, int64_t __pyx_v_connectivity, bool __pyx_v_return_N, PyObject *__pyx_v_delta, PyObject *__pyx_v_out_dtype); /* proto */ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_out_labels, PyObject *__pyx_v_sx, PyObject *__pyx_v_sy, PyObject *__pyx_v_sz, PyObject *__pyx_v_dims, PyObject *__pyx_v_order); /* proto */ static PyObject *__pyx_pf_4cc3d_8statistics(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_out_labels); /* proto */ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ @@ -3716,16 +3741,15 @@ static PyObject *__pyx_int_18; static PyObject *__pyx_int_26; static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_k__8; +static PyObject *__pyx_k__9; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; -static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; -static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__31; -static PyObject *__pyx_tuple__11; -static PyObject *__pyx_tuple__13; -static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_slice__32; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; @@ -3741,51 +3765,52 @@ static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; -static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; 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__67; +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__68; static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__70; static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__72; -static PyObject *__pyx_codeobj__10; -static PyObject *__pyx_codeobj__12; -static PyObject *__pyx_codeobj__14; -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__66; -static PyObject *__pyx_codeobj__73; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_codeobj__11; +static PyObject *__pyx_codeobj__13; +static PyObject *__pyx_codeobj__15; +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 */ /* "cc3d.pyx":106 @@ -5633,7 +5658,7 @@ static PyObject *__pyx_pf_4cc3d_2estimate_provisional_labels(CYTHON_UNUSED PyObj /* Python wrapper */ static PyObject *__pyx_pw_4cc3d_5connected_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_4cc3d_4connected_components[] = "\n ndarray connected_components(\n data, max_labels=-1, \n connectivity=26, return_N=False,\n delta=0\n )\n\n Connected components applied to 3D images with \n handling for multiple labels.\n\n Required:\n data: Input weights in a 2D or 3D numpy array. \n Optional:\n max_labels (int): save memory by predicting the maximum\n number of possible labels that might be output.\n Defaults to number of voxels.\n connectivity (int): \n For 3D images, 6 (voxel faces), 18 (+edges), or 26 (+corners)\n If the input image is 2D, you may specify 4 (pixel faces) or\n 8 (+corners).\n return_N (bool): if True, also return the number of connected components\n as the second argument of a return tuple.\n delta (same as data): >= 0. Connect together values whose \n difference in value is <= delta. Useful for rough \n segmentations of continuously valued images.\n\n let OUT = 1D, 2D or 3D numpy array remapped to reflect\n the connected components sequentially numbered from 1 to N. \n\n The data type will be automatically determined as uint16, uint32, \n or uint64 depending on the estimate of the number of provisional \n labels required.\n \n let N = number of connected components\n\n Returns:\n if return_N: (OUT, N)\n else: OUT\n "; +static char __pyx_doc_4cc3d_4connected_components[] = "\n ndarray connected_components(\n data, max_labels=-1, \n connectivity=26, return_N=False,\n delta=0, out_dtype=None\n )\n\n Connected components applied to 3D images with \n handling for multiple labels.\n\n Required:\n data: Input weights in a 2D or 3D numpy array. \n Optional:\n max_labels (int): save memory by predicting the maximum\n number of possible labels that might be output.\n Defaults to number of voxels.\n connectivity (int): \n For 3D images, 6 (voxel faces), 18 (+edges), or 26 (+corners)\n If the input image is 2D, you may specify 4 (pixel faces) or\n 8 (+corners).\n return_N (bool): if True, also return the number of connected components\n as the second argument of a return tuple.\n delta (same as data): >= 0. Connect together values whose \n difference in value is <= delta. Useful for rough \n segmentations of continuously valued images.\n out_dtype: if specified, must be one of np.uint16, np.uint32, np.uint64.\n If not specified, it will be automatically determined. Most of the time,\n you should leave this off so that the smallest safe dtype will be used.\n However, in some applications you can save an up-conversion in the next \n operation by outputting the appropriately sized type instead.\n\n let OUT = 1D, 2D or 3D numpy array remapped to reflect\n the connected components sequentially numbered from 1 to N. \n\n The data type will be automatically determined as uint16, uint32, \n or uint64 depending on the estimate of the number of provisional \n labels required.\n \n let N = number of connected components\n\n Returns:\n if return_N: (OUT, N)\n else: OUT\n "; static PyMethodDef __pyx_mdef_4cc3d_5connected_components = {"connected_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cc3d_5connected_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cc3d_4connected_components}; static PyObject *__pyx_pw_4cc3d_5connected_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; @@ -5641,6 +5666,7 @@ static PyObject *__pyx_pw_4cc3d_5connected_components(PyObject *__pyx_self, PyOb int64_t __pyx_v_connectivity; bool __pyx_v_return_N; PyObject *__pyx_v_delta = 0; + PyObject *__pyx_v_out_dtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5648,13 +5674,24 @@ static PyObject *__pyx_pw_4cc3d_5connected_components(PyObject *__pyx_self, PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("connected_components (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_max_labels,&__pyx_n_s_connectivity,&__pyx_n_s_return_N,&__pyx_n_s_delta,0}; - PyObject* values[5] = {0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_max_labels,&__pyx_n_s_connectivity,&__pyx_n_s_return_N,&__pyx_n_s_delta,&__pyx_n_s_out_dtype,0}; + PyObject* values[6] = {0,0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_0); + + /* "cc3d.pyx":215 + * data, int64_t max_labels=-1, + * int64_t connectivity=26, native_bool return_N=False, + * delta=0, out_dtype=None # <<<<<<<<<<<<<< + * ): + * """ + */ + values[5] = ((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 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); @@ -5697,12 +5734,20 @@ static PyObject *__pyx_pw_4cc3d_5connected_components(PyObject *__pyx_self, PyOb PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta); if (value) { values[4] = value; kw_args--; } } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out_dtype); + if (value) { values[5] = value; kw_args--; } + } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "connected_components") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { + 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); @@ -5735,22 +5780,23 @@ static PyObject *__pyx_pw_4cc3d_5connected_components(PyObject *__pyx_self, PyOb * def connected_components( * data, int64_t max_labels=-1, * int64_t connectivity=26, native_bool return_N=False, # <<<<<<<<<<<<<< - * delta=0 + * delta=0, out_dtype=None * ): */ __pyx_v_return_N = ((bool)0); } __pyx_v_delta = values[4]; + __pyx_v_out_dtype = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("connected_components", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("connected_components", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.connected_components", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4cc3d_4connected_components(__pyx_self, __pyx_v_data, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_v_return_N, __pyx_v_delta); + __pyx_r = __pyx_pf_4cc3d_4connected_components(__pyx_self, __pyx_v_data, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_v_return_N, __pyx_v_delta, __pyx_v_out_dtype); /* "cc3d.pyx":212 * return (epl, first_foreground_row, last_foreground_row) @@ -5765,7 +5811,7 @@ static PyObject *__pyx_pw_4cc3d_5connected_components(PyObject *__pyx_self, PyOb return __pyx_r; } -static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int64_t __pyx_v_max_labels, int64_t __pyx_v_connectivity, bool __pyx_v_return_N, PyObject *__pyx_v_delta) { +static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int64_t __pyx_v_max_labels, int64_t __pyx_v_connectivity, bool __pyx_v_return_N, PyObject *__pyx_v_delta, PyObject *__pyx_v_out_dtype) { int __pyx_v_dims; PyObject *__pyx_v_order = NULL; PyObject *__pyx_v_shape = NULL; @@ -5786,7 +5832,6 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ PyObject *__pyx_v_first_foreground_row = NULL; PyObject *__pyx_v_last_foreground_row = NULL; int64_t __pyx_v_union_find_voxels; - PyObject *__pyx_v_out_dtype = NULL; PyObject *__pyx_v_out_labels = NULL; PyObject *__pyx_v_dtype = NULL; size_t __pyx_v_N; @@ -5817,39 +5862,41 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ int64_t __pyx_t_16; int64_t __pyx_t_17; int64_t __pyx_t_18; - PyObject *__pyx_t_19 = NULL; + Py_UCS4 __pyx_t_19; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; - size_t __pyx_t_22; - __Pyx_memviewslice __pyx_t_23 = { 0, 0, { 0 }, { 0 }, { 0 } }; - Py_ssize_t __pyx_t_24; + PyObject *__pyx_t_22 = NULL; + size_t __pyx_t_23; + __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } }; Py_ssize_t __pyx_t_25; Py_ssize_t __pyx_t_26; - uint64_t __pyx_t_27; - Py_ssize_t __pyx_t_28; - __Pyx_memviewslice __pyx_t_29 = { 0, 0, { 0 }, { 0 }, { 0 } }; - uint32_t __pyx_t_30; - __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } }; - uint16_t __pyx_t_32; - __Pyx_memviewslice __pyx_t_33 = { 0, 0, { 0 }, { 0 }, { 0 } }; - uint8_t __pyx_t_34; - __Pyx_memviewslice __pyx_t_35 = { 0, 0, { 0 }, { 0 }, { 0 } }; - float __pyx_t_36; - __Pyx_memviewslice __pyx_t_37 = { 0, 0, { 0 }, { 0 }, { 0 } }; - double __pyx_t_38; - int __pyx_t_39; - char const *__pyx_t_40; - PyObject *__pyx_t_41 = NULL; + Py_ssize_t __pyx_t_27; + uint64_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __Pyx_memviewslice __pyx_t_30 = { 0, 0, { 0 }, { 0 }, { 0 } }; + uint32_t __pyx_t_31; + __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } }; + uint16_t __pyx_t_33; + __Pyx_memviewslice __pyx_t_34 = { 0, 0, { 0 }, { 0 }, { 0 } }; + uint8_t __pyx_t_35; + __Pyx_memviewslice __pyx_t_36 = { 0, 0, { 0 }, { 0 }, { 0 } }; + float __pyx_t_37; + __Pyx_memviewslice __pyx_t_38 = { 0, 0, { 0 }, { 0 }, { 0 } }; + double __pyx_t_39; + int __pyx_t_40; + char const *__pyx_t_41; PyObject *__pyx_t_42 = NULL; PyObject *__pyx_t_43 = NULL; PyObject *__pyx_t_44 = NULL; PyObject *__pyx_t_45 = NULL; PyObject *__pyx_t_46 = NULL; + PyObject *__pyx_t_47 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("connected_components", 0); __Pyx_INCREF(__pyx_v_data); + __Pyx_INCREF(__pyx_v_out_dtype); __pyx_pybuffer_out_labels16.pybuffer.buf = NULL; __pyx_pybuffer_out_labels16.refcount = 0; __pyx_pybuffernd_out_labels16.data = NULL; @@ -5863,20 +5910,20 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_pybuffernd_out_labels64.data = NULL; __pyx_pybuffernd_out_labels64.rcbuffer = &__pyx_pybuffer_out_labels64; - /* "cc3d.pyx":256 + /* "cc3d.pyx":261 * else: OUT * """ * cdef int dims = len(data.shape) # <<<<<<<<<<<<<< * if dims not in (1,2,3): * raise DimensionError("Only 1D, 2D, and 3D arrays 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, 256, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __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, 256, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dims = __pyx_t_2; - /* "cc3d.pyx":257 + /* "cc3d.pyx":262 * """ * cdef int dims = len(data.shape) * if dims not in (1,2,3): # <<<<<<<<<<<<<< @@ -5896,21 +5943,21 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_t_4 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_4)) { - /* "cc3d.pyx":258 + /* "cc3d.pyx":263 * cdef int dims = len(data.shape) * if dims not in (1,2,3): * raise DimensionError("Only 1D, 2D, and 3D arrays supported. Got: " + str(dims)) # <<<<<<<<<<<<<< * * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_1D_2D_and_3D_arrays_support, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_1D_2D_and_3D_arrays_support, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -5926,14 +5973,14 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 258, __pyx_L1_error) + __PYX_ERR(0, 263, __pyx_L1_error) - /* "cc3d.pyx":257 + /* "cc3d.pyx":262 * """ * cdef int dims = len(data.shape) * if dims not in (1,2,3): # <<<<<<<<<<<<<< @@ -5942,7 +5989,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":260 + /* "cc3d.pyx":265 * raise DimensionError("Only 1D, 2D, and 3D arrays supported. Got: " + str(dims)) * * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): # <<<<<<<<<<<<<< @@ -5972,29 +6019,29 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_L5_bool_binop_done:; if (unlikely(__pyx_t_4)) { - /* "cc3d.pyx":261 + /* "cc3d.pyx":266 * * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): * raise ValueError("Only 4, 8, and 6, 18, 26 connectivities are supported for 2D images. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * elif dims != 2 and connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported for 3D images. Got: " + str(connectivity)) */ - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_4_8_and_6_18_26_connectivit, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_4_8_and_6_18_26_connectivit, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __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_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __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, 261, __pyx_L1_error) + __PYX_ERR(0, 266, __pyx_L1_error) - /* "cc3d.pyx":260 + /* "cc3d.pyx":265 * raise DimensionError("Only 1D, 2D, and 3D arrays supported. Got: " + str(dims)) * * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): # <<<<<<<<<<<<<< @@ -6003,7 +6050,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":262 + /* "cc3d.pyx":267 * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): * raise ValueError("Only 4, 8, and 6, 18, 26 connectivities are supported for 2D images. Got: " + str(connectivity)) * elif dims != 2 and connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -6031,29 +6078,29 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_4)) { - /* "cc3d.pyx":263 + /* "cc3d.pyx":268 * raise ValueError("Only 4, 8, and 6, 18, 26 connectivities are supported for 2D images. Got: " + str(connectivity)) * elif dims != 2 and connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported for 3D images. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * if data.size == 0: */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 263, __pyx_L1_error) + __PYX_ERR(0, 268, __pyx_L1_error) - /* "cc3d.pyx":262 + /* "cc3d.pyx":267 * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): * raise ValueError("Only 4, 8, and 6, 18, 26 connectivities are supported for 2D images. Got: " + str(connectivity)) * elif dims != 2 and connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -6062,23 +6109,23 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":265 + /* "cc3d.pyx":270 * raise ValueError("Only 6, 18, and 26 connectivities are supported for 3D images. Got: " + str(connectivity)) * * if data.size == 0: # <<<<<<<<<<<<<< * return np.zeros(shape=(0,), dtype=data.dtype) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":266 + /* "cc3d.pyx":271 * * if data.size == 0: * return np.zeros(shape=(0,), dtype=data.dtype) # <<<<<<<<<<<<<< @@ -6086,19 +6133,19 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * order = 'F' if data.flags['F_CONTIGUOUS'] else 'C' */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 266, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 266, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 271, __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_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __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; @@ -6106,7 +6153,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_t_6 = 0; goto __pyx_L0; - /* "cc3d.pyx":265 + /* "cc3d.pyx":270 * raise ValueError("Only 6, 18, and 26 connectivities are supported for 3D images. Got: " + str(connectivity)) * * if data.size == 0: # <<<<<<<<<<<<<< @@ -6115,19 +6162,19 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":268 + /* "cc3d.pyx":273 * return np.zeros(shape=(0,), dtype=data.dtype) * * order = 'F' if data.flags['F_CONTIGUOUS'] else 'C' # <<<<<<<<<<<<<< * * while len(data.shape) < 3: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { __Pyx_INCREF(__pyx_n_u_F); @@ -6139,7 +6186,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_v_order = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":270 + /* "cc3d.pyx":275 * order = 'F' if data.flags['F_CONTIGUOUS'] else 'C' * * while len(data.shape) < 3: # <<<<<<<<<<<<<< @@ -6147,37 +6194,37 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * data = data[np.newaxis, ...] */ while (1) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = ((__pyx_t_2 < 3) != 0); if (!__pyx_t_4) break; - /* "cc3d.pyx":271 + /* "cc3d.pyx":276 * * while len(data.shape) < 3: * if order == 'C': # <<<<<<<<<<<<<< * data = data[np.newaxis, ...] * else: # F */ - __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_order, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_order, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "cc3d.pyx":272 + /* "cc3d.pyx":277 * while len(data.shape) < 3: * if order == 'C': * data = data[np.newaxis, ...] # <<<<<<<<<<<<<< * else: # F * data = data[..., np.newaxis ] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __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, 272, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -6185,13 +6232,13 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_GIVEREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_6, 1, Py_Ellipsis); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __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; - /* "cc3d.pyx":271 + /* "cc3d.pyx":276 * * while len(data.shape) < 3: * if order == 'C': # <<<<<<<<<<<<<< @@ -6201,7 +6248,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ goto __pyx_L12; } - /* "cc3d.pyx":274 + /* "cc3d.pyx":279 * data = data[np.newaxis, ...] * else: # F * data = data[..., np.newaxis ] # <<<<<<<<<<<<<< @@ -6209,12 +6256,12 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * if not data.flags['C_CONTIGUOUS'] and not data.flags['F_CONTIGUOUS']: */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); __Pyx_GIVEREF(Py_Ellipsis); @@ -6222,7 +6269,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6); @@ -6231,19 +6278,19 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_L12:; } - /* "cc3d.pyx":276 + /* "cc3d.pyx":281 * data = data[..., np.newaxis ] * * if not data.flags['C_CONTIGUOUS'] and not data.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * data = np.copy(data, order=order) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = ((!__pyx_t_4) != 0); if (__pyx_t_8) { @@ -6251,39 +6298,39 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_8; goto __pyx_L14_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = ((!__pyx_t_8) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L14_bool_binop_done:; if (__pyx_t_3) { - /* "cc3d.pyx":277 + /* "cc3d.pyx":282 * * if not data.flags['C_CONTIGUOUS'] and not data.flags['F_CONTIGUOUS']: * data = np.copy(data, order=order) # <<<<<<<<<<<<<< * * shape = list(data.shape) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __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, 277, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_data); - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 277, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 277, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __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; @@ -6291,7 +6338,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7); __pyx_t_7 = 0; - /* "cc3d.pyx":276 + /* "cc3d.pyx":281 * data = data[..., np.newaxis ] * * if not data.flags['C_CONTIGUOUS'] and not data.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -6300,42 +6347,42 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":279 + /* "cc3d.pyx":284 * data = np.copy(data, order=order) * * shape = list(data.shape) # <<<<<<<<<<<<<< * * if order == 'C': */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_5 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_shape = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":281 + /* "cc3d.pyx":286 * shape = list(data.shape) * * if order == 'C': # <<<<<<<<<<<<<< * shape.reverse() * */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_order, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_order, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 286, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "cc3d.pyx":282 + /* "cc3d.pyx":287 * * if order == 'C': * shape.reverse() # <<<<<<<<<<<<<< * * cdef int sx = shape[0] */ - __pyx_t_9 = PyList_Reverse(__pyx_v_shape); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_9 = PyList_Reverse(__pyx_v_shape); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 287, __pyx_L1_error) - /* "cc3d.pyx":281 + /* "cc3d.pyx":286 * shape = list(data.shape) * * if order == 'C': # <<<<<<<<<<<<<< @@ -6344,46 +6391,46 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":284 + /* "cc3d.pyx":289 * shape.reverse() * * cdef int sx = shape[0] # <<<<<<<<<<<<<< * cdef int sy = shape[1] * cdef int sz = shape[2] */ - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_sx = __pyx_t_10; - /* "cc3d.pyx":285 + /* "cc3d.pyx":290 * * cdef int sx = shape[0] * cdef int sy = shape[1] # <<<<<<<<<<<<<< * cdef int sz = shape[2] * */ - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_sy = __pyx_t_10; - /* "cc3d.pyx":286 + /* "cc3d.pyx":291 * cdef int sx = shape[0] * cdef int sy = shape[1] * cdef int sz = shape[2] # <<<<<<<<<<<<<< * * cdef uint8_t[:,:,:] arr_memview8u */ - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_sz = __pyx_t_10; - /* "cc3d.pyx":295 + /* "cc3d.pyx":300 * cdef double[:,:,:] arr_memviewd * * cdef int64_t voxels = sx * sy * sz # <<<<<<<<<<<<<< @@ -6392,46 +6439,46 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ __pyx_v_voxels = ((((int64_t)__pyx_v_sx) * ((int64_t)__pyx_v_sy)) * ((int64_t)__pyx_v_sz)); - /* "cc3d.pyx":296 + /* "cc3d.pyx":301 * * cdef int64_t voxels = sx * sy * sz * cdef cnp.ndarray[uint16_t, ndim=1] out_labels16 = np.array([], dtype=np.uint16) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] out_labels32 = np.array([], dtype=np.uint32) * cdef cnp.ndarray[uint64_t, ndim=1] out_labels64 = np.array([], dtype=np.uint64) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 296, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 296, __pyx_L1_error) + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 301, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_11); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels16.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_out_labels16 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 296, __pyx_L1_error) + __PYX_ERR(0, 301, __pyx_L1_error) } else {__pyx_pybuffernd_out_labels16.diminfo[0].strides = __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels16.diminfo[0].shape = __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.shape[0]; } } @@ -6439,46 +6486,46 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_v_out_labels16 = ((PyArrayObject *)__pyx_t_11); __pyx_t_11 = 0; - /* "cc3d.pyx":297 + /* "cc3d.pyx":302 * cdef int64_t voxels = sx * sy * sz * cdef cnp.ndarray[uint16_t, ndim=1] out_labels16 = np.array([], dtype=np.uint16) * cdef cnp.ndarray[uint32_t, ndim=1] out_labels32 = np.array([], dtype=np.uint32) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint64_t, ndim=1] out_labels64 = np.array([], dtype=np.uint64) * */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 297, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 297, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 302, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels32.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_out_labels32 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 297, __pyx_L1_error) + __PYX_ERR(0, 302, __pyx_L1_error) } else {__pyx_pybuffernd_out_labels32.diminfo[0].strides = __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels32.diminfo[0].shape = __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.shape[0]; } } @@ -6486,46 +6533,46 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_v_out_labels32 = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":298 + /* "cc3d.pyx":303 * cdef cnp.ndarray[uint16_t, ndim=1] out_labels16 = np.array([], dtype=np.uint16) * cdef cnp.ndarray[uint32_t, ndim=1] out_labels32 = np.array([], dtype=np.uint32) * cdef cnp.ndarray[uint64_t, ndim=1] out_labels64 = np.array([], dtype=np.uint64) # <<<<<<<<<<<<<< * * epl, first_foreground_row, last_foreground_row = estimate_provisional_labels(data) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 298, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 303, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels64.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_out_labels64 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 298, __pyx_L1_error) + __PYX_ERR(0, 303, __pyx_L1_error) } else {__pyx_pybuffernd_out_labels64.diminfo[0].strides = __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels64.diminfo[0].shape = __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.shape[0]; } } @@ -6533,14 +6580,14 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_v_out_labels64 = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "cc3d.pyx":300 + /* "cc3d.pyx":305 * cdef cnp.ndarray[uint64_t, ndim=1] out_labels64 = np.array([], dtype=np.uint64) * * epl, first_foreground_row, last_foreground_row = estimate_provisional_labels(data) # <<<<<<<<<<<<<< * * if max_labels <= 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_estimate_provisional_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_estimate_provisional_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -6554,7 +6601,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ } __pyx_t_7 = (__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_7)) __PYX_ERR(0, 300, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { @@ -6563,7 +6610,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 300, __pyx_L1_error) + __PYX_ERR(0, 305, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -6579,17 +6626,17 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; @@ -6599,7 +6646,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_GOTREF(__pyx_t_6); index = 2; __pyx_t_11 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_11)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 3) < 0) __PYX_ERR(0, 300, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 3) < 0) __PYX_ERR(0, 305, __pyx_L1_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L18_unpacking_done; @@ -6607,7 +6654,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 300, __pyx_L1_error) + __PYX_ERR(0, 305, __pyx_L1_error) __pyx_L18_unpacking_done:; } __pyx_v_epl = __pyx_t_1; @@ -6617,7 +6664,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_v_last_foreground_row = __pyx_t_11; __pyx_t_11 = 0; - /* "cc3d.pyx":302 + /* "cc3d.pyx":307 * epl, first_foreground_row, last_foreground_row = estimate_provisional_labels(data) * * if max_labels <= 0: # <<<<<<<<<<<<<< @@ -6627,7 +6674,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_t_4 = ((__pyx_v_max_labels <= 0) != 0); if (__pyx_t_4) { - /* "cc3d.pyx":303 + /* "cc3d.pyx":308 * * if max_labels <= 0: * max_labels = voxels # <<<<<<<<<<<<<< @@ -6636,7 +6683,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ __pyx_v_max_labels = __pyx_v_voxels; - /* "cc3d.pyx":302 + /* "cc3d.pyx":307 * epl, first_foreground_row, last_foreground_row = estimate_provisional_labels(data) * * if max_labels <= 0: # <<<<<<<<<<<<<< @@ -6645,7 +6692,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":304 + /* "cc3d.pyx":309 * if max_labels <= 0: * max_labels = voxels * max_labels = min(max_labels, epl, voxels) # <<<<<<<<<<<<<< @@ -6656,17 +6703,17 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_t_7 = __pyx_v_epl; __pyx_t_16 = __pyx_v_voxels; __pyx_t_17 = __pyx_v_max_labels; - __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = __pyx_t_7; } else { - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __pyx_t_1; __pyx_t_1 = 0; @@ -6674,14 +6721,14 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(__pyx_t_11); __pyx_t_1 = __pyx_t_11; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __pyx_t_5; __pyx_t_5 = 0; @@ -6691,56 +6738,56 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_16 = __Pyx_PyInt_As_int64_t(__pyx_t_11); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_int64_t(__pyx_t_11); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_max_labels = __pyx_t_16; - /* "cc3d.pyx":316 + /* "cc3d.pyx":321 * # at most 1/4 + 1 of the pixels can be labeled. For 26 * # connected, 2x2x2 blocks are connected, so at most 1/8 + 1 * cdef int64_t union_find_voxels = even_ceil(data.shape[0]) * even_ceil(data.shape[1]) * even_ceil(data.shape[2]) # <<<<<<<<<<<<<< * * if data.dtype == bool: */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_16 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_17 = __Pyx_PyInt_As_int64_t(__pyx_t_11); if (unlikely((__pyx_t_17 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyInt_As_int64_t(__pyx_t_11); if (unlikely((__pyx_t_17 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_11, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_11, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_18 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_18 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_18 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_union_find_voxels = ((__pyx_f_4cc3d_even_ceil(__pyx_t_16) * __pyx_f_4cc3d_even_ceil(__pyx_t_17)) * __pyx_f_4cc3d_even_ceil(__pyx_t_18)); - /* "cc3d.pyx":318 + /* "cc3d.pyx":323 * cdef int64_t union_find_voxels = even_ceil(data.shape[0]) * even_ceil(data.shape[1]) * even_ceil(data.shape[2]) * * if data.dtype == bool: # <<<<<<<<<<<<<< * if connectivity in (4,6): * max_labels = min(max_labels, (union_find_voxels // 2) + 1) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":319 + /* "cc3d.pyx":324 * * if data.dtype == bool: * if connectivity in (4,6): # <<<<<<<<<<<<<< @@ -6759,7 +6806,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "cc3d.pyx":320 + /* "cc3d.pyx":325 * if data.dtype == bool: * if connectivity in (4,6): * max_labels = min(max_labels, (union_find_voxels // 2) + 1) # <<<<<<<<<<<<<< @@ -6775,7 +6822,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ } __pyx_v_max_labels = __pyx_t_16; - /* "cc3d.pyx":319 + /* "cc3d.pyx":324 * * if data.dtype == bool: * if connectivity in (4,6): # <<<<<<<<<<<<<< @@ -6785,22 +6832,22 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ goto __pyx_L21; } - /* "cc3d.pyx":321 + /* "cc3d.pyx":326 * if connectivity in (4,6): * max_labels = min(max_labels, (union_find_voxels // 2) + 1) * elif connectivity == (8,18): # <<<<<<<<<<<<<< * max_labels = min(max_labels, (union_find_voxels // 4) + 1) * else: # 26 */ - __pyx_t_11 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_11, __pyx_tuple__2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_11, __pyx_tuple__2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":322 + /* "cc3d.pyx":327 * max_labels = min(max_labels, (union_find_voxels // 2) + 1) * elif connectivity == (8,18): * max_labels = min(max_labels, (union_find_voxels // 4) + 1) # <<<<<<<<<<<<<< @@ -6816,7 +6863,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ } __pyx_v_max_labels = __pyx_t_17; - /* "cc3d.pyx":321 + /* "cc3d.pyx":326 * if connectivity in (4,6): * max_labels = min(max_labels, (union_find_voxels // 2) + 1) * elif connectivity == (8,18): # <<<<<<<<<<<<<< @@ -6826,12 +6873,12 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ goto __pyx_L21; } - /* "cc3d.pyx":324 + /* "cc3d.pyx":329 * max_labels = min(max_labels, (union_find_voxels // 4) + 1) * else: # 26 * max_labels = min(max_labels, (union_find_voxels // 8) + 1) # <<<<<<<<<<<<<< * - * if max_labels < np.iinfo(np.uint16).max: + * if out_dtype is not None: */ /*else*/ { __pyx_t_17 = (__Pyx_div_int64_t(__pyx_v_union_find_voxels, 8) + 1); @@ -6845,7 +6892,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ } __pyx_L21:; - /* "cc3d.pyx":318 + /* "cc3d.pyx":323 * cdef int64_t union_find_voxels = even_ceil(data.shape[0]) * even_ceil(data.shape[1]) * even_ceil(data.shape[2]) * * if data.dtype == bool: # <<<<<<<<<<<<<< @@ -6854,138 +6901,416 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":326 + /* "cc3d.pyx":331 * max_labels = min(max_labels, (union_find_voxels // 8) + 1) * - * if max_labels < np.iinfo(np.uint16).max: # <<<<<<<<<<<<<< + * if out_dtype is not None: # <<<<<<<<<<<<<< + * out_dtype = np.dtype(out_dtype) + * if out_dtype not in (np.uint16, np.uint32, np.uint64): + */ + __pyx_t_3 = (__pyx_v_out_dtype != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "cc3d.pyx":332 + * + * if out_dtype is not None: + * out_dtype = np.dtype(out_dtype) # <<<<<<<<<<<<<< + * if out_dtype not in (np.uint16, np.uint32, np.uint64): + * raise ValueError( + */ + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_7 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_11, __pyx_v_out_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_out_dtype); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_out_dtype, __pyx_t_7); + __pyx_t_7 = 0; + + /* "cc3d.pyx":333 + * if out_dtype is not None: + * out_dtype = np.dtype(out_dtype) + * if out_dtype not in (np.uint16, np.uint32, np.uint64): # <<<<<<<<<<<<<< + * raise ValueError( + * f"Explicitly defined out_dtype ({out_dtype}) must be one of: " + */ + __Pyx_INCREF(__pyx_v_out_dtype); + __pyx_t_7 = __pyx_v_out_dtype; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + } else { + __pyx_t_4 = __pyx_t_3; + goto __pyx_L24_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + } else { + __pyx_t_4 = __pyx_t_3; + goto __pyx_L24_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_L24_bool_binop_done:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = (__pyx_t_4 != 0); + if (unlikely(__pyx_t_3)) { + + /* "cc3d.pyx":335 + * if out_dtype not in (np.uint16, np.uint32, np.uint64): + * raise ValueError( + * f"Explicitly defined out_dtype ({out_dtype}) must be one of: " # <<<<<<<<<<<<<< + * f"np.uint16, np.uint32, np.uint64" + * ) + */ + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = 0; + __pyx_t_19 = 127; + __Pyx_INCREF(__pyx_kp_u_Explicitly_defined_out_dtype); + __pyx_t_2 += 30; + __Pyx_GIVEREF(__pyx_kp_u_Explicitly_defined_out_dtype); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_Explicitly_defined_out_dtype); + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_out_dtype, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_19; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_kp_u_must_be_one_of_np_uint16_np_uin); + __pyx_t_2 += 49; + __Pyx_GIVEREF(__pyx_kp_u_must_be_one_of_np_uint16_np_uin); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_must_be_one_of_np_uint16_np_uin); + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_2, __pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "cc3d.pyx":334 + * out_dtype = np.dtype(out_dtype) + * if out_dtype not in (np.uint16, np.uint32, np.uint64): + * raise ValueError( # <<<<<<<<<<<<<< + * f"Explicitly defined out_dtype ({out_dtype}) must be one of: " + * f"np.uint16, np.uint32, np.uint64" + */ + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 334, __pyx_L1_error) + + /* "cc3d.pyx":333 + * if out_dtype is not None: + * out_dtype = np.dtype(out_dtype) + * if out_dtype not in (np.uint16, np.uint32, np.uint64): # <<<<<<<<<<<<<< + * raise ValueError( + * f"Explicitly defined out_dtype ({out_dtype}) must be one of: " + */ + } + + /* "cc3d.pyx":338 + * f"np.uint16, np.uint32, np.uint64" + * ) + * if np.iinfo(out_dtype).max < max_labels: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Explicitly defined out_dtype ({out_dtype}) is too small " + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + } + } + __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_1, __pyx_v_out_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_out_dtype); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_max); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_max_labels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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, 338, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_3)) { + + /* "cc3d.pyx":340 + * if np.iinfo(out_dtype).max < max_labels: + * raise ValueError( + * f"Explicitly defined out_dtype ({out_dtype}) is too small " # <<<<<<<<<<<<<< + * f"to contain the estimated maximum number of labels ({max_labels})." + * ) + */ + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_19 = 127; + __Pyx_INCREF(__pyx_kp_u_Explicitly_defined_out_dtype); + __pyx_t_2 += 30; + __Pyx_GIVEREF(__pyx_kp_u_Explicitly_defined_out_dtype); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Explicitly_defined_out_dtype); + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_out_dtype, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_19; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_kp_u_is_too_small_to_contain_the_est); + __pyx_t_2 += 66; + __Pyx_GIVEREF(__pyx_kp_u_is_too_small_to_contain_the_est); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_is_too_small_to_contain_the_est); + + /* "cc3d.pyx":341 + * raise ValueError( + * f"Explicitly defined out_dtype ({out_dtype}) is too small " + * f"to contain the estimated maximum number of labels ({max_labels})." # <<<<<<<<<<<<<< + * ) + * elif max_labels < np.iinfo(np.uint16).max: + */ + __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_max_labels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_19; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_11); + __pyx_t_11 = 0; + __Pyx_INCREF(__pyx_kp_u__3); + __pyx_t_2 += 2; + __Pyx_GIVEREF(__pyx_kp_u__3); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3); + + /* "cc3d.pyx":340 + * if np.iinfo(out_dtype).max < max_labels: + * raise ValueError( + * f"Explicitly defined out_dtype ({out_dtype}) is too small " # <<<<<<<<<<<<<< + * f"to contain the estimated maximum number of labels ({max_labels})." + * ) + */ + __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_19); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cc3d.pyx":339 + * ) + * if np.iinfo(out_dtype).max < max_labels: + * raise ValueError( # <<<<<<<<<<<<<< + * f"Explicitly defined out_dtype ({out_dtype}) is too small " + * f"to contain the estimated maximum number of labels ({max_labels})." + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 339, __pyx_L1_error) + + /* "cc3d.pyx":338 + * f"np.uint16, np.uint32, np.uint64" + * ) + * if np.iinfo(out_dtype).max < max_labels: # <<<<<<<<<<<<<< + * raise ValueError( + * f"Explicitly defined out_dtype ({out_dtype}) is too small " + */ + } + + /* "cc3d.pyx":331 + * max_labels = min(max_labels, (union_find_voxels // 8) + 1) + * + * if out_dtype is not None: # <<<<<<<<<<<<<< + * out_dtype = np.dtype(out_dtype) + * if out_dtype not in (np.uint16, np.uint32, np.uint64): + */ + goto __pyx_L22; + } + + /* "cc3d.pyx":343 + * f"to contain the estimated maximum number of labels ({max_labels})." + * ) + * elif max_labels < np.iinfo(np.uint16).max: # <<<<<<<<<<<<<< * out_dtype = np.uint16 * elif max_labels < np.iinfo(np.uint32).max: */ - __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_max_labels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_max_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_1)) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } - __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 326, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":327 - * - * if max_labels < np.iinfo(np.uint16).max: + /* "cc3d.pyx":344 + * ) + * elif max_labels < np.iinfo(np.uint16).max: * out_dtype = np.uint16 # <<<<<<<<<<<<<< * elif max_labels < np.iinfo(np.uint32).max: * out_dtype = np.uint32 */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_out_dtype = __pyx_t_5; + __Pyx_DECREF_SET(__pyx_v_out_dtype, __pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":326 - * max_labels = min(max_labels, (union_find_voxels // 8) + 1) - * - * if max_labels < np.iinfo(np.uint16).max: # <<<<<<<<<<<<<< + /* "cc3d.pyx":343 + * f"to contain the estimated maximum number of labels ({max_labels})." + * ) + * elif max_labels < np.iinfo(np.uint16).max: # <<<<<<<<<<<<<< * out_dtype = np.uint16 * elif max_labels < np.iinfo(np.uint32).max: */ goto __pyx_L22; } - /* "cc3d.pyx":328 - * if max_labels < np.iinfo(np.uint16).max: + /* "cc3d.pyx":345 + * elif max_labels < np.iinfo(np.uint16).max: * out_dtype = np.uint16 * elif max_labels < np.iinfo(np.uint32).max: # <<<<<<<<<<<<<< * out_dtype = np.uint32 * else: */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_max_labels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_max_labels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } - __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":329 + /* "cc3d.pyx":346 * out_dtype = np.uint16 * elif max_labels < np.iinfo(np.uint32).max: * out_dtype = np.uint32 # <<<<<<<<<<<<<< * else: * out_dtype = np.uint64 */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_out_dtype = __pyx_t_6; + __Pyx_DECREF_SET(__pyx_v_out_dtype, __pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":328 - * if max_labels < np.iinfo(np.uint16).max: + /* "cc3d.pyx":345 + * elif max_labels < np.iinfo(np.uint16).max: * out_dtype = np.uint16 * elif max_labels < np.iinfo(np.uint32).max: # <<<<<<<<<<<<<< * out_dtype = np.uint32 @@ -6994,7 +7319,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ goto __pyx_L22; } - /* "cc3d.pyx":331 + /* "cc3d.pyx":348 * out_dtype = np.uint32 * else: * out_dtype = np.uint64 # <<<<<<<<<<<<<< @@ -7002,91 +7327,91 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * if out_dtype == np.uint16: */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_out_dtype = __pyx_t_11; + __Pyx_DECREF_SET(__pyx_v_out_dtype, __pyx_t_11); __pyx_t_11 = 0; } __pyx_L22:; - /* "cc3d.pyx":333 + /* "cc3d.pyx":350 * out_dtype = np.uint64 * * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * out_labels16 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels16 */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":334 + /* "cc3d.pyx":351 * * if out_dtype == np.uint16: * out_labels16 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) # <<<<<<<<<<<<<< * out_labels = out_labels16 * elif out_dtype == np.uint32: */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyInt_From_int64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_From_int64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 334, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 334, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 351, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 334, __pyx_L1_error) - __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_12 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_labels16.rcbuffer->pybuffer); __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels16.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); + PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels16.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels16, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); + Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21); + PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); } - __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0; + __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0; } __pyx_pybuffernd_out_labels16.diminfo[0].strides = __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels16.diminfo[0].shape = __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 351, __pyx_L1_error) } __pyx_t_12 = 0; - __Pyx_DECREF_SET(__pyx_v_out_labels16, ((PyArrayObject *)__pyx_t_1)); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_out_labels16, ((PyArrayObject *)__pyx_t_7)); + __pyx_t_7 = 0; - /* "cc3d.pyx":335 + /* "cc3d.pyx":352 * if out_dtype == np.uint16: * out_labels16 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels16 # <<<<<<<<<<<<<< @@ -7096,91 +7421,91 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(((PyObject *)__pyx_v_out_labels16)); __pyx_v_out_labels = ((PyObject *)__pyx_v_out_labels16); - /* "cc3d.pyx":333 + /* "cc3d.pyx":350 * out_dtype = np.uint64 * * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * out_labels16 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels16 */ - goto __pyx_L23; + goto __pyx_L28; } - /* "cc3d.pyx":336 + /* "cc3d.pyx":353 * out_labels16 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels16 * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * out_labels32 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels32 */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 336, __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, 353, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":337 + /* "cc3d.pyx":354 * out_labels = out_labels16 * elif out_dtype == np.uint32: * out_labels32 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) # <<<<<<<<<<<<<< * out_labels = out_labels32 * elif out_dtype == np.uint64: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 337, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 337, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 354, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 337, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_labels32.rcbuffer->pybuffer); __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels32.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); + PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels32.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels32, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19); + Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19); + PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20); } - __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0; + __pyx_t_22 = __pyx_t_21 = __pyx_t_20 = 0; } __pyx_pybuffernd_out_labels32.diminfo[0].strides = __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels32.diminfo[0].shape = __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 354, __pyx_L1_error) } __pyx_t_13 = 0; __Pyx_DECREF_SET(__pyx_v_out_labels32, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "cc3d.pyx":338 + /* "cc3d.pyx":355 * elif out_dtype == np.uint32: * out_labels32 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels32 # <<<<<<<<<<<<<< @@ -7190,91 +7515,91 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(((PyObject *)__pyx_v_out_labels32)); __pyx_v_out_labels = ((PyObject *)__pyx_v_out_labels32); - /* "cc3d.pyx":336 + /* "cc3d.pyx":353 * out_labels16 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels16 * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * out_labels32 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels32 */ - goto __pyx_L23; + goto __pyx_L28; } - /* "cc3d.pyx":339 + /* "cc3d.pyx":356 * out_labels32 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels32 * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< * out_labels64 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels64 */ - __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, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":340 + /* "cc3d.pyx":357 * out_labels = out_labels32 * elif out_dtype == np.uint64: * out_labels64 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) # <<<<<<<<<<<<<< * out_labels = out_labels64 * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 340, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 340, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 357, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 357, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_labels64.rcbuffer->pybuffer); __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels64.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); if (unlikely(__pyx_t_10 < 0)) { - PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); + PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels64.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels64, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); + Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21); + PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); } - __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0; + __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0; } __pyx_pybuffernd_out_labels64.diminfo[0].strides = __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels64.diminfo[0].shape = __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) } __pyx_t_14 = 0; __Pyx_DECREF_SET(__pyx_v_out_labels64, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* "cc3d.pyx":341 + /* "cc3d.pyx":358 * elif out_dtype == np.uint64: * out_labels64 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels64 # <<<<<<<<<<<<<< @@ -7284,7 +7609,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(((PyObject *)__pyx_v_out_labels64)); __pyx_v_out_labels = ((PyObject *)__pyx_v_out_labels64); - /* "cc3d.pyx":339 + /* "cc3d.pyx":356 * out_labels32 = np.zeros( (voxels,), dtype=out_dtype, order='C' ) * out_labels = out_labels32 * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< @@ -7292,21 +7617,21 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * out_labels = out_labels64 */ } - __pyx_L23:; + __pyx_L28:; - /* "cc3d.pyx":343 + /* "cc3d.pyx":360 * out_labels = out_labels64 * * dtype = data.dtype # <<<<<<<<<<<<<< * * cdef size_t N = 0 */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_dtype = __pyx_t_5; __pyx_t_5 = 0; - /* "cc3d.pyx":345 + /* "cc3d.pyx":362 * dtype = data.dtype * * cdef size_t N = 0 # <<<<<<<<<<<<<< @@ -7315,7 +7640,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ __pyx_v_N = 0; - /* "cc3d.pyx":347 + /* "cc3d.pyx":364 * cdef size_t N = 0 * * try: # <<<<<<<<<<<<<< @@ -7324,56 +7649,56 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ /*try:*/ { - /* "cc3d.pyx":352 + /* "cc3d.pyx":369 * # by this flag, so we'll just unset it and reset it at * # the end. * writable = data.flags.writeable # <<<<<<<<<<<<<< * if data.flags.owndata: * data.setflags(write=1) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L25_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_writeable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_writeable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_writable = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_writable = __pyx_t_7; + __pyx_t_7 = 0; - /* "cc3d.pyx":353 + /* "cc3d.pyx":370 * # the end. * writable = data.flags.writeable * if data.flags.owndata: # <<<<<<<<<<<<<< * data.setflags(write=1) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_owndata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 353, __pyx_L25_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_owndata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 353, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 370, __pyx_L30_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":354 + /* "cc3d.pyx":371 * writable = data.flags.writeable * if data.flags.owndata: * data.setflags(write=1) # <<<<<<<<<<<<<< * * # This first condition can only happen if there */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_setflags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L25_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_setflags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_write, __pyx_int_1) < 0) __PYX_ERR(0, 354, __pyx_L25_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L25_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_write, __pyx_int_1) < 0) __PYX_ERR(0, 371, __pyx_L30_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":353 + /* "cc3d.pyx":370 * # the end. * writable = data.flags.writeable * if data.flags.owndata: # <<<<<<<<<<<<<< @@ -7382,59 +7707,59 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":359 + /* "cc3d.pyx":376 * # is a single X axis aligned foreground row. Let's handle * # it hyper efficiently. * if delta == 0 and first_foreground_row == last_foreground_row and first_foreground_row >= 0: # <<<<<<<<<<<<<< * N = epl_special_row(first_foreground_row, sx, sy, data, out_labels) * elif dtype in (np.uint64, np.int64): */ - __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_delta, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L25_error) + __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_delta, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 359, __pyx_L25_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 376, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; - goto __pyx_L29_bool_binop_done; + goto __pyx_L34_bool_binop_done; } - __pyx_t_6 = PyObject_RichCompare(__pyx_v_first_foreground_row, __pyx_v_last_foreground_row, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L25_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 359, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_first_foreground_row, __pyx_v_last_foreground_row, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L30_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 376, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; - goto __pyx_L29_bool_binop_done; + goto __pyx_L34_bool_binop_done; } - __pyx_t_6 = PyObject_RichCompare(__pyx_v_first_foreground_row, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L25_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 359, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_first_foreground_row, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L30_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 376, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_4; - __pyx_L29_bool_binop_done:; + __pyx_L34_bool_binop_done:; if (__pyx_t_3) { - /* "cc3d.pyx":360 + /* "cc3d.pyx":377 * # it hyper efficiently. * if delta == 0 and first_foreground_row == last_foreground_row and first_foreground_row >= 0: * N = epl_special_row(first_foreground_row, sx, sy, data, out_labels) # <<<<<<<<<<<<<< * elif dtype in (np.uint64, np.int64): * arr_memview64u = data.view(np.uint64) */ - __pyx_t_22 = __Pyx_PyInt_As_size_t(__pyx_v_first_foreground_row); if (unlikely((__pyx_t_22 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L25_error) - if (unlikely(!__pyx_v_out_labels)) { __Pyx_RaiseUnboundLocalError("out_labels"); __PYX_ERR(0, 360, __pyx_L25_error) } - __pyx_v_N = __pyx_f_4cc3d_epl_special_row(__pyx_t_22, __pyx_v_sx, __pyx_v_sy, __pyx_v_data, __pyx_v_out_labels, NULL); + __pyx_t_23 = __Pyx_PyInt_As_size_t(__pyx_v_first_foreground_row); if (unlikely((__pyx_t_23 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L30_error) + if (unlikely(!__pyx_v_out_labels)) { __Pyx_RaiseUnboundLocalError("out_labels"); __PYX_ERR(0, 377, __pyx_L30_error) } + __pyx_v_N = __pyx_f_4cc3d_epl_special_row(__pyx_t_23, __pyx_v_sx, __pyx_v_sy, __pyx_v_data, __pyx_v_out_labels, NULL); - /* "cc3d.pyx":359 + /* "cc3d.pyx":376 * # is a single X axis aligned foreground row. Let's handle * # it hyper efficiently. * if delta == 0 and first_foreground_row == last_foreground_row and first_foreground_row >= 0: # <<<<<<<<<<<<<< * N = epl_special_row(first_foreground_row, sx, sy, data, out_labels) * elif dtype in (np.uint64, np.int64): */ - goto __pyx_L28; + goto __pyx_L33; } - /* "cc3d.pyx":361 + /* "cc3d.pyx":378 * if delta == 0 and first_foreground_row == last_foreground_row and first_foreground_row >= 0: * N = epl_special_row(first_foreground_row, sx, sy, data, out_labels) * elif dtype in (np.uint64, np.int64): # <<<<<<<<<<<<<< @@ -7443,145 +7768,145 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_6 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L30_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 361, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 378, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; - goto __pyx_L32_bool_binop_done; + goto __pyx_L37_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L30_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 361, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 378, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __pyx_t_4; - __pyx_L32_bool_binop_done:; + __pyx_L37_bool_binop_done:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "cc3d.pyx":362 + /* "cc3d.pyx":379 * N = epl_special_row(first_foreground_row, sx, sy, data, out_labels) * elif dtype in (np.uint64, np.int64): * arr_memview64u = data.view(np.uint64) # <<<<<<<<<<<<<< * if out_dtype == np.uint16: * connected_components3d[uint64_t, uint16_t]( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L25_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 362, __pyx_L25_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 379, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); + __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_11); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L25_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 362, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 379, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_arr_memview64u = __pyx_t_23; - __pyx_t_23.memview = NULL; - __pyx_t_23.data = NULL; + __pyx_v_arr_memview64u = __pyx_t_24; + __pyx_t_24.memview = NULL; + __pyx_t_24.data = NULL; - /* "cc3d.pyx":363 + /* "cc3d.pyx":380 * elif dtype in (np.uint64, np.int64): * arr_memview64u = data.view(np.uint64) * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[uint64_t, uint16_t]( * &arr_memview64u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 363, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 380, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":365 + /* "cc3d.pyx":382 * if out_dtype == np.uint16: * connected_components3d[uint64_t, uint16_t]( * &arr_memview64u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N */ - __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_t_27 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_v_arr_memview64u.shape[0]; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_v_arr_memview64u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview64u.shape[1]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview64u.shape[1])) __pyx_t_10 = 1; + __pyx_t_25 += __pyx_v_arr_memview64u.shape[0]; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview64u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview64u.shape[2]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview64u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview64u.shape[1]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview64u.shape[1])) __pyx_t_10 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview64u.shape[2]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview64u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 365, __pyx_L25_error) + __PYX_ERR(0, 382, __pyx_L30_error) } - /* "cc3d.pyx":366 + /* "cc3d.pyx":383 * connected_components3d[uint64_t, uint16_t]( * &arr_memview64u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels16[0], N * ) */ - __pyx_t_27 = __Pyx_PyInt_As_uint64_t(__pyx_v_delta); if (unlikely((__pyx_t_27 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L25_error) + __pyx_t_28 = __Pyx_PyInt_As_uint64_t(__pyx_v_delta); if (unlikely((__pyx_t_28 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L30_error) - /* "cc3d.pyx":367 + /* "cc3d.pyx":384 * &arr_memview64u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint32: */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 367, __pyx_L25_error) + __PYX_ERR(0, 384, __pyx_L30_error) } - /* "cc3d.pyx":364 + /* "cc3d.pyx":381 * arr_memview64u = data.view(np.uint64) * if out_dtype == np.uint16: * connected_components3d[uint64_t, uint16_t]( # <<<<<<<<<<<<<< @@ -7589,96 +7914,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64u.data + __pyx_t_24 * __pyx_v_arr_memview64u.strides[0]) ) + __pyx_t_25 * __pyx_v_arr_memview64u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview64u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_27, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64u.data + __pyx_t_25 * __pyx_v_arr_memview64u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview64u.strides[1]) ) + __pyx_t_27 * __pyx_v_arr_memview64u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_28, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 364, __pyx_L25_error) + __PYX_ERR(0, 381, __pyx_L30_error) } - /* "cc3d.pyx":363 + /* "cc3d.pyx":380 * elif dtype in (np.uint64, np.int64): * arr_memview64u = data.view(np.uint64) * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[uint64_t, uint16_t]( * &arr_memview64u[0,0,0], */ - goto __pyx_L34; + goto __pyx_L39; } - /* "cc3d.pyx":369 + /* "cc3d.pyx":386 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[uint64_t, uint32_t]( * &arr_memview64u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 369, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 386, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":371 + /* "cc3d.pyx":388 * elif out_dtype == np.uint32: * connected_components3d[uint64_t, uint32_t]( * &arr_memview64u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; + __pyx_t_27 = 0; __pyx_t_26 = 0; - __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_arr_memview64u.shape[0]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_v_arr_memview64u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_v_arr_memview64u.shape[0]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_v_arr_memview64u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview64u.shape[1]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview64u.shape[1])) __pyx_t_10 = 1; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview64u.shape[1]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview64u.shape[1])) __pyx_t_10 = 1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview64u.shape[2]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview64u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview64u.shape[2]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview64u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 371, __pyx_L25_error) + __PYX_ERR(0, 388, __pyx_L30_error) } - /* "cc3d.pyx":372 + /* "cc3d.pyx":389 * connected_components3d[uint64_t, uint32_t]( * &arr_memview64u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels32[0], N * ) */ - __pyx_t_27 = __Pyx_PyInt_As_uint64_t(__pyx_v_delta); if (unlikely((__pyx_t_27 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L25_error) + __pyx_t_28 = __Pyx_PyInt_As_uint64_t(__pyx_v_delta); if (unlikely((__pyx_t_28 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L30_error) - /* "cc3d.pyx":373 + /* "cc3d.pyx":390 * &arr_memview64u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint64: */ - __pyx_t_24 = 0; + __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 373, __pyx_L25_error) + __PYX_ERR(0, 390, __pyx_L30_error) } - /* "cc3d.pyx":370 + /* "cc3d.pyx":387 * ) * elif out_dtype == np.uint32: * connected_components3d[uint64_t, uint32_t]( # <<<<<<<<<<<<<< @@ -7686,96 +8011,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64u.data + __pyx_t_28 * __pyx_v_arr_memview64u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview64u.strides[1]) ) + __pyx_t_25 * __pyx_v_arr_memview64u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_27, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64u.data + __pyx_t_29 * __pyx_v_arr_memview64u.strides[0]) ) + __pyx_t_27 * __pyx_v_arr_memview64u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview64u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_28, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 370, __pyx_L25_error) + __PYX_ERR(0, 387, __pyx_L30_error) } - /* "cc3d.pyx":369 + /* "cc3d.pyx":386 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[uint64_t, uint32_t]( * &arr_memview64u[0,0,0], */ - goto __pyx_L34; + goto __pyx_L39; } - /* "cc3d.pyx":375 + /* "cc3d.pyx":392 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< * connected_components3d[uint64_t, uint64_t]( * &arr_memview64u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 392, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 375, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 392, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":377 + /* "cc3d.pyx":394 * elif out_dtype == np.uint64: * connected_components3d[uint64_t, uint64_t]( * &arr_memview64u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N */ - __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_t_27 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_v_arr_memview64u.shape[0]; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_v_arr_memview64u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview64u.shape[1]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview64u.shape[1])) __pyx_t_10 = 1; + __pyx_t_25 += __pyx_v_arr_memview64u.shape[0]; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview64u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview64u.shape[2]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview64u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview64u.shape[1]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview64u.shape[1])) __pyx_t_10 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview64u.shape[2]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview64u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 377, __pyx_L25_error) + __PYX_ERR(0, 394, __pyx_L30_error) } - /* "cc3d.pyx":378 + /* "cc3d.pyx":395 * connected_components3d[uint64_t, uint64_t]( * &arr_memview64u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels64[0], N * ) */ - __pyx_t_27 = __Pyx_PyInt_As_uint64_t(__pyx_v_delta); if (unlikely((__pyx_t_27 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L25_error) + __pyx_t_28 = __Pyx_PyInt_As_uint64_t(__pyx_v_delta); if (unlikely((__pyx_t_28 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L30_error) - /* "cc3d.pyx":379 + /* "cc3d.pyx":396 * &arr_memview64u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N # <<<<<<<<<<<<<< * ) * elif dtype in (np.uint32, np.int32): */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 379, __pyx_L25_error) + __PYX_ERR(0, 396, __pyx_L30_error) } - /* "cc3d.pyx":376 + /* "cc3d.pyx":393 * ) * elif out_dtype == np.uint64: * connected_components3d[uint64_t, uint64_t]( # <<<<<<<<<<<<<< @@ -7783,13 +8108,13 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64u.data + __pyx_t_24 * __pyx_v_arr_memview64u.strides[0]) ) + __pyx_t_25 * __pyx_v_arr_memview64u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview64u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_27, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64u.data + __pyx_t_25 * __pyx_v_arr_memview64u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview64u.strides[1]) ) + __pyx_t_27 * __pyx_v_arr_memview64u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_28, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 376, __pyx_L25_error) + __PYX_ERR(0, 393, __pyx_L30_error) } - /* "cc3d.pyx":375 + /* "cc3d.pyx":392 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< @@ -7797,19 +8122,19 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * &arr_memview64u[0,0,0], */ } - __pyx_L34:; + __pyx_L39:; - /* "cc3d.pyx":361 + /* "cc3d.pyx":378 * if delta == 0 and first_foreground_row == last_foreground_row and first_foreground_row >= 0: * N = epl_special_row(first_foreground_row, sx, sy, data, out_labels) * elif dtype in (np.uint64, np.int64): # <<<<<<<<<<<<<< * arr_memview64u = data.view(np.uint64) * if out_dtype == np.uint16: */ - goto __pyx_L28; + goto __pyx_L33; } - /* "cc3d.pyx":381 + /* "cc3d.pyx":398 * &out_labels64[0], N * ) * elif dtype in (np.uint32, np.int32): # <<<<<<<<<<<<<< @@ -7818,145 +8143,145 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_6 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 381, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 398, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L30_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 381, __pyx_L25_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, 398, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; - goto __pyx_L35_bool_binop_done; + goto __pyx_L40_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 381, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 398, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L30_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 381, __pyx_L25_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, 398, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __pyx_t_3; - __pyx_L35_bool_binop_done:; + __pyx_L40_bool_binop_done:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "cc3d.pyx":382 + /* "cc3d.pyx":399 * ) * elif dtype in (np.uint32, np.int32): * arr_memview32u = data.view(np.uint32) # <<<<<<<<<<<<<< * if out_dtype == np.uint16: * connected_components3d[uint32_t, uint16_t]( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 382, __pyx_L25_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 399, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L25_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_11, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); + __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_11, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L25_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_29 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_29.memview)) __PYX_ERR(0, 382, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_30.memview)) __PYX_ERR(0, 399, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_arr_memview32u = __pyx_t_29; - __pyx_t_29.memview = NULL; - __pyx_t_29.data = NULL; + __pyx_v_arr_memview32u = __pyx_t_30; + __pyx_t_30.memview = NULL; + __pyx_t_30.data = NULL; - /* "cc3d.pyx":383 + /* "cc3d.pyx":400 * elif dtype in (np.uint32, np.int32): * arr_memview32u = data.view(np.uint32) * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[uint32_t, uint16_t]( * &arr_memview32u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 400, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 383, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 400, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":385 + /* "cc3d.pyx":402 * if out_dtype == np.uint16: * connected_components3d[uint32_t, uint16_t]( * &arr_memview32u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; + __pyx_t_27 = 0; __pyx_t_26 = 0; - __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_arr_memview32u.shape[0]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_v_arr_memview32u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_v_arr_memview32u.shape[0]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_v_arr_memview32u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview32u.shape[1]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview32u.shape[1])) __pyx_t_10 = 1; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview32u.shape[1]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview32u.shape[1])) __pyx_t_10 = 1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview32u.shape[2]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview32u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview32u.shape[2]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview32u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 385, __pyx_L25_error) + __PYX_ERR(0, 402, __pyx_L30_error) } - /* "cc3d.pyx":386 + /* "cc3d.pyx":403 * connected_components3d[uint32_t, uint16_t]( * &arr_memview32u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels16[0], N * ) */ - __pyx_t_30 = __Pyx_PyInt_As_uint32_t(__pyx_v_delta); if (unlikely((__pyx_t_30 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 386, __pyx_L25_error) + __pyx_t_31 = __Pyx_PyInt_As_uint32_t(__pyx_v_delta); if (unlikely((__pyx_t_31 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L30_error) - /* "cc3d.pyx":387 + /* "cc3d.pyx":404 * &arr_memview32u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint32: */ - __pyx_t_24 = 0; + __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 387, __pyx_L25_error) + __PYX_ERR(0, 404, __pyx_L30_error) } - /* "cc3d.pyx":384 + /* "cc3d.pyx":401 * arr_memview32u = data.view(np.uint32) * if out_dtype == np.uint16: * connected_components3d[uint32_t, uint16_t]( # <<<<<<<<<<<<<< @@ -7964,96 +8289,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32u.data + __pyx_t_28 * __pyx_v_arr_memview32u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview32u.strides[1]) ) + __pyx_t_25 * __pyx_v_arr_memview32u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_30, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32u.data + __pyx_t_29 * __pyx_v_arr_memview32u.strides[0]) ) + __pyx_t_27 * __pyx_v_arr_memview32u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview32u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_31, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 384, __pyx_L25_error) + __PYX_ERR(0, 401, __pyx_L30_error) } - /* "cc3d.pyx":383 + /* "cc3d.pyx":400 * elif dtype in (np.uint32, np.int32): * arr_memview32u = data.view(np.uint32) * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[uint32_t, uint16_t]( * &arr_memview32u[0,0,0], */ - goto __pyx_L37; + goto __pyx_L42; } - /* "cc3d.pyx":389 + /* "cc3d.pyx":406 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[uint32_t, uint32_t]( * &arr_memview32u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 406, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 389, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 406, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":391 + /* "cc3d.pyx":408 * elif out_dtype == np.uint32: * connected_components3d[uint32_t, uint32_t]( * &arr_memview32u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N */ - __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_t_27 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_v_arr_memview32u.shape[0]; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_v_arr_memview32u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview32u.shape[1]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview32u.shape[1])) __pyx_t_10 = 1; + __pyx_t_25 += __pyx_v_arr_memview32u.shape[0]; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview32u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview32u.shape[2]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview32u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview32u.shape[1]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview32u.shape[1])) __pyx_t_10 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview32u.shape[2]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview32u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 391, __pyx_L25_error) + __PYX_ERR(0, 408, __pyx_L30_error) } - /* "cc3d.pyx":392 + /* "cc3d.pyx":409 * connected_components3d[uint32_t, uint32_t]( * &arr_memview32u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels32[0], N * ) */ - __pyx_t_30 = __Pyx_PyInt_As_uint32_t(__pyx_v_delta); if (unlikely((__pyx_t_30 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L25_error) + __pyx_t_31 = __Pyx_PyInt_As_uint32_t(__pyx_v_delta); if (unlikely((__pyx_t_31 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L30_error) - /* "cc3d.pyx":393 + /* "cc3d.pyx":410 * &arr_memview32u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint64: */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 393, __pyx_L25_error) + __PYX_ERR(0, 410, __pyx_L30_error) } - /* "cc3d.pyx":390 + /* "cc3d.pyx":407 * ) * elif out_dtype == np.uint32: * connected_components3d[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -8061,96 +8386,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32u.data + __pyx_t_24 * __pyx_v_arr_memview32u.strides[0]) ) + __pyx_t_25 * __pyx_v_arr_memview32u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview32u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_30, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32u.data + __pyx_t_25 * __pyx_v_arr_memview32u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview32u.strides[1]) ) + __pyx_t_27 * __pyx_v_arr_memview32u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_31, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 390, __pyx_L25_error) + __PYX_ERR(0, 407, __pyx_L30_error) } - /* "cc3d.pyx":389 + /* "cc3d.pyx":406 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[uint32_t, uint32_t]( * &arr_memview32u[0,0,0], */ - goto __pyx_L37; + goto __pyx_L42; } - /* "cc3d.pyx":395 + /* "cc3d.pyx":412 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< * connected_components3d[uint32_t, uint64_t]( * &arr_memview32u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 395, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 412, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":397 + /* "cc3d.pyx":414 * elif out_dtype == np.uint64: * connected_components3d[uint32_t, uint64_t]( * &arr_memview32u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; + __pyx_t_27 = 0; __pyx_t_26 = 0; - __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_arr_memview32u.shape[0]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_v_arr_memview32u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_v_arr_memview32u.shape[0]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_v_arr_memview32u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview32u.shape[1]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview32u.shape[1])) __pyx_t_10 = 1; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview32u.shape[1]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview32u.shape[1])) __pyx_t_10 = 1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview32u.shape[2]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview32u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview32u.shape[2]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview32u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 397, __pyx_L25_error) + __PYX_ERR(0, 414, __pyx_L30_error) } - /* "cc3d.pyx":398 + /* "cc3d.pyx":415 * connected_components3d[uint32_t, uint64_t]( * &arr_memview32u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels64[0], N * ) */ - __pyx_t_30 = __Pyx_PyInt_As_uint32_t(__pyx_v_delta); if (unlikely((__pyx_t_30 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L25_error) + __pyx_t_31 = __Pyx_PyInt_As_uint32_t(__pyx_v_delta); if (unlikely((__pyx_t_31 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 415, __pyx_L30_error) - /* "cc3d.pyx":399 + /* "cc3d.pyx":416 * &arr_memview32u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N # <<<<<<<<<<<<<< * ) * elif dtype in (np.uint16, np.int16): */ - __pyx_t_24 = 0; + __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 399, __pyx_L25_error) + __PYX_ERR(0, 416, __pyx_L30_error) } - /* "cc3d.pyx":396 + /* "cc3d.pyx":413 * ) * elif out_dtype == np.uint64: * connected_components3d[uint32_t, uint64_t]( # <<<<<<<<<<<<<< @@ -8158,13 +8483,13 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32u.data + __pyx_t_28 * __pyx_v_arr_memview32u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview32u.strides[1]) ) + __pyx_t_25 * __pyx_v_arr_memview32u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_30, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32u.data + __pyx_t_29 * __pyx_v_arr_memview32u.strides[0]) ) + __pyx_t_27 * __pyx_v_arr_memview32u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview32u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_31, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 396, __pyx_L25_error) + __PYX_ERR(0, 413, __pyx_L30_error) } - /* "cc3d.pyx":395 + /* "cc3d.pyx":412 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< @@ -8172,19 +8497,19 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * &arr_memview32u[0,0,0], */ } - __pyx_L37:; + __pyx_L42:; - /* "cc3d.pyx":381 + /* "cc3d.pyx":398 * &out_labels64[0], N * ) * elif dtype in (np.uint32, np.int32): # <<<<<<<<<<<<<< * arr_memview32u = data.view(np.uint32) * if out_dtype == np.uint16: */ - goto __pyx_L28; + goto __pyx_L33; } - /* "cc3d.pyx":401 + /* "cc3d.pyx":418 * &out_labels64[0], N * ) * elif dtype in (np.uint16, np.int16): # <<<<<<<<<<<<<< @@ -8193,145 +8518,145 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_6 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L30_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 401, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 418, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; - goto __pyx_L38_bool_binop_done; + goto __pyx_L43_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L30_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 401, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 418, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __pyx_t_4; - __pyx_L38_bool_binop_done:; + __pyx_L43_bool_binop_done:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "cc3d.pyx":402 + /* "cc3d.pyx":419 * ) * elif dtype in (np.uint16, np.int16): * arr_memview16u = data.view(np.uint16) # <<<<<<<<<<<<<< * if out_dtype == np.uint16: * connected_components3d[uint16_t, uint16_t]( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L25_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 402, __pyx_L25_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 419, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); + __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_11); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L25_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 419, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 402, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 419, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_arr_memview16u = __pyx_t_31; - __pyx_t_31.memview = NULL; - __pyx_t_31.data = NULL; + __pyx_v_arr_memview16u = __pyx_t_32; + __pyx_t_32.memview = NULL; + __pyx_t_32.data = NULL; - /* "cc3d.pyx":403 + /* "cc3d.pyx":420 * elif dtype in (np.uint16, np.int16): * arr_memview16u = data.view(np.uint16) * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[uint16_t, uint16_t]( * &arr_memview16u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 403, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 420, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":405 + /* "cc3d.pyx":422 * if out_dtype == np.uint16: * connected_components3d[uint16_t, uint16_t]( * &arr_memview16u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N */ - __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_t_27 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_v_arr_memview16u.shape[0]; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_v_arr_memview16u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview16u.shape[1]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview16u.shape[1])) __pyx_t_10 = 1; + __pyx_t_25 += __pyx_v_arr_memview16u.shape[0]; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview16u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview16u.shape[2]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview16u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview16u.shape[1]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview16u.shape[1])) __pyx_t_10 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview16u.shape[2]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview16u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 405, __pyx_L25_error) + __PYX_ERR(0, 422, __pyx_L30_error) } - /* "cc3d.pyx":406 + /* "cc3d.pyx":423 * connected_components3d[uint16_t, uint16_t]( * &arr_memview16u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels16[0], N * ) */ - __pyx_t_32 = __Pyx_PyInt_As_uint16_t(__pyx_v_delta); if (unlikely((__pyx_t_32 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L25_error) + __pyx_t_33 = __Pyx_PyInt_As_uint16_t(__pyx_v_delta); if (unlikely((__pyx_t_33 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L30_error) - /* "cc3d.pyx":407 + /* "cc3d.pyx":424 * &arr_memview16u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint32: */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 407, __pyx_L25_error) + __PYX_ERR(0, 424, __pyx_L30_error) } - /* "cc3d.pyx":404 + /* "cc3d.pyx":421 * arr_memview16u = data.view(np.uint16) * if out_dtype == np.uint16: * connected_components3d[uint16_t, uint16_t]( # <<<<<<<<<<<<<< @@ -8339,96 +8664,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16u.data + __pyx_t_24 * __pyx_v_arr_memview16u.strides[0]) ) + __pyx_t_25 * __pyx_v_arr_memview16u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview16u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_32, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16u.data + __pyx_t_25 * __pyx_v_arr_memview16u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview16u.strides[1]) ) + __pyx_t_27 * __pyx_v_arr_memview16u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_33, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 404, __pyx_L25_error) + __PYX_ERR(0, 421, __pyx_L30_error) } - /* "cc3d.pyx":403 + /* "cc3d.pyx":420 * elif dtype in (np.uint16, np.int16): * arr_memview16u = data.view(np.uint16) * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[uint16_t, uint16_t]( * &arr_memview16u[0,0,0], */ - goto __pyx_L40; + goto __pyx_L45; } - /* "cc3d.pyx":409 + /* "cc3d.pyx":426 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[uint16_t, uint32_t]( * &arr_memview16u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 409, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 409, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 409, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 426, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":411 + /* "cc3d.pyx":428 * elif out_dtype == np.uint32: * connected_components3d[uint16_t, uint32_t]( * &arr_memview16u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; + __pyx_t_27 = 0; __pyx_t_26 = 0; - __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_arr_memview16u.shape[0]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_v_arr_memview16u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_v_arr_memview16u.shape[0]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_v_arr_memview16u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview16u.shape[1]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview16u.shape[1])) __pyx_t_10 = 1; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview16u.shape[1]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview16u.shape[1])) __pyx_t_10 = 1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview16u.shape[2]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview16u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview16u.shape[2]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview16u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 411, __pyx_L25_error) + __PYX_ERR(0, 428, __pyx_L30_error) } - /* "cc3d.pyx":412 + /* "cc3d.pyx":429 * connected_components3d[uint16_t, uint32_t]( * &arr_memview16u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels32[0], N * ) */ - __pyx_t_32 = __Pyx_PyInt_As_uint16_t(__pyx_v_delta); if (unlikely((__pyx_t_32 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L25_error) + __pyx_t_33 = __Pyx_PyInt_As_uint16_t(__pyx_v_delta); if (unlikely((__pyx_t_33 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L30_error) - /* "cc3d.pyx":413 + /* "cc3d.pyx":430 * &arr_memview16u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint64: */ - __pyx_t_24 = 0; + __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 413, __pyx_L25_error) + __PYX_ERR(0, 430, __pyx_L30_error) } - /* "cc3d.pyx":410 + /* "cc3d.pyx":427 * ) * elif out_dtype == np.uint32: * connected_components3d[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -8436,96 +8761,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16u.data + __pyx_t_28 * __pyx_v_arr_memview16u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview16u.strides[1]) ) + __pyx_t_25 * __pyx_v_arr_memview16u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_32, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16u.data + __pyx_t_29 * __pyx_v_arr_memview16u.strides[0]) ) + __pyx_t_27 * __pyx_v_arr_memview16u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview16u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_33, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 410, __pyx_L25_error) + __PYX_ERR(0, 427, __pyx_L30_error) } - /* "cc3d.pyx":409 + /* "cc3d.pyx":426 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[uint16_t, uint32_t]( * &arr_memview16u[0,0,0], */ - goto __pyx_L40; + goto __pyx_L45; } - /* "cc3d.pyx":415 + /* "cc3d.pyx":432 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< * connected_components3d[uint16_t, uint64_t]( * &arr_memview16u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 415, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 432, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":417 + /* "cc3d.pyx":434 * elif out_dtype == np.uint64: * connected_components3d[uint16_t, uint64_t]( * &arr_memview16u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N */ - __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_t_27 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_v_arr_memview16u.shape[0]; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_v_arr_memview16u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview16u.shape[1]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview16u.shape[1])) __pyx_t_10 = 1; + __pyx_t_25 += __pyx_v_arr_memview16u.shape[0]; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview16u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview16u.shape[2]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview16u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview16u.shape[1]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview16u.shape[1])) __pyx_t_10 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview16u.shape[2]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview16u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 417, __pyx_L25_error) + __PYX_ERR(0, 434, __pyx_L30_error) } - /* "cc3d.pyx":418 + /* "cc3d.pyx":435 * connected_components3d[uint16_t, uint64_t]( * &arr_memview16u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels64[0], N * ) */ - __pyx_t_32 = __Pyx_PyInt_As_uint16_t(__pyx_v_delta); if (unlikely((__pyx_t_32 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L25_error) + __pyx_t_33 = __Pyx_PyInt_As_uint16_t(__pyx_v_delta); if (unlikely((__pyx_t_33 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L30_error) - /* "cc3d.pyx":419 + /* "cc3d.pyx":436 * &arr_memview16u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N # <<<<<<<<<<<<<< * ) * elif dtype in (np.uint8, np.int8, bool): */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 419, __pyx_L25_error) + __PYX_ERR(0, 436, __pyx_L30_error) } - /* "cc3d.pyx":416 + /* "cc3d.pyx":433 * ) * elif out_dtype == np.uint64: * connected_components3d[uint16_t, uint64_t]( # <<<<<<<<<<<<<< @@ -8533,13 +8858,13 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16u.data + __pyx_t_24 * __pyx_v_arr_memview16u.strides[0]) ) + __pyx_t_25 * __pyx_v_arr_memview16u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview16u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_32, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16u.data + __pyx_t_25 * __pyx_v_arr_memview16u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview16u.strides[1]) ) + __pyx_t_27 * __pyx_v_arr_memview16u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_33, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 416, __pyx_L25_error) + __PYX_ERR(0, 433, __pyx_L30_error) } - /* "cc3d.pyx":415 + /* "cc3d.pyx":432 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< @@ -8547,19 +8872,19 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * &arr_memview16u[0,0,0], */ } - __pyx_L40:; + __pyx_L45:; - /* "cc3d.pyx":401 + /* "cc3d.pyx":418 * &out_labels64[0], N * ) * elif dtype in (np.uint16, np.int16): # <<<<<<<<<<<<<< * arr_memview16u = data.view(np.uint16) * if out_dtype == np.uint16: */ - goto __pyx_L28; + goto __pyx_L33; } - /* "cc3d.pyx":421 + /* "cc3d.pyx":438 * &out_labels64[0], N * ) * elif dtype in (np.uint8, np.int8, bool): # <<<<<<<<<<<<<< @@ -8568,153 +8893,153 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_6 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 421, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 438, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L30_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 421, __pyx_L25_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, 438, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; - goto __pyx_L41_bool_binop_done; + goto __pyx_L46_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 421, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 438, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L30_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 421, __pyx_L25_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, 438, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; - goto __pyx_L41_bool_binop_done; + goto __pyx_L46_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L25_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 421, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L30_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 438, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __pyx_t_3; - __pyx_L41_bool_binop_done:; + __pyx_L46_bool_binop_done:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "cc3d.pyx":422 + /* "cc3d.pyx":439 * ) * elif dtype in (np.uint8, np.int8, bool): * arr_memview8u = data.view(np.uint8) # <<<<<<<<<<<<<< * if out_dtype == np.uint16: * connected_components3d[uint8_t, uint16_t]( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 422, __pyx_L25_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 439, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L25_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_11, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); + __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_11, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L25_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_33 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_33.memview)) __PYX_ERR(0, 422, __pyx_L25_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_34 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_34.memview)) __PYX_ERR(0, 439, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_arr_memview8u = __pyx_t_33; - __pyx_t_33.memview = NULL; - __pyx_t_33.data = NULL; + __pyx_v_arr_memview8u = __pyx_t_34; + __pyx_t_34.memview = NULL; + __pyx_t_34.data = NULL; - /* "cc3d.pyx":423 + /* "cc3d.pyx":440 * elif dtype in (np.uint8, np.int8, bool): * arr_memview8u = data.view(np.uint8) * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[uint8_t, uint16_t]( * &arr_memview8u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 423, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 440, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":425 + /* "cc3d.pyx":442 * if out_dtype == np.uint16: * connected_components3d[uint8_t, uint16_t]( * &arr_memview8u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; + __pyx_t_27 = 0; __pyx_t_26 = 0; - __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_arr_memview8u.shape[0]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_v_arr_memview8u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_v_arr_memview8u.shape[0]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_v_arr_memview8u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview8u.shape[1]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview8u.shape[1])) __pyx_t_10 = 1; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview8u.shape[1]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview8u.shape[1])) __pyx_t_10 = 1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview8u.shape[2]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview8u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview8u.shape[2]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview8u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 425, __pyx_L25_error) + __PYX_ERR(0, 442, __pyx_L30_error) } - /* "cc3d.pyx":426 + /* "cc3d.pyx":443 * connected_components3d[uint8_t, uint16_t]( * &arr_memview8u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels16[0], N * ) */ - __pyx_t_34 = __Pyx_PyInt_As_uint8_t(__pyx_v_delta); if (unlikely((__pyx_t_34 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L25_error) + __pyx_t_35 = __Pyx_PyInt_As_uint8_t(__pyx_v_delta); if (unlikely((__pyx_t_35 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 443, __pyx_L30_error) - /* "cc3d.pyx":427 + /* "cc3d.pyx":444 * &arr_memview8u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint32: */ - __pyx_t_24 = 0; + __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 427, __pyx_L25_error) + __PYX_ERR(0, 444, __pyx_L30_error) } - /* "cc3d.pyx":424 + /* "cc3d.pyx":441 * arr_memview8u = data.view(np.uint8) * if out_dtype == np.uint16: * connected_components3d[uint8_t, uint16_t]( # <<<<<<<<<<<<<< @@ -8722,96 +9047,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8u.data + __pyx_t_28 * __pyx_v_arr_memview8u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview8u.strides[1]) ) + __pyx_t_25 * __pyx_v_arr_memview8u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_34, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8u.data + __pyx_t_29 * __pyx_v_arr_memview8u.strides[0]) ) + __pyx_t_27 * __pyx_v_arr_memview8u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview8u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_35, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 424, __pyx_L25_error) + __PYX_ERR(0, 441, __pyx_L30_error) } - /* "cc3d.pyx":423 + /* "cc3d.pyx":440 * elif dtype in (np.uint8, np.int8, bool): * arr_memview8u = data.view(np.uint8) * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[uint8_t, uint16_t]( * &arr_memview8u[0,0,0], */ - goto __pyx_L44; + goto __pyx_L49; } - /* "cc3d.pyx":429 + /* "cc3d.pyx":446 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[uint8_t, uint32_t]( * &arr_memview8u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 429, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 446, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":431 + /* "cc3d.pyx":448 * elif out_dtype == np.uint32: * connected_components3d[uint8_t, uint32_t]( * &arr_memview8u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N */ - __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_t_27 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_v_arr_memview8u.shape[0]; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_v_arr_memview8u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview8u.shape[1]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview8u.shape[1])) __pyx_t_10 = 1; + __pyx_t_25 += __pyx_v_arr_memview8u.shape[0]; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview8u.shape[0])) __pyx_t_10 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview8u.shape[2]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview8u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview8u.shape[1]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview8u.shape[1])) __pyx_t_10 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview8u.shape[2]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview8u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 431, __pyx_L25_error) + __PYX_ERR(0, 448, __pyx_L30_error) } - /* "cc3d.pyx":432 + /* "cc3d.pyx":449 * connected_components3d[uint8_t, uint32_t]( * &arr_memview8u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels32[0], N * ) */ - __pyx_t_34 = __Pyx_PyInt_As_uint8_t(__pyx_v_delta); if (unlikely((__pyx_t_34 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L25_error) + __pyx_t_35 = __Pyx_PyInt_As_uint8_t(__pyx_v_delta); if (unlikely((__pyx_t_35 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L30_error) - /* "cc3d.pyx":433 + /* "cc3d.pyx":450 * &arr_memview8u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint64: */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 433, __pyx_L25_error) + __PYX_ERR(0, 450, __pyx_L30_error) } - /* "cc3d.pyx":430 + /* "cc3d.pyx":447 * ) * elif out_dtype == np.uint32: * connected_components3d[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -8819,96 +9144,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8u.data + __pyx_t_24 * __pyx_v_arr_memview8u.strides[0]) ) + __pyx_t_25 * __pyx_v_arr_memview8u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview8u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_34, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8u.data + __pyx_t_25 * __pyx_v_arr_memview8u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview8u.strides[1]) ) + __pyx_t_27 * __pyx_v_arr_memview8u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_35, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 430, __pyx_L25_error) + __PYX_ERR(0, 447, __pyx_L30_error) } - /* "cc3d.pyx":429 + /* "cc3d.pyx":446 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[uint8_t, uint32_t]( * &arr_memview8u[0,0,0], */ - goto __pyx_L44; + goto __pyx_L49; } - /* "cc3d.pyx":435 + /* "cc3d.pyx":452 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< * connected_components3d[uint8_t, uint64_t]( * &arr_memview8u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 435, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 452, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":437 + /* "cc3d.pyx":454 * elif out_dtype == np.uint64: * connected_components3d[uint8_t, uint64_t]( * &arr_memview8u[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; + __pyx_t_27 = 0; __pyx_t_26 = 0; - __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_arr_memview8u.shape[0]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_v_arr_memview8u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_v_arr_memview8u.shape[0]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_v_arr_memview8u.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memview8u.shape[1]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memview8u.shape[1])) __pyx_t_10 = 1; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memview8u.shape[1]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview8u.shape[1])) __pyx_t_10 = 1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memview8u.shape[2]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memview8u.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memview8u.shape[2]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memview8u.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 437, __pyx_L25_error) + __PYX_ERR(0, 454, __pyx_L30_error) } - /* "cc3d.pyx":438 + /* "cc3d.pyx":455 * connected_components3d[uint8_t, uint64_t]( * &arr_memview8u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels64[0], N * ) */ - __pyx_t_34 = __Pyx_PyInt_As_uint8_t(__pyx_v_delta); if (unlikely((__pyx_t_34 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L25_error) + __pyx_t_35 = __Pyx_PyInt_As_uint8_t(__pyx_v_delta); if (unlikely((__pyx_t_35 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L30_error) - /* "cc3d.pyx":439 + /* "cc3d.pyx":456 * &arr_memview8u[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N # <<<<<<<<<<<<<< * ) * elif dtype == np.float32: */ - __pyx_t_24 = 0; + __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 439, __pyx_L25_error) + __PYX_ERR(0, 456, __pyx_L30_error) } - /* "cc3d.pyx":436 + /* "cc3d.pyx":453 * ) * elif out_dtype == np.uint64: * connected_components3d[uint8_t, uint64_t]( # <<<<<<<<<<<<<< @@ -8916,13 +9241,13 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8u.data + __pyx_t_28 * __pyx_v_arr_memview8u.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memview8u.strides[1]) ) + __pyx_t_25 * __pyx_v_arr_memview8u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_34, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8u.data + __pyx_t_29 * __pyx_v_arr_memview8u.strides[0]) ) + __pyx_t_27 * __pyx_v_arr_memview8u.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memview8u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_35, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 436, __pyx_L25_error) + __PYX_ERR(0, 453, __pyx_L30_error) } - /* "cc3d.pyx":435 + /* "cc3d.pyx":452 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< @@ -8930,122 +9255,122 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * &arr_memview8u[0,0,0], */ } - __pyx_L44:; + __pyx_L49:; - /* "cc3d.pyx":421 + /* "cc3d.pyx":438 * &out_labels64[0], N * ) * elif dtype in (np.uint8, np.int8, bool): # <<<<<<<<<<<<<< * arr_memview8u = data.view(np.uint8) * if out_dtype == np.uint16: */ - goto __pyx_L28; + goto __pyx_L33; } - /* "cc3d.pyx":441 + /* "cc3d.pyx":458 * &out_labels64[0], N * ) * elif dtype == np.float32: # <<<<<<<<<<<<<< * arr_memviewf = data * if out_dtype == np.uint16: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 441, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 458, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":442 + /* "cc3d.pyx":459 * ) * elif dtype == np.float32: * arr_memviewf = data # <<<<<<<<<<<<<< * if out_dtype == np.uint16: * connected_components3d[float, uint16_t]( */ - __pyx_t_35 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_35.memview)) __PYX_ERR(0, 442, __pyx_L25_error) - __pyx_v_arr_memviewf = __pyx_t_35; - __pyx_t_35.memview = NULL; - __pyx_t_35.data = NULL; + __pyx_t_36 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_36.memview)) __PYX_ERR(0, 459, __pyx_L30_error) + __pyx_v_arr_memviewf = __pyx_t_36; + __pyx_t_36.memview = NULL; + __pyx_t_36.data = NULL; - /* "cc3d.pyx":443 + /* "cc3d.pyx":460 * elif dtype == np.float32: * arr_memviewf = data * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[float, uint16_t]( * &arr_memviewf[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 443, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 460, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":445 + /* "cc3d.pyx":462 * if out_dtype == np.uint16: * connected_components3d[float, uint16_t]( * &arr_memviewf[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N */ - __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_t_27 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_v_arr_memviewf.shape[0]; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_v_arr_memviewf.shape[0])) __pyx_t_10 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memviewf.shape[1]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memviewf.shape[1])) __pyx_t_10 = 1; + __pyx_t_25 += __pyx_v_arr_memviewf.shape[0]; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memviewf.shape[0])) __pyx_t_10 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memviewf.shape[2]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewf.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memviewf.shape[1]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewf.shape[1])) __pyx_t_10 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memviewf.shape[2]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memviewf.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 445, __pyx_L25_error) + __PYX_ERR(0, 462, __pyx_L30_error) } - /* "cc3d.pyx":446 + /* "cc3d.pyx":463 * connected_components3d[float, uint16_t]( * &arr_memviewf[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels16[0], N * ) */ - __pyx_t_36 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_36 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L25_error) + __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L30_error) - /* "cc3d.pyx":447 + /* "cc3d.pyx":464 * &arr_memviewf[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint32: */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 447, __pyx_L25_error) + __PYX_ERR(0, 464, __pyx_L30_error) } - /* "cc3d.pyx":444 + /* "cc3d.pyx":461 * arr_memviewf = data * if out_dtype == np.uint16: * connected_components3d[float, uint16_t]( # <<<<<<<<<<<<<< @@ -9053,96 +9378,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewf.data + __pyx_t_24 * __pyx_v_arr_memviewf.strides[0]) ) + __pyx_t_25 * __pyx_v_arr_memviewf.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memviewf.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_36, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewf.data + __pyx_t_25 * __pyx_v_arr_memviewf.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memviewf.strides[1]) ) + __pyx_t_27 * __pyx_v_arr_memviewf.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_37, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 444, __pyx_L25_error) + __PYX_ERR(0, 461, __pyx_L30_error) } - /* "cc3d.pyx":443 + /* "cc3d.pyx":460 * elif dtype == np.float32: * arr_memviewf = data * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[float, uint16_t]( * &arr_memviewf[0,0,0], */ - goto __pyx_L45; + goto __pyx_L50; } - /* "cc3d.pyx":449 + /* "cc3d.pyx":466 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[float, uint32_t]( * &arr_memviewf[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 449, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 466, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":451 + /* "cc3d.pyx":468 * elif out_dtype == np.uint32: * connected_components3d[float, uint32_t]( * &arr_memviewf[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; + __pyx_t_27 = 0; __pyx_t_26 = 0; - __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_arr_memviewf.shape[0]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_v_arr_memviewf.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_v_arr_memviewf.shape[0]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_v_arr_memviewf.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memviewf.shape[1]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memviewf.shape[1])) __pyx_t_10 = 1; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memviewf.shape[1]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewf.shape[1])) __pyx_t_10 = 1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memviewf.shape[2]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memviewf.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memviewf.shape[2]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewf.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 451, __pyx_L25_error) + __PYX_ERR(0, 468, __pyx_L30_error) } - /* "cc3d.pyx":452 + /* "cc3d.pyx":469 * connected_components3d[float, uint32_t]( * &arr_memviewf[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels32[0], N * ) */ - __pyx_t_36 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_36 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L25_error) + __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L30_error) - /* "cc3d.pyx":453 + /* "cc3d.pyx":470 * &arr_memviewf[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint64: */ - __pyx_t_24 = 0; + __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 453, __pyx_L25_error) + __PYX_ERR(0, 470, __pyx_L30_error) } - /* "cc3d.pyx":450 + /* "cc3d.pyx":467 * ) * elif out_dtype == np.uint32: * connected_components3d[float, uint32_t]( # <<<<<<<<<<<<<< @@ -9150,96 +9475,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewf.data + __pyx_t_28 * __pyx_v_arr_memviewf.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memviewf.strides[1]) ) + __pyx_t_25 * __pyx_v_arr_memviewf.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_36, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewf.data + __pyx_t_29 * __pyx_v_arr_memviewf.strides[0]) ) + __pyx_t_27 * __pyx_v_arr_memviewf.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memviewf.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_37, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 450, __pyx_L25_error) + __PYX_ERR(0, 467, __pyx_L30_error) } - /* "cc3d.pyx":449 + /* "cc3d.pyx":466 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[float, uint32_t]( * &arr_memviewf[0,0,0], */ - goto __pyx_L45; + goto __pyx_L50; } - /* "cc3d.pyx":455 + /* "cc3d.pyx":472 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< * connected_components3d[float, uint64_t]( * &arr_memviewf[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 455, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 472, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":457 + /* "cc3d.pyx":474 * elif out_dtype == np.uint64: * connected_components3d[float, uint64_t]( * &arr_memviewf[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N */ - __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_t_27 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_v_arr_memviewf.shape[0]; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_v_arr_memviewf.shape[0])) __pyx_t_10 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memviewf.shape[1]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memviewf.shape[1])) __pyx_t_10 = 1; + __pyx_t_25 += __pyx_v_arr_memviewf.shape[0]; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memviewf.shape[0])) __pyx_t_10 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memviewf.shape[2]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewf.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memviewf.shape[1]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewf.shape[1])) __pyx_t_10 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memviewf.shape[2]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memviewf.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 457, __pyx_L25_error) + __PYX_ERR(0, 474, __pyx_L30_error) } - /* "cc3d.pyx":458 + /* "cc3d.pyx":475 * connected_components3d[float, uint64_t]( * &arr_memviewf[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels64[0], N * ) */ - __pyx_t_36 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_36 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L25_error) + __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L30_error) - /* "cc3d.pyx":459 + /* "cc3d.pyx":476 * &arr_memviewf[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N # <<<<<<<<<<<<<< * ) * elif dtype == np.float64: */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 459, __pyx_L25_error) + __PYX_ERR(0, 476, __pyx_L30_error) } - /* "cc3d.pyx":456 + /* "cc3d.pyx":473 * ) * elif out_dtype == np.uint64: * connected_components3d[float, uint64_t]( # <<<<<<<<<<<<<< @@ -9247,13 +9572,13 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewf.data + __pyx_t_24 * __pyx_v_arr_memviewf.strides[0]) ) + __pyx_t_25 * __pyx_v_arr_memviewf.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memviewf.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_36, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewf.data + __pyx_t_25 * __pyx_v_arr_memviewf.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memviewf.strides[1]) ) + __pyx_t_27 * __pyx_v_arr_memviewf.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_37, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 456, __pyx_L25_error) + __PYX_ERR(0, 473, __pyx_L30_error) } - /* "cc3d.pyx":455 + /* "cc3d.pyx":472 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< @@ -9261,122 +9586,122 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * &arr_memviewf[0,0,0], */ } - __pyx_L45:; + __pyx_L50:; - /* "cc3d.pyx":441 + /* "cc3d.pyx":458 * &out_labels64[0], N * ) * elif dtype == np.float32: # <<<<<<<<<<<<<< * arr_memviewf = data * if out_dtype == np.uint16: */ - goto __pyx_L28; + goto __pyx_L33; } - /* "cc3d.pyx":461 + /* "cc3d.pyx":478 * &out_labels64[0], N * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< * arr_memviewd = data * if out_dtype == np.uint16: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 461, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 478, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 478, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 461, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 461, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 478, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 478, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(__pyx_t_3)) { - /* "cc3d.pyx":462 + /* "cc3d.pyx":479 * ) * elif dtype == np.float64: * arr_memviewd = data # <<<<<<<<<<<<<< * if out_dtype == np.uint16: * connected_components3d[double, uint16_t]( */ - __pyx_t_37 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_37.memview)) __PYX_ERR(0, 462, __pyx_L25_error) - __pyx_v_arr_memviewd = __pyx_t_37; - __pyx_t_37.memview = NULL; - __pyx_t_37.data = NULL; + __pyx_t_38 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_38.memview)) __PYX_ERR(0, 479, __pyx_L30_error) + __pyx_v_arr_memviewd = __pyx_t_38; + __pyx_t_38.memview = NULL; + __pyx_t_38.data = NULL; - /* "cc3d.pyx":463 + /* "cc3d.pyx":480 * elif dtype == np.float64: * arr_memviewd = data * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[double, uint16_t]( * &arr_memviewd[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 480, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 480, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 463, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 480, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 480, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":465 + /* "cc3d.pyx":482 * if out_dtype == np.uint16: * connected_components3d[double, uint16_t]( * &arr_memviewd[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; + __pyx_t_27 = 0; __pyx_t_26 = 0; - __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_arr_memviewd.shape[0]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_v_arr_memviewd.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_v_arr_memviewd.shape[0]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_v_arr_memviewd.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memviewd.shape[1]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memviewd.shape[1])) __pyx_t_10 = 1; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memviewd.shape[1]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewd.shape[1])) __pyx_t_10 = 1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memviewd.shape[2]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memviewd.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memviewd.shape[2]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewd.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 465, __pyx_L25_error) + __PYX_ERR(0, 482, __pyx_L30_error) } - /* "cc3d.pyx":466 + /* "cc3d.pyx":483 * connected_components3d[double, uint16_t]( * &arr_memviewd[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels16[0], N * ) */ - __pyx_t_38 = __pyx_PyFloat_AsDouble(__pyx_v_delta); if (unlikely((__pyx_t_38 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L25_error) + __pyx_t_39 = __pyx_PyFloat_AsDouble(__pyx_v_delta); if (unlikely((__pyx_t_39 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L30_error) - /* "cc3d.pyx":467 + /* "cc3d.pyx":484 * &arr_memviewd[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels16[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint32: */ - __pyx_t_24 = 0; + __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_out_labels16.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_out_labels16.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 467, __pyx_L25_error) + __PYX_ERR(0, 484, __pyx_L30_error) } - /* "cc3d.pyx":464 + /* "cc3d.pyx":481 * arr_memviewd = data * if out_dtype == np.uint16: * connected_components3d[double, uint16_t]( # <<<<<<<<<<<<<< @@ -9384,96 +9709,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewd.data + __pyx_t_28 * __pyx_v_arr_memviewd.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memviewd.strides[1]) ) + __pyx_t_25 * __pyx_v_arr_memviewd.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_38, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewd.data + __pyx_t_29 * __pyx_v_arr_memviewd.strides[0]) ) + __pyx_t_27 * __pyx_v_arr_memviewd.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memviewd.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_39, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_out_labels16.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out_labels16.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 464, __pyx_L25_error) + __PYX_ERR(0, 481, __pyx_L30_error) } - /* "cc3d.pyx":463 + /* "cc3d.pyx":480 * elif dtype == np.float64: * arr_memviewd = data * if out_dtype == np.uint16: # <<<<<<<<<<<<<< * connected_components3d[double, uint16_t]( * &arr_memviewd[0,0,0], */ - goto __pyx_L46; + goto __pyx_L51; } - /* "cc3d.pyx":469 + /* "cc3d.pyx":486 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[double, uint32_t]( * &arr_memviewd[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 469, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 469, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 469, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 486, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":471 + /* "cc3d.pyx":488 * elif out_dtype == np.uint32: * connected_components3d[double, uint32_t]( * &arr_memviewd[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N */ - __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; + __pyx_t_27 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_v_arr_memviewd.shape[0]; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_v_arr_memviewd.shape[0])) __pyx_t_10 = 0; if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memviewd.shape[1]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memviewd.shape[1])) __pyx_t_10 = 1; + __pyx_t_25 += __pyx_v_arr_memviewd.shape[0]; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memviewd.shape[0])) __pyx_t_10 = 0; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memviewd.shape[2]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewd.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memviewd.shape[1]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewd.shape[1])) __pyx_t_10 = 1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memviewd.shape[2]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memviewd.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 471, __pyx_L25_error) + __PYX_ERR(0, 488, __pyx_L30_error) } - /* "cc3d.pyx":472 + /* "cc3d.pyx":489 * connected_components3d[double, uint32_t]( * &arr_memviewd[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels32[0], N * ) */ - __pyx_t_38 = __pyx_PyFloat_AsDouble(__pyx_v_delta); if (unlikely((__pyx_t_38 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L25_error) + __pyx_t_39 = __pyx_PyFloat_AsDouble(__pyx_v_delta); if (unlikely((__pyx_t_39 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 489, __pyx_L30_error) - /* "cc3d.pyx":473 + /* "cc3d.pyx":490 * &arr_memviewd[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels32[0], N # <<<<<<<<<<<<<< * ) * elif out_dtype == np.uint64: */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_out_labels32.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out_labels32.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 473, __pyx_L25_error) + __PYX_ERR(0, 490, __pyx_L30_error) } - /* "cc3d.pyx":470 + /* "cc3d.pyx":487 * ) * elif out_dtype == np.uint32: * connected_components3d[double, uint32_t]( # <<<<<<<<<<<<<< @@ -9481,96 +9806,96 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewd.data + __pyx_t_24 * __pyx_v_arr_memviewd.strides[0]) ) + __pyx_t_25 * __pyx_v_arr_memviewd.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memviewd.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_38, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewd.data + __pyx_t_25 * __pyx_v_arr_memviewd.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memviewd.strides[1]) ) + __pyx_t_27 * __pyx_v_arr_memviewd.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_39, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_out_labels32.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out_labels32.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 470, __pyx_L25_error) + __PYX_ERR(0, 487, __pyx_L30_error) } - /* "cc3d.pyx":469 + /* "cc3d.pyx":486 * &out_labels16[0], N * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * connected_components3d[double, uint32_t]( * &arr_memviewd[0,0,0], */ - goto __pyx_L46; + goto __pyx_L51; } - /* "cc3d.pyx":475 + /* "cc3d.pyx":492 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< * connected_components3d[double, uint64_t]( * &arr_memviewd[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L25_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 492, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 475, __pyx_L25_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L30_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 492, __pyx_L30_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":477 + /* "cc3d.pyx":494 * elif out_dtype == np.uint64: * connected_components3d[double, uint64_t]( * &arr_memviewd[0,0,0], # <<<<<<<<<<<<<< * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N */ - __pyx_t_28 = 0; + __pyx_t_29 = 0; + __pyx_t_27 = 0; __pyx_t_26 = 0; - __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_v_arr_memviewd.shape[0]; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_v_arr_memviewd.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_v_arr_memviewd.shape[0]; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_v_arr_memviewd.shape[0])) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_v_arr_memviewd.shape[1]; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_v_arr_memviewd.shape[1])) __pyx_t_10 = 1; if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_v_arr_memviewd.shape[1]; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewd.shape[1])) __pyx_t_10 = 1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_v_arr_memviewd.shape[2]; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2; - } else if (unlikely(__pyx_t_25 >= __pyx_v_arr_memviewd.shape[2])) __pyx_t_10 = 2; + __pyx_t_26 += __pyx_v_arr_memviewd.shape[2]; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2; + } else if (unlikely(__pyx_t_26 >= __pyx_v_arr_memviewd.shape[2])) __pyx_t_10 = 2; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 477, __pyx_L25_error) + __PYX_ERR(0, 494, __pyx_L30_error) } - /* "cc3d.pyx":478 + /* "cc3d.pyx":495 * connected_components3d[double, uint64_t]( * &arr_memviewd[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, # <<<<<<<<<<<<<< * &out_labels64[0], N * ) */ - __pyx_t_38 = __pyx_PyFloat_AsDouble(__pyx_v_delta); if (unlikely((__pyx_t_38 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L25_error) + __pyx_t_39 = __pyx_PyFloat_AsDouble(__pyx_v_delta); if (unlikely((__pyx_t_39 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L30_error) - /* "cc3d.pyx":479 + /* "cc3d.pyx":496 * &arr_memviewd[0,0,0], * sx, sy, sz, max_labels, connectivity, delta, * &out_labels64[0], N # <<<<<<<<<<<<<< * ) * else: */ - __pyx_t_24 = 0; + __pyx_t_25 = 0; __pyx_t_10 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_out_labels64.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_out_labels64.diminfo[0].shape)) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - __PYX_ERR(0, 479, __pyx_L25_error) + __PYX_ERR(0, 496, __pyx_L30_error) } - /* "cc3d.pyx":476 + /* "cc3d.pyx":493 * ) * elif out_dtype == np.uint64: * connected_components3d[double, uint64_t]( # <<<<<<<<<<<<<< @@ -9578,13 +9903,13 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * sx, sy, sz, max_labels, connectivity, delta, */ try { - cc3d::connected_components3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewd.data + __pyx_t_28 * __pyx_v_arr_memviewd.strides[0]) ) + __pyx_t_26 * __pyx_v_arr_memviewd.strides[1]) ) + __pyx_t_25 * __pyx_v_arr_memviewd.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_38, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); + cc3d::connected_components3d((&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memviewd.data + __pyx_t_29 * __pyx_v_arr_memviewd.strides[0]) ) + __pyx_t_27 * __pyx_v_arr_memviewd.strides[1]) ) + __pyx_t_26 * __pyx_v_arr_memviewd.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_max_labels, __pyx_v_connectivity, __pyx_t_39, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_out_labels64.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out_labels64.diminfo[0].strides)))), __pyx_v_N); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 476, __pyx_L25_error) + __PYX_ERR(0, 493, __pyx_L30_error) } - /* "cc3d.pyx":475 + /* "cc3d.pyx":492 * &out_labels32[0], N * ) * elif out_dtype == np.uint64: # <<<<<<<<<<<<<< @@ -9592,19 +9917,19 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * &arr_memviewd[0,0,0], */ } - __pyx_L46:; + __pyx_L51:; - /* "cc3d.pyx":461 + /* "cc3d.pyx":478 * &out_labels64[0], N * ) * elif dtype == np.float64: # <<<<<<<<<<<<<< * arr_memviewd = data * if out_dtype == np.uint16: */ - goto __pyx_L28; + goto __pyx_L33; } - /* "cc3d.pyx":482 + /* "cc3d.pyx":499 * ) * else: * raise TypeError("Type {} not currently supported.".format(dtype)) # <<<<<<<<<<<<<< @@ -9612,34 +9937,34 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * if data.flags.owndata: */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dtype); + __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 482, __pyx_L25_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 482, __pyx_L25_error) + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 499, __pyx_L30_error) } - __pyx_L28:; + __pyx_L33:; } - /* "cc3d.pyx":484 + /* "cc3d.pyx":501 * raise TypeError("Type {} not currently supported.".format(dtype)) * finally: * if data.flags.owndata: # <<<<<<<<<<<<<< @@ -9648,34 +9973,34 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ /*finally:*/ { /*normal exit:*/{ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_owndata); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_owndata); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 484, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":485 + /* "cc3d.pyx":502 * finally: * if data.flags.owndata: * data.setflags(write=writable) # <<<<<<<<<<<<<< * * out_labels = _final_reshape(out_labels, sx, sy, sz, dims, order) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_setflags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_setflags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __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_write, __pyx_v_writable) < 0) __PYX_ERR(0, 485, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_write, __pyx_v_writable) < 0) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":484 + /* "cc3d.pyx":501 * raise TypeError("Type {} not currently supported.".format(dtype)) * finally: * if data.flags.owndata: # <<<<<<<<<<<<<< @@ -9683,63 +10008,63 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * */ } - goto __pyx_L26; + goto __pyx_L31; } - __pyx_L25_error:; + __pyx_L30_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_41 = 0; __pyx_t_42 = 0; __pyx_t_43 = 0; + __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_42 = 0; __pyx_t_43 = 0; __pyx_t_44 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_38, 1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_41, &__pyx_t_42, &__pyx_t_43); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_42, &__pyx_t_43, &__pyx_t_44); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); - __Pyx_XGOTREF(__pyx_t_19); - __Pyx_XGOTREF(__pyx_t_41); __Pyx_XGOTREF(__pyx_t_42); __Pyx_XGOTREF(__pyx_t_43); - __pyx_t_10 = __pyx_lineno; __pyx_t_39 = __pyx_clineno; __pyx_t_40 = __pyx_filename; + __Pyx_XGOTREF(__pyx_t_44); + __pyx_t_10 = __pyx_lineno; __pyx_t_40 = __pyx_clineno; __pyx_t_41 = __pyx_filename; { - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L49_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_owndata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L49_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_owndata); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 484, __pyx_L49_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, 501, __pyx_L54_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":485 + /* "cc3d.pyx":502 * finally: * if data.flags.owndata: * data.setflags(write=writable) # <<<<<<<<<<<<<< * * out_labels = _final_reshape(out_labels, sx, sy, sz, dims, order) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_setflags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L49_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L49_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_setflags); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(!__pyx_v_writable)) { __Pyx_RaiseUnboundLocalError("writable"); __PYX_ERR(0, 485, __pyx_L49_error) } - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_write, __pyx_v_writable) < 0) __PYX_ERR(0, 485, __pyx_L49_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 485, __pyx_L49_error) + if (unlikely(!__pyx_v_writable)) { __Pyx_RaiseUnboundLocalError("writable"); __PYX_ERR(0, 502, __pyx_L54_error) } + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_write, __pyx_v_writable) < 0) __PYX_ERR(0, 502, __pyx_L54_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":484 + /* "cc3d.pyx":501 * raise TypeError("Type {} not currently supported.".format(dtype)) * finally: * if data.flags.owndata: # <<<<<<<<<<<<<< @@ -9749,121 +10074,121 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ } } if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_41); __Pyx_XGIVEREF(__pyx_t_42); __Pyx_XGIVEREF(__pyx_t_43); - __Pyx_ExceptionReset(__pyx_t_41, __pyx_t_42, __pyx_t_43); + __Pyx_XGIVEREF(__pyx_t_44); + __Pyx_ExceptionReset(__pyx_t_42, __pyx_t_43, __pyx_t_44); } + __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); - __Pyx_XGIVEREF(__pyx_t_19); - __Pyx_ErrRestore(__pyx_t_21, __pyx_t_20, __pyx_t_19); - __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_41 = 0; __pyx_t_42 = 0; __pyx_t_43 = 0; - __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_39; __pyx_filename = __pyx_t_40; + __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20); + __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_42 = 0; __pyx_t_43 = 0; __pyx_t_44 = 0; + __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_40; __pyx_filename = __pyx_t_41; goto __pyx_L1_error; - __pyx_L49_error:; + __pyx_L54_error:; if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_41); __Pyx_XGIVEREF(__pyx_t_42); __Pyx_XGIVEREF(__pyx_t_43); - __Pyx_ExceptionReset(__pyx_t_41, __pyx_t_42, __pyx_t_43); + __Pyx_XGIVEREF(__pyx_t_44); + __Pyx_ExceptionReset(__pyx_t_42, __pyx_t_43, __pyx_t_44); } + __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_41 = 0; __pyx_t_42 = 0; __pyx_t_43 = 0; + __pyx_t_42 = 0; __pyx_t_43 = 0; __pyx_t_44 = 0; goto __pyx_L1_error; } - __pyx_L26:; + __pyx_L31:; } - /* "cc3d.pyx":487 + /* "cc3d.pyx":504 * data.setflags(write=writable) * * out_labels = _final_reshape(out_labels, sx, sy, sz, dims, order) # <<<<<<<<<<<<<< * * if return_N: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_final_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_final_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(!__pyx_v_out_labels)) { __Pyx_RaiseUnboundLocalError("out_labels"); __PYX_ERR(0, 487, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_sy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_sz); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 487, __pyx_L1_error) + if (unlikely(!__pyx_v_out_labels)) { __Pyx_RaiseUnboundLocalError("out_labels"); __PYX_ERR(0, 504, __pyx_L1_error) } + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_sx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_44 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_44); - __pyx_t_45 = NULL; - __pyx_t_39 = 0; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_sy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_45 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_45); + __pyx_t_46 = NULL; + __pyx_t_40 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_45 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_45)) { + __pyx_t_46 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_46)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_45); + __Pyx_INCREF(__pyx_t_46); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_39 = 1; + __pyx_t_40 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[7] = {__pyx_t_45, __pyx_v_out_labels, __pyx_t_1, __pyx_t_11, __pyx_t_7, __pyx_t_44, __pyx_v_order}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_39, 6+__pyx_t_39); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0; + PyObject *__pyx_temp[7] = {__pyx_t_46, __pyx_v_out_labels, __pyx_t_7, __pyx_t_11, __pyx_t_1, __pyx_t_45, __pyx_v_order}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_40, 6+__pyx_t_40); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0; __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { - PyObject *__pyx_temp[7] = {__pyx_t_45, __pyx_v_out_labels, __pyx_t_1, __pyx_t_11, __pyx_t_7, __pyx_t_44, __pyx_v_order}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_39, 6+__pyx_t_39); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0; + PyObject *__pyx_temp[7] = {__pyx_t_46, __pyx_v_out_labels, __pyx_t_7, __pyx_t_11, __pyx_t_1, __pyx_t_45, __pyx_v_order}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_40, 6+__pyx_t_40); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0; __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0; } else #endif { - __pyx_t_46 = PyTuple_New(6+__pyx_t_39); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_46); - if (__pyx_t_45) { - __Pyx_GIVEREF(__pyx_t_45); PyTuple_SET_ITEM(__pyx_t_46, 0, __pyx_t_45); __pyx_t_45 = NULL; + __pyx_t_47 = PyTuple_New(6+__pyx_t_40); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_47); + if (__pyx_t_46) { + __Pyx_GIVEREF(__pyx_t_46); PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_46); __pyx_t_46 = NULL; } __Pyx_INCREF(__pyx_v_out_labels); __Pyx_GIVEREF(__pyx_v_out_labels); - PyTuple_SET_ITEM(__pyx_t_46, 0+__pyx_t_39, __pyx_v_out_labels); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_46, 1+__pyx_t_39, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_46, 2+__pyx_t_39, __pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_47, 0+__pyx_t_40, __pyx_v_out_labels); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_46, 3+__pyx_t_39, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_44); - PyTuple_SET_ITEM(__pyx_t_46, 4+__pyx_t_39, __pyx_t_44); + PyTuple_SET_ITEM(__pyx_t_47, 1+__pyx_t_40, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_47, 2+__pyx_t_40, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_47, 3+__pyx_t_40, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_45); + PyTuple_SET_ITEM(__pyx_t_47, 4+__pyx_t_40, __pyx_t_45); __Pyx_INCREF(__pyx_v_order); __Pyx_GIVEREF(__pyx_v_order); - PyTuple_SET_ITEM(__pyx_t_46, 5+__pyx_t_39, __pyx_v_order); - __pyx_t_1 = 0; - __pyx_t_11 = 0; + PyTuple_SET_ITEM(__pyx_t_47, 5+__pyx_t_40, __pyx_v_order); __pyx_t_7 = 0; - __pyx_t_44 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_46, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_11 = 0; + __pyx_t_1 = 0; + __pyx_t_45 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_47, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0; + __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_out_labels, __pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":489 + /* "cc3d.pyx":506 * out_labels = _final_reshape(out_labels, sx, sy, sz, dims, order) * * if return_N: # <<<<<<<<<<<<<< @@ -9873,7 +10198,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_return_N != 0); if (__pyx_t_3) { - /* "cc3d.pyx":490 + /* "cc3d.pyx":507 * * if return_N: * return (out_labels, N) # <<<<<<<<<<<<<< @@ -9881,9 +10206,9 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_out_labels); __Pyx_GIVEREF(__pyx_v_out_labels); @@ -9895,7 +10220,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __pyx_t_5 = 0; goto __pyx_L0; - /* "cc3d.pyx":489 + /* "cc3d.pyx":506 * out_labels = _final_reshape(out_labels, sx, sy, sz, dims, order) * * if return_N: # <<<<<<<<<<<<<< @@ -9904,7 +10229,7 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ */ } - /* "cc3d.pyx":491 + /* "cc3d.pyx":508 * if return_N: * return (out_labels, N) * return out_labels # <<<<<<<<<<<<<< @@ -9931,15 +10256,15 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); - __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); - __Pyx_XDECREF(__pyx_t_44); + __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_38, 1); __Pyx_XDECREF(__pyx_t_45); __Pyx_XDECREF(__pyx_t_46); + __Pyx_XDECREF(__pyx_t_47); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -9970,17 +10295,17 @@ static PyObject *__pyx_pf_4cc3d_4connected_components(CYTHON_UNUSED PyObject *__ __Pyx_XDECREF(__pyx_v_epl); __Pyx_XDECREF(__pyx_v_first_foreground_row); __Pyx_XDECREF(__pyx_v_last_foreground_row); - __Pyx_XDECREF(__pyx_v_out_dtype); __Pyx_XDECREF(__pyx_v_out_labels); __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XDECREF(__pyx_v_writable); __Pyx_XDECREF(__pyx_v_data); + __Pyx_XDECREF(__pyx_v_out_dtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cc3d.pyx":493 +/* "cc3d.pyx":510 * return out_labels * * def _final_reshape(out_labels, sx, sy, sz, dims, order): # <<<<<<<<<<<<<< @@ -10035,35 +10360,35 @@ static PyObject *__pyx_pw_4cc3d_7_final_reshape(PyObject *__pyx_self, PyObject * case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sx)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 1); __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 1); __PYX_ERR(0, 510, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 2); __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 2); __PYX_ERR(0, 510, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sz)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 3); __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 3); __PYX_ERR(0, 510, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dims)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 4); __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 4); __PYX_ERR(0, 510, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 5); __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, 5); __PYX_ERR(0, 510, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_final_reshape") < 0)) __PYX_ERR(0, 493, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_final_reshape") < 0)) __PYX_ERR(0, 510, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -10084,7 +10409,7 @@ static PyObject *__pyx_pw_4cc3d_7_final_reshape(PyObject *__pyx_self, PyObject * } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_final_reshape", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 510, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d._final_reshape", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -10111,39 +10436,39 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se __Pyx_RefNannySetupContext("_final_reshape", 0); __Pyx_INCREF(__pyx_v_out_labels); - /* "cc3d.pyx":494 + /* "cc3d.pyx":511 * * def _final_reshape(out_labels, sx, sy, sz, dims, order): * if dims == 3: # <<<<<<<<<<<<<< * if order == 'C': * out_labels = out_labels.reshape( (sz, sy, sx), order=order) */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "cc3d.pyx":495 + /* "cc3d.pyx":512 * def _final_reshape(out_labels, sx, sy, sz, dims, order): * if dims == 3: * if order == 'C': # <<<<<<<<<<<<<< * out_labels = out_labels.reshape( (sz, sy, sx), order=order) * else: */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_order, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_order, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 512, __pyx_L1_error) if (__pyx_t_2) { - /* "cc3d.pyx":496 + /* "cc3d.pyx":513 * if dims == 3: * if order == 'C': * out_labels = out_labels.reshape( (sz, sy, sx), order=order) # <<<<<<<<<<<<<< * else: * out_labels = out_labels.reshape( (sx, sy, sz), order=order) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_sz); __Pyx_GIVEREF(__pyx_v_sz); @@ -10154,15 +10479,15 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se __Pyx_INCREF(__pyx_v_sx); __Pyx_GIVEREF(__pyx_v_sx); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_sx); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 496, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __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; @@ -10170,7 +10495,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se __Pyx_DECREF_SET(__pyx_v_out_labels, __pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":495 + /* "cc3d.pyx":512 * def _final_reshape(out_labels, sx, sy, sz, dims, order): * if dims == 3: * if order == 'C': # <<<<<<<<<<<<<< @@ -10180,7 +10505,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se goto __pyx_L4; } - /* "cc3d.pyx":498 + /* "cc3d.pyx":515 * out_labels = out_labels.reshape( (sz, sy, sx), order=order) * else: * out_labels = out_labels.reshape( (sx, sy, sz), order=order) # <<<<<<<<<<<<<< @@ -10188,9 +10513,9 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se * if order == 'C': */ /*else*/ { - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_sx); __Pyx_GIVEREF(__pyx_v_sx); @@ -10201,15 +10526,15 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se __Pyx_INCREF(__pyx_v_sz); __Pyx_GIVEREF(__pyx_v_sz); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_sz); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 498, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -10219,7 +10544,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se } __pyx_L4:; - /* "cc3d.pyx":494 + /* "cc3d.pyx":511 * * def _final_reshape(out_labels, sx, sy, sz, dims, order): * if dims == 3: # <<<<<<<<<<<<<< @@ -10229,39 +10554,39 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se goto __pyx_L3; } - /* "cc3d.pyx":499 + /* "cc3d.pyx":516 * else: * out_labels = out_labels.reshape( (sx, sy, sz), order=order) * elif dims == 2: # <<<<<<<<<<<<<< * if order == 'C': * out_labels = out_labels.reshape( (sy, sx), order=order) */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_dims, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __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, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "cc3d.pyx":500 + /* "cc3d.pyx":517 * out_labels = out_labels.reshape( (sx, sy, sz), order=order) * elif dims == 2: * if order == 'C': # <<<<<<<<<<<<<< * out_labels = out_labels.reshape( (sy, sx), order=order) * else: */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_order, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_order, __pyx_n_u_C, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 517, __pyx_L1_error) if (__pyx_t_2) { - /* "cc3d.pyx":501 + /* "cc3d.pyx":518 * elif dims == 2: * if order == 'C': * out_labels = out_labels.reshape( (sy, sx), order=order) # <<<<<<<<<<<<<< * else: * out_labels = out_labels.reshape( (sx, sy), order=order) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_sy); __Pyx_GIVEREF(__pyx_v_sy); @@ -10269,15 +10594,15 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se __Pyx_INCREF(__pyx_v_sx); __Pyx_GIVEREF(__pyx_v_sx); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_sx); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 501, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __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; @@ -10285,7 +10610,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se __Pyx_DECREF_SET(__pyx_v_out_labels, __pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":500 + /* "cc3d.pyx":517 * out_labels = out_labels.reshape( (sx, sy, sz), order=order) * elif dims == 2: * if order == 'C': # <<<<<<<<<<<<<< @@ -10295,7 +10620,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se goto __pyx_L5; } - /* "cc3d.pyx":503 + /* "cc3d.pyx":520 * out_labels = out_labels.reshape( (sy, sx), order=order) * else: * out_labels = out_labels.reshape( (sx, sy), order=order) # <<<<<<<<<<<<<< @@ -10303,9 +10628,9 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se * out_labels = out_labels.reshape( (sx), order=order) */ /*else*/ { - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_sx); __Pyx_GIVEREF(__pyx_v_sx); @@ -10313,15 +10638,15 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se __Pyx_INCREF(__pyx_v_sy); __Pyx_GIVEREF(__pyx_v_sy); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_sy); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 503, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -10331,7 +10656,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se } __pyx_L5:; - /* "cc3d.pyx":499 + /* "cc3d.pyx":516 * else: * out_labels = out_labels.reshape( (sx, sy, sz), order=order) * elif dims == 2: # <<<<<<<<<<<<<< @@ -10341,7 +10666,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se goto __pyx_L3; } - /* "cc3d.pyx":505 + /* "cc3d.pyx":522 * out_labels = out_labels.reshape( (sx, sy), order=order) * else: * out_labels = out_labels.reshape( (sx), order=order) # <<<<<<<<<<<<<< @@ -10349,17 +10674,17 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se * return out_labels */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_sx); __Pyx_GIVEREF(__pyx_v_sx); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sx); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 505, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10369,7 +10694,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se } __pyx_L3:; - /* "cc3d.pyx":507 + /* "cc3d.pyx":524 * out_labels = out_labels.reshape( (sx), order=order) * * return out_labels # <<<<<<<<<<<<<< @@ -10381,7 +10706,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se __pyx_r = __pyx_v_out_labels; goto __pyx_L0; - /* "cc3d.pyx":493 + /* "cc3d.pyx":510 * return out_labels * * def _final_reshape(out_labels, sx, sy, sz, dims, order): # <<<<<<<<<<<<<< @@ -10404,7 +10729,7 @@ static PyObject *__pyx_pf_4cc3d_6_final_reshape(CYTHON_UNUSED PyObject *__pyx_se return __pyx_r; } -/* "cc3d.pyx":509 +/* "cc3d.pyx":526 * return out_labels * * cdef size_t epl_special_row( # <<<<<<<<<<<<<< @@ -10441,7 +10766,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ } } - /* "cc3d.pyx":513 + /* "cc3d.pyx":530 * data, out_labels, size_t N = 0 * ): * cdef size_t start = foreground_row * sx # <<<<<<<<<<<<<< @@ -10450,7 +10775,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ __pyx_v_start = (__pyx_v_foreground_row * __pyx_v_sx); - /* "cc3d.pyx":514 + /* "cc3d.pyx":531 * ): * cdef size_t start = foreground_row * sx * cdef size_t rz = foreground_row // sy # <<<<<<<<<<<<<< @@ -10459,11 +10784,11 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ if (unlikely(__pyx_v_sy == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 514, __pyx_L1_error) + __PYX_ERR(0, 531, __pyx_L1_error) } __pyx_v_rz = (__pyx_v_foreground_row / __pyx_v_sy); - /* "cc3d.pyx":515 + /* "cc3d.pyx":532 * cdef size_t start = foreground_row * sx * cdef size_t rz = foreground_row // sy * cdef size_t ry = foreground_row - rz * sy # <<<<<<<<<<<<<< @@ -10472,7 +10797,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ __pyx_v_ry = (__pyx_v_foreground_row - (__pyx_v_rz * __pyx_v_sy)); - /* "cc3d.pyx":517 + /* "cc3d.pyx":534 * cdef size_t ry = foreground_row - rz * sy * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -10481,7 +10806,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ __pyx_v_i = 0; - /* "cc3d.pyx":518 + /* "cc3d.pyx":535 * * cdef size_t i = 0 * cdef int64_t last_label = 0 # <<<<<<<<<<<<<< @@ -10490,23 +10815,23 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ __pyx_v_last_label = 0; - /* "cc3d.pyx":519 + /* "cc3d.pyx":536 * cdef size_t i = 0 * cdef int64_t last_label = 0 * if data.flags.c_contiguous: # <<<<<<<<<<<<<< * for i in range(sx): * if data[rz,ry,i] == 0: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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, 519, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":520 + /* "cc3d.pyx":537 * cdef int64_t last_label = 0 * if data.flags.c_contiguous: * for i in range(sx): # <<<<<<<<<<<<<< @@ -10518,20 +10843,20 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "cc3d.pyx":521 + /* "cc3d.pyx":538 * if data.flags.c_contiguous: * for i in range(sx): * if data[rz,ry,i] == 0: # <<<<<<<<<<<<<< * last_label = 0 * continue */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); @@ -10542,17 +10867,17 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":522 + /* "cc3d.pyx":539 * for i in range(sx): * if data[rz,ry,i] == 0: * last_label = 0 # <<<<<<<<<<<<<< @@ -10561,7 +10886,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ __pyx_v_last_label = 0; - /* "cc3d.pyx":523 + /* "cc3d.pyx":540 * if data[rz,ry,i] == 0: * last_label = 0 * continue # <<<<<<<<<<<<<< @@ -10570,7 +10895,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ goto __pyx_L4_continue; - /* "cc3d.pyx":521 + /* "cc3d.pyx":538 * if data.flags.c_contiguous: * for i in range(sx): * if data[rz,ry,i] == 0: # <<<<<<<<<<<<<< @@ -10579,20 +10904,20 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ } - /* "cc3d.pyx":524 + /* "cc3d.pyx":541 * last_label = 0 * continue * elif data[rz,ry,i] == last_label: # <<<<<<<<<<<<<< * out_labels[start + i] = N * continue */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -10603,32 +10928,32 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_last_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_last_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 524, __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) { - /* "cc3d.pyx":525 + /* "cc3d.pyx":542 * continue * elif data[rz,ry,i] == last_label: * out_labels[start + i] = N # <<<<<<<<<<<<<< * continue * else: */ - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = (__pyx_v_start + __pyx_v_i); - if (unlikely(__Pyx_SetItemInt(__pyx_v_out_labels, __pyx_t_9, __pyx_t_7, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1) < 0)) __PYX_ERR(0, 525, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_out_labels, __pyx_t_9, __pyx_t_7, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1) < 0)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "cc3d.pyx":526 + /* "cc3d.pyx":543 * elif data[rz,ry,i] == last_label: * out_labels[start + i] = N * continue # <<<<<<<<<<<<<< @@ -10637,7 +10962,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ goto __pyx_L4_continue; - /* "cc3d.pyx":524 + /* "cc3d.pyx":541 * last_label = 0 * continue * elif data[rz,ry,i] == last_label: # <<<<<<<<<<<<<< @@ -10646,7 +10971,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ } - /* "cc3d.pyx":528 + /* "cc3d.pyx":545 * continue * else: * N += 1 # <<<<<<<<<<<<<< @@ -10656,33 +10981,33 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ /*else*/ { __pyx_v_N = (__pyx_v_N + 1); - /* "cc3d.pyx":529 + /* "cc3d.pyx":546 * else: * N += 1 * out_labels[start + i] = N # <<<<<<<<<<<<<< * last_label = data[rz,ry,i] * else: */ - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = (__pyx_v_start + __pyx_v_i); - if (unlikely(__Pyx_SetItemInt(__pyx_v_out_labels, __pyx_t_9, __pyx_t_7, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1) < 0)) __PYX_ERR(0, 529, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_out_labels, __pyx_t_9, __pyx_t_7, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1) < 0)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "cc3d.pyx":530 + /* "cc3d.pyx":547 * N += 1 * out_labels[start + i] = N * last_label = data[rz,ry,i] # <<<<<<<<<<<<<< * else: * for i in range(sx): */ - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); @@ -10693,17 +11018,17 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ __pyx_t_7 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_last_label = __pyx_t_10; } __pyx_L4_continue:; } - /* "cc3d.pyx":519 + /* "cc3d.pyx":536 * cdef size_t i = 0 * cdef int64_t last_label = 0 * if data.flags.c_contiguous: # <<<<<<<<<<<<<< @@ -10713,7 +11038,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ goto __pyx_L3; } - /* "cc3d.pyx":532 + /* "cc3d.pyx":549 * last_label = data[rz,ry,i] * else: * for i in range(sx): # <<<<<<<<<<<<<< @@ -10726,20 +11051,20 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "cc3d.pyx":533 + /* "cc3d.pyx":550 * else: * for i in range(sx): * if data[i,ry,rz] == 0: # <<<<<<<<<<<<<< * last_label = 0 * continue */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -10750,17 +11075,17 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ __pyx_t_1 = 0; __pyx_t_8 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":534 + /* "cc3d.pyx":551 * for i in range(sx): * if data[i,ry,rz] == 0: * last_label = 0 # <<<<<<<<<<<<<< @@ -10769,7 +11094,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ __pyx_v_last_label = 0; - /* "cc3d.pyx":535 + /* "cc3d.pyx":552 * if data[i,ry,rz] == 0: * last_label = 0 * continue # <<<<<<<<<<<<<< @@ -10778,7 +11103,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ goto __pyx_L7_continue; - /* "cc3d.pyx":533 + /* "cc3d.pyx":550 * else: * for i in range(sx): * if data[i,ry,rz] == 0: # <<<<<<<<<<<<<< @@ -10787,20 +11112,20 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ } - /* "cc3d.pyx":536 + /* "cc3d.pyx":553 * last_label = 0 * continue * elif data[i,ry,rz] == last_label: # <<<<<<<<<<<<<< * out_labels[start + i] = N * continue */ - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); @@ -10811,32 +11136,32 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ __pyx_t_7 = 0; __pyx_t_2 = 0; __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_last_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_last_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __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, 536, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":537 + /* "cc3d.pyx":554 * continue * elif data[i,ry,rz] == last_label: * out_labels[start + i] = N # <<<<<<<<<<<<<< * continue * else: */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = (__pyx_v_start + __pyx_v_i); - if (unlikely(__Pyx_SetItemInt(__pyx_v_out_labels, __pyx_t_9, __pyx_t_2, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1) < 0)) __PYX_ERR(0, 537, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_out_labels, __pyx_t_9, __pyx_t_2, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1) < 0)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cc3d.pyx":538 + /* "cc3d.pyx":555 * elif data[i,ry,rz] == last_label: * out_labels[start + i] = N * continue # <<<<<<<<<<<<<< @@ -10845,7 +11170,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ goto __pyx_L7_continue; - /* "cc3d.pyx":536 + /* "cc3d.pyx":553 * last_label = 0 * continue * elif data[i,ry,rz] == last_label: # <<<<<<<<<<<<<< @@ -10854,7 +11179,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ */ } - /* "cc3d.pyx":540 + /* "cc3d.pyx":557 * continue * else: * N += 1 # <<<<<<<<<<<<<< @@ -10864,33 +11189,33 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ /*else*/ { __pyx_v_N = (__pyx_v_N + 1); - /* "cc3d.pyx":541 + /* "cc3d.pyx":558 * else: * N += 1 * out_labels[start + i] = N # <<<<<<<<<<<<<< * last_label = data[i,ry,rz] * */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = (__pyx_v_start + __pyx_v_i); - if (unlikely(__Pyx_SetItemInt(__pyx_v_out_labels, __pyx_t_9, __pyx_t_2, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1) < 0)) __PYX_ERR(0, 541, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_out_labels, __pyx_t_9, __pyx_t_2, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1) < 0)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cc3d.pyx":542 + /* "cc3d.pyx":559 * N += 1 * out_labels[start + i] = N * last_label = data[i,ry,rz] # <<<<<<<<<<<<<< * * return N */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_rz); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); @@ -10901,10 +11226,10 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_last_label = __pyx_t_10; } @@ -10913,7 +11238,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ } __pyx_L3:; - /* "cc3d.pyx":544 + /* "cc3d.pyx":561 * last_label = data[i,ry,rz] * * return N # <<<<<<<<<<<<<< @@ -10923,7 +11248,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ __pyx_r = __pyx_v_N; goto __pyx_L0; - /* "cc3d.pyx":509 + /* "cc3d.pyx":526 * return out_labels * * cdef size_t epl_special_row( # <<<<<<<<<<<<<< @@ -10944,7 +11269,7 @@ static size_t __pyx_f_4cc3d_epl_special_row(size_t __pyx_v_foreground_row, size_ return __pyx_r; } -/* "cc3d.pyx":547 +/* "cc3d.pyx":564 * * * def statistics(out_labels): # <<<<<<<<<<<<<< @@ -10981,7 +11306,7 @@ static PyObject *__pyx_pf_4cc3d_8statistics(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_RefNannySetupContext("statistics", 0); __Pyx_INCREF(__pyx_v_out_labels); - /* "cc3d.pyx":568 + /* "cc3d.pyx":585 * } * """ * while out_labels.ndim < 3: # <<<<<<<<<<<<<< @@ -10989,27 +11314,27 @@ static PyObject *__pyx_pf_4cc3d_8statistics(CYTHON_UNUSED PyObject *__pyx_self, * */ while (1) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __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, 568, __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, 585, __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, 568, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) break; - /* "cc3d.pyx":569 + /* "cc3d.pyx":586 * """ * while out_labels.ndim < 3: * out_labels = out_labels[..., np.newaxis] # <<<<<<<<<<<<<< * * if out_labels.dtype == bool: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __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, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __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, 569, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_Ellipsis); __Pyx_GIVEREF(Py_Ellipsis); @@ -11017,40 +11342,40 @@ static PyObject *__pyx_pf_4cc3d_8statistics(CYTHON_UNUSED PyObject *__pyx_self, __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_out_labels, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_out_labels, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_out_labels, __pyx_t_1); __pyx_t_1 = 0; } - /* "cc3d.pyx":571 + /* "cc3d.pyx":588 * out_labels = out_labels[..., np.newaxis] * * if out_labels.dtype == bool: # <<<<<<<<<<<<<< * out_labels = out_labels.view(np.uint8) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __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, 571, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":572 + /* "cc3d.pyx":589 * * if out_labels.dtype == bool: * out_labels = out_labels.view(np.uint8) # <<<<<<<<<<<<<< * * return _statistics(out_labels) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_labels, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __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, 572, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -11066,13 +11391,13 @@ static PyObject *__pyx_pf_4cc3d_8statistics(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_out_labels, __pyx_t_2); __pyx_t_2 = 0; - /* "cc3d.pyx":571 + /* "cc3d.pyx":588 * out_labels = out_labels[..., np.newaxis] * * if out_labels.dtype == bool: # <<<<<<<<<<<<<< @@ -11081,7 +11406,7 @@ static PyObject *__pyx_pf_4cc3d_8statistics(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "cc3d.pyx":574 + /* "cc3d.pyx":591 * out_labels = out_labels.view(np.uint8) * * return _statistics(out_labels) # <<<<<<<<<<<<<< @@ -11089,7 +11414,7 @@ static PyObject *__pyx_pf_4cc3d_8statistics(CYTHON_UNUSED PyObject *__pyx_self, * @cython.cdivision(True) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_statistics); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_statistics); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -11103,14 +11428,14 @@ static PyObject *__pyx_pf_4cc3d_8statistics(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_out_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_out_labels); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "cc3d.pyx":547 + /* "cc3d.pyx":564 * * * def statistics(out_labels): # <<<<<<<<<<<<<< @@ -11133,7 +11458,7 @@ static PyObject *__pyx_pf_4cc3d_8statistics(CYTHON_UNUSED PyObject *__pyx_self, return __pyx_r; } -/* "cc3d.pyx":580 +/* "cc3d.pyx":597 * @cython.wraparound(False) * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): # <<<<<<<<<<<<<< @@ -11182,23 +11507,23 @@ static PyObject *__pyx_pw_4cc3d_11_statistics(PyObject *__pyx_self, PyObject *__ 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, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 597, __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, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 597, __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, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 597, __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, 580, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 597, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -11215,7 +11540,7 @@ static PyObject *__pyx_pw_4cc3d_11_statistics(PyObject *__pyx_self, PyObject *__ } 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, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 597, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11273,7 +11598,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_statistics", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -11287,7 +11612,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 597, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -11295,7 +11620,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -11306,14 +11631,14 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __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, 580, __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, 597, __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, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -11330,18 +11655,18 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_out_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_out_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_out_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_out_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -11350,31 +11675,31 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __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, 597, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_1); - __Pyx_INCREF(__pyx_kp_s__3); - __Pyx_GIVEREF(__pyx_kp_s__3); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s__3); + __Pyx_INCREF(__pyx_kp_s__4); + __Pyx_GIVEREF(__pyx_kp_s__4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s__4); __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, 580, __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, 597, __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -11384,7 +11709,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -11393,14 +11718,14 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __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, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -11422,14 +11747,14 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __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, 597, __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __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, 597, __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'); @@ -11442,9 +11767,9 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __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, 597, __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) { @@ -11456,7 +11781,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 0) < 0)) __PYX_ERR(0, 580, __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, 0) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -11465,9 +11790,9 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __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, 597, __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) { @@ -11479,7 +11804,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 0) < 0)) __PYX_ERR(0, 580, __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, 0) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -11488,9 +11813,9 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __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, 597, __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) { @@ -11502,7 +11827,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 0) < 0)) __PYX_ERR(0, 580, __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, 0) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -11511,9 +11836,9 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __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, 597, __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) { @@ -11525,7 +11850,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 0) < 0)) __PYX_ERR(0, 580, __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, 0) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -11554,7 +11879,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 0) < 0)) __PYX_ERR(0, 580, __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, 0) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -11576,7 +11901,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 0) < 0)) __PYX_ERR(0, 580, __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, 0) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -11598,7 +11923,7 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 0) < 0)) __PYX_ERR(0, 580, __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, 0) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -11620,27 +11945,27 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 0) < 0)) __PYX_ERR(0, 580, __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, 0) < 0)) __PYX_ERR(0, 597, __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, 0) < 0)) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 597, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __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, 580, __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, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -11648,12 +11973,12 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self 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, 580, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -11665,12 +11990,12 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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__5) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__5); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -11683,14 +12008,14 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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__6) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __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, 580, __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, 597, __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; @@ -11701,11 +12026,11 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __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, 580, __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, 597, __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, 580, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -11721,35 +12046,35 @@ static PyObject *__pyx_pf_4cc3d_10_statistics(CYTHON_UNUSED PyObject *__pyx_self __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, 580, __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, 597, __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + __PYX_ERR(0, 597, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -11791,7 +12116,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_4cc3d_33_statistics(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_statistics (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_labels), __pyx_ptype_5numpy_ndarray, 1, "out_labels", 0))) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_labels), __pyx_ptype_5numpy_ndarray, 1, "out_labels", 0))) __PYX_ERR(0, 597, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_32_statistics(__pyx_self, ((PyArrayObject *)__pyx_v_out_labels)); /* function exit code */ @@ -11885,24 +12210,24 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_out_labels.rcbuffer = &__pyx_pybuffer_out_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 597, __pyx_L1_error) } __pyx_pybuffernd_out_labels.diminfo[0].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels.diminfo[0].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out_labels.diminfo[1].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out_labels.diminfo[1].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_out_labels.diminfo[2].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_out_labels.diminfo[2].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":581 + /* "cc3d.pyx":598 * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): * cdef uint64_t voxels = out_labels.size; # <<<<<<<<<<<<<< * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "cc3d.pyx":582 + /* "cc3d.pyx":599 * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] # <<<<<<<<<<<<<< @@ -11911,7 +12236,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_out_labels->dimensions[0]); - /* "cc3d.pyx":583 + /* "cc3d.pyx":600 * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] # <<<<<<<<<<<<<< @@ -11920,7 +12245,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_out_labels->dimensions[1]); - /* "cc3d.pyx":584 + /* "cc3d.pyx":601 * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] * cdef uint64_t sz = out_labels.shape[2] # <<<<<<<<<<<<<< @@ -11929,7 +12254,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_out_labels->dimensions[2]); - /* "cc3d.pyx":586 + /* "cc3d.pyx":603 * cdef uint64_t sz = out_labels.shape[2] * * if voxels == 0: # <<<<<<<<<<<<<< @@ -11939,7 +12264,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = ((__pyx_v_voxels == 0) != 0); if (__pyx_t_3) { - /* "cc3d.pyx":587 + /* "cc3d.pyx":604 * * if voxels == 0: * return { # <<<<<<<<<<<<<< @@ -11948,39 +12273,39 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __Pyx_XDECREF(__pyx_r); - /* "cc3d.pyx":588 + /* "cc3d.pyx":605 * if voxels == 0: * return { * "voxel_counts": None, # <<<<<<<<<<<<<< * "bounding_boxes": None, * "centroids": None, */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_voxel_counts, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_voxel_counts, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) - /* "cc3d.pyx":589 + /* "cc3d.pyx":606 * return { * "voxel_counts": None, * "bounding_boxes": None, # <<<<<<<<<<<<<< * "centroids": None, * } */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bounding_boxes, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bounding_boxes, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) - /* "cc3d.pyx":590 + /* "cc3d.pyx":607 * "voxel_counts": None, * "bounding_boxes": None, * "centroids": None, # <<<<<<<<<<<<<< * } * */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_centroids, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_centroids, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":586 + /* "cc3d.pyx":603 * cdef uint64_t sz = out_labels.shape[2] * * if voxels == 0: # <<<<<<<<<<<<<< @@ -11989,16 +12314,16 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "cc3d.pyx":593 + /* "cc3d.pyx":610 * } * * cdef uint64_t N = np.max(out_labels) # <<<<<<<<<<<<<< * * if N > voxels: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -12013,14 +12338,14 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_out_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_out_labels)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_N = __pyx_t_2; - /* "cc3d.pyx":595 + /* "cc3d.pyx":612 * cdef uint64_t N = np.max(out_labels) * * if N > voxels: # <<<<<<<<<<<<<< @@ -12030,37 +12355,37 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = ((__pyx_v_N > __pyx_v_voxels) != 0); if (unlikely(__pyx_t_3)) { - /* "cc3d.pyx":597 + /* "cc3d.pyx":614 * if N > voxels: * raise ValueError( * f"Statistics can only be computed on volumes containing labels with values lower than the number of voxels. Max: {N}" # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Statistics_can_only_be_computed, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Statistics_can_only_be_computed, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":596 + /* "cc3d.pyx":613 * * if N > voxels: * raise ValueError( # <<<<<<<<<<<<<< * f"Statistics can only be computed on volumes containing labels with values lower than the number of voxels. Max: {N}" * ) */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __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, 596, __pyx_L1_error) + __PYX_ERR(0, 613, __pyx_L1_error) - /* "cc3d.pyx":595 + /* "cc3d.pyx":612 * cdef uint64_t N = np.max(out_labels) * * if N > voxels: # <<<<<<<<<<<<<< @@ -12069,46 +12394,46 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "cc3d.pyx":600 + /* "cc3d.pyx":617 * ) * * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __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, 600, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 600, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 617, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 600, __pyx_L1_error) + __PYX_ERR(0, 617, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -12116,46 +12441,46 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_counts = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "cc3d.pyx":601 + /* "cc3d.pyx":618 * * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) # <<<<<<<<<<<<<< * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) * */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_uint64_t((6 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_uint64_t((6 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 601, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 601, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 618, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_bounding_boxes = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 601, __pyx_L1_error) + __PYX_ERR(0, 618, __pyx_L1_error) } else {__pyx_pybuffernd_bounding_boxes.diminfo[0].strides = __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bounding_boxes.diminfo[0].shape = __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.shape[0]; } } @@ -12163,46 +12488,46 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_bounding_boxes = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":602 + /* "cc3d.pyx":619 * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) # <<<<<<<<<<<<<< * * cdef uint64_t x = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_uint64_t((3 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_uint64_t((3 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 602, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __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_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 602, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 619, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_centroids.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_centroids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 602, __pyx_L1_error) + __PYX_ERR(0, 619, __pyx_L1_error) } else {__pyx_pybuffernd_centroids.diminfo[0].strides = __pyx_pybuffernd_centroids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_centroids.diminfo[0].shape = __pyx_pybuffernd_centroids.rcbuffer->pybuffer.shape[0]; } } @@ -12210,7 +12535,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_centroids = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":604 + /* "cc3d.pyx":621 * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) * * cdef uint64_t x = 0 # <<<<<<<<<<<<<< @@ -12219,7 +12544,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_x = 0; - /* "cc3d.pyx":605 + /* "cc3d.pyx":622 * * cdef uint64_t x = 0 * cdef uint64_t y = 0 # <<<<<<<<<<<<<< @@ -12228,7 +12553,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_y = 0; - /* "cc3d.pyx":606 + /* "cc3d.pyx":623 * cdef uint64_t x = 0 * cdef uint64_t y = 0 * cdef uint64_t z = 0 # <<<<<<<<<<<<<< @@ -12237,7 +12562,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_z = 0; - /* "cc3d.pyx":608 + /* "cc3d.pyx":625 * cdef uint64_t z = 0 * * cdef uint64_t label = 0 # <<<<<<<<<<<<<< @@ -12246,23 +12571,23 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_label = 0; - /* "cc3d.pyx":610 + /* "cc3d.pyx":627 * cdef uint64_t label = 0 * * for label in range(0, bounding_boxes.size, 2): # <<<<<<<<<<<<<< * bounding_boxes[label] = voxels * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = ((uint64_t)__pyx_t_2); __pyx_t_2 = __pyx_t_11; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=2) { __pyx_v_label = __pyx_t_12; - /* "cc3d.pyx":611 + /* "cc3d.pyx":628 * * for label in range(0, bounding_boxes.size, 2): * bounding_boxes[label] = voxels # <<<<<<<<<<<<<< @@ -12273,7 +12598,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_v_voxels; } - /* "cc3d.pyx":613 + /* "cc3d.pyx":630 * bounding_boxes[label] = voxels * * for z in range(sz): # <<<<<<<<<<<<<< @@ -12285,7 +12610,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_z = __pyx_t_12; - /* "cc3d.pyx":614 + /* "cc3d.pyx":631 * * for z in range(sz): * for y in range(sy): # <<<<<<<<<<<<<< @@ -12297,7 +12622,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_y = __pyx_t_15; - /* "cc3d.pyx":615 + /* "cc3d.pyx":632 * for z in range(sz): * for y in range(sy): * for x in range(sx): # <<<<<<<<<<<<<< @@ -12309,7 +12634,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_v_x = __pyx_t_18; - /* "cc3d.pyx":616 + /* "cc3d.pyx":633 * for y in range(sy): * for x in range(sx): * label = out_labels[x,y,z] # <<<<<<<<<<<<<< @@ -12321,7 +12646,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = __pyx_v_z; __pyx_v_label = ((uint64_t)(*__Pyx_BufPtrStrided3d(uint8_t *, __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out_labels.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_out_labels.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_out_labels.diminfo[2].strides))); - /* "cc3d.pyx":617 + /* "cc3d.pyx":634 * for x in range(sx): * label = out_labels[x,y,z] * counts[label] += 1 # <<<<<<<<<<<<<< @@ -12331,7 +12656,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = __pyx_v_label; *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; - /* "cc3d.pyx":618 + /* "cc3d.pyx":635 * label = out_labels[x,y,z] * counts[label] += 1 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) # <<<<<<<<<<<<<< @@ -12349,7 +12674,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":619 + /* "cc3d.pyx":636 * counts[label] += 1 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) # <<<<<<<<<<<<<< @@ -12367,7 +12692,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":620 + /* "cc3d.pyx":637 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) # <<<<<<<<<<<<<< @@ -12385,7 +12710,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 2); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":621 + /* "cc3d.pyx":638 * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) # <<<<<<<<<<<<<< @@ -12403,7 +12728,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 3); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":622 + /* "cc3d.pyx":639 * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) # <<<<<<<<<<<<<< @@ -12421,7 +12746,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 4); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":623 + /* "cc3d.pyx":640 * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) # <<<<<<<<<<<<<< @@ -12439,7 +12764,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 5); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":624 + /* "cc3d.pyx":641 * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) * centroids[3 * label + 0] += x # <<<<<<<<<<<<<< @@ -12449,7 +12774,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((3 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_centroids.diminfo[0].strides) += ((double)__pyx_v_x); - /* "cc3d.pyx":625 + /* "cc3d.pyx":642 * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) * centroids[3 * label + 0] += x * centroids[3 * label + 1] += y # <<<<<<<<<<<<<< @@ -12459,7 +12784,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((3 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_centroids.diminfo[0].strides) += ((double)__pyx_v_y); - /* "cc3d.pyx":626 + /* "cc3d.pyx":643 * centroids[3 * label + 0] += x * centroids[3 * label + 1] += y * centroids[3 * label + 2] += z # <<<<<<<<<<<<<< @@ -12472,7 +12797,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self } } - /* "cc3d.pyx":628 + /* "cc3d.pyx":645 * centroids[3 * label + 2] += z * * for label in range(N+1): # <<<<<<<<<<<<<< @@ -12484,7 +12809,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_label = __pyx_t_12; - /* "cc3d.pyx":629 + /* "cc3d.pyx":646 * * for label in range(N+1): * centroids[3 * label + 0] /= counts[label] # <<<<<<<<<<<<<< @@ -12495,7 +12820,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_14 = ((3 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); - /* "cc3d.pyx":630 + /* "cc3d.pyx":647 * for label in range(N+1): * centroids[3 * label + 0] /= counts[label] * centroids[3 * label + 1] /= counts[label] # <<<<<<<<<<<<<< @@ -12506,7 +12831,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_14 = ((3 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); - /* "cc3d.pyx":631 + /* "cc3d.pyx":648 * centroids[3 * label + 0] /= counts[label] * centroids[3 * label + 1] /= counts[label] * centroids[3 * label + 2] /= counts[label] # <<<<<<<<<<<<<< @@ -12518,30 +12843,30 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); } - /* "cc3d.pyx":633 + /* "cc3d.pyx":650 * centroids[3 * label + 2] /= counts[label] * * slices = [] # <<<<<<<<<<<<<< * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_slices = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":634 + /* "cc3d.pyx":651 * * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): # <<<<<<<<<<<<<< * if xs < voxels and ys < voxels and zs < voxels: * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); @@ -12562,16 +12887,16 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_22 = 0; __pyx_t_23 = NULL; } else { - __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_23 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_23 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 651, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -12579,17 +12904,17 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -12599,7 +12924,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 634, __pyx_L1_error) + else __PYX_ERR(0, 651, __pyx_L1_error) } break; } @@ -12611,7 +12936,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(size != 6)) { if (size > 6) __Pyx_RaiseTooManyValuesError(6); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 634, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -12640,7 +12965,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self Py_ssize_t i; PyObject** temps[6] = {&__pyx_t_7,&__pyx_t_4,&__pyx_t_5,&__pyx_t_24,&__pyx_t_25,&__pyx_t_26}; for (i=0; i < 6; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 634, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -12650,7 +12975,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self } else { Py_ssize_t index = -1; PyObject** temps[6] = {&__pyx_t_7,&__pyx_t_4,&__pyx_t_5,&__pyx_t_24,&__pyx_t_25,&__pyx_t_26}; - __pyx_t_27 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_27 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_28 = Py_TYPE(__pyx_t_27)->tp_iternext; @@ -12659,7 +12984,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_28(__pyx_t_27), 6) < 0) __PYX_ERR(0, 634, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_28(__pyx_t_27), 6) < 0) __PYX_ERR(0, 651, __pyx_L1_error) __pyx_t_28 = NULL; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; goto __pyx_L18_unpacking_done; @@ -12667,7 +12992,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_t_28 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 634, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_xs, __pyx_t_7); @@ -12683,68 +13008,68 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_XDECREF_SET(__pyx_v_ze, __pyx_t_26); __pyx_t_26 = 0; - /* "cc3d.pyx":635 + /* "cc3d.pyx":652 * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: # <<<<<<<<<<<<<< * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) * else: */ - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = PyObject_RichCompare(__pyx_v_xs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = PyObject_RichCompare(__pyx_v_xs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (__pyx_t_29) { } else { __pyx_t_3 = __pyx_t_29; goto __pyx_L20_bool_binop_done; } - __pyx_t_26 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ys, __pyx_t_26, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ys, __pyx_t_26, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_29) { } else { __pyx_t_3 = __pyx_t_29; goto __pyx_L20_bool_binop_done; } - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = PyObject_RichCompare(__pyx_v_zs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = PyObject_RichCompare(__pyx_v_zs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __pyx_t_3 = __pyx_t_29; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "cc3d.pyx":636 + /* "cc3d.pyx":653 * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) # <<<<<<<<<<<<<< * else: * slices.append(None) */ - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_xe, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_xe, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_1 = PySlice_New(__pyx_v_xs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_v_xs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ye, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ye, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_25 = PySlice_New(__pyx_v_ys, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_25 = PySlice_New(__pyx_v_ys, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ze, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ze, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_24 = PySlice_New(__pyx_v_zs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_24 = PySlice_New(__pyx_v_zs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_1); @@ -12755,10 +13080,10 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_1 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; - __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, __pyx_t_26); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, __pyx_t_26); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - /* "cc3d.pyx":635 + /* "cc3d.pyx":652 * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: # <<<<<<<<<<<<<< @@ -12768,7 +13093,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L19; } - /* "cc3d.pyx":638 + /* "cc3d.pyx":655 * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) * else: * slices.append(None) # <<<<<<<<<<<<<< @@ -12776,11 +13101,11 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self * return { */ /*else*/ { - __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, Py_None); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, Py_None); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 655, __pyx_L1_error) } __pyx_L19:; - /* "cc3d.pyx":634 + /* "cc3d.pyx":651 * * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): # <<<<<<<<<<<<<< @@ -12790,7 +13115,7 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":640 + /* "cc3d.pyx":657 * slices.append(None) * * return { # <<<<<<<<<<<<<< @@ -12799,38 +13124,38 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __Pyx_XDECREF(__pyx_r); - /* "cc3d.pyx":641 + /* "cc3d.pyx":658 * * return { * "voxel_counts": counts, # <<<<<<<<<<<<<< * "bounding_boxes": slices, * "centroids": centroids.reshape((N+1,3)), */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_voxel_counts, ((PyObject *)__pyx_v_counts)) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_voxel_counts, ((PyObject *)__pyx_v_counts)) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "cc3d.pyx":642 + /* "cc3d.pyx":659 * return { * "voxel_counts": counts, * "bounding_boxes": slices, # <<<<<<<<<<<<<< * "centroids": centroids.reshape((N+1,3)), * } */ - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_bounding_boxes, __pyx_v_slices) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_bounding_boxes, __pyx_v_slices) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "cc3d.pyx":643 + /* "cc3d.pyx":660 * "voxel_counts": counts, * "bounding_boxes": slices, * "centroids": centroids.reshape((N+1,3)), # <<<<<<<<<<<<<< * } * */ - __pyx_t_24 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_centroids), __pyx_n_s_reshape); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_centroids), __pyx_n_s_reshape); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); - __pyx_t_25 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_25); @@ -12851,16 +13176,16 @@ static PyObject *__pyx_pf_4cc3d_32_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_26 = (__pyx_t_25) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_25, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_1); __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 643, __pyx_L1_error) + if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_centroids, __pyx_t_26) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_centroids, __pyx_t_26) < 0) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "cc3d.pyx":580 + /* "cc3d.pyx":597 * @cython.wraparound(False) * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): # <<<<<<<<<<<<<< @@ -12922,7 +13247,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_4cc3d_35_statistics(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_statistics (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_labels), __pyx_ptype_5numpy_ndarray, 1, "out_labels", 0))) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_labels), __pyx_ptype_5numpy_ndarray, 1, "out_labels", 0))) __PYX_ERR(0, 597, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_34_statistics(__pyx_self, ((PyArrayObject *)__pyx_v_out_labels)); /* function exit code */ @@ -13016,24 +13341,24 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_out_labels.rcbuffer = &__pyx_pybuffer_out_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 597, __pyx_L1_error) } __pyx_pybuffernd_out_labels.diminfo[0].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels.diminfo[0].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out_labels.diminfo[1].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out_labels.diminfo[1].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_out_labels.diminfo[2].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_out_labels.diminfo[2].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":581 + /* "cc3d.pyx":598 * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): * cdef uint64_t voxels = out_labels.size; # <<<<<<<<<<<<<< * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "cc3d.pyx":582 + /* "cc3d.pyx":599 * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] # <<<<<<<<<<<<<< @@ -13042,7 +13367,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_out_labels->dimensions[0]); - /* "cc3d.pyx":583 + /* "cc3d.pyx":600 * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] # <<<<<<<<<<<<<< @@ -13051,7 +13376,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_out_labels->dimensions[1]); - /* "cc3d.pyx":584 + /* "cc3d.pyx":601 * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] * cdef uint64_t sz = out_labels.shape[2] # <<<<<<<<<<<<<< @@ -13060,7 +13385,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_out_labels->dimensions[2]); - /* "cc3d.pyx":586 + /* "cc3d.pyx":603 * cdef uint64_t sz = out_labels.shape[2] * * if voxels == 0: # <<<<<<<<<<<<<< @@ -13070,7 +13395,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = ((__pyx_v_voxels == 0) != 0); if (__pyx_t_3) { - /* "cc3d.pyx":587 + /* "cc3d.pyx":604 * * if voxels == 0: * return { # <<<<<<<<<<<<<< @@ -13079,39 +13404,39 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __Pyx_XDECREF(__pyx_r); - /* "cc3d.pyx":588 + /* "cc3d.pyx":605 * if voxels == 0: * return { * "voxel_counts": None, # <<<<<<<<<<<<<< * "bounding_boxes": None, * "centroids": None, */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_voxel_counts, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_voxel_counts, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) - /* "cc3d.pyx":589 + /* "cc3d.pyx":606 * return { * "voxel_counts": None, * "bounding_boxes": None, # <<<<<<<<<<<<<< * "centroids": None, * } */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bounding_boxes, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bounding_boxes, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) - /* "cc3d.pyx":590 + /* "cc3d.pyx":607 * "voxel_counts": None, * "bounding_boxes": None, * "centroids": None, # <<<<<<<<<<<<<< * } * */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_centroids, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_centroids, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":586 + /* "cc3d.pyx":603 * cdef uint64_t sz = out_labels.shape[2] * * if voxels == 0: # <<<<<<<<<<<<<< @@ -13120,16 +13445,16 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "cc3d.pyx":593 + /* "cc3d.pyx":610 * } * * cdef uint64_t N = np.max(out_labels) # <<<<<<<<<<<<<< * * if N > voxels: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -13144,14 +13469,14 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_out_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_out_labels)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_N = __pyx_t_2; - /* "cc3d.pyx":595 + /* "cc3d.pyx":612 * cdef uint64_t N = np.max(out_labels) * * if N > voxels: # <<<<<<<<<<<<<< @@ -13161,37 +13486,37 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = ((__pyx_v_N > __pyx_v_voxels) != 0); if (unlikely(__pyx_t_3)) { - /* "cc3d.pyx":597 + /* "cc3d.pyx":614 * if N > voxels: * raise ValueError( * f"Statistics can only be computed on volumes containing labels with values lower than the number of voxels. Max: {N}" # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Statistics_can_only_be_computed, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Statistics_can_only_be_computed, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":596 + /* "cc3d.pyx":613 * * if N > voxels: * raise ValueError( # <<<<<<<<<<<<<< * f"Statistics can only be computed on volumes containing labels with values lower than the number of voxels. Max: {N}" * ) */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __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, 596, __pyx_L1_error) + __PYX_ERR(0, 613, __pyx_L1_error) - /* "cc3d.pyx":595 + /* "cc3d.pyx":612 * cdef uint64_t N = np.max(out_labels) * * if N > voxels: # <<<<<<<<<<<<<< @@ -13200,46 +13525,46 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "cc3d.pyx":600 + /* "cc3d.pyx":617 * ) * * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __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, 600, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 600, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 617, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 600, __pyx_L1_error) + __PYX_ERR(0, 617, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -13247,46 +13572,46 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_counts = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "cc3d.pyx":601 + /* "cc3d.pyx":618 * * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) # <<<<<<<<<<<<<< * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) * */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_uint64_t((6 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_uint64_t((6 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 601, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 601, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 618, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_bounding_boxes = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 601, __pyx_L1_error) + __PYX_ERR(0, 618, __pyx_L1_error) } else {__pyx_pybuffernd_bounding_boxes.diminfo[0].strides = __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bounding_boxes.diminfo[0].shape = __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.shape[0]; } } @@ -13294,46 +13619,46 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_bounding_boxes = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":602 + /* "cc3d.pyx":619 * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) # <<<<<<<<<<<<<< * * cdef uint64_t x = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_uint64_t((3 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_uint64_t((3 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 602, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __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_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 602, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 619, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_centroids.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_centroids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 602, __pyx_L1_error) + __PYX_ERR(0, 619, __pyx_L1_error) } else {__pyx_pybuffernd_centroids.diminfo[0].strides = __pyx_pybuffernd_centroids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_centroids.diminfo[0].shape = __pyx_pybuffernd_centroids.rcbuffer->pybuffer.shape[0]; } } @@ -13341,7 +13666,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_centroids = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":604 + /* "cc3d.pyx":621 * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) * * cdef uint64_t x = 0 # <<<<<<<<<<<<<< @@ -13350,7 +13675,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_x = 0; - /* "cc3d.pyx":605 + /* "cc3d.pyx":622 * * cdef uint64_t x = 0 * cdef uint64_t y = 0 # <<<<<<<<<<<<<< @@ -13359,7 +13684,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_y = 0; - /* "cc3d.pyx":606 + /* "cc3d.pyx":623 * cdef uint64_t x = 0 * cdef uint64_t y = 0 * cdef uint64_t z = 0 # <<<<<<<<<<<<<< @@ -13368,7 +13693,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_z = 0; - /* "cc3d.pyx":608 + /* "cc3d.pyx":625 * cdef uint64_t z = 0 * * cdef uint64_t label = 0 # <<<<<<<<<<<<<< @@ -13377,23 +13702,23 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_label = 0; - /* "cc3d.pyx":610 + /* "cc3d.pyx":627 * cdef uint64_t label = 0 * * for label in range(0, bounding_boxes.size, 2): # <<<<<<<<<<<<<< * bounding_boxes[label] = voxels * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = ((uint64_t)__pyx_t_2); __pyx_t_2 = __pyx_t_11; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=2) { __pyx_v_label = __pyx_t_12; - /* "cc3d.pyx":611 + /* "cc3d.pyx":628 * * for label in range(0, bounding_boxes.size, 2): * bounding_boxes[label] = voxels # <<<<<<<<<<<<<< @@ -13404,7 +13729,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_v_voxels; } - /* "cc3d.pyx":613 + /* "cc3d.pyx":630 * bounding_boxes[label] = voxels * * for z in range(sz): # <<<<<<<<<<<<<< @@ -13416,7 +13741,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_z = __pyx_t_12; - /* "cc3d.pyx":614 + /* "cc3d.pyx":631 * * for z in range(sz): * for y in range(sy): # <<<<<<<<<<<<<< @@ -13428,7 +13753,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_y = __pyx_t_15; - /* "cc3d.pyx":615 + /* "cc3d.pyx":632 * for z in range(sz): * for y in range(sy): * for x in range(sx): # <<<<<<<<<<<<<< @@ -13440,7 +13765,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_v_x = __pyx_t_18; - /* "cc3d.pyx":616 + /* "cc3d.pyx":633 * for y in range(sy): * for x in range(sx): * label = out_labels[x,y,z] # <<<<<<<<<<<<<< @@ -13452,7 +13777,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = __pyx_v_z; __pyx_v_label = ((uint64_t)(*__Pyx_BufPtrStrided3d(uint16_t *, __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out_labels.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_out_labels.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_out_labels.diminfo[2].strides))); - /* "cc3d.pyx":617 + /* "cc3d.pyx":634 * for x in range(sx): * label = out_labels[x,y,z] * counts[label] += 1 # <<<<<<<<<<<<<< @@ -13462,7 +13787,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = __pyx_v_label; *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; - /* "cc3d.pyx":618 + /* "cc3d.pyx":635 * label = out_labels[x,y,z] * counts[label] += 1 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) # <<<<<<<<<<<<<< @@ -13480,7 +13805,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":619 + /* "cc3d.pyx":636 * counts[label] += 1 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) # <<<<<<<<<<<<<< @@ -13498,7 +13823,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":620 + /* "cc3d.pyx":637 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) # <<<<<<<<<<<<<< @@ -13516,7 +13841,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 2); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":621 + /* "cc3d.pyx":638 * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) # <<<<<<<<<<<<<< @@ -13534,7 +13859,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 3); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":622 + /* "cc3d.pyx":639 * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) # <<<<<<<<<<<<<< @@ -13552,7 +13877,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 4); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":623 + /* "cc3d.pyx":640 * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) # <<<<<<<<<<<<<< @@ -13570,7 +13895,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 5); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":624 + /* "cc3d.pyx":641 * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) * centroids[3 * label + 0] += x # <<<<<<<<<<<<<< @@ -13580,7 +13905,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((3 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_centroids.diminfo[0].strides) += ((double)__pyx_v_x); - /* "cc3d.pyx":625 + /* "cc3d.pyx":642 * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) * centroids[3 * label + 0] += x * centroids[3 * label + 1] += y # <<<<<<<<<<<<<< @@ -13590,7 +13915,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((3 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_centroids.diminfo[0].strides) += ((double)__pyx_v_y); - /* "cc3d.pyx":626 + /* "cc3d.pyx":643 * centroids[3 * label + 0] += x * centroids[3 * label + 1] += y * centroids[3 * label + 2] += z # <<<<<<<<<<<<<< @@ -13603,7 +13928,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self } } - /* "cc3d.pyx":628 + /* "cc3d.pyx":645 * centroids[3 * label + 2] += z * * for label in range(N+1): # <<<<<<<<<<<<<< @@ -13615,7 +13940,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_label = __pyx_t_12; - /* "cc3d.pyx":629 + /* "cc3d.pyx":646 * * for label in range(N+1): * centroids[3 * label + 0] /= counts[label] # <<<<<<<<<<<<<< @@ -13626,7 +13951,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_14 = ((3 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); - /* "cc3d.pyx":630 + /* "cc3d.pyx":647 * for label in range(N+1): * centroids[3 * label + 0] /= counts[label] * centroids[3 * label + 1] /= counts[label] # <<<<<<<<<<<<<< @@ -13637,7 +13962,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_14 = ((3 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); - /* "cc3d.pyx":631 + /* "cc3d.pyx":648 * centroids[3 * label + 0] /= counts[label] * centroids[3 * label + 1] /= counts[label] * centroids[3 * label + 2] /= counts[label] # <<<<<<<<<<<<<< @@ -13649,30 +13974,30 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); } - /* "cc3d.pyx":633 + /* "cc3d.pyx":650 * centroids[3 * label + 2] /= counts[label] * * slices = [] # <<<<<<<<<<<<<< * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_slices = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":634 + /* "cc3d.pyx":651 * * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): # <<<<<<<<<<<<<< * if xs < voxels and ys < voxels and zs < voxels: * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); @@ -13693,16 +14018,16 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_22 = 0; __pyx_t_23 = NULL; } else { - __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_23 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_23 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 651, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -13710,17 +14035,17 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -13730,7 +14055,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 634, __pyx_L1_error) + else __PYX_ERR(0, 651, __pyx_L1_error) } break; } @@ -13742,7 +14067,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(size != 6)) { if (size > 6) __Pyx_RaiseTooManyValuesError(6); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 634, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -13771,7 +14096,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self Py_ssize_t i; PyObject** temps[6] = {&__pyx_t_7,&__pyx_t_4,&__pyx_t_5,&__pyx_t_24,&__pyx_t_25,&__pyx_t_26}; for (i=0; i < 6; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 634, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -13781,7 +14106,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self } else { Py_ssize_t index = -1; PyObject** temps[6] = {&__pyx_t_7,&__pyx_t_4,&__pyx_t_5,&__pyx_t_24,&__pyx_t_25,&__pyx_t_26}; - __pyx_t_27 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_27 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_28 = Py_TYPE(__pyx_t_27)->tp_iternext; @@ -13790,7 +14115,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_28(__pyx_t_27), 6) < 0) __PYX_ERR(0, 634, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_28(__pyx_t_27), 6) < 0) __PYX_ERR(0, 651, __pyx_L1_error) __pyx_t_28 = NULL; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; goto __pyx_L18_unpacking_done; @@ -13798,7 +14123,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_t_28 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 634, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_xs, __pyx_t_7); @@ -13814,68 +14139,68 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_XDECREF_SET(__pyx_v_ze, __pyx_t_26); __pyx_t_26 = 0; - /* "cc3d.pyx":635 + /* "cc3d.pyx":652 * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: # <<<<<<<<<<<<<< * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) * else: */ - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = PyObject_RichCompare(__pyx_v_xs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = PyObject_RichCompare(__pyx_v_xs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (__pyx_t_29) { } else { __pyx_t_3 = __pyx_t_29; goto __pyx_L20_bool_binop_done; } - __pyx_t_26 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ys, __pyx_t_26, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ys, __pyx_t_26, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_29) { } else { __pyx_t_3 = __pyx_t_29; goto __pyx_L20_bool_binop_done; } - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = PyObject_RichCompare(__pyx_v_zs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = PyObject_RichCompare(__pyx_v_zs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __pyx_t_3 = __pyx_t_29; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "cc3d.pyx":636 + /* "cc3d.pyx":653 * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) # <<<<<<<<<<<<<< * else: * slices.append(None) */ - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_xe, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_xe, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_1 = PySlice_New(__pyx_v_xs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_v_xs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ye, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ye, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_25 = PySlice_New(__pyx_v_ys, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_25 = PySlice_New(__pyx_v_ys, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ze, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ze, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_24 = PySlice_New(__pyx_v_zs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_24 = PySlice_New(__pyx_v_zs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_1); @@ -13886,10 +14211,10 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_1 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; - __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, __pyx_t_26); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, __pyx_t_26); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - /* "cc3d.pyx":635 + /* "cc3d.pyx":652 * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: # <<<<<<<<<<<<<< @@ -13899,7 +14224,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L19; } - /* "cc3d.pyx":638 + /* "cc3d.pyx":655 * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) * else: * slices.append(None) # <<<<<<<<<<<<<< @@ -13907,11 +14232,11 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self * return { */ /*else*/ { - __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, Py_None); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, Py_None); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 655, __pyx_L1_error) } __pyx_L19:; - /* "cc3d.pyx":634 + /* "cc3d.pyx":651 * * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): # <<<<<<<<<<<<<< @@ -13921,7 +14246,7 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":640 + /* "cc3d.pyx":657 * slices.append(None) * * return { # <<<<<<<<<<<<<< @@ -13930,38 +14255,38 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __Pyx_XDECREF(__pyx_r); - /* "cc3d.pyx":641 + /* "cc3d.pyx":658 * * return { * "voxel_counts": counts, # <<<<<<<<<<<<<< * "bounding_boxes": slices, * "centroids": centroids.reshape((N+1,3)), */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_voxel_counts, ((PyObject *)__pyx_v_counts)) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_voxel_counts, ((PyObject *)__pyx_v_counts)) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "cc3d.pyx":642 + /* "cc3d.pyx":659 * return { * "voxel_counts": counts, * "bounding_boxes": slices, # <<<<<<<<<<<<<< * "centroids": centroids.reshape((N+1,3)), * } */ - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_bounding_boxes, __pyx_v_slices) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_bounding_boxes, __pyx_v_slices) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "cc3d.pyx":643 + /* "cc3d.pyx":660 * "voxel_counts": counts, * "bounding_boxes": slices, * "centroids": centroids.reshape((N+1,3)), # <<<<<<<<<<<<<< * } * */ - __pyx_t_24 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_centroids), __pyx_n_s_reshape); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_centroids), __pyx_n_s_reshape); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); - __pyx_t_25 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_25); @@ -13982,16 +14307,16 @@ static PyObject *__pyx_pf_4cc3d_34_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_26 = (__pyx_t_25) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_25, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_1); __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 643, __pyx_L1_error) + if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_centroids, __pyx_t_26) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_centroids, __pyx_t_26) < 0) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "cc3d.pyx":580 + /* "cc3d.pyx":597 * @cython.wraparound(False) * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): # <<<<<<<<<<<<<< @@ -14053,7 +14378,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_4cc3d_37_statistics(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_statistics (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_labels), __pyx_ptype_5numpy_ndarray, 1, "out_labels", 0))) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_labels), __pyx_ptype_5numpy_ndarray, 1, "out_labels", 0))) __PYX_ERR(0, 597, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_36_statistics(__pyx_self, ((PyArrayObject *)__pyx_v_out_labels)); /* function exit code */ @@ -14147,24 +14472,24 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_out_labels.rcbuffer = &__pyx_pybuffer_out_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 597, __pyx_L1_error) } __pyx_pybuffernd_out_labels.diminfo[0].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels.diminfo[0].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out_labels.diminfo[1].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out_labels.diminfo[1].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_out_labels.diminfo[2].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_out_labels.diminfo[2].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":581 + /* "cc3d.pyx":598 * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): * cdef uint64_t voxels = out_labels.size; # <<<<<<<<<<<<<< * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "cc3d.pyx":582 + /* "cc3d.pyx":599 * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] # <<<<<<<<<<<<<< @@ -14173,7 +14498,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_out_labels->dimensions[0]); - /* "cc3d.pyx":583 + /* "cc3d.pyx":600 * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] # <<<<<<<<<<<<<< @@ -14182,7 +14507,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_out_labels->dimensions[1]); - /* "cc3d.pyx":584 + /* "cc3d.pyx":601 * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] * cdef uint64_t sz = out_labels.shape[2] # <<<<<<<<<<<<<< @@ -14191,7 +14516,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_out_labels->dimensions[2]); - /* "cc3d.pyx":586 + /* "cc3d.pyx":603 * cdef uint64_t sz = out_labels.shape[2] * * if voxels == 0: # <<<<<<<<<<<<<< @@ -14201,7 +14526,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = ((__pyx_v_voxels == 0) != 0); if (__pyx_t_3) { - /* "cc3d.pyx":587 + /* "cc3d.pyx":604 * * if voxels == 0: * return { # <<<<<<<<<<<<<< @@ -14210,39 +14535,39 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __Pyx_XDECREF(__pyx_r); - /* "cc3d.pyx":588 + /* "cc3d.pyx":605 * if voxels == 0: * return { * "voxel_counts": None, # <<<<<<<<<<<<<< * "bounding_boxes": None, * "centroids": None, */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_voxel_counts, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_voxel_counts, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) - /* "cc3d.pyx":589 + /* "cc3d.pyx":606 * return { * "voxel_counts": None, * "bounding_boxes": None, # <<<<<<<<<<<<<< * "centroids": None, * } */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bounding_boxes, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bounding_boxes, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) - /* "cc3d.pyx":590 + /* "cc3d.pyx":607 * "voxel_counts": None, * "bounding_boxes": None, * "centroids": None, # <<<<<<<<<<<<<< * } * */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_centroids, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_centroids, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":586 + /* "cc3d.pyx":603 * cdef uint64_t sz = out_labels.shape[2] * * if voxels == 0: # <<<<<<<<<<<<<< @@ -14251,16 +14576,16 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "cc3d.pyx":593 + /* "cc3d.pyx":610 * } * * cdef uint64_t N = np.max(out_labels) # <<<<<<<<<<<<<< * * if N > voxels: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -14275,14 +14600,14 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_out_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_out_labels)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_N = __pyx_t_2; - /* "cc3d.pyx":595 + /* "cc3d.pyx":612 * cdef uint64_t N = np.max(out_labels) * * if N > voxels: # <<<<<<<<<<<<<< @@ -14292,37 +14617,37 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = ((__pyx_v_N > __pyx_v_voxels) != 0); if (unlikely(__pyx_t_3)) { - /* "cc3d.pyx":597 + /* "cc3d.pyx":614 * if N > voxels: * raise ValueError( * f"Statistics can only be computed on volumes containing labels with values lower than the number of voxels. Max: {N}" # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Statistics_can_only_be_computed, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Statistics_can_only_be_computed, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":596 + /* "cc3d.pyx":613 * * if N > voxels: * raise ValueError( # <<<<<<<<<<<<<< * f"Statistics can only be computed on volumes containing labels with values lower than the number of voxels. Max: {N}" * ) */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __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, 596, __pyx_L1_error) + __PYX_ERR(0, 613, __pyx_L1_error) - /* "cc3d.pyx":595 + /* "cc3d.pyx":612 * cdef uint64_t N = np.max(out_labels) * * if N > voxels: # <<<<<<<<<<<<<< @@ -14331,46 +14656,46 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "cc3d.pyx":600 + /* "cc3d.pyx":617 * ) * * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __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, 600, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 600, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 617, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 600, __pyx_L1_error) + __PYX_ERR(0, 617, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -14378,46 +14703,46 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_counts = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "cc3d.pyx":601 + /* "cc3d.pyx":618 * * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) # <<<<<<<<<<<<<< * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) * */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_uint64_t((6 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_uint64_t((6 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 601, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 601, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 618, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_bounding_boxes = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 601, __pyx_L1_error) + __PYX_ERR(0, 618, __pyx_L1_error) } else {__pyx_pybuffernd_bounding_boxes.diminfo[0].strides = __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bounding_boxes.diminfo[0].shape = __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.shape[0]; } } @@ -14425,46 +14750,46 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_bounding_boxes = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":602 + /* "cc3d.pyx":619 * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) # <<<<<<<<<<<<<< * * cdef uint64_t x = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_uint64_t((3 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_uint64_t((3 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 602, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __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_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 602, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 619, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_centroids.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_centroids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 602, __pyx_L1_error) + __PYX_ERR(0, 619, __pyx_L1_error) } else {__pyx_pybuffernd_centroids.diminfo[0].strides = __pyx_pybuffernd_centroids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_centroids.diminfo[0].shape = __pyx_pybuffernd_centroids.rcbuffer->pybuffer.shape[0]; } } @@ -14472,7 +14797,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_centroids = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":604 + /* "cc3d.pyx":621 * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) * * cdef uint64_t x = 0 # <<<<<<<<<<<<<< @@ -14481,7 +14806,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_x = 0; - /* "cc3d.pyx":605 + /* "cc3d.pyx":622 * * cdef uint64_t x = 0 * cdef uint64_t y = 0 # <<<<<<<<<<<<<< @@ -14490,7 +14815,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_y = 0; - /* "cc3d.pyx":606 + /* "cc3d.pyx":623 * cdef uint64_t x = 0 * cdef uint64_t y = 0 * cdef uint64_t z = 0 # <<<<<<<<<<<<<< @@ -14499,7 +14824,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_z = 0; - /* "cc3d.pyx":608 + /* "cc3d.pyx":625 * cdef uint64_t z = 0 * * cdef uint64_t label = 0 # <<<<<<<<<<<<<< @@ -14508,23 +14833,23 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_label = 0; - /* "cc3d.pyx":610 + /* "cc3d.pyx":627 * cdef uint64_t label = 0 * * for label in range(0, bounding_boxes.size, 2): # <<<<<<<<<<<<<< * bounding_boxes[label] = voxels * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = ((uint64_t)__pyx_t_2); __pyx_t_2 = __pyx_t_11; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=2) { __pyx_v_label = __pyx_t_12; - /* "cc3d.pyx":611 + /* "cc3d.pyx":628 * * for label in range(0, bounding_boxes.size, 2): * bounding_boxes[label] = voxels # <<<<<<<<<<<<<< @@ -14535,7 +14860,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_v_voxels; } - /* "cc3d.pyx":613 + /* "cc3d.pyx":630 * bounding_boxes[label] = voxels * * for z in range(sz): # <<<<<<<<<<<<<< @@ -14547,7 +14872,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_z = __pyx_t_12; - /* "cc3d.pyx":614 + /* "cc3d.pyx":631 * * for z in range(sz): * for y in range(sy): # <<<<<<<<<<<<<< @@ -14559,7 +14884,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_y = __pyx_t_15; - /* "cc3d.pyx":615 + /* "cc3d.pyx":632 * for z in range(sz): * for y in range(sy): * for x in range(sx): # <<<<<<<<<<<<<< @@ -14571,7 +14896,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_v_x = __pyx_t_18; - /* "cc3d.pyx":616 + /* "cc3d.pyx":633 * for y in range(sy): * for x in range(sx): * label = out_labels[x,y,z] # <<<<<<<<<<<<<< @@ -14583,7 +14908,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = __pyx_v_z; __pyx_v_label = ((uint64_t)(*__Pyx_BufPtrStrided3d(uint32_t *, __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out_labels.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_out_labels.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_out_labels.diminfo[2].strides))); - /* "cc3d.pyx":617 + /* "cc3d.pyx":634 * for x in range(sx): * label = out_labels[x,y,z] * counts[label] += 1 # <<<<<<<<<<<<<< @@ -14593,7 +14918,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = __pyx_v_label; *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; - /* "cc3d.pyx":618 + /* "cc3d.pyx":635 * label = out_labels[x,y,z] * counts[label] += 1 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) # <<<<<<<<<<<<<< @@ -14611,7 +14936,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":619 + /* "cc3d.pyx":636 * counts[label] += 1 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) # <<<<<<<<<<<<<< @@ -14629,7 +14954,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":620 + /* "cc3d.pyx":637 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) # <<<<<<<<<<<<<< @@ -14647,7 +14972,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 2); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":621 + /* "cc3d.pyx":638 * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) # <<<<<<<<<<<<<< @@ -14665,7 +14990,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 3); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":622 + /* "cc3d.pyx":639 * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) # <<<<<<<<<<<<<< @@ -14683,7 +15008,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 4); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":623 + /* "cc3d.pyx":640 * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) # <<<<<<<<<<<<<< @@ -14701,7 +15026,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 5); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":624 + /* "cc3d.pyx":641 * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) * centroids[3 * label + 0] += x # <<<<<<<<<<<<<< @@ -14711,7 +15036,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((3 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_centroids.diminfo[0].strides) += ((double)__pyx_v_x); - /* "cc3d.pyx":625 + /* "cc3d.pyx":642 * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) * centroids[3 * label + 0] += x * centroids[3 * label + 1] += y # <<<<<<<<<<<<<< @@ -14721,7 +15046,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((3 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_centroids.diminfo[0].strides) += ((double)__pyx_v_y); - /* "cc3d.pyx":626 + /* "cc3d.pyx":643 * centroids[3 * label + 0] += x * centroids[3 * label + 1] += y * centroids[3 * label + 2] += z # <<<<<<<<<<<<<< @@ -14734,7 +15059,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self } } - /* "cc3d.pyx":628 + /* "cc3d.pyx":645 * centroids[3 * label + 2] += z * * for label in range(N+1): # <<<<<<<<<<<<<< @@ -14746,7 +15071,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_label = __pyx_t_12; - /* "cc3d.pyx":629 + /* "cc3d.pyx":646 * * for label in range(N+1): * centroids[3 * label + 0] /= counts[label] # <<<<<<<<<<<<<< @@ -14757,7 +15082,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_14 = ((3 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); - /* "cc3d.pyx":630 + /* "cc3d.pyx":647 * for label in range(N+1): * centroids[3 * label + 0] /= counts[label] * centroids[3 * label + 1] /= counts[label] # <<<<<<<<<<<<<< @@ -14768,7 +15093,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_14 = ((3 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); - /* "cc3d.pyx":631 + /* "cc3d.pyx":648 * centroids[3 * label + 0] /= counts[label] * centroids[3 * label + 1] /= counts[label] * centroids[3 * label + 2] /= counts[label] # <<<<<<<<<<<<<< @@ -14780,30 +15105,30 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); } - /* "cc3d.pyx":633 + /* "cc3d.pyx":650 * centroids[3 * label + 2] /= counts[label] * * slices = [] # <<<<<<<<<<<<<< * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_slices = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":634 + /* "cc3d.pyx":651 * * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): # <<<<<<<<<<<<<< * if xs < voxels and ys < voxels and zs < voxels: * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); @@ -14824,16 +15149,16 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_22 = 0; __pyx_t_23 = NULL; } else { - __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_23 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_23 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 651, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14841,17 +15166,17 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -14861,7 +15186,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 634, __pyx_L1_error) + else __PYX_ERR(0, 651, __pyx_L1_error) } break; } @@ -14873,7 +15198,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(size != 6)) { if (size > 6) __Pyx_RaiseTooManyValuesError(6); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 634, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -14902,7 +15227,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self Py_ssize_t i; PyObject** temps[6] = {&__pyx_t_7,&__pyx_t_4,&__pyx_t_5,&__pyx_t_24,&__pyx_t_25,&__pyx_t_26}; for (i=0; i < 6; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 634, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -14912,7 +15237,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self } else { Py_ssize_t index = -1; PyObject** temps[6] = {&__pyx_t_7,&__pyx_t_4,&__pyx_t_5,&__pyx_t_24,&__pyx_t_25,&__pyx_t_26}; - __pyx_t_27 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_27 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_28 = Py_TYPE(__pyx_t_27)->tp_iternext; @@ -14921,7 +15246,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_28(__pyx_t_27), 6) < 0) __PYX_ERR(0, 634, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_28(__pyx_t_27), 6) < 0) __PYX_ERR(0, 651, __pyx_L1_error) __pyx_t_28 = NULL; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; goto __pyx_L18_unpacking_done; @@ -14929,7 +15254,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_t_28 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 634, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_xs, __pyx_t_7); @@ -14945,68 +15270,68 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_XDECREF_SET(__pyx_v_ze, __pyx_t_26); __pyx_t_26 = 0; - /* "cc3d.pyx":635 + /* "cc3d.pyx":652 * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: # <<<<<<<<<<<<<< * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) * else: */ - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = PyObject_RichCompare(__pyx_v_xs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = PyObject_RichCompare(__pyx_v_xs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (__pyx_t_29) { } else { __pyx_t_3 = __pyx_t_29; goto __pyx_L20_bool_binop_done; } - __pyx_t_26 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ys, __pyx_t_26, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ys, __pyx_t_26, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_29) { } else { __pyx_t_3 = __pyx_t_29; goto __pyx_L20_bool_binop_done; } - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = PyObject_RichCompare(__pyx_v_zs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = PyObject_RichCompare(__pyx_v_zs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __pyx_t_3 = __pyx_t_29; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "cc3d.pyx":636 + /* "cc3d.pyx":653 * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) # <<<<<<<<<<<<<< * else: * slices.append(None) */ - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_xe, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_xe, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_1 = PySlice_New(__pyx_v_xs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_v_xs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ye, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ye, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_25 = PySlice_New(__pyx_v_ys, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_25 = PySlice_New(__pyx_v_ys, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ze, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ze, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_24 = PySlice_New(__pyx_v_zs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_24 = PySlice_New(__pyx_v_zs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_1); @@ -15017,10 +15342,10 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_1 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; - __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, __pyx_t_26); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, __pyx_t_26); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - /* "cc3d.pyx":635 + /* "cc3d.pyx":652 * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: # <<<<<<<<<<<<<< @@ -15030,7 +15355,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L19; } - /* "cc3d.pyx":638 + /* "cc3d.pyx":655 * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) * else: * slices.append(None) # <<<<<<<<<<<<<< @@ -15038,11 +15363,11 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self * return { */ /*else*/ { - __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, Py_None); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, Py_None); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 655, __pyx_L1_error) } __pyx_L19:; - /* "cc3d.pyx":634 + /* "cc3d.pyx":651 * * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): # <<<<<<<<<<<<<< @@ -15052,7 +15377,7 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":640 + /* "cc3d.pyx":657 * slices.append(None) * * return { # <<<<<<<<<<<<<< @@ -15061,38 +15386,38 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __Pyx_XDECREF(__pyx_r); - /* "cc3d.pyx":641 + /* "cc3d.pyx":658 * * return { * "voxel_counts": counts, # <<<<<<<<<<<<<< * "bounding_boxes": slices, * "centroids": centroids.reshape((N+1,3)), */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_voxel_counts, ((PyObject *)__pyx_v_counts)) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_voxel_counts, ((PyObject *)__pyx_v_counts)) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "cc3d.pyx":642 + /* "cc3d.pyx":659 * return { * "voxel_counts": counts, * "bounding_boxes": slices, # <<<<<<<<<<<<<< * "centroids": centroids.reshape((N+1,3)), * } */ - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_bounding_boxes, __pyx_v_slices) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_bounding_boxes, __pyx_v_slices) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "cc3d.pyx":643 + /* "cc3d.pyx":660 * "voxel_counts": counts, * "bounding_boxes": slices, * "centroids": centroids.reshape((N+1,3)), # <<<<<<<<<<<<<< * } * */ - __pyx_t_24 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_centroids), __pyx_n_s_reshape); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_centroids), __pyx_n_s_reshape); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); - __pyx_t_25 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_25); @@ -15113,16 +15438,16 @@ static PyObject *__pyx_pf_4cc3d_36_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_26 = (__pyx_t_25) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_25, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_1); __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 643, __pyx_L1_error) + if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_centroids, __pyx_t_26) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_centroids, __pyx_t_26) < 0) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "cc3d.pyx":580 + /* "cc3d.pyx":597 * @cython.wraparound(False) * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): # <<<<<<<<<<<<<< @@ -15184,7 +15509,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_4cc3d_39_statistics(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_statistics (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_labels), __pyx_ptype_5numpy_ndarray, 1, "out_labels", 0))) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_labels), __pyx_ptype_5numpy_ndarray, 1, "out_labels", 0))) __PYX_ERR(0, 597, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_38_statistics(__pyx_self, ((PyArrayObject *)__pyx_v_out_labels)); /* function exit code */ @@ -15278,24 +15603,24 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_out_labels.rcbuffer = &__pyx_pybuffer_out_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 597, __pyx_L1_error) } __pyx_pybuffernd_out_labels.diminfo[0].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_labels.diminfo[0].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out_labels.diminfo[1].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out_labels.diminfo[1].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_out_labels.diminfo[2].strides = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_out_labels.diminfo[2].shape = __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":581 + /* "cc3d.pyx":598 * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): * cdef uint64_t voxels = out_labels.size; # <<<<<<<<<<<<<< * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "cc3d.pyx":582 + /* "cc3d.pyx":599 * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] # <<<<<<<<<<<<<< @@ -15304,7 +15629,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_out_labels->dimensions[0]); - /* "cc3d.pyx":583 + /* "cc3d.pyx":600 * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] # <<<<<<<<<<<<<< @@ -15313,7 +15638,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_out_labels->dimensions[1]); - /* "cc3d.pyx":584 + /* "cc3d.pyx":601 * cdef uint64_t sx = out_labels.shape[0] * cdef uint64_t sy = out_labels.shape[1] * cdef uint64_t sz = out_labels.shape[2] # <<<<<<<<<<<<<< @@ -15322,7 +15647,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_out_labels->dimensions[2]); - /* "cc3d.pyx":586 + /* "cc3d.pyx":603 * cdef uint64_t sz = out_labels.shape[2] * * if voxels == 0: # <<<<<<<<<<<<<< @@ -15332,7 +15657,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = ((__pyx_v_voxels == 0) != 0); if (__pyx_t_3) { - /* "cc3d.pyx":587 + /* "cc3d.pyx":604 * * if voxels == 0: * return { # <<<<<<<<<<<<<< @@ -15341,39 +15666,39 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __Pyx_XDECREF(__pyx_r); - /* "cc3d.pyx":588 + /* "cc3d.pyx":605 * if voxels == 0: * return { * "voxel_counts": None, # <<<<<<<<<<<<<< * "bounding_boxes": None, * "centroids": None, */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_voxel_counts, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_voxel_counts, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) - /* "cc3d.pyx":589 + /* "cc3d.pyx":606 * return { * "voxel_counts": None, * "bounding_boxes": None, # <<<<<<<<<<<<<< * "centroids": None, * } */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bounding_boxes, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bounding_boxes, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) - /* "cc3d.pyx":590 + /* "cc3d.pyx":607 * "voxel_counts": None, * "bounding_boxes": None, * "centroids": None, # <<<<<<<<<<<<<< * } * */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_centroids, Py_None) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_centroids, Py_None) < 0) __PYX_ERR(0, 605, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":586 + /* "cc3d.pyx":603 * cdef uint64_t sz = out_labels.shape[2] * * if voxels == 0: # <<<<<<<<<<<<<< @@ -15382,16 +15707,16 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "cc3d.pyx":593 + /* "cc3d.pyx":610 * } * * cdef uint64_t N = np.max(out_labels) # <<<<<<<<<<<<<< * * if N > voxels: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -15406,14 +15731,14 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_out_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_out_labels)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_N = __pyx_t_2; - /* "cc3d.pyx":595 + /* "cc3d.pyx":612 * cdef uint64_t N = np.max(out_labels) * * if N > voxels: # <<<<<<<<<<<<<< @@ -15423,37 +15748,37 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = ((__pyx_v_N > __pyx_v_voxels) != 0); if (unlikely(__pyx_t_3)) { - /* "cc3d.pyx":597 + /* "cc3d.pyx":614 * if N > voxels: * raise ValueError( * f"Statistics can only be computed on volumes containing labels with values lower than the number of voxels. Max: {N}" # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Statistics_can_only_be_computed, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Statistics_can_only_be_computed, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":596 + /* "cc3d.pyx":613 * * if N > voxels: * raise ValueError( # <<<<<<<<<<<<<< * f"Statistics can only be computed on volumes containing labels with values lower than the number of voxels. Max: {N}" * ) */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __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, 596, __pyx_L1_error) + __PYX_ERR(0, 613, __pyx_L1_error) - /* "cc3d.pyx":595 + /* "cc3d.pyx":612 * cdef uint64_t N = np.max(out_labels) * * if N > voxels: # <<<<<<<<<<<<<< @@ -15462,46 +15787,46 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "cc3d.pyx":600 + /* "cc3d.pyx":617 * ) * * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __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, 600, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 600, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 617, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 600, __pyx_L1_error) + __PYX_ERR(0, 617, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -15509,46 +15834,46 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_counts = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "cc3d.pyx":601 + /* "cc3d.pyx":618 * * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) # <<<<<<<<<<<<<< * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) * */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_uint64_t((6 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_uint64_t((6 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 601, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 601, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 618, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_bounding_boxes = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 601, __pyx_L1_error) + __PYX_ERR(0, 618, __pyx_L1_error) } else {__pyx_pybuffernd_bounding_boxes.diminfo[0].strides = __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bounding_boxes.diminfo[0].shape = __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.shape[0]; } } @@ -15556,46 +15881,46 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_bounding_boxes = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":602 + /* "cc3d.pyx":619 * cdef cnp.ndarray[uint64_t] counts = np.zeros(N + 1, dtype=np.uint64) * cdef cnp.ndarray[uint64_t] bounding_boxes = np.zeros(6 * (N + 1), dtype=np.uint64) * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) # <<<<<<<<<<<<<< * * cdef uint64_t x = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_uint64_t((3 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_uint64_t((3 * (__pyx_v_N + 1))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 602, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __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_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 602, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 619, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_centroids.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_centroids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 602, __pyx_L1_error) + __PYX_ERR(0, 619, __pyx_L1_error) } else {__pyx_pybuffernd_centroids.diminfo[0].strides = __pyx_pybuffernd_centroids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_centroids.diminfo[0].shape = __pyx_pybuffernd_centroids.rcbuffer->pybuffer.shape[0]; } } @@ -15603,7 +15928,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_centroids = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":604 + /* "cc3d.pyx":621 * cdef cnp.ndarray[double] centroids = np.zeros(3 * (N + 1), dtype=np.float64) * * cdef uint64_t x = 0 # <<<<<<<<<<<<<< @@ -15612,7 +15937,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_x = 0; - /* "cc3d.pyx":605 + /* "cc3d.pyx":622 * * cdef uint64_t x = 0 * cdef uint64_t y = 0 # <<<<<<<<<<<<<< @@ -15621,7 +15946,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_y = 0; - /* "cc3d.pyx":606 + /* "cc3d.pyx":623 * cdef uint64_t x = 0 * cdef uint64_t y = 0 * cdef uint64_t z = 0 # <<<<<<<<<<<<<< @@ -15630,7 +15955,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_z = 0; - /* "cc3d.pyx":608 + /* "cc3d.pyx":625 * cdef uint64_t z = 0 * * cdef uint64_t label = 0 # <<<<<<<<<<<<<< @@ -15639,23 +15964,23 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_label = 0; - /* "cc3d.pyx":610 + /* "cc3d.pyx":627 * cdef uint64_t label = 0 * * for label in range(0, bounding_boxes.size, 2): # <<<<<<<<<<<<<< * bounding_boxes[label] = voxels * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = ((uint64_t)__pyx_t_2); __pyx_t_2 = __pyx_t_11; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=2) { __pyx_v_label = __pyx_t_12; - /* "cc3d.pyx":611 + /* "cc3d.pyx":628 * * for label in range(0, bounding_boxes.size, 2): * bounding_boxes[label] = voxels # <<<<<<<<<<<<<< @@ -15666,7 +15991,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_v_voxels; } - /* "cc3d.pyx":613 + /* "cc3d.pyx":630 * bounding_boxes[label] = voxels * * for z in range(sz): # <<<<<<<<<<<<<< @@ -15678,7 +16003,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_z = __pyx_t_12; - /* "cc3d.pyx":614 + /* "cc3d.pyx":631 * * for z in range(sz): * for y in range(sy): # <<<<<<<<<<<<<< @@ -15690,7 +16015,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_y = __pyx_t_15; - /* "cc3d.pyx":615 + /* "cc3d.pyx":632 * for z in range(sz): * for y in range(sy): * for x in range(sx): # <<<<<<<<<<<<<< @@ -15702,7 +16027,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_v_x = __pyx_t_18; - /* "cc3d.pyx":616 + /* "cc3d.pyx":633 * for y in range(sy): * for x in range(sx): * label = out_labels[x,y,z] # <<<<<<<<<<<<<< @@ -15714,7 +16039,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = __pyx_v_z; __pyx_v_label = ((uint64_t)(*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_out_labels.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out_labels.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_out_labels.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_out_labels.diminfo[2].strides))); - /* "cc3d.pyx":617 + /* "cc3d.pyx":634 * for x in range(sx): * label = out_labels[x,y,z] * counts[label] += 1 # <<<<<<<<<<<<<< @@ -15724,7 +16049,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = __pyx_v_label; *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; - /* "cc3d.pyx":618 + /* "cc3d.pyx":635 * label = out_labels[x,y,z] * counts[label] += 1 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) # <<<<<<<<<<<<<< @@ -15742,7 +16067,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":619 + /* "cc3d.pyx":636 * counts[label] += 1 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) # <<<<<<<<<<<<<< @@ -15760,7 +16085,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":620 + /* "cc3d.pyx":637 * bounding_boxes[6 * label + 0] = min(bounding_boxes[6 * label + 0], x) * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) # <<<<<<<<<<<<<< @@ -15778,7 +16103,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 2); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":621 + /* "cc3d.pyx":638 * bounding_boxes[6 * label + 1] = max(bounding_boxes[6 * label + 1], x) * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) # <<<<<<<<<<<<<< @@ -15796,7 +16121,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 3); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":622 + /* "cc3d.pyx":639 * bounding_boxes[6 * label + 2] = min(bounding_boxes[6 * label + 2], y) * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) # <<<<<<<<<<<<<< @@ -15814,7 +16139,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((6 * __pyx_v_label) + 4); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_20; - /* "cc3d.pyx":623 + /* "cc3d.pyx":640 * bounding_boxes[6 * label + 3] = max(bounding_boxes[6 * label + 3], y) * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) # <<<<<<<<<<<<<< @@ -15832,7 +16157,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_20 = ((6 * __pyx_v_label) + 5); *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_bounding_boxes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_bounding_boxes.diminfo[0].strides) = __pyx_t_21; - /* "cc3d.pyx":624 + /* "cc3d.pyx":641 * bounding_boxes[6 * label + 4] = min(bounding_boxes[6 * label + 4], z) * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) * centroids[3 * label + 0] += x # <<<<<<<<<<<<<< @@ -15842,7 +16167,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((3 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_centroids.diminfo[0].strides) += ((double)__pyx_v_x); - /* "cc3d.pyx":625 + /* "cc3d.pyx":642 * bounding_boxes[6 * label + 5] = max(bounding_boxes[6 * label + 5], z) * centroids[3 * label + 0] += x * centroids[3 * label + 1] += y # <<<<<<<<<<<<<< @@ -15852,7 +16177,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_21 = ((3 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_centroids.diminfo[0].strides) += ((double)__pyx_v_y); - /* "cc3d.pyx":626 + /* "cc3d.pyx":643 * centroids[3 * label + 0] += x * centroids[3 * label + 1] += y * centroids[3 * label + 2] += z # <<<<<<<<<<<<<< @@ -15865,7 +16190,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self } } - /* "cc3d.pyx":628 + /* "cc3d.pyx":645 * centroids[3 * label + 2] += z * * for label in range(N+1): # <<<<<<<<<<<<<< @@ -15877,7 +16202,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_label = __pyx_t_12; - /* "cc3d.pyx":629 + /* "cc3d.pyx":646 * * for label in range(N+1): * centroids[3 * label + 0] /= counts[label] # <<<<<<<<<<<<<< @@ -15888,7 +16213,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_14 = ((3 * __pyx_v_label) + 0); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); - /* "cc3d.pyx":630 + /* "cc3d.pyx":647 * for label in range(N+1): * centroids[3 * label + 0] /= counts[label] * centroids[3 * label + 1] /= counts[label] # <<<<<<<<<<<<<< @@ -15899,7 +16224,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_14 = ((3 * __pyx_v_label) + 1); *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); - /* "cc3d.pyx":631 + /* "cc3d.pyx":648 * centroids[3 * label + 0] /= counts[label] * centroids[3 * label + 1] /= counts[label] * centroids[3 * label + 2] /= counts[label] # <<<<<<<<<<<<<< @@ -15911,30 +16236,30 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_centroids.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_centroids.diminfo[0].strides) /= ((double)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); } - /* "cc3d.pyx":633 + /* "cc3d.pyx":650 * centroids[3 * label + 2] /= counts[label] * * slices = [] # <<<<<<<<<<<<<< * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_slices = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":634 + /* "cc3d.pyx":651 * * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): # <<<<<<<<<<<<<< * if xs < voxels and ys < voxels and zs < voxels: * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bounding_boxes), __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); @@ -15955,16 +16280,16 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_22 = 0; __pyx_t_23 = NULL; } else { - __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_23 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_23 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 651, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -15972,17 +16297,17 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_1); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -15992,7 +16317,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 634, __pyx_L1_error) + else __PYX_ERR(0, 651, __pyx_L1_error) } break; } @@ -16004,7 +16329,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(size != 6)) { if (size > 6) __Pyx_RaiseTooManyValuesError(6); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 634, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16033,7 +16358,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self Py_ssize_t i; PyObject** temps[6] = {&__pyx_t_7,&__pyx_t_4,&__pyx_t_5,&__pyx_t_24,&__pyx_t_25,&__pyx_t_26}; for (i=0; i < 6; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 634, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -16043,7 +16368,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self } else { Py_ssize_t index = -1; PyObject** temps[6] = {&__pyx_t_7,&__pyx_t_4,&__pyx_t_5,&__pyx_t_24,&__pyx_t_25,&__pyx_t_26}; - __pyx_t_27 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_27 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_28 = Py_TYPE(__pyx_t_27)->tp_iternext; @@ -16052,7 +16377,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_28(__pyx_t_27), 6) < 0) __PYX_ERR(0, 634, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_28(__pyx_t_27), 6) < 0) __PYX_ERR(0, 651, __pyx_L1_error) __pyx_t_28 = NULL; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; goto __pyx_L18_unpacking_done; @@ -16060,7 +16385,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __pyx_t_28 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 634, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_xs, __pyx_t_7); @@ -16076,68 +16401,68 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __Pyx_XDECREF_SET(__pyx_v_ze, __pyx_t_26); __pyx_t_26 = 0; - /* "cc3d.pyx":635 + /* "cc3d.pyx":652 * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: # <<<<<<<<<<<<<< * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) * else: */ - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = PyObject_RichCompare(__pyx_v_xs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = PyObject_RichCompare(__pyx_v_xs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (__pyx_t_29) { } else { __pyx_t_3 = __pyx_t_29; goto __pyx_L20_bool_binop_done; } - __pyx_t_26 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ys, __pyx_t_26, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ys, __pyx_t_26, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_29) { } else { __pyx_t_3 = __pyx_t_29; goto __pyx_L20_bool_binop_done; } - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = PyObject_RichCompare(__pyx_v_zs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_26 = PyObject_RichCompare(__pyx_v_zs, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __pyx_t_3 = __pyx_t_29; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "cc3d.pyx":636 + /* "cc3d.pyx":653 * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) # <<<<<<<<<<<<<< * else: * slices.append(None) */ - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_xe, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_xe, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_1 = PySlice_New(__pyx_v_xs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_v_xs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ye, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ye, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_25 = PySlice_New(__pyx_v_ys, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_25 = PySlice_New(__pyx_v_ys, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ze, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_ze, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); - __pyx_t_24 = PySlice_New(__pyx_v_zs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_24 = PySlice_New(__pyx_v_zs, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_1); @@ -16148,10 +16473,10 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_1 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; - __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, __pyx_t_26); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, __pyx_t_26); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; - /* "cc3d.pyx":635 + /* "cc3d.pyx":652 * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): * if xs < voxels and ys < voxels and zs < voxels: # <<<<<<<<<<<<<< @@ -16161,7 +16486,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L19; } - /* "cc3d.pyx":638 + /* "cc3d.pyx":655 * slices.append((slice(xs,xe+1), slice(ys,ye+1), slice(zs,ze+1))) * else: * slices.append(None) # <<<<<<<<<<<<<< @@ -16169,11 +16494,11 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self * return { */ /*else*/ { - __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, Py_None); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_slices, Py_None); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 655, __pyx_L1_error) } __pyx_L19:; - /* "cc3d.pyx":634 + /* "cc3d.pyx":651 * * slices = [] * for xs, xe, ys, ye, zs, ze in bounding_boxes.reshape((N+1,6)): # <<<<<<<<<<<<<< @@ -16183,7 +16508,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":640 + /* "cc3d.pyx":657 * slices.append(None) * * return { # <<<<<<<<<<<<<< @@ -16192,38 +16517,38 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self */ __Pyx_XDECREF(__pyx_r); - /* "cc3d.pyx":641 + /* "cc3d.pyx":658 * * return { * "voxel_counts": counts, # <<<<<<<<<<<<<< * "bounding_boxes": slices, * "centroids": centroids.reshape((N+1,3)), */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_voxel_counts, ((PyObject *)__pyx_v_counts)) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_voxel_counts, ((PyObject *)__pyx_v_counts)) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "cc3d.pyx":642 + /* "cc3d.pyx":659 * return { * "voxel_counts": counts, * "bounding_boxes": slices, # <<<<<<<<<<<<<< * "centroids": centroids.reshape((N+1,3)), * } */ - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_bounding_boxes, __pyx_v_slices) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_bounding_boxes, __pyx_v_slices) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - /* "cc3d.pyx":643 + /* "cc3d.pyx":660 * "voxel_counts": counts, * "bounding_boxes": slices, * "centroids": centroids.reshape((N+1,3)), # <<<<<<<<<<<<<< * } * */ - __pyx_t_24 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_centroids), __pyx_n_s_reshape); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_centroids), __pyx_n_s_reshape); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); - __pyx_t_25 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyInt_From_uint64_t((__pyx_v_N + 1)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_25); @@ -16244,16 +16569,16 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_26 = (__pyx_t_25) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_25, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_1); __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 643, __pyx_L1_error) + if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_centroids, __pyx_t_26) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_centroids, __pyx_t_26) < 0) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "cc3d.pyx":580 + /* "cc3d.pyx":597 * @cython.wraparound(False) * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): # <<<<<<<<<<<<<< @@ -16305,7 +16630,7 @@ static PyObject *__pyx_pf_4cc3d_38_statistics(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "cc3d.pyx":646 +/* "cc3d.pyx":663 * } * * def voxel_connectivity_graph(data, int64_t connectivity=26): # <<<<<<<<<<<<<< @@ -16353,7 +16678,7 @@ static PyObject *__pyx_pw_4cc3d_13voxel_connectivity_graph(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "voxel_connectivity_graph") < 0)) __PYX_ERR(0, 646, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "voxel_connectivity_graph") < 0)) __PYX_ERR(0, 663, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -16366,14 +16691,14 @@ static PyObject *__pyx_pw_4cc3d_13voxel_connectivity_graph(PyObject *__pyx_self, } __pyx_v_data = values[0]; if (values[1]) { - __pyx_v_connectivity = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_connectivity == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 646, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_connectivity == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 663, __pyx_L3_error) } else { __pyx_v_connectivity = ((int64_t)26); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("voxel_connectivity_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("voxel_connectivity_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 663, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.voxel_connectivity_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16445,20 +16770,20 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_pybuffernd_graph32.data = NULL; __pyx_pybuffernd_graph32.rcbuffer = &__pyx_pybuffer_graph32; - /* "cc3d.pyx":690 + /* "cc3d.pyx":707 * Returns: uint8 or uint32 numpy array the same size as the input * """ * cdef int dims = len(data.shape) # <<<<<<<<<<<<<< * if dims not in (1,2,3): * raise DimensionError("Only 1D, 2D, and 3D arrays 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, 690, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __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, 690, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dims = __pyx_t_2; - /* "cc3d.pyx":691 + /* "cc3d.pyx":708 * """ * cdef int dims = len(data.shape) * if dims not in (1,2,3): # <<<<<<<<<<<<<< @@ -16478,21 +16803,21 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_4 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_4)) { - /* "cc3d.pyx":692 + /* "cc3d.pyx":709 * cdef int dims = len(data.shape) * if dims not in (1,2,3): * raise DimensionError("Only 1D, 2D, and 3D arrays supported. Got: " + str(dims)) # <<<<<<<<<<<<<< * * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DimensionError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_1D_2D_and_3D_arrays_support, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_1D_2D_and_3D_arrays_support, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -16508,14 +16833,14 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 692, __pyx_L1_error) + __PYX_ERR(0, 709, __pyx_L1_error) - /* "cc3d.pyx":691 + /* "cc3d.pyx":708 * """ * cdef int dims = len(data.shape) * if dims not in (1,2,3): # <<<<<<<<<<<<<< @@ -16524,7 +16849,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec */ } - /* "cc3d.pyx":694 + /* "cc3d.pyx":711 * raise DimensionError("Only 1D, 2D, and 3D arrays supported. Got: " + str(dims)) * * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): # <<<<<<<<<<<<<< @@ -16554,29 +16879,29 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_L5_bool_binop_done:; if (unlikely(__pyx_t_4)) { - /* "cc3d.pyx":695 + /* "cc3d.pyx":712 * * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): * raise ValueError("Only 4, 8, and 6, 18, 26 connectivities are supported for 2D images. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * elif dims != 2 and connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported for 3D images. Got: " + str(connectivity)) */ - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_4_8_and_6_18_26_connectivit, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_4_8_and_6_18_26_connectivit, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __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_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __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, 695, __pyx_L1_error) + __PYX_ERR(0, 712, __pyx_L1_error) - /* "cc3d.pyx":694 + /* "cc3d.pyx":711 * raise DimensionError("Only 1D, 2D, and 3D arrays supported. Got: " + str(dims)) * * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): # <<<<<<<<<<<<<< @@ -16585,7 +16910,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec */ } - /* "cc3d.pyx":696 + /* "cc3d.pyx":713 * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): * raise ValueError("Only 4, 8, and 6, 18, 26 connectivities are supported for 2D images. Got: " + str(connectivity)) * elif dims != 2 and connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -16613,29 +16938,29 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_4)) { - /* "cc3d.pyx":697 + /* "cc3d.pyx":714 * raise ValueError("Only 4, 8, and 6, 18, 26 connectivities are supported for 2D images. Got: " + str(connectivity)) * elif dims != 2 and connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported for 3D images. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * out_dtype = np.uint32 */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_connectivity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 714, __pyx_L1_error) - /* "cc3d.pyx":696 + /* "cc3d.pyx":713 * if dims == 2 and connectivity not in (4, 8, 6, 18, 26): * raise ValueError("Only 4, 8, and 6, 18, 26 connectivities are supported for 2D images. Got: " + str(connectivity)) * elif dims != 2 and connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -16644,22 +16969,22 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec */ } - /* "cc3d.pyx":699 + /* "cc3d.pyx":716 * raise ValueError("Only 6, 18, and 26 connectivities are supported for 3D images. Got: " + str(connectivity)) * * out_dtype = np.uint32 # <<<<<<<<<<<<<< * if connectivity in (4, 8, 6): * out_dtype = np.uint8 */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_out_dtype = __pyx_t_5; __pyx_t_5 = 0; - /* "cc3d.pyx":700 + /* "cc3d.pyx":717 * * out_dtype = np.uint32 * if connectivity in (4, 8, 6): # <<<<<<<<<<<<<< @@ -16671,22 +16996,22 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec case 8: case 6: - /* "cc3d.pyx":701 + /* "cc3d.pyx":718 * out_dtype = np.uint32 * if connectivity in (4, 8, 6): * out_dtype = np.uint8 # <<<<<<<<<<<<<< * * if data.size == 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_out_dtype, __pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":700 + /* "cc3d.pyx":717 * * out_dtype = np.uint32 * if connectivity in (4, 8, 6): # <<<<<<<<<<<<<< @@ -16697,23 +17022,23 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec default: break; } - /* "cc3d.pyx":703 + /* "cc3d.pyx":720 * out_dtype = np.uint8 * * if data.size == 0: # <<<<<<<<<<<<<< * return np.zeros(shape=(0,), dtype=out_dtype) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":704 + /* "cc3d.pyx":721 * * if data.size == 0: * return np.zeros(shape=(0,), dtype=out_dtype) # <<<<<<<<<<<<<< @@ -16721,16 +17046,16 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec * data = np.asfortranarray(data) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 704, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 704, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 704, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_tuple_) < 0) __PYX_ERR(0, 721, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 721, __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; @@ -16738,7 +17063,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_6 = 0; goto __pyx_L0; - /* "cc3d.pyx":703 + /* "cc3d.pyx":720 * out_dtype = np.uint8 * * if data.size == 0: # <<<<<<<<<<<<<< @@ -16747,16 +17072,16 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec */ } - /* "cc3d.pyx":706 + /* "cc3d.pyx":723 * return np.zeros(shape=(0,), dtype=out_dtype) * * data = np.asfortranarray(data) # <<<<<<<<<<<<<< * * while len(data.shape) < 3: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -16771,13 +17096,13 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 706, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":708 + /* "cc3d.pyx":725 * data = np.asfortranarray(data) * * while len(data.shape) < 3: # <<<<<<<<<<<<<< @@ -16785,26 +17110,26 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec * */ while (1) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = ((__pyx_t_2 < 3) != 0); if (!__pyx_t_4) break; - /* "cc3d.pyx":709 + /* "cc3d.pyx":726 * * while len(data.shape) < 3: * data = data[..., np.newaxis ] # <<<<<<<<<<<<<< * * shape = list(data.shape) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __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, 709, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(Py_Ellipsis); __Pyx_GIVEREF(Py_Ellipsis); @@ -16812,68 +17137,68 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 1, __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, 709, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __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; } - /* "cc3d.pyx":711 + /* "cc3d.pyx":728 * data = data[..., np.newaxis ] * * shape = list(data.shape) # <<<<<<<<<<<<<< * * cdef int sx = shape[0] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_6 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_shape = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":713 + /* "cc3d.pyx":730 * shape = list(data.shape) * * cdef int sx = shape[0] # <<<<<<<<<<<<<< * cdef int sy = shape[1] * cdef int sz = shape[2] */ - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_sx = __pyx_t_9; - /* "cc3d.pyx":714 + /* "cc3d.pyx":731 * * cdef int sx = shape[0] * cdef int sy = shape[1] # <<<<<<<<<<<<<< * cdef int sz = shape[2] * */ - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_sy = __pyx_t_9; - /* "cc3d.pyx":715 + /* "cc3d.pyx":732 * cdef int sx = shape[0] * cdef int sy = shape[1] * cdef int sz = shape[2] # <<<<<<<<<<<<<< * * cdef uint8_t[:,:,:] arr_memview8u */ - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_sz = __pyx_t_9; - /* "cc3d.pyx":722 + /* "cc3d.pyx":739 * cdef uint64_t[:,:,:] arr_memview64u * * cdef uint64_t voxels = sx * sy * sz # <<<<<<<<<<<<<< @@ -16882,46 +17207,46 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec */ __pyx_v_voxels = ((((uint64_t)__pyx_v_sx) * ((uint64_t)__pyx_v_sy)) * ((uint64_t)__pyx_v_sz)); - /* "cc3d.pyx":723 + /* "cc3d.pyx":740 * * cdef uint64_t voxels = sx * sy * sz * cdef cnp.ndarray[uint8_t, ndim=1] graph8 = np.array([], dtype=np.uint8) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] graph32 = np.array([], dtype=np.uint32) * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 723, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 723, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 723, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 740, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_graph8.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_graph8 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_graph8.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 723, __pyx_L1_error) + __PYX_ERR(0, 740, __pyx_L1_error) } else {__pyx_pybuffernd_graph8.diminfo[0].strides = __pyx_pybuffernd_graph8.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_graph8.diminfo[0].shape = __pyx_pybuffernd_graph8.rcbuffer->pybuffer.shape[0]; } } @@ -16929,46 +17254,46 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_v_graph8 = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "cc3d.pyx":724 + /* "cc3d.pyx":741 * cdef uint64_t voxels = sx * sy * sz * cdef cnp.ndarray[uint8_t, ndim=1] graph8 = np.array([], dtype=np.uint8) * cdef cnp.ndarray[uint32_t, ndim=1] graph32 = np.array([], dtype=np.uint32) # <<<<<<<<<<<<<< * * if out_dtype == np.uint8: */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 741, __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_10); __pyx_t_10 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 724, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 741, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_graph32.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_graph32 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_graph32.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 724, __pyx_L1_error) + __PYX_ERR(0, 741, __pyx_L1_error) } else {__pyx_pybuffernd_graph32.diminfo[0].strides = __pyx_pybuffernd_graph32.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_graph32.diminfo[0].shape = __pyx_pybuffernd_graph32.rcbuffer->pybuffer.shape[0]; } } @@ -16976,58 +17301,58 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_v_graph32 = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "cc3d.pyx":726 + /* "cc3d.pyx":743 * cdef cnp.ndarray[uint32_t, ndim=1] graph32 = np.array([], dtype=np.uint32) * * if out_dtype == np.uint8: # <<<<<<<<<<<<<< * graph8 = np.zeros( (voxels,), dtype=out_dtype, order='F' ) * graph = graph8 */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":727 + /* "cc3d.pyx":744 * * if out_dtype == np.uint8: * graph8 = np.zeros( (voxels,), dtype=out_dtype, order='F' ) # <<<<<<<<<<<<<< * graph = graph8 * elif out_dtype == np.uint32: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 744, __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 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 727, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 727, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 727, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 744, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 727, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 744, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -17044,13 +17369,13 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0; } __pyx_pybuffernd_graph8.diminfo[0].strides = __pyx_pybuffernd_graph8.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_graph8.diminfo[0].shape = __pyx_pybuffernd_graph8.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 744, __pyx_L1_error) } __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_graph8, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "cc3d.pyx":728 + /* "cc3d.pyx":745 * if out_dtype == np.uint8: * graph8 = np.zeros( (voxels,), dtype=out_dtype, order='F' ) * graph = graph8 # <<<<<<<<<<<<<< @@ -17060,7 +17385,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __Pyx_INCREF(((PyObject *)__pyx_v_graph8)); __pyx_v_graph = ((PyObject *)__pyx_v_graph8); - /* "cc3d.pyx":726 + /* "cc3d.pyx":743 * cdef cnp.ndarray[uint32_t, ndim=1] graph32 = np.array([], dtype=np.uint32) * * if out_dtype == np.uint8: # <<<<<<<<<<<<<< @@ -17070,58 +17395,58 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec goto __pyx_L12; } - /* "cc3d.pyx":729 + /* "cc3d.pyx":746 * graph8 = np.zeros( (voxels,), dtype=out_dtype, order='F' ) * graph = graph8 * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * graph32 = np.zeros( (voxels,), dtype=out_dtype, order='F' ) * graph = graph32 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":730 + /* "cc3d.pyx":747 * graph = graph8 * elif out_dtype == np.uint32: * graph32 = np.zeros( (voxels,), dtype=out_dtype, order='F' ) # <<<<<<<<<<<<<< * graph = graph32 * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_uint64_t(__pyx_v_voxels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 730, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 730, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 730, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_v_out_dtype) < 0) __PYX_ERR(0, 747, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 730, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 747, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -17138,13 +17463,13 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0; } __pyx_pybuffernd_graph32.diminfo[0].strides = __pyx_pybuffernd_graph32.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_graph32.diminfo[0].shape = __pyx_pybuffernd_graph32.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 730, __pyx_L1_error) + if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 747, __pyx_L1_error) } __pyx_t_12 = 0; __Pyx_DECREF_SET(__pyx_v_graph32, ((PyArrayObject *)__pyx_t_10)); __pyx_t_10 = 0; - /* "cc3d.pyx":731 + /* "cc3d.pyx":748 * elif out_dtype == np.uint32: * graph32 = np.zeros( (voxels,), dtype=out_dtype, order='F' ) * graph = graph32 # <<<<<<<<<<<<<< @@ -17154,7 +17479,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __Pyx_INCREF(((PyObject *)__pyx_v_graph32)); __pyx_v_graph = ((PyObject *)__pyx_v_graph32); - /* "cc3d.pyx":729 + /* "cc3d.pyx":746 * graph8 = np.zeros( (voxels,), dtype=out_dtype, order='F' ) * graph = graph8 * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< @@ -17164,19 +17489,19 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } __pyx_L12:; - /* "cc3d.pyx":733 + /* "cc3d.pyx":750 * graph = graph32 * * dtype = data.dtype # <<<<<<<<<<<<<< * * if dtype in (np.uint64, np.int64): */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 733, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_v_dtype = __pyx_t_10; __pyx_t_10 = 0; - /* "cc3d.pyx":735 + /* "cc3d.pyx":752 * dtype = data.dtype * * if dtype in (np.uint64, np.int64): # <<<<<<<<<<<<<< @@ -17185,28 +17510,28 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_10 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L14_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __pyx_t_3; __pyx_L14_bool_binop_done:; @@ -17214,18 +17539,18 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "cc3d.pyx":736 + /* "cc3d.pyx":753 * * if dtype in (np.uint64, np.int64): * arr_memview64u = data.view(np.uint64) # <<<<<<<<<<<<<< * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint64_t, uint8_t]( */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -17241,34 +17566,34 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_10 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_arr_memview64u = __pyx_t_16; __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL; - /* "cc3d.pyx":737 + /* "cc3d.pyx":754 * if dtype in (np.uint64, np.int64): * arr_memview64u = data.view(np.uint64) * if out_dtype == np.uint8: # <<<<<<<<<<<<<< * extract_voxel_connectivity_graph[uint64_t, uint8_t]( * &arr_memview64u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 737, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":739 + /* "cc3d.pyx":756 * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint64_t, uint8_t]( * &arr_memview64u[0,0,0], # <<<<<<<<<<<<<< @@ -17293,10 +17618,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_19 >= __pyx_v_arr_memview64u.shape[2])) __pyx_t_9 = 2; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 739, __pyx_L1_error) + __PYX_ERR(0, 756, __pyx_L1_error) } - /* "cc3d.pyx":741 + /* "cc3d.pyx":758 * &arr_memview64u[0,0,0], * sx, sy, sz, connectivity, * &graph8[0] # <<<<<<<<<<<<<< @@ -17311,10 +17636,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_graph8.diminfo[0].shape)) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 741, __pyx_L1_error) + __PYX_ERR(0, 758, __pyx_L1_error) } - /* "cc3d.pyx":738 + /* "cc3d.pyx":755 * arr_memview64u = data.view(np.uint64) * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint64_t, uint8_t]( # <<<<<<<<<<<<<< @@ -17325,10 +17650,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec cc3d::extract_voxel_connectivity_graph((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64u.data + __pyx_t_17 * __pyx_v_arr_memview64u.strides[0]) ) + __pyx_t_18 * __pyx_v_arr_memview64u.strides[1]) ) + __pyx_t_19 * __pyx_v_arr_memview64u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_connectivity, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_graph8.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_graph8.diminfo[0].strides))))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 738, __pyx_L1_error) + __PYX_ERR(0, 755, __pyx_L1_error) } - /* "cc3d.pyx":737 + /* "cc3d.pyx":754 * if dtype in (np.uint64, np.int64): * arr_memview64u = data.view(np.uint64) * if out_dtype == np.uint8: # <<<<<<<<<<<<<< @@ -17338,25 +17663,25 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec goto __pyx_L16; } - /* "cc3d.pyx":743 + /* "cc3d.pyx":760 * &graph8[0] * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * extract_voxel_connectivity_graph[uint64_t, uint32_t]( * &arr_memview64u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":745 + /* "cc3d.pyx":762 * elif out_dtype == np.uint32: * extract_voxel_connectivity_graph[uint64_t, uint32_t]( * &arr_memview64u[0,0,0], # <<<<<<<<<<<<<< @@ -17381,10 +17706,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_18 >= __pyx_v_arr_memview64u.shape[2])) __pyx_t_9 = 2; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 745, __pyx_L1_error) + __PYX_ERR(0, 762, __pyx_L1_error) } - /* "cc3d.pyx":747 + /* "cc3d.pyx":764 * &arr_memview64u[0,0,0], * sx, sy, sz, connectivity, * &graph32[0] # <<<<<<<<<<<<<< @@ -17399,10 +17724,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_graph32.diminfo[0].shape)) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 747, __pyx_L1_error) + __PYX_ERR(0, 764, __pyx_L1_error) } - /* "cc3d.pyx":744 + /* "cc3d.pyx":761 * ) * elif out_dtype == np.uint32: * extract_voxel_connectivity_graph[uint64_t, uint32_t]( # <<<<<<<<<<<<<< @@ -17413,10 +17738,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec cc3d::extract_voxel_connectivity_graph((&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview64u.data + __pyx_t_20 * __pyx_v_arr_memview64u.strides[0]) ) + __pyx_t_19 * __pyx_v_arr_memview64u.strides[1]) ) + __pyx_t_18 * __pyx_v_arr_memview64u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_connectivity, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_graph32.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_graph32.diminfo[0].strides))))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 744, __pyx_L1_error) + __PYX_ERR(0, 761, __pyx_L1_error) } - /* "cc3d.pyx":743 + /* "cc3d.pyx":760 * &graph8[0] * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< @@ -17426,7 +17751,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } __pyx_L16:; - /* "cc3d.pyx":735 + /* "cc3d.pyx":752 * dtype = data.dtype * * if dtype in (np.uint64, np.int64): # <<<<<<<<<<<<<< @@ -17436,7 +17761,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec goto __pyx_L13; } - /* "cc3d.pyx":749 + /* "cc3d.pyx":766 * &graph32[0] * ) * elif dtype in (np.uint32, np.int32): # <<<<<<<<<<<<<< @@ -17445,28 +17770,28 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_10 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L17_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 749, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L17_bool_binop_done:; @@ -17474,18 +17799,18 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "cc3d.pyx":750 + /* "cc3d.pyx":767 * ) * elif dtype in (np.uint32, np.int32): * arr_memview32u = data.view(np.uint32) # <<<<<<<<<<<<<< * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint32_t, uint8_t]( */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __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, 750, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -17501,34 +17826,34 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_10 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __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_10)) __PYX_ERR(0, 750, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_arr_memview32u = __pyx_t_21; __pyx_t_21.memview = NULL; __pyx_t_21.data = NULL; - /* "cc3d.pyx":751 + /* "cc3d.pyx":768 * elif dtype in (np.uint32, np.int32): * arr_memview32u = data.view(np.uint32) * if out_dtype == np.uint8: # <<<<<<<<<<<<<< * extract_voxel_connectivity_graph[uint32_t, uint8_t]( * &arr_memview32u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":753 + /* "cc3d.pyx":770 * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint32_t, uint8_t]( * &arr_memview32u[0,0,0], # <<<<<<<<<<<<<< @@ -17553,10 +17878,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_19 >= __pyx_v_arr_memview32u.shape[2])) __pyx_t_9 = 2; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 753, __pyx_L1_error) + __PYX_ERR(0, 770, __pyx_L1_error) } - /* "cc3d.pyx":755 + /* "cc3d.pyx":772 * &arr_memview32u[0,0,0], * sx, sy, sz, connectivity, * &graph8[0] # <<<<<<<<<<<<<< @@ -17571,10 +17896,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_graph8.diminfo[0].shape)) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 755, __pyx_L1_error) + __PYX_ERR(0, 772, __pyx_L1_error) } - /* "cc3d.pyx":752 + /* "cc3d.pyx":769 * arr_memview32u = data.view(np.uint32) * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint32_t, uint8_t]( # <<<<<<<<<<<<<< @@ -17585,10 +17910,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec cc3d::extract_voxel_connectivity_graph((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32u.data + __pyx_t_17 * __pyx_v_arr_memview32u.strides[0]) ) + __pyx_t_18 * __pyx_v_arr_memview32u.strides[1]) ) + __pyx_t_19 * __pyx_v_arr_memview32u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_connectivity, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_graph8.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_graph8.diminfo[0].strides))))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 752, __pyx_L1_error) + __PYX_ERR(0, 769, __pyx_L1_error) } - /* "cc3d.pyx":751 + /* "cc3d.pyx":768 * elif dtype in (np.uint32, np.int32): * arr_memview32u = data.view(np.uint32) * if out_dtype == np.uint8: # <<<<<<<<<<<<<< @@ -17598,25 +17923,25 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec goto __pyx_L19; } - /* "cc3d.pyx":757 + /* "cc3d.pyx":774 * &graph8[0] * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * extract_voxel_connectivity_graph[uint32_t, uint32_t]( * &arr_memview32u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":759 + /* "cc3d.pyx":776 * elif out_dtype == np.uint32: * extract_voxel_connectivity_graph[uint32_t, uint32_t]( * &arr_memview32u[0,0,0], # <<<<<<<<<<<<<< @@ -17641,10 +17966,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_18 >= __pyx_v_arr_memview32u.shape[2])) __pyx_t_9 = 2; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 759, __pyx_L1_error) + __PYX_ERR(0, 776, __pyx_L1_error) } - /* "cc3d.pyx":761 + /* "cc3d.pyx":778 * &arr_memview32u[0,0,0], * sx, sy, sz, connectivity, * &graph32[0] # <<<<<<<<<<<<<< @@ -17659,10 +17984,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_graph32.diminfo[0].shape)) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 761, __pyx_L1_error) + __PYX_ERR(0, 778, __pyx_L1_error) } - /* "cc3d.pyx":758 + /* "cc3d.pyx":775 * ) * elif out_dtype == np.uint32: * extract_voxel_connectivity_graph[uint32_t, uint32_t]( # <<<<<<<<<<<<<< @@ -17673,10 +17998,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec cc3d::extract_voxel_connectivity_graph((&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview32u.data + __pyx_t_20 * __pyx_v_arr_memview32u.strides[0]) ) + __pyx_t_19 * __pyx_v_arr_memview32u.strides[1]) ) + __pyx_t_18 * __pyx_v_arr_memview32u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_connectivity, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_graph32.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_graph32.diminfo[0].strides))))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 758, __pyx_L1_error) + __PYX_ERR(0, 775, __pyx_L1_error) } - /* "cc3d.pyx":757 + /* "cc3d.pyx":774 * &graph8[0] * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< @@ -17686,7 +18011,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } __pyx_L19:; - /* "cc3d.pyx":749 + /* "cc3d.pyx":766 * &graph32[0] * ) * elif dtype in (np.uint32, np.int32): # <<<<<<<<<<<<<< @@ -17696,7 +18021,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec goto __pyx_L13; } - /* "cc3d.pyx":763 + /* "cc3d.pyx":780 * &graph32[0] * ) * elif dtype in (np.uint16, np.int16): # <<<<<<<<<<<<<< @@ -17705,28 +18030,28 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_10 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L20_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __pyx_t_3; __pyx_L20_bool_binop_done:; @@ -17734,18 +18059,18 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "cc3d.pyx":764 + /* "cc3d.pyx":781 * ) * elif dtype in (np.uint16, np.int16): * arr_memview16u = data.view(np.uint16) # <<<<<<<<<<<<<< * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint16_t, uint8_t]( */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 764, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -17761,34 +18086,34 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_10 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 764, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_arr_memview16u = __pyx_t_22; __pyx_t_22.memview = NULL; __pyx_t_22.data = NULL; - /* "cc3d.pyx":765 + /* "cc3d.pyx":782 * elif dtype in (np.uint16, np.int16): * arr_memview16u = data.view(np.uint16) * if out_dtype == np.uint8: # <<<<<<<<<<<<<< * extract_voxel_connectivity_graph[uint16_t, uint8_t]( * &arr_memview16u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 765, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":767 + /* "cc3d.pyx":784 * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint16_t, uint8_t]( * &arr_memview16u[0,0,0], # <<<<<<<<<<<<<< @@ -17813,10 +18138,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_19 >= __pyx_v_arr_memview16u.shape[2])) __pyx_t_9 = 2; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 767, __pyx_L1_error) + __PYX_ERR(0, 784, __pyx_L1_error) } - /* "cc3d.pyx":769 + /* "cc3d.pyx":786 * &arr_memview16u[0,0,0], * sx, sy, sz, connectivity, * &graph8[0] # <<<<<<<<<<<<<< @@ -17831,10 +18156,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_graph8.diminfo[0].shape)) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 769, __pyx_L1_error) + __PYX_ERR(0, 786, __pyx_L1_error) } - /* "cc3d.pyx":766 + /* "cc3d.pyx":783 * arr_memview16u = data.view(np.uint16) * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint16_t, uint8_t]( # <<<<<<<<<<<<<< @@ -17845,10 +18170,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec cc3d::extract_voxel_connectivity_graph((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16u.data + __pyx_t_17 * __pyx_v_arr_memview16u.strides[0]) ) + __pyx_t_18 * __pyx_v_arr_memview16u.strides[1]) ) + __pyx_t_19 * __pyx_v_arr_memview16u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_connectivity, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_graph8.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_graph8.diminfo[0].strides))))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 766, __pyx_L1_error) + __PYX_ERR(0, 783, __pyx_L1_error) } - /* "cc3d.pyx":765 + /* "cc3d.pyx":782 * elif dtype in (np.uint16, np.int16): * arr_memview16u = data.view(np.uint16) * if out_dtype == np.uint8: # <<<<<<<<<<<<<< @@ -17858,25 +18183,25 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec goto __pyx_L22; } - /* "cc3d.pyx":771 + /* "cc3d.pyx":788 * &graph8[0] * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * extract_voxel_connectivity_graph[uint16_t, uint32_t]( * &arr_memview16u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":773 + /* "cc3d.pyx":790 * elif out_dtype == np.uint32: * extract_voxel_connectivity_graph[uint16_t, uint32_t]( * &arr_memview16u[0,0,0], # <<<<<<<<<<<<<< @@ -17901,10 +18226,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_18 >= __pyx_v_arr_memview16u.shape[2])) __pyx_t_9 = 2; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 773, __pyx_L1_error) + __PYX_ERR(0, 790, __pyx_L1_error) } - /* "cc3d.pyx":775 + /* "cc3d.pyx":792 * &arr_memview16u[0,0,0], * sx, sy, sz, connectivity, * &graph32[0] # <<<<<<<<<<<<<< @@ -17919,10 +18244,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_graph32.diminfo[0].shape)) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 775, __pyx_L1_error) + __PYX_ERR(0, 792, __pyx_L1_error) } - /* "cc3d.pyx":772 + /* "cc3d.pyx":789 * ) * elif out_dtype == np.uint32: * extract_voxel_connectivity_graph[uint16_t, uint32_t]( # <<<<<<<<<<<<<< @@ -17933,10 +18258,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec cc3d::extract_voxel_connectivity_graph((&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview16u.data + __pyx_t_20 * __pyx_v_arr_memview16u.strides[0]) ) + __pyx_t_19 * __pyx_v_arr_memview16u.strides[1]) ) + __pyx_t_18 * __pyx_v_arr_memview16u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_connectivity, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_graph32.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_graph32.diminfo[0].strides))))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 772, __pyx_L1_error) + __PYX_ERR(0, 789, __pyx_L1_error) } - /* "cc3d.pyx":771 + /* "cc3d.pyx":788 * &graph8[0] * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< @@ -17946,7 +18271,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } __pyx_L22:; - /* "cc3d.pyx":763 + /* "cc3d.pyx":780 * &graph32[0] * ) * elif dtype in (np.uint16, np.int16): # <<<<<<<<<<<<<< @@ -17956,7 +18281,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec goto __pyx_L13; } - /* "cc3d.pyx":777 + /* "cc3d.pyx":794 * &graph32[0] * ) * elif dtype in (np.uint8, np.int8, bool): # <<<<<<<<<<<<<< @@ -17965,36 +18290,36 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_10 = __pyx_v_dtype; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L23_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L23_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 794, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L23_bool_binop_done:; @@ -18002,18 +18327,18 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_4 = (__pyx_t_3 != 0); if (likely(__pyx_t_4)) { - /* "cc3d.pyx":778 + /* "cc3d.pyx":795 * ) * elif dtype in (np.uint8, np.int8, bool): * arr_memview8u = data.view(np.uint8) # <<<<<<<<<<<<<< * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint8_t, uint8_t]( */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -18029,34 +18354,34 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_10 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __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_10)) __PYX_ERR(0, 778, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_arr_memview8u = __pyx_t_23; __pyx_t_23.memview = NULL; __pyx_t_23.data = NULL; - /* "cc3d.pyx":779 + /* "cc3d.pyx":796 * elif dtype in (np.uint8, np.int8, bool): * arr_memview8u = data.view(np.uint8) * if out_dtype == np.uint8: # <<<<<<<<<<<<<< * extract_voxel_connectivity_graph[uint8_t, uint8_t]( * &arr_memview8u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":781 + /* "cc3d.pyx":798 * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint8_t, uint8_t]( * &arr_memview8u[0,0,0], # <<<<<<<<<<<<<< @@ -18081,10 +18406,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_19 >= __pyx_v_arr_memview8u.shape[2])) __pyx_t_9 = 2; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 781, __pyx_L1_error) + __PYX_ERR(0, 798, __pyx_L1_error) } - /* "cc3d.pyx":783 + /* "cc3d.pyx":800 * &arr_memview8u[0,0,0], * sx, sy, sz, connectivity, * &graph8[0] # <<<<<<<<<<<<<< @@ -18099,10 +18424,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_graph8.diminfo[0].shape)) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 783, __pyx_L1_error) + __PYX_ERR(0, 800, __pyx_L1_error) } - /* "cc3d.pyx":780 + /* "cc3d.pyx":797 * arr_memview8u = data.view(np.uint8) * if out_dtype == np.uint8: * extract_voxel_connectivity_graph[uint8_t, uint8_t]( # <<<<<<<<<<<<<< @@ -18113,10 +18438,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec cc3d::extract_voxel_connectivity_graph((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8u.data + __pyx_t_17 * __pyx_v_arr_memview8u.strides[0]) ) + __pyx_t_18 * __pyx_v_arr_memview8u.strides[1]) ) + __pyx_t_19 * __pyx_v_arr_memview8u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_connectivity, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_graph8.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_graph8.diminfo[0].strides))))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 780, __pyx_L1_error) + __PYX_ERR(0, 797, __pyx_L1_error) } - /* "cc3d.pyx":779 + /* "cc3d.pyx":796 * elif dtype in (np.uint8, np.int8, bool): * arr_memview8u = data.view(np.uint8) * if out_dtype == np.uint8: # <<<<<<<<<<<<<< @@ -18126,25 +18451,25 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec goto __pyx_L26; } - /* "cc3d.pyx":785 + /* "cc3d.pyx":802 * &graph8[0] * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< * extract_voxel_connectivity_graph[uint8_t, uint32_t]( * &arr_memview8u[0,0,0], */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_out_dtype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - /* "cc3d.pyx":787 + /* "cc3d.pyx":804 * elif out_dtype == np.uint32: * extract_voxel_connectivity_graph[uint8_t, uint32_t]( * &arr_memview8u[0,0,0], # <<<<<<<<<<<<<< @@ -18169,10 +18494,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_18 >= __pyx_v_arr_memview8u.shape[2])) __pyx_t_9 = 2; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 787, __pyx_L1_error) + __PYX_ERR(0, 804, __pyx_L1_error) } - /* "cc3d.pyx":789 + /* "cc3d.pyx":806 * &arr_memview8u[0,0,0], * sx, sy, sz, connectivity, * &graph32[0] # <<<<<<<<<<<<<< @@ -18187,10 +18512,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_graph32.diminfo[0].shape)) __pyx_t_9 = 0; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_9); - __PYX_ERR(0, 789, __pyx_L1_error) + __PYX_ERR(0, 806, __pyx_L1_error) } - /* "cc3d.pyx":786 + /* "cc3d.pyx":803 * ) * elif out_dtype == np.uint32: * extract_voxel_connectivity_graph[uint8_t, uint32_t]( # <<<<<<<<<<<<<< @@ -18201,10 +18526,10 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec cc3d::extract_voxel_connectivity_graph((&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_memview8u.data + __pyx_t_20 * __pyx_v_arr_memview8u.strides[0]) ) + __pyx_t_19 * __pyx_v_arr_memview8u.strides[1]) ) + __pyx_t_18 * __pyx_v_arr_memview8u.strides[2]) )))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_connectivity, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_graph32.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_graph32.diminfo[0].strides))))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 786, __pyx_L1_error) + __PYX_ERR(0, 803, __pyx_L1_error) } - /* "cc3d.pyx":785 + /* "cc3d.pyx":802 * &graph8[0] * ) * elif out_dtype == np.uint32: # <<<<<<<<<<<<<< @@ -18214,7 +18539,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } __pyx_L26:; - /* "cc3d.pyx":777 + /* "cc3d.pyx":794 * &graph32[0] * ) * elif dtype in (np.uint8, np.int8, bool): # <<<<<<<<<<<<<< @@ -18224,7 +18549,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec goto __pyx_L13; } - /* "cc3d.pyx":792 + /* "cc3d.pyx":809 * ) * else: * raise TypeError("Type {} not currently supported.".format(dtype)) # <<<<<<<<<<<<<< @@ -18232,7 +18557,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec * if dims == 3: */ /*else*/ { - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_not_currently_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { @@ -18246,19 +18571,19 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec } __pyx_t_10 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 792, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 792, __pyx_L1_error) + __PYX_ERR(0, 809, __pyx_L1_error) } __pyx_L13:; - /* "cc3d.pyx":794 + /* "cc3d.pyx":811 * raise TypeError("Type {} not currently supported.".format(dtype)) * * if dims == 3: # <<<<<<<<<<<<<< @@ -18268,7 +18593,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec switch (__pyx_v_dims) { case 3: - /* "cc3d.pyx":795 + /* "cc3d.pyx":812 * * if dims == 3: * return graph.reshape( (sx, sy, sz), order='F') # <<<<<<<<<<<<<< @@ -18276,16 +18601,16 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec * return graph.reshape( (sx, sy), order='F') */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_graph)) { __Pyx_RaiseUnboundLocalError("graph"); __PYX_ERR(0, 795, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_reshape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error) + if (unlikely(!__pyx_v_graph)) { __Pyx_RaiseUnboundLocalError("graph"); __PYX_ERR(0, 812, __pyx_L1_error) } + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_reshape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_sx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_sx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_sy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_sy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_sz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_sz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); @@ -18296,15 +18621,15 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_10 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __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, 795, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -18313,7 +18638,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_6 = 0; goto __pyx_L0; - /* "cc3d.pyx":794 + /* "cc3d.pyx":811 * raise TypeError("Type {} not currently supported.".format(dtype)) * * if dims == 3: # <<<<<<<<<<<<<< @@ -18323,7 +18648,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec break; case 2: - /* "cc3d.pyx":797 + /* "cc3d.pyx":814 * return graph.reshape( (sx, sy, sz), order='F') * elif dims == 2: * return graph.reshape( (sx, sy), order='F') # <<<<<<<<<<<<<< @@ -18331,14 +18656,14 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec * return graph.reshape( (sx), order='F') */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_graph)) { __Pyx_RaiseUnboundLocalError("graph"); __PYX_ERR(0, 797, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 797, __pyx_L1_error) + if (unlikely(!__pyx_v_graph)) { __Pyx_RaiseUnboundLocalError("graph"); __PYX_ERR(0, 814, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_sy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 797, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_sy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 797, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -18346,15 +18671,15 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 797, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 814, __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, 797, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 797, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -18363,7 +18688,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":796 + /* "cc3d.pyx":813 * if dims == 3: * return graph.reshape( (sx, sy, sz), order='F') * elif dims == 2: # <<<<<<<<<<<<<< @@ -18373,7 +18698,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec break; default: - /* "cc3d.pyx":799 + /* "cc3d.pyx":816 * return graph.reshape( (sx, sy), order='F') * else: * return graph.reshape( (sx), order='F') # <<<<<<<<<<<<<< @@ -18381,20 +18706,20 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec * def region_graph( */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_graph)) { __Pyx_RaiseUnboundLocalError("graph"); __PYX_ERR(0, 799, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error) + if (unlikely(!__pyx_v_graph)) { __Pyx_RaiseUnboundLocalError("graph"); __PYX_ERR(0, 816, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_sx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 799, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_sx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 799, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __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, 799, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 799, __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, 799, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 816, __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, 816, __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; @@ -18405,7 +18730,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec break; } - /* "cc3d.pyx":646 + /* "cc3d.pyx":663 * } * * def voxel_connectivity_graph(data, int64_t connectivity=26): # <<<<<<<<<<<<<< @@ -18454,7 +18779,7 @@ static PyObject *__pyx_pf_4cc3d_12voxel_connectivity_graph(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "cc3d.pyx":801 +/* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< @@ -18480,7 +18805,7 @@ static PyObject *__pyx_pw_4cc3d_15region_graph(PyObject *__pyx_self, PyObject *_ { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0}; PyObject* values[4] = {0,0,0,0}; - values[1] = __pyx_k__8; + values[1] = __pyx_k__9; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); @@ -18511,17 +18836,17 @@ static PyObject *__pyx_pw_4cc3d_15region_graph(PyObject *__pyx_self, PyObject *_ 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, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 818, __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, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 818, __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, 801, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -18538,7 +18863,7 @@ static PyObject *__pyx_pw_4cc3d_15region_graph(PyObject *__pyx_self, PyObject *_ } 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, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18600,7 +18925,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("region_graph", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -18614,7 +18939,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -18622,7 +18947,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -18637,16 +18962,16 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v____pyx_int64_t_is_signed = (!((((int64_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, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __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, 801, __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, 818, __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, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __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, 801, __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, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -18661,18 +18986,18 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -18681,31 +19006,31 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __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, 818, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_1); - __Pyx_INCREF(__pyx_kp_s__3); - __Pyx_GIVEREF(__pyx_kp_s__3); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s__3); + __Pyx_INCREF(__pyx_kp_s__4); + __Pyx_GIVEREF(__pyx_kp_s__4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s__4); __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, 801, __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, 818, __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -18715,7 +19040,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -18724,14 +19049,14 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -18753,14 +19078,14 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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'); @@ -18773,9 +19098,9 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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) { @@ -18787,7 +19112,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __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, 818, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -18796,9 +19121,9 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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) { @@ -18810,7 +19135,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __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, 818, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -18819,9 +19144,9 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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) { @@ -18833,7 +19158,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __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, 818, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -18842,9 +19167,9 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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) { @@ -18856,7 +19181,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __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, 818, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -18865,9 +19190,9 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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) { @@ -18879,7 +19204,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 818, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -18888,9 +19213,9 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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) { @@ -18902,7 +19227,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 818, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -18911,9 +19236,9 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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) { @@ -18925,7 +19250,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 818, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -18934,9 +19259,9 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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) { @@ -18948,7 +19273,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 818, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -18977,7 +19302,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __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, 818, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -18999,7 +19324,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __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, 818, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -19021,7 +19346,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __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, 818, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -19043,7 +19368,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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, 801, __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, 818, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -19065,7 +19390,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 818, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -19087,7 +19412,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 818, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -19109,7 +19434,7 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 818, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -19131,27 +19456,27 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 818, __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, 801, __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, 818, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __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, 801, __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, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -19159,12 +19484,12 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel 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, 801, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -19176,12 +19501,12 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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__5) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__5); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -19194,29 +19519,29 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __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__6) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __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, 801, __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, 818, __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, 801, __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, 818, __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, 801, __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, 818, __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, 801, __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, 818, __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, 801, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -19232,37 +19557,37 @@ static PyObject *__pyx_pf_4cc3d_14region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L82_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, 801, __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, 818, __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __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, 801, __pyx_L1_error) + __PYX_ERR(0, 818, __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, 801, __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, 818, __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, 801, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_13; @@ -19305,14 +19630,14 @@ static PyObject *__pyx_pf_4cc3d_96__defaults__(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -19376,7 +19701,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_4cc3d_43region_graph(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 801, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -19389,20 +19714,20 @@ static PyObject *__pyx_fuse_0__pyx_pw_4cc3d_43region_graph(PyObject *__pyx_self, } __pyx_v_labels = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) } else { __pyx_v_connectivity = __pyx_dynamic_args->__pyx_arg_connectivity; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.region_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 819, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_42region_graph(__pyx_self, __pyx_v_labels, __pyx_v_connectivity); /* function exit code */ @@ -19451,11 +19776,11 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 818, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -19475,29 +19800,29 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_2 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_2)) { - /* "cc3d.pyx":816 + /* "cc3d.pyx":833 * """ * if connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * labels = np.asfortranarray(labels) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -19506,16 +19831,16 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "cc3d.pyx":818 + /* "cc3d.pyx":835 * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) * * labels = np.asfortranarray(labels) # <<<<<<<<<<<<<< * * cdef vector[INTEGER] res = extract_region_graph( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -19530,10 +19855,10 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 818, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -19550,13 +19875,13 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "cc3d.pyx":821 + /* "cc3d.pyx":838 * * cdef vector[INTEGER] res = extract_region_graph( * &labels[0,0,0], # <<<<<<<<<<<<<< @@ -19581,10 +19906,10 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 821, __pyx_L1_error) + __PYX_ERR(0, 838, __pyx_L1_error) } - /* "cc3d.pyx":820 + /* "cc3d.pyx":837 * labels = np.asfortranarray(labels) * * cdef vector[INTEGER] res = extract_region_graph( # <<<<<<<<<<<<<< @@ -19595,23 +19920,23 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_14 = cc3d::extract_region_graph(((uint8_t *)(&(*__Pyx_BufPtrStrided3d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[2].strides)))), (__pyx_v_labels->dimensions[0]), (__pyx_v_labels->dimensions[1]), (__pyx_v_labels->dimensions[2]), __pyx_v_connectivity); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) } __pyx_v_res = ((std::vector )__pyx_t_14); - /* "cc3d.pyx":826 + /* "cc3d.pyx":843 * ) * * output = set() # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_output = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":827 + /* "cc3d.pyx":844 * * output = set() * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -19620,7 +19945,7 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "cc3d.pyx":829 + /* "cc3d.pyx":846 * cdef size_t i = 0 * * for i in range(res.size() // 2): # <<<<<<<<<<<<<< @@ -19632,18 +19957,18 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "cc3d.pyx":831 + /* "cc3d.pyx":848 * for i in range(res.size() // 2): * output.add( * (res[i * 2], res[i*2 + 1]) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyInt_From_uint8_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint8_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -19652,18 +19977,18 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "cc3d.pyx":830 + /* "cc3d.pyx":847 * * for i in range(res.size() // 2): * output.add( # <<<<<<<<<<<<<< * (res[i * 2], res[i*2 + 1]) * ) */ - __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "cc3d.pyx":834 + /* "cc3d.pyx":851 * ) * * return output # <<<<<<<<<<<<<< @@ -19675,7 +20000,7 @@ static PyObject *__pyx_pf_4cc3d_42region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< @@ -19717,14 +20042,14 @@ static PyObject *__pyx_pf_4cc3d_98__defaults__(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -19788,7 +20113,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_4cc3d_45region_graph(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 801, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -19801,20 +20126,20 @@ static PyObject *__pyx_fuse_1__pyx_pw_4cc3d_45region_graph(PyObject *__pyx_self, } __pyx_v_labels = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) } else { __pyx_v_connectivity = __pyx_dynamic_args->__pyx_arg_connectivity; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.region_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 819, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_44region_graph(__pyx_self, __pyx_v_labels, __pyx_v_connectivity); /* function exit code */ @@ -19863,11 +20188,11 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 818, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -19887,29 +20212,29 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_2 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_2)) { - /* "cc3d.pyx":816 + /* "cc3d.pyx":833 * """ * if connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * labels = np.asfortranarray(labels) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -19918,16 +20243,16 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "cc3d.pyx":818 + /* "cc3d.pyx":835 * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) * * labels = np.asfortranarray(labels) # <<<<<<<<<<<<<< * * cdef vector[INTEGER] res = extract_region_graph( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -19942,10 +20267,10 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 818, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -19962,13 +20287,13 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "cc3d.pyx":821 + /* "cc3d.pyx":838 * * cdef vector[INTEGER] res = extract_region_graph( * &labels[0,0,0], # <<<<<<<<<<<<<< @@ -19993,10 +20318,10 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 821, __pyx_L1_error) + __PYX_ERR(0, 838, __pyx_L1_error) } - /* "cc3d.pyx":820 + /* "cc3d.pyx":837 * labels = np.asfortranarray(labels) * * cdef vector[INTEGER] res = extract_region_graph( # <<<<<<<<<<<<<< @@ -20007,23 +20332,23 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_14 = cc3d::extract_region_graph(((uint16_t *)(&(*__Pyx_BufPtrStrided3d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[2].strides)))), (__pyx_v_labels->dimensions[0]), (__pyx_v_labels->dimensions[1]), (__pyx_v_labels->dimensions[2]), __pyx_v_connectivity); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) } __pyx_v_res = ((std::vector )__pyx_t_14); - /* "cc3d.pyx":826 + /* "cc3d.pyx":843 * ) * * output = set() # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_output = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":827 + /* "cc3d.pyx":844 * * output = set() * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -20032,7 +20357,7 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "cc3d.pyx":829 + /* "cc3d.pyx":846 * cdef size_t i = 0 * * for i in range(res.size() // 2): # <<<<<<<<<<<<<< @@ -20044,18 +20369,18 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "cc3d.pyx":831 + /* "cc3d.pyx":848 * for i in range(res.size() // 2): * output.add( * (res[i * 2], res[i*2 + 1]) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyInt_From_uint16_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint16_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -20064,18 +20389,18 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "cc3d.pyx":830 + /* "cc3d.pyx":847 * * for i in range(res.size() // 2): * output.add( # <<<<<<<<<<<<<< * (res[i * 2], res[i*2 + 1]) * ) */ - __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "cc3d.pyx":834 + /* "cc3d.pyx":851 * ) * * return output # <<<<<<<<<<<<<< @@ -20087,7 +20412,7 @@ static PyObject *__pyx_pf_4cc3d_44region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< @@ -20129,14 +20454,14 @@ static PyObject *__pyx_pf_4cc3d_100__defaults__(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -20200,7 +20525,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_4cc3d_47region_graph(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 801, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -20213,20 +20538,20 @@ static PyObject *__pyx_fuse_2__pyx_pw_4cc3d_47region_graph(PyObject *__pyx_self, } __pyx_v_labels = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) } else { __pyx_v_connectivity = __pyx_dynamic_args->__pyx_arg_connectivity; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.region_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 819, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_46region_graph(__pyx_self, __pyx_v_labels, __pyx_v_connectivity); /* function exit code */ @@ -20275,11 +20600,11 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 818, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -20299,29 +20624,29 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_2 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_2)) { - /* "cc3d.pyx":816 + /* "cc3d.pyx":833 * """ * if connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * labels = np.asfortranarray(labels) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -20330,16 +20655,16 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "cc3d.pyx":818 + /* "cc3d.pyx":835 * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) * * labels = np.asfortranarray(labels) # <<<<<<<<<<<<<< * * cdef vector[INTEGER] res = extract_region_graph( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -20354,10 +20679,10 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 818, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20374,13 +20699,13 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "cc3d.pyx":821 + /* "cc3d.pyx":838 * * cdef vector[INTEGER] res = extract_region_graph( * &labels[0,0,0], # <<<<<<<<<<<<<< @@ -20405,10 +20730,10 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 821, __pyx_L1_error) + __PYX_ERR(0, 838, __pyx_L1_error) } - /* "cc3d.pyx":820 + /* "cc3d.pyx":837 * labels = np.asfortranarray(labels) * * cdef vector[INTEGER] res = extract_region_graph( # <<<<<<<<<<<<<< @@ -20419,23 +20744,23 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_14 = cc3d::extract_region_graph(((uint32_t *)(&(*__Pyx_BufPtrStrided3d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[2].strides)))), (__pyx_v_labels->dimensions[0]), (__pyx_v_labels->dimensions[1]), (__pyx_v_labels->dimensions[2]), __pyx_v_connectivity); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) } __pyx_v_res = ((std::vector )__pyx_t_14); - /* "cc3d.pyx":826 + /* "cc3d.pyx":843 * ) * * output = set() # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_output = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":827 + /* "cc3d.pyx":844 * * output = set() * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -20444,7 +20769,7 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "cc3d.pyx":829 + /* "cc3d.pyx":846 * cdef size_t i = 0 * * for i in range(res.size() // 2): # <<<<<<<<<<<<<< @@ -20456,18 +20781,18 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "cc3d.pyx":831 + /* "cc3d.pyx":848 * for i in range(res.size() // 2): * output.add( * (res[i * 2], res[i*2 + 1]) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyInt_From_uint32_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint32_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -20476,18 +20801,18 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "cc3d.pyx":830 + /* "cc3d.pyx":847 * * for i in range(res.size() // 2): * output.add( # <<<<<<<<<<<<<< * (res[i * 2], res[i*2 + 1]) * ) */ - __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "cc3d.pyx":834 + /* "cc3d.pyx":851 * ) * * return output # <<<<<<<<<<<<<< @@ -20499,7 +20824,7 @@ static PyObject *__pyx_pf_4cc3d_46region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< @@ -20541,14 +20866,14 @@ static PyObject *__pyx_pf_4cc3d_102__defaults__(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -20612,7 +20937,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_4cc3d_49region_graph(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 801, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -20625,20 +20950,20 @@ static PyObject *__pyx_fuse_3__pyx_pw_4cc3d_49region_graph(PyObject *__pyx_self, } __pyx_v_labels = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) } else { __pyx_v_connectivity = __pyx_dynamic_args->__pyx_arg_connectivity; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.region_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 819, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_48region_graph(__pyx_self, __pyx_v_labels, __pyx_v_connectivity); /* function exit code */ @@ -20687,11 +21012,11 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 818, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -20711,29 +21036,29 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_2 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_2)) { - /* "cc3d.pyx":816 + /* "cc3d.pyx":833 * """ * if connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * labels = np.asfortranarray(labels) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -20742,16 +21067,16 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "cc3d.pyx":818 + /* "cc3d.pyx":835 * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) * * labels = np.asfortranarray(labels) # <<<<<<<<<<<<<< * * cdef vector[INTEGER] res = extract_region_graph( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -20766,10 +21091,10 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 818, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20786,13 +21111,13 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "cc3d.pyx":821 + /* "cc3d.pyx":838 * * cdef vector[INTEGER] res = extract_region_graph( * &labels[0,0,0], # <<<<<<<<<<<<<< @@ -20817,10 +21142,10 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 821, __pyx_L1_error) + __PYX_ERR(0, 838, __pyx_L1_error) } - /* "cc3d.pyx":820 + /* "cc3d.pyx":837 * labels = np.asfortranarray(labels) * * cdef vector[INTEGER] res = extract_region_graph( # <<<<<<<<<<<<<< @@ -20831,23 +21156,23 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_14 = cc3d::extract_region_graph(((uint64_t *)(&(*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[2].strides)))), (__pyx_v_labels->dimensions[0]), (__pyx_v_labels->dimensions[1]), (__pyx_v_labels->dimensions[2]), __pyx_v_connectivity); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) } __pyx_v_res = ((std::vector )__pyx_t_14); - /* "cc3d.pyx":826 + /* "cc3d.pyx":843 * ) * * output = set() # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_output = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":827 + /* "cc3d.pyx":844 * * output = set() * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -20856,7 +21181,7 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "cc3d.pyx":829 + /* "cc3d.pyx":846 * cdef size_t i = 0 * * for i in range(res.size() // 2): # <<<<<<<<<<<<<< @@ -20868,18 +21193,18 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "cc3d.pyx":831 + /* "cc3d.pyx":848 * for i in range(res.size() // 2): * output.add( * (res[i * 2], res[i*2 + 1]) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -20888,18 +21213,18 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "cc3d.pyx":830 + /* "cc3d.pyx":847 * * for i in range(res.size() // 2): * output.add( # <<<<<<<<<<<<<< * (res[i * 2], res[i*2 + 1]) * ) */ - __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "cc3d.pyx":834 + /* "cc3d.pyx":851 * ) * * return output # <<<<<<<<<<<<<< @@ -20911,7 +21236,7 @@ static PyObject *__pyx_pf_4cc3d_48region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< @@ -20953,14 +21278,14 @@ static PyObject *__pyx_pf_4cc3d_104__defaults__(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -21024,7 +21349,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_4cc3d_51region_graph(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 801, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -21037,20 +21362,20 @@ static PyObject *__pyx_fuse_4__pyx_pw_4cc3d_51region_graph(PyObject *__pyx_self, } __pyx_v_labels = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) } else { __pyx_v_connectivity = __pyx_dynamic_args->__pyx_arg_connectivity; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.region_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 819, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_50region_graph(__pyx_self, __pyx_v_labels, __pyx_v_connectivity); /* function exit code */ @@ -21099,11 +21424,11 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 818, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -21123,29 +21448,29 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_2 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_2)) { - /* "cc3d.pyx":816 + /* "cc3d.pyx":833 * """ * if connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * labels = np.asfortranarray(labels) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -21154,16 +21479,16 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "cc3d.pyx":818 + /* "cc3d.pyx":835 * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) * * labels = np.asfortranarray(labels) # <<<<<<<<<<<<<< * * cdef vector[INTEGER] res = extract_region_graph( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -21178,10 +21503,10 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 818, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -21198,13 +21523,13 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "cc3d.pyx":821 + /* "cc3d.pyx":838 * * cdef vector[INTEGER] res = extract_region_graph( * &labels[0,0,0], # <<<<<<<<<<<<<< @@ -21229,10 +21554,10 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 821, __pyx_L1_error) + __PYX_ERR(0, 838, __pyx_L1_error) } - /* "cc3d.pyx":820 + /* "cc3d.pyx":837 * labels = np.asfortranarray(labels) * * cdef vector[INTEGER] res = extract_region_graph( # <<<<<<<<<<<<<< @@ -21243,23 +21568,23 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_14 = cc3d::extract_region_graph(((int8_t *)(&(*__Pyx_BufPtrStrided3d(int8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[2].strides)))), (__pyx_v_labels->dimensions[0]), (__pyx_v_labels->dimensions[1]), (__pyx_v_labels->dimensions[2]), __pyx_v_connectivity); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) } __pyx_v_res = ((std::vector )__pyx_t_14); - /* "cc3d.pyx":826 + /* "cc3d.pyx":843 * ) * * output = set() # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_output = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":827 + /* "cc3d.pyx":844 * * output = set() * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -21268,7 +21593,7 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "cc3d.pyx":829 + /* "cc3d.pyx":846 * cdef size_t i = 0 * * for i in range(res.size() // 2): # <<<<<<<<<<<<<< @@ -21280,18 +21605,18 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "cc3d.pyx":831 + /* "cc3d.pyx":848 * for i in range(res.size() // 2): * output.add( * (res[i * 2], res[i*2 + 1]) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyInt_From_int8_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int8_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int8_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -21300,18 +21625,18 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "cc3d.pyx":830 + /* "cc3d.pyx":847 * * for i in range(res.size() // 2): * output.add( # <<<<<<<<<<<<<< * (res[i * 2], res[i*2 + 1]) * ) */ - __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "cc3d.pyx":834 + /* "cc3d.pyx":851 * ) * * return output # <<<<<<<<<<<<<< @@ -21323,7 +21648,7 @@ static PyObject *__pyx_pf_4cc3d_50region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< @@ -21365,14 +21690,14 @@ static PyObject *__pyx_pf_4cc3d_106__defaults__(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -21436,7 +21761,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_4cc3d_53region_graph(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 801, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -21449,20 +21774,20 @@ static PyObject *__pyx_fuse_5__pyx_pw_4cc3d_53region_graph(PyObject *__pyx_self, } __pyx_v_labels = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) } else { __pyx_v_connectivity = __pyx_dynamic_args->__pyx_arg_connectivity; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.region_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 819, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_52region_graph(__pyx_self, __pyx_v_labels, __pyx_v_connectivity); /* function exit code */ @@ -21511,11 +21836,11 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 818, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -21535,29 +21860,29 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_2 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_2)) { - /* "cc3d.pyx":816 + /* "cc3d.pyx":833 * """ * if connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * labels = np.asfortranarray(labels) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -21566,16 +21891,16 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "cc3d.pyx":818 + /* "cc3d.pyx":835 * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) * * labels = np.asfortranarray(labels) # <<<<<<<<<<<<<< * * cdef vector[INTEGER] res = extract_region_graph( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -21590,10 +21915,10 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 818, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -21610,13 +21935,13 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "cc3d.pyx":821 + /* "cc3d.pyx":838 * * cdef vector[INTEGER] res = extract_region_graph( * &labels[0,0,0], # <<<<<<<<<<<<<< @@ -21641,10 +21966,10 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 821, __pyx_L1_error) + __PYX_ERR(0, 838, __pyx_L1_error) } - /* "cc3d.pyx":820 + /* "cc3d.pyx":837 * labels = np.asfortranarray(labels) * * cdef vector[INTEGER] res = extract_region_graph( # <<<<<<<<<<<<<< @@ -21655,23 +21980,23 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_14 = cc3d::extract_region_graph(((int16_t *)(&(*__Pyx_BufPtrStrided3d(int16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[2].strides)))), (__pyx_v_labels->dimensions[0]), (__pyx_v_labels->dimensions[1]), (__pyx_v_labels->dimensions[2]), __pyx_v_connectivity); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) } __pyx_v_res = ((std::vector )__pyx_t_14); - /* "cc3d.pyx":826 + /* "cc3d.pyx":843 * ) * * output = set() # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_output = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":827 + /* "cc3d.pyx":844 * * output = set() * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -21680,7 +22005,7 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "cc3d.pyx":829 + /* "cc3d.pyx":846 * cdef size_t i = 0 * * for i in range(res.size() // 2): # <<<<<<<<<<<<<< @@ -21692,18 +22017,18 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "cc3d.pyx":831 + /* "cc3d.pyx":848 * for i in range(res.size() // 2): * output.add( * (res[i * 2], res[i*2 + 1]) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyInt_From_int16_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int16_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int16_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -21712,18 +22037,18 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "cc3d.pyx":830 + /* "cc3d.pyx":847 * * for i in range(res.size() // 2): * output.add( # <<<<<<<<<<<<<< * (res[i * 2], res[i*2 + 1]) * ) */ - __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "cc3d.pyx":834 + /* "cc3d.pyx":851 * ) * * return output # <<<<<<<<<<<<<< @@ -21735,7 +22060,7 @@ static PyObject *__pyx_pf_4cc3d_52region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< @@ -21777,14 +22102,14 @@ static PyObject *__pyx_pf_4cc3d_108__defaults__(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -21848,7 +22173,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_4cc3d_55region_graph(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 801, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -21861,20 +22186,20 @@ static PyObject *__pyx_fuse_6__pyx_pw_4cc3d_55region_graph(PyObject *__pyx_self, } __pyx_v_labels = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) } else { __pyx_v_connectivity = __pyx_dynamic_args->__pyx_arg_connectivity; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.region_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 819, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_54region_graph(__pyx_self, __pyx_v_labels, __pyx_v_connectivity); /* function exit code */ @@ -21923,11 +22248,11 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 818, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -21947,29 +22272,29 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_2 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_2)) { - /* "cc3d.pyx":816 + /* "cc3d.pyx":833 * """ * if connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * labels = np.asfortranarray(labels) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -21978,16 +22303,16 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "cc3d.pyx":818 + /* "cc3d.pyx":835 * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) * * labels = np.asfortranarray(labels) # <<<<<<<<<<<<<< * * cdef vector[INTEGER] res = extract_region_graph( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -22002,10 +22327,10 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 818, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -22022,13 +22347,13 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "cc3d.pyx":821 + /* "cc3d.pyx":838 * * cdef vector[INTEGER] res = extract_region_graph( * &labels[0,0,0], # <<<<<<<<<<<<<< @@ -22053,10 +22378,10 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 821, __pyx_L1_error) + __PYX_ERR(0, 838, __pyx_L1_error) } - /* "cc3d.pyx":820 + /* "cc3d.pyx":837 * labels = np.asfortranarray(labels) * * cdef vector[INTEGER] res = extract_region_graph( # <<<<<<<<<<<<<< @@ -22067,23 +22392,23 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_14 = cc3d::extract_region_graph(((int32_t *)(&(*__Pyx_BufPtrStrided3d(int32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[2].strides)))), (__pyx_v_labels->dimensions[0]), (__pyx_v_labels->dimensions[1]), (__pyx_v_labels->dimensions[2]), __pyx_v_connectivity); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) } __pyx_v_res = ((std::vector )__pyx_t_14); - /* "cc3d.pyx":826 + /* "cc3d.pyx":843 * ) * * output = set() # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_output = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":827 + /* "cc3d.pyx":844 * * output = set() * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -22092,7 +22417,7 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "cc3d.pyx":829 + /* "cc3d.pyx":846 * cdef size_t i = 0 * * for i in range(res.size() // 2): # <<<<<<<<<<<<<< @@ -22104,18 +22429,18 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "cc3d.pyx":831 + /* "cc3d.pyx":848 * for i in range(res.size() // 2): * output.add( * (res[i * 2], res[i*2 + 1]) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyInt_From_int32_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int32_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int32_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -22124,18 +22449,18 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "cc3d.pyx":830 + /* "cc3d.pyx":847 * * for i in range(res.size() // 2): * output.add( # <<<<<<<<<<<<<< * (res[i * 2], res[i*2 + 1]) * ) */ - __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "cc3d.pyx":834 + /* "cc3d.pyx":851 * ) * * return output # <<<<<<<<<<<<<< @@ -22147,7 +22472,7 @@ static PyObject *__pyx_pf_4cc3d_54region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< @@ -22189,14 +22514,14 @@ static PyObject *__pyx_pf_4cc3d_110__defaults__(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_connectivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -22260,7 +22585,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_4cc3d_57region_graph(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 801, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "region_graph") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -22273,20 +22598,20 @@ static PyObject *__pyx_fuse_7__pyx_pw_4cc3d_57region_graph(PyObject *__pyx_self, } __pyx_v_labels = ((PyArrayObject *)values[0]); if (values[1]) { - __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L3_error) + __pyx_v_connectivity = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_connectivity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) } else { __pyx_v_connectivity = __pyx_dynamic_args->__pyx_arg_connectivity; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("region_graph", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.region_graph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 819, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_56region_graph(__pyx_self, __pyx_v_labels, __pyx_v_connectivity); /* function exit code */ @@ -22335,11 +22660,11 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 818, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -22359,29 +22684,29 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_2 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_2)) { - /* "cc3d.pyx":816 + /* "cc3d.pyx":833 * """ * if connectivity not in (6, 18, 26): * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) # <<<<<<<<<<<<<< * * labels = np.asfortranarray(labels) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_connectivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Only_6_18_and_26_connectivities_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) - /* "cc3d.pyx":815 + /* "cc3d.pyx":832 * Returns: set of edges between labels * """ * if connectivity not in (6, 18, 26): # <<<<<<<<<<<<<< @@ -22390,16 +22715,16 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "cc3d.pyx":818 + /* "cc3d.pyx":835 * raise ValueError("Only 6, 18, and 26 connectivities are supported. Got: " + str(connectivity)) * * labels = np.asfortranarray(labels) # <<<<<<<<<<<<<< * * cdef vector[INTEGER] res = extract_region_graph( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -22414,10 +22739,10 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 818, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -22434,13 +22759,13 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_labels.diminfo[2].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_labels.diminfo[2].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[2]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) } __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "cc3d.pyx":821 + /* "cc3d.pyx":838 * * cdef vector[INTEGER] res = extract_region_graph( * &labels[0,0,0], # <<<<<<<<<<<<<< @@ -22465,10 +22790,10 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[2].shape)) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 821, __pyx_L1_error) + __PYX_ERR(0, 838, __pyx_L1_error) } - /* "cc3d.pyx":820 + /* "cc3d.pyx":837 * labels = np.asfortranarray(labels) * * cdef vector[INTEGER] res = extract_region_graph( # <<<<<<<<<<<<<< @@ -22479,23 +22804,23 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_14 = cc3d::extract_region_graph(((int64_t *)(&(*__Pyx_BufPtrStrided3d(int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[2].strides)))), (__pyx_v_labels->dimensions[0]), (__pyx_v_labels->dimensions[1]), (__pyx_v_labels->dimensions[2]), __pyx_v_connectivity); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 837, __pyx_L1_error) } __pyx_v_res = ((std::vector )__pyx_t_14); - /* "cc3d.pyx":826 + /* "cc3d.pyx":843 * ) * * output = set() # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_output = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":827 + /* "cc3d.pyx":844 * * output = set() * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -22504,7 +22829,7 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "cc3d.pyx":829 + /* "cc3d.pyx":846 * cdef size_t i = 0 * * for i in range(res.size() // 2): # <<<<<<<<<<<<<< @@ -22516,18 +22841,18 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "cc3d.pyx":831 + /* "cc3d.pyx":848 * for i in range(res.size() // 2): * output.add( * (res[i * 2], res[i*2 + 1]) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyInt_From_int64_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int64_t((__pyx_v_res[(__pyx_v_i * 2)])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int64_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((__pyx_v_res[((__pyx_v_i * 2) + 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -22536,18 +22861,18 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "cc3d.pyx":830 + /* "cc3d.pyx":847 * * for i in range(res.size() // 2): * output.add( # <<<<<<<<<<<<<< * (res[i * 2], res[i*2 + 1]) * ) */ - __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_18 = PySet_Add(__pyx_v_output, __pyx_t_3); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "cc3d.pyx":834 + /* "cc3d.pyx":851 * ) * * return output # <<<<<<<<<<<<<< @@ -22559,7 +22884,7 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = __pyx_v_output; goto __pyx_L0; - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< @@ -22591,7 +22916,7 @@ static PyObject *__pyx_pf_4cc3d_56region_graph(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "cc3d.pyx":839 +/* "cc3d.pyx":856 * ## of a densely labeled image into a series of binary images. * * def runs(labels): # <<<<<<<<<<<<<< @@ -22630,7 +22955,7 @@ static PyObject *__pyx_pf_4cc3d_16runs(CYTHON_UNUSED PyObject *__pyx_self, PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("runs", 0); - /* "cc3d.pyx":846 + /* "cc3d.pyx":863 * Use this data in conjunction with render and erase. * """ * return _runs(reshape(labels, (labels.size,))) # <<<<<<<<<<<<<< @@ -22638,13 +22963,13 @@ static PyObject *__pyx_pf_4cc3d_16runs(CYTHON_UNUSED PyObject *__pyx_self, PyObj * def _runs( */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_runs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_runs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); @@ -22664,7 +22989,7 @@ static PyObject *__pyx_pf_4cc3d_16runs(CYTHON_UNUSED PyObject *__pyx_self, PyObj #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_labels, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -22673,14 +22998,14 @@ static PyObject *__pyx_pf_4cc3d_16runs(CYTHON_UNUSED PyObject *__pyx_self, PyObj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_labels, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 863, __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; @@ -22691,7 +23016,7 @@ static PyObject *__pyx_pf_4cc3d_16runs(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -22709,14 +23034,14 @@ static PyObject *__pyx_pf_4cc3d_16runs(CYTHON_UNUSED PyObject *__pyx_self, PyObj __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __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; - /* "cc3d.pyx":839 + /* "cc3d.pyx":856 * ## of a densely labeled image into a series of binary images. * * def runs(labels): # <<<<<<<<<<<<<< @@ -22741,7 +23066,7 @@ static PyObject *__pyx_pf_4cc3d_16runs(CYTHON_UNUSED PyObject *__pyx_self, PyObj return __pyx_r; } -/* "cc3d.pyx":848 +/* "cc3d.pyx":865 * return _runs(reshape(labels, (labels.size,))) * * def _runs( # <<<<<<<<<<<<<< @@ -22790,23 +23115,23 @@ static PyObject *__pyx_pw_4cc3d_19_runs(PyObject *__pyx_self, PyObject *__pyx_ar 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, 848, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 865, __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, 848, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 865, __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, 848, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 865, __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, 848, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 865, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -22823,7 +23148,7 @@ static PyObject *__pyx_pw_4cc3d_19_runs(PyObject *__pyx_self, PyObject *__pyx_ar } 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, 848, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 865, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -22881,7 +23206,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_runs", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -22895,7 +23220,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 865, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -22903,7 +23228,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -22914,16 +23239,16 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __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, 848, __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, 865, __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, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __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, 848, __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, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -22938,18 +23263,18 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -22958,31 +23283,31 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __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, 865, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_1); - __Pyx_INCREF(__pyx_kp_s__3); - __Pyx_GIVEREF(__pyx_kp_s__3); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s__3); + __Pyx_INCREF(__pyx_kp_s__4); + __Pyx_GIVEREF(__pyx_kp_s__4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s__4); __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, 848, __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, 865, __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -22992,7 +23317,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -23001,14 +23326,14 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __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, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -23030,14 +23355,14 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __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, 865, __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __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, 865, __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'); @@ -23050,9 +23375,9 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __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, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -23064,7 +23389,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __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, 865, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -23073,9 +23398,9 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __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, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -23087,7 +23412,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __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, 865, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -23096,9 +23421,9 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __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, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -23110,7 +23435,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __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, 865, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -23119,9 +23444,9 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __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, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -23133,7 +23458,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __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, 865, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -23162,7 +23487,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __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, 865, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -23184,7 +23509,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __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, 865, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -23206,7 +23531,7 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __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, 865, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -23228,27 +23553,27 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __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, 865, __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, 848, __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, 865, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __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, 848, __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, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -23256,12 +23581,12 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb 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, 848, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -23273,12 +23598,12 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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__5) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__5); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 848, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -23291,29 +23616,29 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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__6) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __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, 848, __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, 865, __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, 848, __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, 865, __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, 848, __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, 865, __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, 848, __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, 865, __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, 848, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -23329,37 +23654,37 @@ static PyObject *__pyx_pf_4cc3d_18_runs(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 848, __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, 865, __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __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, 848, __pyx_L1_error) + __PYX_ERR(0, 865, __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, 848, __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, 865, __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, 848, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_13; @@ -23402,7 +23727,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_4cc3d_61_runs(PyObject *__pyx_self, PyObje PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_runs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 849, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_60_runs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -23437,35 +23762,35 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 848, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 865, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "cc3d.pyx":851 + /* "cc3d.pyx":868 * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): * if labels.dtype in (np.uint8, bool): # <<<<<<<<<<<<<< * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -23473,7 +23798,7 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { - /* "cc3d.pyx":852 + /* "cc3d.pyx":869 * ): * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -23489,19 +23814,19 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 852, __pyx_L1_error) + __PYX_ERR(0, 869, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_map_to_py_uint8_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_map_to_py_uint8_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":851 + /* "cc3d.pyx":868 * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): * if labels.dtype in (np.uint8, bool): # <<<<<<<<<<<<<< @@ -23510,28 +23835,28 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":853 + /* "cc3d.pyx":870 * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: # <<<<<<<<<<<<<< * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "cc3d.pyx":854 + /* "cc3d.pyx":871 * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -23547,19 +23872,19 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 854, __pyx_L1_error) + __PYX_ERR(0, 871, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_convert_map_to_py_uint16_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_map_to_py_uint16_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "cc3d.pyx":853 + /* "cc3d.pyx":870 * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: # <<<<<<<<<<<<<< @@ -23568,28 +23893,28 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":855 + /* "cc3d.pyx":872 * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: # <<<<<<<<<<<<<< * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "cc3d.pyx":856 + /* "cc3d.pyx":873 * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -23605,19 +23930,19 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 856, __pyx_L1_error) + __PYX_ERR(0, 873, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_convert_map_to_py_uint32_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_to_py_uint32_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "cc3d.pyx":855 + /* "cc3d.pyx":872 * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: # <<<<<<<<<<<<<< @@ -23626,28 +23951,28 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":857 + /* "cc3d.pyx":874 * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: # <<<<<<<<<<<<<< * return extract_runs[uint64_t](&labels[0], labels.size) * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_5)) { - /* "cc3d.pyx":858 + /* "cc3d.pyx":875 * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: * return extract_runs[uint64_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -23663,19 +23988,19 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 858, __pyx_L1_error) + __PYX_ERR(0, 875, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_map_to_py_uint64_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_map_to_py_uint64_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":857 + /* "cc3d.pyx":874 * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: # <<<<<<<<<<<<<< @@ -23684,7 +24009,7 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":860 + /* "cc3d.pyx":877 * return extract_runs[uint64_t](&labels[0], labels.size) * else: * raise TypeError("Unsupported type: " + str(labels.dtype)) # <<<<<<<<<<<<<< @@ -23692,23 +24017,23 @@ static PyObject *__pyx_pf_4cc3d_60_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr * def draw( */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 860, __pyx_L1_error) + __PYX_ERR(0, 877, __pyx_L1_error) } - /* "cc3d.pyx":848 + /* "cc3d.pyx":865 * return _runs(reshape(labels, (labels.size,))) * * def _runs( # <<<<<<<<<<<<<< @@ -23748,7 +24073,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_4cc3d_63_runs(PyObject *__pyx_self, PyObje PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_runs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 849, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_62_runs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -23783,35 +24108,35 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 848, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 865, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "cc3d.pyx":851 + /* "cc3d.pyx":868 * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): * if labels.dtype in (np.uint8, bool): # <<<<<<<<<<<<<< * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -23819,7 +24144,7 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { - /* "cc3d.pyx":852 + /* "cc3d.pyx":869 * ): * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -23835,19 +24160,19 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 852, __pyx_L1_error) + __PYX_ERR(0, 869, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_map_to_py_uint8_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_map_to_py_uint8_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":851 + /* "cc3d.pyx":868 * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): * if labels.dtype in (np.uint8, bool): # <<<<<<<<<<<<<< @@ -23856,28 +24181,28 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":853 + /* "cc3d.pyx":870 * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: # <<<<<<<<<<<<<< * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "cc3d.pyx":854 + /* "cc3d.pyx":871 * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -23893,19 +24218,19 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 854, __pyx_L1_error) + __PYX_ERR(0, 871, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_convert_map_to_py_uint16_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_map_to_py_uint16_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "cc3d.pyx":853 + /* "cc3d.pyx":870 * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: # <<<<<<<<<<<<<< @@ -23914,28 +24239,28 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":855 + /* "cc3d.pyx":872 * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: # <<<<<<<<<<<<<< * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "cc3d.pyx":856 + /* "cc3d.pyx":873 * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -23951,19 +24276,19 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 856, __pyx_L1_error) + __PYX_ERR(0, 873, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_convert_map_to_py_uint32_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_to_py_uint32_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "cc3d.pyx":855 + /* "cc3d.pyx":872 * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: # <<<<<<<<<<<<<< @@ -23972,28 +24297,28 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":857 + /* "cc3d.pyx":874 * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: # <<<<<<<<<<<<<< * return extract_runs[uint64_t](&labels[0], labels.size) * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_5)) { - /* "cc3d.pyx":858 + /* "cc3d.pyx":875 * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: * return extract_runs[uint64_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -24009,19 +24334,19 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 858, __pyx_L1_error) + __PYX_ERR(0, 875, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_map_to_py_uint64_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_map_to_py_uint64_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":857 + /* "cc3d.pyx":874 * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: # <<<<<<<<<<<<<< @@ -24030,7 +24355,7 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":860 + /* "cc3d.pyx":877 * return extract_runs[uint64_t](&labels[0], labels.size) * else: * raise TypeError("Unsupported type: " + str(labels.dtype)) # <<<<<<<<<<<<<< @@ -24038,23 +24363,23 @@ static PyObject *__pyx_pf_4cc3d_62_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr * def draw( */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 860, __pyx_L1_error) + __PYX_ERR(0, 877, __pyx_L1_error) } - /* "cc3d.pyx":848 + /* "cc3d.pyx":865 * return _runs(reshape(labels, (labels.size,))) * * def _runs( # <<<<<<<<<<<<<< @@ -24094,7 +24419,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_4cc3d_65_runs(PyObject *__pyx_self, PyObje PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_runs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 849, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_64_runs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -24129,35 +24454,35 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 848, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 865, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "cc3d.pyx":851 + /* "cc3d.pyx":868 * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): * if labels.dtype in (np.uint8, bool): # <<<<<<<<<<<<<< * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -24165,7 +24490,7 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { - /* "cc3d.pyx":852 + /* "cc3d.pyx":869 * ): * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -24181,19 +24506,19 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 852, __pyx_L1_error) + __PYX_ERR(0, 869, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_map_to_py_uint8_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_map_to_py_uint8_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":851 + /* "cc3d.pyx":868 * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): * if labels.dtype in (np.uint8, bool): # <<<<<<<<<<<<<< @@ -24202,28 +24527,28 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":853 + /* "cc3d.pyx":870 * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: # <<<<<<<<<<<<<< * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "cc3d.pyx":854 + /* "cc3d.pyx":871 * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -24239,19 +24564,19 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 854, __pyx_L1_error) + __PYX_ERR(0, 871, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_convert_map_to_py_uint16_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_map_to_py_uint16_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "cc3d.pyx":853 + /* "cc3d.pyx":870 * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: # <<<<<<<<<<<<<< @@ -24260,28 +24585,28 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":855 + /* "cc3d.pyx":872 * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: # <<<<<<<<<<<<<< * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "cc3d.pyx":856 + /* "cc3d.pyx":873 * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -24297,19 +24622,19 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 856, __pyx_L1_error) + __PYX_ERR(0, 873, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_convert_map_to_py_uint32_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_to_py_uint32_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "cc3d.pyx":855 + /* "cc3d.pyx":872 * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: # <<<<<<<<<<<<<< @@ -24318,28 +24643,28 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":857 + /* "cc3d.pyx":874 * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: # <<<<<<<<<<<<<< * return extract_runs[uint64_t](&labels[0], labels.size) * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_5)) { - /* "cc3d.pyx":858 + /* "cc3d.pyx":875 * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: * return extract_runs[uint64_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -24355,19 +24680,19 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 858, __pyx_L1_error) + __PYX_ERR(0, 875, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_map_to_py_uint64_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_map_to_py_uint64_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":857 + /* "cc3d.pyx":874 * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: # <<<<<<<<<<<<<< @@ -24376,7 +24701,7 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":860 + /* "cc3d.pyx":877 * return extract_runs[uint64_t](&labels[0], labels.size) * else: * raise TypeError("Unsupported type: " + str(labels.dtype)) # <<<<<<<<<<<<<< @@ -24384,23 +24709,23 @@ static PyObject *__pyx_pf_4cc3d_64_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr * def draw( */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 860, __pyx_L1_error) + __PYX_ERR(0, 877, __pyx_L1_error) } - /* "cc3d.pyx":848 + /* "cc3d.pyx":865 * return _runs(reshape(labels, (labels.size,))) * * def _runs( # <<<<<<<<<<<<<< @@ -24440,7 +24765,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_4cc3d_67_runs(PyObject *__pyx_self, PyObje PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_runs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 849, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_66_runs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -24475,35 +24800,35 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 848, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 865, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "cc3d.pyx":851 + /* "cc3d.pyx":868 * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): * if labels.dtype in (np.uint8, bool): # <<<<<<<<<<<<<< * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -24511,7 +24836,7 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { - /* "cc3d.pyx":852 + /* "cc3d.pyx":869 * ): * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -24527,19 +24852,19 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 852, __pyx_L1_error) + __PYX_ERR(0, 869, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_map_to_py_uint8_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_map_to_py_uint8_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":851 + /* "cc3d.pyx":868 * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): * if labels.dtype in (np.uint8, bool): # <<<<<<<<<<<<<< @@ -24548,28 +24873,28 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":853 + /* "cc3d.pyx":870 * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: # <<<<<<<<<<<<<< * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "cc3d.pyx":854 + /* "cc3d.pyx":871 * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -24585,19 +24910,19 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 854, __pyx_L1_error) + __PYX_ERR(0, 871, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_convert_map_to_py_uint16_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_map_to_py_uint16_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "cc3d.pyx":853 + /* "cc3d.pyx":870 * if labels.dtype in (np.uint8, bool): * return extract_runs[uint8_t](&labels[0], labels.size) * elif labels.dtype == np.uint16: # <<<<<<<<<<<<<< @@ -24606,28 +24931,28 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":855 + /* "cc3d.pyx":872 * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: # <<<<<<<<<<<<<< * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "cc3d.pyx":856 + /* "cc3d.pyx":873 * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -24643,19 +24968,19 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 856, __pyx_L1_error) + __PYX_ERR(0, 873, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_convert_map_to_py_uint32_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_map_to_py_uint32_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "cc3d.pyx":855 + /* "cc3d.pyx":872 * elif labels.dtype == np.uint16: * return extract_runs[uint16_t](&labels[0], labels.size) * elif labels.dtype == np.uint32: # <<<<<<<<<<<<<< @@ -24664,28 +24989,28 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":857 + /* "cc3d.pyx":874 * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: # <<<<<<<<<<<<<< * return extract_runs[uint64_t](&labels[0], labels.size) * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_5)) { - /* "cc3d.pyx":858 + /* "cc3d.pyx":875 * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: * return extract_runs[uint64_t](&labels[0], labels.size) # <<<<<<<<<<<<<< @@ -24701,19 +25026,19 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 858, __pyx_L1_error) + __PYX_ERR(0, 875, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_map_to_py_uint64_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_map_to_py_uint64_t____std_3a__3a_vector_3c_std_3a__3a_pair_3c_size_t_2c_size_t_3e____3e___(cc3d::extract_runs(((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_labels.diminfo[0].strides)))), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":857 + /* "cc3d.pyx":874 * elif labels.dtype == np.uint32: * return extract_runs[uint32_t](&labels[0], labels.size) * elif labels.dtype == np.uint64: # <<<<<<<<<<<<<< @@ -24722,7 +25047,7 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr */ } - /* "cc3d.pyx":860 + /* "cc3d.pyx":877 * return extract_runs[uint64_t](&labels[0], labels.size) * else: * raise TypeError("Unsupported type: " + str(labels.dtype)) # <<<<<<<<<<<<<< @@ -24730,23 +25055,23 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr * def draw( */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 860, __pyx_L1_error) + __PYX_ERR(0, 877, __pyx_L1_error) } - /* "cc3d.pyx":848 + /* "cc3d.pyx":865 * return _runs(reshape(labels, (labels.size,))) * * def _runs( # <<<<<<<<<<<<<< @@ -24776,7 +25101,7 @@ static PyObject *__pyx_pf_4cc3d_66_runs(CYTHON_UNUSED PyObject *__pyx_self, PyAr return __pyx_r; } -/* "cc3d.pyx":862 +/* "cc3d.pyx":879 * raise TypeError("Unsupported type: " + str(labels.dtype)) * * def draw( # <<<<<<<<<<<<<< @@ -24823,17 +25148,17 @@ static PyObject *__pyx_pw_4cc3d_21draw(PyObject *__pyx_self, PyObject *__pyx_arg case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_runs_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, 1); __PYX_ERR(0, 862, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, 1); __PYX_ERR(0, 879, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, 2); __PYX_ERR(0, 862, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, 2); __PYX_ERR(0, 879, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 862, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 879, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -24843,12 +25168,12 @@ static PyObject *__pyx_pw_4cc3d_21draw(PyObject *__pyx_self, PyObject *__pyx_arg values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_label = values[0]; - __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error) + __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L3_error) __pyx_v_image = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 862, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 879, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.draw", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -24878,7 +25203,7 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw", 0); - /* "cc3d.pyx":873 + /* "cc3d.pyx":890 * runs. * """ * return _draw(label, runs, reshape(image, (image.size,))) # <<<<<<<<<<<<<< @@ -24886,15 +25211,15 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj * def _draw( */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_runs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_runs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_image, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_image, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); @@ -24914,7 +25239,7 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_image, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -24923,14 +25248,14 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_image, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -24941,7 +25266,7 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -24961,7 +25286,7 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_label, __pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -24971,7 +25296,7 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_label, __pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -24979,7 +25304,7 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj } else #endif { - __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -24993,7 +25318,7 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -25002,7 +25327,7 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":862 + /* "cc3d.pyx":879 * raise TypeError("Unsupported type: " + str(labels.dtype)) * * def draw( # <<<<<<<<<<<<<< @@ -25028,7 +25353,7 @@ static PyObject *__pyx_pf_4cc3d_20draw(CYTHON_UNUSED PyObject *__pyx_self, PyObj return __pyx_r; } -/* "cc3d.pyx":875 +/* "cc3d.pyx":892 * return _draw(label, runs, reshape(image, (image.size,))) * * def _draw( # <<<<<<<<<<<<<< @@ -25077,23 +25402,23 @@ static PyObject *__pyx_pw_4cc3d_23_draw(PyObject *__pyx_self, PyObject *__pyx_ar 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, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 892, __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, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 892, __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, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 892, __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, 875, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 892, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -25110,7 +25435,7 @@ static PyObject *__pyx_pw_4cc3d_23_draw(PyObject *__pyx_self, PyObject *__pyx_ar } 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, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 892, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -25168,7 +25493,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_draw", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -25182,7 +25507,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -25190,7 +25515,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -25201,16 +25526,16 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __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, 875, __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, 892, __pyx_L1_error) __pyx_t_2 = ((2 < __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, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -25225,18 +25550,18 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_image, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_image, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_image); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_image); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -25245,12 +25570,12 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __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, 892, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -25261,15 +25586,15 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -25279,7 +25604,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -25288,14 +25613,14 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __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, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -25317,14 +25642,14 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __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, 892, __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __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, 892, __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'); @@ -25337,9 +25662,9 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __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, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -25351,7 +25676,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -25360,9 +25685,9 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __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, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -25374,7 +25699,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -25383,9 +25708,9 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __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, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -25397,7 +25722,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -25406,9 +25731,9 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __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, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -25420,7 +25745,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -25449,7 +25774,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25471,7 +25796,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25493,7 +25818,7 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25515,27 +25840,27 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __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, 875, __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, 892, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __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, 875, __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, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -25543,12 +25868,12 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb 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, 875, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -25560,12 +25885,12 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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__5) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__5); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 875, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -25578,29 +25903,29 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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__6) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __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, 875, __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, 892, __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, 875, __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, 892, __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, 875, __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, 892, __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, 875, __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, 892, __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, 875, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -25616,37 +25941,37 @@ static PyObject *__pyx_pf_4cc3d_22_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __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, 875, __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, 892, __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __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, 875, __pyx_L1_error) + __PYX_ERR(0, 892, __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, 875, __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, 892, __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, 875, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_13; @@ -25717,17 +26042,17 @@ static PyObject *__pyx_fuse_0__pyx_pw_4cc3d_71_draw(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_runs_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 1); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 1); __PYX_ERR(0, 892, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 2); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 2); __PYX_ERR(0, 892, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_draw") < 0)) __PYX_ERR(0, 875, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_draw") < 0)) __PYX_ERR(0, 892, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -25737,18 +26062,18 @@ static PyObject *__pyx_fuse_0__pyx_pw_4cc3d_71_draw(PyObject *__pyx_self, PyObje values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_label = values[0]; - __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L3_error) + __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 894, __pyx_L3_error) __pyx_v_image = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 892, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d._draw", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 878, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_70_draw(__pyx_self, __pyx_v_label, __pyx_v_runs, __pyx_v_image); /* function exit code */ @@ -25786,35 +26111,35 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __pyx_pybuffernd_image.rcbuffer = &__pyx_pybuffer_image; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 875, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; - /* "cc3d.pyx":880 + /* "cc3d.pyx":897 * cnp.ndarray[UINT, ndim=1, cast=True] image * ): * if image.dtype == bool: # <<<<<<<<<<<<<< * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __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, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":881 + /* "cc3d.pyx":898 * ): * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) */ - __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_label, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_label, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_6 = -1; @@ -25824,20 +26149,20 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 881, __pyx_L1_error) + __PYX_ERR(0, 898, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; try { cc3d::set_run_voxels(__pyx_t_4, __pyx_v_runs, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 881, __pyx_L1_error) + __PYX_ERR(0, 898, __pyx_L1_error) } - /* "cc3d.pyx":880 + /* "cc3d.pyx":897 * cnp.ndarray[UINT, ndim=1, cast=True] image * ): * if image.dtype == bool: # <<<<<<<<<<<<<< @@ -25847,35 +26172,35 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":882 + /* "cc3d.pyx":899 * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: # <<<<<<<<<<<<<< * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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, 882, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":883 + /* "cc3d.pyx":900 * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) */ - __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -25884,20 +26209,20 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 883, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { cc3d::set_run_voxels(__pyx_t_4, __pyx_v_runs, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 883, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } - /* "cc3d.pyx":882 + /* "cc3d.pyx":899 * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: # <<<<<<<<<<<<<< @@ -25907,35 +26232,35 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":884 + /* "cc3d.pyx":901 * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: # <<<<<<<<<<<<<< * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":885 + /* "cc3d.pyx":902 * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) */ - __pyx_t_9 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_9 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_9 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -25944,20 +26269,20 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 885, __pyx_L1_error) + __PYX_ERR(0, 902, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; try { cc3d::set_run_voxels(__pyx_t_9, __pyx_v_runs, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 885, __pyx_L1_error) + __PYX_ERR(0, 902, __pyx_L1_error) } - /* "cc3d.pyx":884 + /* "cc3d.pyx":901 * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: # <<<<<<<<<<<<<< @@ -25967,35 +26292,35 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":886 + /* "cc3d.pyx":903 * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: # <<<<<<<<<<<<<< * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __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, 886, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":887 + /* "cc3d.pyx":904 * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint64: * set_run_voxels[uint64_t](label, runs, &image[0], image.size) */ - __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_10 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_10 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -26004,20 +26329,20 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 887, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; try { cc3d::set_run_voxels(__pyx_t_10, __pyx_v_runs, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 887, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - /* "cc3d.pyx":886 + /* "cc3d.pyx":903 * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: # <<<<<<<<<<<<<< @@ -26027,35 +26352,35 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":888 + /* "cc3d.pyx":905 * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: # <<<<<<<<<<<<<< * set_run_voxels[uint64_t](label, runs, &image[0], image.size) * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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, 888, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_3)) { - /* "cc3d.pyx":889 + /* "cc3d.pyx":906 * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: * set_run_voxels[uint64_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * else: * raise TypeError("Unsupported type: " + str(image.dtype)) */ - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -26064,20 +26389,20 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 889, __pyx_L1_error) + __PYX_ERR(0, 906, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { cc3d::set_run_voxels(__pyx_t_11, __pyx_v_runs, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 889, __pyx_L1_error) + __PYX_ERR(0, 906, __pyx_L1_error) } - /* "cc3d.pyx":888 + /* "cc3d.pyx":905 * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: # <<<<<<<<<<<<<< @@ -26087,7 +26412,7 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":891 + /* "cc3d.pyx":908 * set_run_voxels[uint64_t](label, runs, &image[0], image.size) * else: * raise TypeError("Unsupported type: " + str(image.dtype)) # <<<<<<<<<<<<<< @@ -26095,24 +26420,24 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb * return image */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 891, __pyx_L1_error) + __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_L3:; - /* "cc3d.pyx":893 + /* "cc3d.pyx":910 * raise TypeError("Unsupported type: " + str(image.dtype)) * * return image # <<<<<<<<<<<<<< @@ -26124,7 +26449,7 @@ static PyObject *__pyx_pf_4cc3d_70_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __pyx_r = ((PyObject *)__pyx_v_image); goto __pyx_L0; - /* "cc3d.pyx":875 + /* "cc3d.pyx":892 * return _draw(label, runs, reshape(image, (image.size,))) * * def _draw( # <<<<<<<<<<<<<< @@ -26192,17 +26517,17 @@ static PyObject *__pyx_fuse_1__pyx_pw_4cc3d_73_draw(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_runs_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 1); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 1); __PYX_ERR(0, 892, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 2); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 2); __PYX_ERR(0, 892, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_draw") < 0)) __PYX_ERR(0, 875, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_draw") < 0)) __PYX_ERR(0, 892, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -26212,18 +26537,18 @@ static PyObject *__pyx_fuse_1__pyx_pw_4cc3d_73_draw(PyObject *__pyx_self, PyObje values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_label = values[0]; - __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L3_error) + __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 894, __pyx_L3_error) __pyx_v_image = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 892, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d._draw", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 878, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_72_draw(__pyx_self, __pyx_v_label, __pyx_v_runs, __pyx_v_image); /* function exit code */ @@ -26261,35 +26586,35 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __pyx_pybuffernd_image.rcbuffer = &__pyx_pybuffer_image; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 875, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; - /* "cc3d.pyx":880 + /* "cc3d.pyx":897 * cnp.ndarray[UINT, ndim=1, cast=True] image * ): * if image.dtype == bool: # <<<<<<<<<<<<<< * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __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, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":881 + /* "cc3d.pyx":898 * ): * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) */ - __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_label, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_label, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_6 = -1; @@ -26299,20 +26624,20 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 881, __pyx_L1_error) + __PYX_ERR(0, 898, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; try { cc3d::set_run_voxels(__pyx_t_4, __pyx_v_runs, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 881, __pyx_L1_error) + __PYX_ERR(0, 898, __pyx_L1_error) } - /* "cc3d.pyx":880 + /* "cc3d.pyx":897 * cnp.ndarray[UINT, ndim=1, cast=True] image * ): * if image.dtype == bool: # <<<<<<<<<<<<<< @@ -26322,35 +26647,35 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":882 + /* "cc3d.pyx":899 * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: # <<<<<<<<<<<<<< * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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, 882, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":883 + /* "cc3d.pyx":900 * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) */ - __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -26359,20 +26684,20 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 883, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { cc3d::set_run_voxels(__pyx_t_4, __pyx_v_runs, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 883, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } - /* "cc3d.pyx":882 + /* "cc3d.pyx":899 * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: # <<<<<<<<<<<<<< @@ -26382,35 +26707,35 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":884 + /* "cc3d.pyx":901 * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: # <<<<<<<<<<<<<< * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":885 + /* "cc3d.pyx":902 * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) */ - __pyx_t_9 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_9 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_9 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -26419,20 +26744,20 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 885, __pyx_L1_error) + __PYX_ERR(0, 902, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; try { cc3d::set_run_voxels(__pyx_t_9, __pyx_v_runs, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 885, __pyx_L1_error) + __PYX_ERR(0, 902, __pyx_L1_error) } - /* "cc3d.pyx":884 + /* "cc3d.pyx":901 * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: # <<<<<<<<<<<<<< @@ -26442,35 +26767,35 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":886 + /* "cc3d.pyx":903 * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: # <<<<<<<<<<<<<< * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __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, 886, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":887 + /* "cc3d.pyx":904 * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint64: * set_run_voxels[uint64_t](label, runs, &image[0], image.size) */ - __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_10 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_10 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -26479,20 +26804,20 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 887, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; try { cc3d::set_run_voxels(__pyx_t_10, __pyx_v_runs, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 887, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - /* "cc3d.pyx":886 + /* "cc3d.pyx":903 * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: # <<<<<<<<<<<<<< @@ -26502,35 +26827,35 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":888 + /* "cc3d.pyx":905 * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: # <<<<<<<<<<<<<< * set_run_voxels[uint64_t](label, runs, &image[0], image.size) * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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, 888, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_3)) { - /* "cc3d.pyx":889 + /* "cc3d.pyx":906 * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: * set_run_voxels[uint64_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * else: * raise TypeError("Unsupported type: " + str(image.dtype)) */ - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -26539,20 +26864,20 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 889, __pyx_L1_error) + __PYX_ERR(0, 906, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { cc3d::set_run_voxels(__pyx_t_11, __pyx_v_runs, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 889, __pyx_L1_error) + __PYX_ERR(0, 906, __pyx_L1_error) } - /* "cc3d.pyx":888 + /* "cc3d.pyx":905 * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: # <<<<<<<<<<<<<< @@ -26562,7 +26887,7 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":891 + /* "cc3d.pyx":908 * set_run_voxels[uint64_t](label, runs, &image[0], image.size) * else: * raise TypeError("Unsupported type: " + str(image.dtype)) # <<<<<<<<<<<<<< @@ -26570,24 +26895,24 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb * return image */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 891, __pyx_L1_error) + __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_L3:; - /* "cc3d.pyx":893 + /* "cc3d.pyx":910 * raise TypeError("Unsupported type: " + str(image.dtype)) * * return image # <<<<<<<<<<<<<< @@ -26599,7 +26924,7 @@ static PyObject *__pyx_pf_4cc3d_72_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __pyx_r = ((PyObject *)__pyx_v_image); goto __pyx_L0; - /* "cc3d.pyx":875 + /* "cc3d.pyx":892 * return _draw(label, runs, reshape(image, (image.size,))) * * def _draw( # <<<<<<<<<<<<<< @@ -26667,17 +26992,17 @@ static PyObject *__pyx_fuse_2__pyx_pw_4cc3d_75_draw(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_runs_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 1); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 1); __PYX_ERR(0, 892, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 2); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 2); __PYX_ERR(0, 892, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_draw") < 0)) __PYX_ERR(0, 875, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_draw") < 0)) __PYX_ERR(0, 892, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -26687,18 +27012,18 @@ static PyObject *__pyx_fuse_2__pyx_pw_4cc3d_75_draw(PyObject *__pyx_self, PyObje values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_label = values[0]; - __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L3_error) + __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 894, __pyx_L3_error) __pyx_v_image = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 892, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d._draw", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 878, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_74_draw(__pyx_self, __pyx_v_label, __pyx_v_runs, __pyx_v_image); /* function exit code */ @@ -26736,35 +27061,35 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __pyx_pybuffernd_image.rcbuffer = &__pyx_pybuffer_image; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 875, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; - /* "cc3d.pyx":880 + /* "cc3d.pyx":897 * cnp.ndarray[UINT, ndim=1, cast=True] image * ): * if image.dtype == bool: # <<<<<<<<<<<<<< * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __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, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":881 + /* "cc3d.pyx":898 * ): * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) */ - __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_label, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_label, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_6 = -1; @@ -26774,20 +27099,20 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 881, __pyx_L1_error) + __PYX_ERR(0, 898, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; try { cc3d::set_run_voxels(__pyx_t_4, __pyx_v_runs, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 881, __pyx_L1_error) + __PYX_ERR(0, 898, __pyx_L1_error) } - /* "cc3d.pyx":880 + /* "cc3d.pyx":897 * cnp.ndarray[UINT, ndim=1, cast=True] image * ): * if image.dtype == bool: # <<<<<<<<<<<<<< @@ -26797,35 +27122,35 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":882 + /* "cc3d.pyx":899 * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: # <<<<<<<<<<<<<< * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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, 882, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":883 + /* "cc3d.pyx":900 * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) */ - __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -26834,20 +27159,20 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 883, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { cc3d::set_run_voxels(__pyx_t_4, __pyx_v_runs, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 883, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } - /* "cc3d.pyx":882 + /* "cc3d.pyx":899 * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: # <<<<<<<<<<<<<< @@ -26857,35 +27182,35 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":884 + /* "cc3d.pyx":901 * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: # <<<<<<<<<<<<<< * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":885 + /* "cc3d.pyx":902 * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) */ - __pyx_t_9 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_9 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_9 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -26894,20 +27219,20 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 885, __pyx_L1_error) + __PYX_ERR(0, 902, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; try { cc3d::set_run_voxels(__pyx_t_9, __pyx_v_runs, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 885, __pyx_L1_error) + __PYX_ERR(0, 902, __pyx_L1_error) } - /* "cc3d.pyx":884 + /* "cc3d.pyx":901 * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: # <<<<<<<<<<<<<< @@ -26917,35 +27242,35 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":886 + /* "cc3d.pyx":903 * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: # <<<<<<<<<<<<<< * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __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, 886, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":887 + /* "cc3d.pyx":904 * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint64: * set_run_voxels[uint64_t](label, runs, &image[0], image.size) */ - __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_10 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_10 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -26954,20 +27279,20 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 887, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; try { cc3d::set_run_voxels(__pyx_t_10, __pyx_v_runs, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 887, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - /* "cc3d.pyx":886 + /* "cc3d.pyx":903 * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: # <<<<<<<<<<<<<< @@ -26977,35 +27302,35 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":888 + /* "cc3d.pyx":905 * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: # <<<<<<<<<<<<<< * set_run_voxels[uint64_t](label, runs, &image[0], image.size) * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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, 888, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_3)) { - /* "cc3d.pyx":889 + /* "cc3d.pyx":906 * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: * set_run_voxels[uint64_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * else: * raise TypeError("Unsupported type: " + str(image.dtype)) */ - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -27014,20 +27339,20 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 889, __pyx_L1_error) + __PYX_ERR(0, 906, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { cc3d::set_run_voxels(__pyx_t_11, __pyx_v_runs, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 889, __pyx_L1_error) + __PYX_ERR(0, 906, __pyx_L1_error) } - /* "cc3d.pyx":888 + /* "cc3d.pyx":905 * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: # <<<<<<<<<<<<<< @@ -27037,7 +27362,7 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":891 + /* "cc3d.pyx":908 * set_run_voxels[uint64_t](label, runs, &image[0], image.size) * else: * raise TypeError("Unsupported type: " + str(image.dtype)) # <<<<<<<<<<<<<< @@ -27045,24 +27370,24 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb * return image */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 891, __pyx_L1_error) + __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_L3:; - /* "cc3d.pyx":893 + /* "cc3d.pyx":910 * raise TypeError("Unsupported type: " + str(image.dtype)) * * return image # <<<<<<<<<<<<<< @@ -27074,7 +27399,7 @@ static PyObject *__pyx_pf_4cc3d_74_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __pyx_r = ((PyObject *)__pyx_v_image); goto __pyx_L0; - /* "cc3d.pyx":875 + /* "cc3d.pyx":892 * return _draw(label, runs, reshape(image, (image.size,))) * * def _draw( # <<<<<<<<<<<<<< @@ -27142,17 +27467,17 @@ static PyObject *__pyx_fuse_3__pyx_pw_4cc3d_77_draw(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_runs_2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 1); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 1); __PYX_ERR(0, 892, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 2); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, 2); __PYX_ERR(0, 892, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_draw") < 0)) __PYX_ERR(0, 875, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_draw") < 0)) __PYX_ERR(0, 892, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -27162,18 +27487,18 @@ static PyObject *__pyx_fuse_3__pyx_pw_4cc3d_77_draw(PyObject *__pyx_self, PyObje values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_label = values[0]; - __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L3_error) + __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 894, __pyx_L3_error) __pyx_v_image = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 892, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d._draw", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 878, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image), __pyx_ptype_5numpy_ndarray, 1, "image", 0))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_r = __pyx_pf_4cc3d_76_draw(__pyx_self, __pyx_v_label, __pyx_v_runs, __pyx_v_image); /* function exit code */ @@ -27211,35 +27536,35 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __pyx_pybuffernd_image.rcbuffer = &__pyx_pybuffer_image; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 875, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_image.rcbuffer->pybuffer, (PyObject*)__pyx_v_image, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 892, __pyx_L1_error) } __pyx_pybuffernd_image.diminfo[0].strides = __pyx_pybuffernd_image.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_image.diminfo[0].shape = __pyx_pybuffernd_image.rcbuffer->pybuffer.shape[0]; - /* "cc3d.pyx":880 + /* "cc3d.pyx":897 * cnp.ndarray[UINT, ndim=1, cast=True] image * ): * if image.dtype == bool: # <<<<<<<<<<<<<< * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __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, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":881 + /* "cc3d.pyx":898 * ): * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) */ - __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_label, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_label, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_6 = -1; @@ -27249,20 +27574,20 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 881, __pyx_L1_error) + __PYX_ERR(0, 898, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; try { cc3d::set_run_voxels(__pyx_t_4, __pyx_v_runs, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 881, __pyx_L1_error) + __PYX_ERR(0, 898, __pyx_L1_error) } - /* "cc3d.pyx":880 + /* "cc3d.pyx":897 * cnp.ndarray[UINT, ndim=1, cast=True] image * ): * if image.dtype == bool: # <<<<<<<<<<<<<< @@ -27272,35 +27597,35 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":882 + /* "cc3d.pyx":899 * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: # <<<<<<<<<<<<<< * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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, 882, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":883 + /* "cc3d.pyx":900 * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) */ - __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -27309,20 +27634,20 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 883, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { cc3d::set_run_voxels(__pyx_t_4, __pyx_v_runs, ((uint8_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 883, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } - /* "cc3d.pyx":882 + /* "cc3d.pyx":899 * if image.dtype == bool: * set_run_voxels[uint8_t](label != 0, runs, &image[0], image.size) * elif image.dtype == np.uint8: # <<<<<<<<<<<<<< @@ -27332,35 +27657,35 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":884 + /* "cc3d.pyx":901 * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: # <<<<<<<<<<<<<< * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":885 + /* "cc3d.pyx":902 * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) */ - __pyx_t_9 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_9 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_9 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -27369,20 +27694,20 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 885, __pyx_L1_error) + __PYX_ERR(0, 902, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; try { cc3d::set_run_voxels(__pyx_t_9, __pyx_v_runs, ((uint16_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 885, __pyx_L1_error) + __PYX_ERR(0, 902, __pyx_L1_error) } - /* "cc3d.pyx":884 + /* "cc3d.pyx":901 * elif image.dtype == np.uint8: * set_run_voxels[uint8_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint16: # <<<<<<<<<<<<<< @@ -27392,35 +27717,35 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":886 + /* "cc3d.pyx":903 * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: # <<<<<<<<<<<<<< * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __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, 886, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "cc3d.pyx":887 + /* "cc3d.pyx":904 * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * elif image.dtype == np.uint64: * set_run_voxels[uint64_t](label, runs, &image[0], image.size) */ - __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_10 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_10 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -27429,20 +27754,20 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 887, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; try { cc3d::set_run_voxels(__pyx_t_10, __pyx_v_runs, ((uint32_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 887, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - /* "cc3d.pyx":886 + /* "cc3d.pyx":903 * elif image.dtype == np.uint16: * set_run_voxels[uint16_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint32: # <<<<<<<<<<<<<< @@ -27452,35 +27777,35 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":888 + /* "cc3d.pyx":905 * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: # <<<<<<<<<<<<<< * set_run_voxels[uint64_t](label, runs, &image[0], image.size) * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __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, 888, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_3)) { - /* "cc3d.pyx":889 + /* "cc3d.pyx":906 * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: * set_run_voxels[uint64_t](label, runs, &image[0], image.size) # <<<<<<<<<<<<<< * else: * raise TypeError("Unsupported type: " + str(image.dtype)) */ - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error) __pyx_t_5 = 0; __pyx_t_6 = -1; if (__pyx_t_5 < 0) { @@ -27489,20 +27814,20 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_image.diminfo[0].shape)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - __PYX_ERR(0, 889, __pyx_L1_error) + __PYX_ERR(0, 906, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; try { cc3d::set_run_voxels(__pyx_t_11, __pyx_v_runs, ((uint64_t *)(&(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_image.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_image.diminfo[0].strides)))), __pyx_t_7); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 889, __pyx_L1_error) + __PYX_ERR(0, 906, __pyx_L1_error) } - /* "cc3d.pyx":888 + /* "cc3d.pyx":905 * elif image.dtype == np.uint32: * set_run_voxels[uint32_t](label, runs, &image[0], image.size) * elif image.dtype == np.uint64: # <<<<<<<<<<<<<< @@ -27512,7 +27837,7 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb goto __pyx_L3; } - /* "cc3d.pyx":891 + /* "cc3d.pyx":908 * set_run_voxels[uint64_t](label, runs, &image[0], image.size) * else: * raise TypeError("Unsupported type: " + str(image.dtype)) # <<<<<<<<<<<<<< @@ -27520,24 +27845,24 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb * return image */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_image), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_type, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 891, __pyx_L1_error) + __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_L3:; - /* "cc3d.pyx":893 + /* "cc3d.pyx":910 * raise TypeError("Unsupported type: " + str(image.dtype)) * * return image # <<<<<<<<<<<<<< @@ -27549,7 +27874,7 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb __pyx_r = ((PyObject *)__pyx_v_image); goto __pyx_L0; - /* "cc3d.pyx":875 + /* "cc3d.pyx":892 * return _draw(label, runs, reshape(image, (image.size,))) * * def _draw( # <<<<<<<<<<<<<< @@ -27579,7 +27904,7 @@ static PyObject *__pyx_pf_4cc3d_76_draw(CYTHON_UNUSED PyObject *__pyx_self, PyOb return __pyx_r; } -/* "cc3d.pyx":895 +/* "cc3d.pyx":912 * return image * * def erase( # <<<<<<<<<<<<<< @@ -27623,11 +27948,11 @@ static PyObject *__pyx_pw_4cc3d_25erase(PyObject *__pyx_self, PyObject *__pyx_ar case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("erase", 1, 2, 2, 1); __PYX_ERR(0, 895, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("erase", 1, 2, 2, 1); __PYX_ERR(0, 912, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "erase") < 0)) __PYX_ERR(0, 895, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "erase") < 0)) __PYX_ERR(0, 912, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -27635,12 +27960,12 @@ static PyObject *__pyx_pw_4cc3d_25erase(PyObject *__pyx_self, PyObject *__pyx_ar values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L3_error) + __pyx_v_runs = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 913, __pyx_L3_error) __pyx_v_image = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("erase", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 895, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("erase", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 912, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.erase", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -27667,7 +27992,7 @@ static PyObject *__pyx_pf_4cc3d_24erase(CYTHON_UNUSED PyObject *__pyx_self, std: int __pyx_clineno = 0; __Pyx_RefNannySetupContext("erase", 0); - /* "cc3d.pyx":905 + /* "cc3d.pyx":922 * runs. * """ * return draw(0, runs, image) # <<<<<<<<<<<<<< @@ -27675,9 +28000,9 @@ static PyObject *__pyx_pf_4cc3d_24erase(CYTHON_UNUSED PyObject *__pyx_self, std: * def each(labels, binary=False, in_place=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_draw_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_draw_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_runs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_runs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -27694,7 +28019,7 @@ static PyObject *__pyx_pf_4cc3d_24erase(CYTHON_UNUSED PyObject *__pyx_self, std: #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_int_0, __pyx_t_3, __pyx_v_image}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -27703,14 +28028,14 @@ static PyObject *__pyx_pf_4cc3d_24erase(CYTHON_UNUSED PyObject *__pyx_self, std: #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_int_0, __pyx_t_3, __pyx_v_image}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -27724,7 +28049,7 @@ static PyObject *__pyx_pf_4cc3d_24erase(CYTHON_UNUSED PyObject *__pyx_self, std: __Pyx_GIVEREF(__pyx_v_image); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_image); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -27733,7 +28058,7 @@ static PyObject *__pyx_pf_4cc3d_24erase(CYTHON_UNUSED PyObject *__pyx_self, std: __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":895 + /* "cc3d.pyx":912 * return image * * def erase( # <<<<<<<<<<<<<< @@ -27756,7 +28081,7 @@ static PyObject *__pyx_pf_4cc3d_24erase(CYTHON_UNUSED PyObject *__pyx_self, std: return __pyx_r; } -/* "cc3d.pyx":907 +/* "cc3d.pyx":924 * return draw(0, runs, image) * * def each(labels, binary=False, in_place=False): # <<<<<<<<<<<<<< @@ -27815,7 +28140,7 @@ static PyObject *__pyx_pw_4cc3d_27each(PyObject *__pyx_self, PyObject *__pyx_arg } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "each") < 0)) __PYX_ERR(0, 907, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "each") < 0)) __PYX_ERR(0, 924, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -27834,7 +28159,7 @@ static PyObject *__pyx_pw_4cc3d_27each(PyObject *__pyx_self, PyObject *__pyx_arg } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("each", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 907, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("each", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 924, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.each", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -27847,7 +28172,7 @@ static PyObject *__pyx_pw_4cc3d_27each(PyObject *__pyx_self, PyObject *__pyx_arg return __pyx_r; } -/* "cc3d.pyx":931 +/* "cc3d.pyx":948 * * class ImageIterator(): * def __len__(self): # <<<<<<<<<<<<<< @@ -27886,7 +28211,7 @@ static PyObject *__pyx_pf_4cc3d_4each_13ImageIterator___len__(PyObject *__pyx_se __pyx_outer_scope = (struct __pyx_obj_4cc3d___pyx_scope_struct__each *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "cc3d.pyx":932 + /* "cc3d.pyx":949 * class ImageIterator(): * def __len__(self): * return len(all_runs) - int(0 in all_runs) # <<<<<<<<<<<<<< @@ -27894,21 +28219,21 @@ static PyObject *__pyx_pf_4cc3d_4each_13ImageIterator___len__(PyObject *__pyx_se * for key, rns in all_runs.items(): */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_v_all_runs)) { __Pyx_RaiseClosureNameError("all_runs"); __PYX_ERR(0, 932, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_all_runs)) { __Pyx_RaiseClosureNameError("all_runs"); __PYX_ERR(0, 949, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_v_all_runs; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 932, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 949, __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, 932, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_all_runs)) { __Pyx_RaiseClosureNameError("all_runs"); __PYX_ERR(0, 932, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_int_0, __pyx_cur_scope->__pyx_v_all_runs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 932, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 932, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_all_runs)) { __Pyx_RaiseClosureNameError("all_runs"); __PYX_ERR(0, 949, __pyx_L1_error) } + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_int_0, __pyx_cur_scope->__pyx_v_all_runs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 949, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 932, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 932, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -27916,7 +28241,7 @@ static PyObject *__pyx_pf_4cc3d_4each_13ImageIterator___len__(PyObject *__pyx_se __pyx_t_4 = 0; goto __pyx_L0; - /* "cc3d.pyx":931 + /* "cc3d.pyx":948 * * class ImageIterator(): * def __len__(self): # <<<<<<<<<<<<<< @@ -27938,7 +28263,7 @@ static PyObject *__pyx_pf_4cc3d_4each_13ImageIterator___len__(PyObject *__pyx_se } static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "cc3d.pyx":933 +/* "cc3d.pyx":950 * def __len__(self): * return len(all_runs) - int(0 in all_runs) * def __iter__(self): # <<<<<<<<<<<<<< @@ -27972,7 +28297,7 @@ static PyObject *__pyx_pf_4cc3d_4each_13ImageIterator_2__iter__(PyObject *__pyx_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4cc3d___pyx_scope_struct_1___iter__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 933, __pyx_L1_error) + __PYX_ERR(0, 950, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -27983,7 +28308,7 @@ static PyObject *__pyx_pf_4cc3d_4each_13ImageIterator_2__iter__(PyObject *__pyx_ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4cc3d_4each_13ImageIterator_4generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_each_locals_ImageIterator___iter, __pyx_n_s_cc3d); if (unlikely(!gen)) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4cc3d_4each_13ImageIterator_4generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_each_locals_ImageIterator___iter, __pyx_n_s_cc3d); if (unlikely(!gen)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -28026,9 +28351,9 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 933, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 950, __pyx_L1_error) - /* "cc3d.pyx":934 + /* "cc3d.pyx":951 * return len(all_runs) - int(0 in all_runs) * def __iter__(self): * for key, rns in all_runs.items(): # <<<<<<<<<<<<<< @@ -28036,12 +28361,12 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine * continue */ __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs)) { __Pyx_RaiseClosureNameError("all_runs"); __PYX_ERR(0, 934, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs)) { __Pyx_RaiseClosureNameError("all_runs"); __PYX_ERR(0, 951, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 934, __pyx_L1_error) + __PYX_ERR(0, 951, __pyx_L1_error) } - __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; @@ -28049,7 +28374,7 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; - if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 934, __pyx_L1_error) + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); @@ -28061,20 +28386,20 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":935 + /* "cc3d.pyx":952 * def __iter__(self): * for key, rns in all_runs.items(): * if key == 0: # <<<<<<<<<<<<<< * continue * img = np.zeros(labels.shape, dtype=dtype, order=order) */ - __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_cur_scope->__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_cur_scope->__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_8) { - /* "cc3d.pyx":936 + /* "cc3d.pyx":953 * for key, rns in all_runs.items(): * if key == 0: * continue # <<<<<<<<<<<<<< @@ -28083,7 +28408,7 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine */ goto __pyx_L4_continue; - /* "cc3d.pyx":935 + /* "cc3d.pyx":952 * def __iter__(self): * for key, rns in all_runs.items(): * if key == 0: # <<<<<<<<<<<<<< @@ -28092,33 +28417,33 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine */ } - /* "cc3d.pyx":937 + /* "cc3d.pyx":954 * if key == 0: * continue * img = np.zeros(labels.shape, dtype=dtype, order=order) # <<<<<<<<<<<<<< * draw(key, rns, img) * yield (key, img) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_labels)) { __Pyx_RaiseClosureNameError("labels"); __PYX_ERR(0, 937, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 937, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_labels)) { __Pyx_RaiseClosureNameError("labels"); __PYX_ERR(0, 954, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_dtype)) { __Pyx_RaiseClosureNameError("dtype"); __PYX_ERR(0, 937, __pyx_L1_error) } - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_dtype) < 0) __PYX_ERR(0, 937, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_order)) { __Pyx_RaiseClosureNameError("order"); __PYX_ERR(0, 937, __pyx_L1_error) } - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_order) < 0) __PYX_ERR(0, 937, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 937, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_dtype)) { __Pyx_RaiseClosureNameError("dtype"); __PYX_ERR(0, 954, __pyx_L1_error) } + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_dtype) < 0) __PYX_ERR(0, 954, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_order)) { __Pyx_RaiseClosureNameError("order"); __PYX_ERR(0, 954, __pyx_L1_error) } + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_order) < 0) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -28128,14 +28453,14 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - /* "cc3d.pyx":938 + /* "cc3d.pyx":955 * continue * img = np.zeros(labels.shape, dtype=dtype, order=order) * draw(key, rns, img) # <<<<<<<<<<<<<< * yield (key, img) * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_draw_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_draw_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = NULL; __pyx_t_7 = 0; @@ -28152,7 +28477,7 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_rns, __pyx_cur_scope->__pyx_v_img}; - __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_10); } else @@ -28160,13 +28485,13 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_rns, __pyx_cur_scope->__pyx_v_img}; - __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { - __pyx_t_5 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -28180,21 +28505,21 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine __Pyx_INCREF(__pyx_cur_scope->__pyx_v_img); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_img); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_cur_scope->__pyx_v_img); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "cc3d.pyx":939 + /* "cc3d.pyx":956 * img = np.zeros(labels.shape, dtype=dtype, order=order) * draw(key, rns, img) * yield (key, img) # <<<<<<<<<<<<<< * * class InPlaceImageIterator(ImageIterator): */ - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); @@ -28222,13 +28547,13 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 939, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 956, __pyx_L1_error) __pyx_L4_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "cc3d.pyx":933 + /* "cc3d.pyx":950 * def __len__(self): * return len(all_runs) - int(0 in all_runs) * def __iter__(self): # <<<<<<<<<<<<<< @@ -28258,7 +28583,7 @@ static PyObject *__pyx_gb_4cc3d_4each_13ImageIterator_4generator(__pyx_Coroutine } static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "cc3d.pyx":942 +/* "cc3d.pyx":959 * * class InPlaceImageIterator(ImageIterator): * def __iter__(self): # <<<<<<<<<<<<<< @@ -28292,7 +28617,7 @@ static PyObject *__pyx_pf_4cc3d_4each_20InPlaceImageIterator___iter__(PyObject * if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4cc3d___pyx_scope_struct_2___iter__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 942, __pyx_L1_error) + __PYX_ERR(0, 959, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -28303,7 +28628,7 @@ static PyObject *__pyx_pf_4cc3d_4each_20InPlaceImageIterator___iter__(PyObject * __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_each_locals_InPlaceImageIterator, __pyx_n_s_cc3d); if (unlikely(!gen)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_each_locals_InPlaceImageIterator, __pyx_n_s_cc3d); if (unlikely(!gen)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -28346,35 +28671,35 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 942, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 959, __pyx_L1_error) - /* "cc3d.pyx":943 + /* "cc3d.pyx":960 * class InPlaceImageIterator(ImageIterator): * def __iter__(self): * img = np.zeros(labels.shape, dtype=dtype, order=order) # <<<<<<<<<<<<<< * for key, rns in all_runs.items(): * if key == 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __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, 943, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_labels)) { __Pyx_RaiseClosureNameError("labels"); __PYX_ERR(0, 943, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_labels)) { __Pyx_RaiseClosureNameError("labels"); __PYX_ERR(0, 960, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __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(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_dtype)) { __Pyx_RaiseClosureNameError("dtype"); __PYX_ERR(0, 943, __pyx_L1_error) } - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_dtype) < 0) __PYX_ERR(0, 943, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_order)) { __Pyx_RaiseClosureNameError("order"); __PYX_ERR(0, 943, __pyx_L1_error) } - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_order) < 0) __PYX_ERR(0, 943, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 943, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_dtype)) { __Pyx_RaiseClosureNameError("dtype"); __PYX_ERR(0, 960, __pyx_L1_error) } + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_dtype) < 0) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_order)) { __Pyx_RaiseClosureNameError("order"); __PYX_ERR(0, 960, __pyx_L1_error) } + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_order) < 0) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -28383,7 +28708,7 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C __pyx_cur_scope->__pyx_v_img = __pyx_t_4; __pyx_t_4 = 0; - /* "cc3d.pyx":944 + /* "cc3d.pyx":961 * def __iter__(self): * img = np.zeros(labels.shape, dtype=dtype, order=order) * for key, rns in all_runs.items(): # <<<<<<<<<<<<<< @@ -28391,12 +28716,12 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C * continue */ __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs)) { __Pyx_RaiseClosureNameError("all_runs"); __PYX_ERR(0, 944, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs)) { __Pyx_RaiseClosureNameError("all_runs"); __PYX_ERR(0, 961, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 944, __pyx_L1_error) + __PYX_ERR(0, 961, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_all_runs, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_1; @@ -28404,7 +28729,7 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_1, &__pyx_t_3, NULL, __pyx_t_7); if (unlikely(__pyx_t_8 == 0)) break; - if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 944, __pyx_L1_error) + if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); @@ -28416,20 +28741,20 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":945 + /* "cc3d.pyx":962 * img = np.zeros(labels.shape, dtype=dtype, order=order) * for key, rns in all_runs.items(): * if key == 0: # <<<<<<<<<<<<<< * continue * draw(key, rns, img) */ - __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_cur_scope->__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_cur_scope->__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_9) { - /* "cc3d.pyx":946 + /* "cc3d.pyx":963 * for key, rns in all_runs.items(): * if key == 0: * continue # <<<<<<<<<<<<<< @@ -28438,7 +28763,7 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C */ goto __pyx_L4_continue; - /* "cc3d.pyx":945 + /* "cc3d.pyx":962 * img = np.zeros(labels.shape, dtype=dtype, order=order) * for key, rns in all_runs.items(): * if key == 0: # <<<<<<<<<<<<<< @@ -28447,14 +28772,14 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C */ } - /* "cc3d.pyx":947 + /* "cc3d.pyx":964 * if key == 0: * continue * draw(key, rns, img) # <<<<<<<<<<<<<< * img.setflags(write=0) * yield (key, img) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_draw_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_draw_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -28471,7 +28796,7 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_rns, __pyx_cur_scope->__pyx_v_img}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -28479,13 +28804,13 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_rns, __pyx_cur_scope->__pyx_v_img}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { - __pyx_t_10 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -28499,39 +28824,39 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C __Pyx_INCREF(__pyx_cur_scope->__pyx_v_img); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_img); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_8, __pyx_cur_scope->__pyx_v_img); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":948 + /* "cc3d.pyx":965 * continue * draw(key, rns, img) * img.setflags(write=0) # <<<<<<<<<<<<<< * yield (key, img) * img.setflags(write=1) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_img, __pyx_n_s_setflags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_img, __pyx_n_s_setflags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_write, __pyx_int_0) < 0) __PYX_ERR(0, 948, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 948, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_write, __pyx_int_0) < 0) __PYX_ERR(0, 965, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "cc3d.pyx":949 + /* "cc3d.pyx":966 * draw(key, rns, img) * img.setflags(write=0) * yield (key, img) # <<<<<<<<<<<<<< * img.setflags(write=1) * erase(rns, img) */ - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 949, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); @@ -28559,34 +28884,34 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 949, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 966, __pyx_L1_error) - /* "cc3d.pyx":950 + /* "cc3d.pyx":967 * img.setflags(write=0) * yield (key, img) * img.setflags(write=1) # <<<<<<<<<<<<<< * erase(rns, img) * */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_img, __pyx_n_s_setflags); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 950, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_img, __pyx_n_s_setflags); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_write, __pyx_int_1) < 0) __PYX_ERR(0, 950, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_write, __pyx_int_1) < 0) __PYX_ERR(0, 967, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":951 + /* "cc3d.pyx":968 * yield (key, img) * img.setflags(write=1) * erase(rns, img) # <<<<<<<<<<<<<< * * if in_place: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = NULL; __pyx_t_8 = 0; @@ -28603,7 +28928,7 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_rns, __pyx_cur_scope->__pyx_v_img}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -28611,13 +28936,13 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_rns, __pyx_cur_scope->__pyx_v_img}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { - __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL; @@ -28628,7 +28953,7 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C __Pyx_INCREF(__pyx_cur_scope->__pyx_v_img); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_img); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_cur_scope->__pyx_v_img); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -28639,7 +28964,7 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "cc3d.pyx":942 + /* "cc3d.pyx":959 * * class InPlaceImageIterator(ImageIterator): * def __iter__(self): # <<<<<<<<<<<<<< @@ -28668,7 +28993,7 @@ static PyObject *__pyx_gb_4cc3d_4each_20InPlaceImageIterator_2generator1(__pyx_C return __pyx_r; } -/* "cc3d.pyx":907 +/* "cc3d.pyx":924 * return draw(0, runs, image) * * def each(labels, binary=False, in_place=False): # <<<<<<<<<<<<<< @@ -28695,7 +29020,7 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4cc3d___pyx_scope_struct__each *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 907, __pyx_L1_error) + __PYX_ERR(0, 924, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -28703,14 +29028,14 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_INCREF(__pyx_cur_scope->__pyx_v_labels); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_labels); - /* "cc3d.pyx":923 + /* "cc3d.pyx":940 * Returns: iterator * """ * all_runs = runs(labels) # <<<<<<<<<<<<<< * order = 'F' if labels.flags['F_CONTIGUOUS'] else 'C' * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_runs_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_runs_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -28724,26 +29049,26 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_labels); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_all_runs = __pyx_t_1; __pyx_t_1 = 0; - /* "cc3d.pyx":924 + /* "cc3d.pyx":941 * """ * all_runs = runs(labels) * order = 'F' if labels.flags['F_CONTIGUOUS'] else 'C' # <<<<<<<<<<<<<< * * dtype = labels.dtype */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_labels, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_labels, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __Pyx_INCREF(__pyx_n_u_F); @@ -28756,30 +29081,30 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj __pyx_cur_scope->__pyx_v_order = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":926 + /* "cc3d.pyx":943 * order = 'F' if labels.flags['F_CONTIGUOUS'] else 'C' * * dtype = labels.dtype # <<<<<<<<<<<<<< * if binary: * dtype = bool */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_dtype = __pyx_t_1; __pyx_t_1 = 0; - /* "cc3d.pyx":927 + /* "cc3d.pyx":944 * * dtype = labels.dtype * if binary: # <<<<<<<<<<<<<< * dtype = bool * */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_binary); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 927, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_binary); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 944, __pyx_L1_error) if (__pyx_t_4) { - /* "cc3d.pyx":928 + /* "cc3d.pyx":945 * dtype = labels.dtype * if binary: * dtype = bool # <<<<<<<<<<<<<< @@ -28791,7 +29116,7 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_dtype, ((PyObject*)&PyBool_Type)); __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); - /* "cc3d.pyx":927 + /* "cc3d.pyx":944 * * dtype = labels.dtype * if binary: # <<<<<<<<<<<<<< @@ -28800,90 +29125,90 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj */ } - /* "cc3d.pyx":930 + /* "cc3d.pyx":947 * dtype = bool * * class ImageIterator(): # <<<<<<<<<<<<<< * def __len__(self): * return len(all_runs) - int(0 in all_runs) */ - __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ImageIterator, __pyx_n_s_each_locals_ImageIterator, (PyObject *) NULL, __pyx_n_s_cc3d, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ImageIterator, __pyx_n_s_each_locals_ImageIterator, (PyObject *) NULL, __pyx_n_s_cc3d, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "cc3d.pyx":931 + /* "cc3d.pyx":948 * * class ImageIterator(): * def __len__(self): # <<<<<<<<<<<<<< * return len(all_runs) - int(0 in all_runs) * def __iter__(self): */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4cc3d_4each_13ImageIterator_1__len__, 0, __pyx_n_s_each_locals_ImageIterator___len, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4cc3d_4each_13ImageIterator_1__len__, 0, __pyx_n_s_each_locals_ImageIterator___len, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_len, __pyx_t_3) < 0) __PYX_ERR(0, 931, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_len, __pyx_t_3) < 0) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":933 + /* "cc3d.pyx":950 * def __len__(self): * return len(all_runs) - int(0 in all_runs) * def __iter__(self): # <<<<<<<<<<<<<< * for key, rns in all_runs.items(): * if key == 0: */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4cc3d_4each_13ImageIterator_3__iter__, 0, __pyx_n_s_each_locals_ImageIterator___iter, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4cc3d_4each_13ImageIterator_3__iter__, 0, __pyx_n_s_each_locals_ImageIterator___iter, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_iter, __pyx_t_3) < 0) __PYX_ERR(0, 933, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_iter, __pyx_t_3) < 0) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":930 + /* "cc3d.pyx":947 * dtype = bool * * class ImageIterator(): # <<<<<<<<<<<<<< * def __len__(self): * return len(all_runs) - int(0 in all_runs) */ - __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_ImageIterator, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_ImageIterator, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ImageIterator = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":941 + /* "cc3d.pyx":958 * yield (key, img) * * class InPlaceImageIterator(ImageIterator): # <<<<<<<<<<<<<< * def __iter__(self): * img = np.zeros(labels.shape, dtype=dtype, order=order) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ImageIterator); __Pyx_GIVEREF(__pyx_v_ImageIterator); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ImageIterator); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_InPlaceImageIterator, __pyx_n_s_each_locals_InPlaceImageIterator_2, (PyObject *) NULL, __pyx_n_s_cc3d, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_InPlaceImageIterator, __pyx_n_s_each_locals_InPlaceImageIterator_2, (PyObject *) NULL, __pyx_n_s_cc3d, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "cc3d.pyx":942 + /* "cc3d.pyx":959 * * class InPlaceImageIterator(ImageIterator): * def __iter__(self): # <<<<<<<<<<<<<< * img = np.zeros(labels.shape, dtype=dtype, order=order) * for key, rns in all_runs.items(): */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4cc3d_4each_20InPlaceImageIterator_1__iter__, 0, __pyx_n_s_each_locals_InPlaceImageIterator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4cc3d_4each_20InPlaceImageIterator_1__iter__, 0, __pyx_n_s_each_locals_InPlaceImageIterator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_5) < 0) __PYX_ERR(0, 942, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_5) < 0) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cc3d.pyx":941 + /* "cc3d.pyx":958 * yield (key, img) * * class InPlaceImageIterator(ImageIterator): # <<<<<<<<<<<<<< * def __iter__(self): * img = np.zeros(labels.shape, dtype=dtype, order=order) */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_InPlaceImageIterator, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_InPlaceImageIterator, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_InPlaceImageIterator = __pyx_t_5; __pyx_t_5 = 0; @@ -28891,17 +29216,17 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":953 + /* "cc3d.pyx":970 * erase(rns, img) * * if in_place: # <<<<<<<<<<<<<< * return InPlaceImageIterator() * return ImageIterator() */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 953, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 970, __pyx_L1_error) if (__pyx_t_4) { - /* "cc3d.pyx":954 + /* "cc3d.pyx":971 * * if in_place: * return InPlaceImageIterator() # <<<<<<<<<<<<<< @@ -28909,13 +29234,13 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_v_InPlaceImageIterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_v_InPlaceImageIterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":953 + /* "cc3d.pyx":970 * erase(rns, img) * * if in_place: # <<<<<<<<<<<<<< @@ -28924,7 +29249,7 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj */ } - /* "cc3d.pyx":955 + /* "cc3d.pyx":972 * if in_place: * return InPlaceImageIterator() * return ImageIterator() # <<<<<<<<<<<<<< @@ -28932,13 +29257,13 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj * ## The functions below are conveniences for doing */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_v_ImageIterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_v_ImageIterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "cc3d.pyx":907 + /* "cc3d.pyx":924 * return draw(0, runs, image) * * def each(labels, binary=False, in_place=False): # <<<<<<<<<<<<<< @@ -28963,7 +29288,7 @@ static PyObject *__pyx_pf_4cc3d_26each(CYTHON_UNUSED PyObject *__pyx_self, PyObj return __pyx_r; } -/* "cc3d.pyx":960 +/* "cc3d.pyx":977 * ## common tasks efficiently. * * def dust( # <<<<<<<<<<<<<< @@ -28991,7 +29316,7 @@ static PyObject *__pyx_pw_4cc3d_29dust(PyObject *__pyx_self, PyObject *__pyx_arg PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)__pyx_int_26); - /* "cc3d.pyx":964 + /* "cc3d.pyx":981 * threshold:Union[int,float], * connectivity:int = 26, * in_place:bool = False, # <<<<<<<<<<<<<< @@ -29023,7 +29348,7 @@ static PyObject *__pyx_pw_4cc3d_29dust(PyObject *__pyx_self, PyObject *__pyx_arg case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_threshold)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("dust", 0, 2, 4, 1); __PYX_ERR(0, 960, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("dust", 0, 2, 4, 1); __PYX_ERR(0, 977, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -29039,7 +29364,7 @@ static PyObject *__pyx_pw_4cc3d_29dust(PyObject *__pyx_self, PyObject *__pyx_arg } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dust") < 0)) __PYX_ERR(0, 960, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dust") < 0)) __PYX_ERR(0, 977, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -29060,7 +29385,7 @@ static PyObject *__pyx_pw_4cc3d_29dust(PyObject *__pyx_self, PyObject *__pyx_arg } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("dust", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 960, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("dust", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 977, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.dust", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -29068,7 +29393,7 @@ static PyObject *__pyx_pw_4cc3d_29dust(PyObject *__pyx_self, PyObject *__pyx_arg __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cc3d_28dust(__pyx_self, __pyx_v_img, __pyx_v_threshold, __pyx_v_connectivity, __pyx_v_in_place); - /* "cc3d.pyx":960 + /* "cc3d.pyx":977 * ## common tasks efficiently. * * def dust( # <<<<<<<<<<<<<< @@ -29110,27 +29435,27 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_RefNannySetupContext("dust", 0); __Pyx_INCREF(__pyx_v_img); - /* "cc3d.pyx":981 + /* "cc3d.pyx":998 * Returns: dusted image * """ * if not in_place: # <<<<<<<<<<<<<< * img = np.copy(img) * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 998, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { - /* "cc3d.pyx":982 + /* "cc3d.pyx":999 * """ * if not in_place: * img = np.copy(img) # <<<<<<<<<<<<<< * * cc_labels, N = connected_components( */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -29145,13 +29470,13 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_img) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_img); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_img, __pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":981 + /* "cc3d.pyx":998 * Returns: dusted image * """ * if not in_place: # <<<<<<<<<<<<<< @@ -29160,41 +29485,41 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj */ } - /* "cc3d.pyx":984 + /* "cc3d.pyx":1001 * img = np.copy(img) * * cc_labels, N = connected_components( # <<<<<<<<<<<<<< * img, connectivity=connectivity, return_N=True * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_connected_components); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_connected_components); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "cc3d.pyx":985 + /* "cc3d.pyx":1002 * * cc_labels, N = connected_components( * img, connectivity=connectivity, return_N=True # <<<<<<<<<<<<<< * ) * stats = statistics(cc_labels) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_img); __Pyx_GIVEREF(__pyx_v_img); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_img); - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_connectivity, __pyx_v_connectivity) < 0) __PYX_ERR(0, 985, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return_N, Py_True) < 0) __PYX_ERR(0, 985, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_connectivity, __pyx_v_connectivity) < 0) __PYX_ERR(0, 1002, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return_N, Py_True) < 0) __PYX_ERR(0, 1002, __pyx_L1_error) - /* "cc3d.pyx":984 + /* "cc3d.pyx":1001 * img = np.copy(img) * * cc_labels, N = connected_components( # <<<<<<<<<<<<<< * img, connectivity=connectivity, return_N=True * ) */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -29205,7 +29530,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 984, __pyx_L1_error) + __PYX_ERR(0, 1001, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -29218,15 +29543,15 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; @@ -29234,7 +29559,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 984, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1001, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L5_unpacking_done; @@ -29242,7 +29567,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 984, __pyx_L1_error) + __PYX_ERR(0, 1001, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_cc_labels = __pyx_t_4; @@ -29250,14 +29575,14 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __pyx_v_N = __pyx_t_5; __pyx_t_5 = 0; - /* "cc3d.pyx":987 + /* "cc3d.pyx":1004 * img, connectivity=connectivity, return_N=True * ) * stats = statistics(cc_labels) # <<<<<<<<<<<<<< * mask_sizes = stats["voxel_counts"] * del stats */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_statistics_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_statistics_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -29271,25 +29596,25 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj } __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_cc_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_cc_labels); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 987, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_stats = __pyx_t_6; __pyx_t_6 = 0; - /* "cc3d.pyx":988 + /* "cc3d.pyx":1005 * ) * stats = statistics(cc_labels) * mask_sizes = stats["voxel_counts"] # <<<<<<<<<<<<<< * del stats * */ - __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_stats, __pyx_n_u_voxel_counts); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_stats, __pyx_n_u_voxel_counts); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_mask_sizes = __pyx_t_6; __pyx_t_6 = 0; - /* "cc3d.pyx":989 + /* "cc3d.pyx":1006 * stats = statistics(cc_labels) * mask_sizes = stats["voxel_counts"] * del stats # <<<<<<<<<<<<<< @@ -29299,7 +29624,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_DECREF(__pyx_v_stats); __pyx_v_stats = NULL; - /* "cc3d.pyx":991 + /* "cc3d.pyx":1008 * del stats * * to_mask = [ # <<<<<<<<<<<<<< @@ -29307,19 +29632,19 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj * ] */ { /* enter inner scope */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 991, __pyx_L8_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1008, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); - /* "cc3d.pyx":992 + /* "cc3d.pyx":1009 * * to_mask = [ * i for i in range(1, N+1) if mask_sizes[i] < threshold # <<<<<<<<<<<<<< * ] * */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_N, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_N, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -29327,16 +29652,16 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1009, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -29344,17 +29669,17 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1009, __pyx_L8_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1009, __pyx_L8_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -29364,7 +29689,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 992, __pyx_L8_error) + else __PYX_ERR(0, 1009, __pyx_L8_error) } break; } @@ -29372,14 +29697,14 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj } __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_i, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_mask_sizes, __pyx_8genexpr2__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_mask_sizes, __pyx_8genexpr2__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_threshold, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_threshold, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 992, __pyx_L8_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1009, __pyx_L8_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_8genexpr2__pyx_v_i))) __PYX_ERR(0, 991, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_8genexpr2__pyx_v_i))) __PYX_ERR(0, 1008, __pyx_L8_error) } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -29393,18 +29718,18 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __pyx_v_to_mask = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":995 + /* "cc3d.pyx":1012 * ] * * if len(to_mask) == 0: # <<<<<<<<<<<<<< * return img * elif len(to_mask) <= 5: */ - __pyx_t_8 = PyList_GET_SIZE(__pyx_v_to_mask); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 995, __pyx_L1_error) + __pyx_t_8 = PyList_GET_SIZE(__pyx_v_to_mask); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1012, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_8 == 0) != 0); if (__pyx_t_2) { - /* "cc3d.pyx":996 + /* "cc3d.pyx":1013 * * if len(to_mask) == 0: * return img # <<<<<<<<<<<<<< @@ -29416,7 +29741,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __pyx_r = __pyx_v_img; goto __pyx_L0; - /* "cc3d.pyx":995 + /* "cc3d.pyx":1012 * ] * * if len(to_mask) == 0: # <<<<<<<<<<<<<< @@ -29425,18 +29750,18 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj */ } - /* "cc3d.pyx":997 + /* "cc3d.pyx":1014 * if len(to_mask) == 0: * return img * elif len(to_mask) <= 5: # <<<<<<<<<<<<<< * for label in to_mask: * img *= (cc_labels != label) */ - __pyx_t_8 = PyList_GET_SIZE(__pyx_v_to_mask); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 997, __pyx_L1_error) + __pyx_t_8 = PyList_GET_SIZE(__pyx_v_to_mask); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1014, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_8 <= 5) != 0); if (__pyx_t_2) { - /* "cc3d.pyx":998 + /* "cc3d.pyx":1015 * return img * elif len(to_mask) <= 5: * for label in to_mask: # <<<<<<<<<<<<<< @@ -29447,29 +29772,29 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj for (;;) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1015, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":999 + /* "cc3d.pyx":1016 * elif len(to_mask) <= 5: * for label in to_mask: * img *= (cc_labels != label) # <<<<<<<<<<<<<< * return img * */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_cc_labels, __pyx_v_label, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L1_error) - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_img, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_cc_labels, __pyx_v_label, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_img, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_img, __pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":998 + /* "cc3d.pyx":1015 * return img * elif len(to_mask) <= 5: * for label in to_mask: # <<<<<<<<<<<<<< @@ -29479,7 +29804,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":1000 + /* "cc3d.pyx":1017 * for label in to_mask: * img *= (cc_labels != label) * return img # <<<<<<<<<<<<<< @@ -29491,7 +29816,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __pyx_r = __pyx_v_img; goto __pyx_L0; - /* "cc3d.pyx":997 + /* "cc3d.pyx":1014 * if len(to_mask) == 0: * return img * elif len(to_mask) <= 5: # <<<<<<<<<<<<<< @@ -29500,14 +29825,14 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj */ } - /* "cc3d.pyx":1002 + /* "cc3d.pyx":1019 * return img * * rns = runs(cc_labels) # <<<<<<<<<<<<<< * del cc_labels * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_runs_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_runs_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -29521,13 +29846,13 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj } __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_cc_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_cc_labels); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1002, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_rns = __pyx_t_6; __pyx_t_6 = 0; - /* "cc3d.pyx":1003 + /* "cc3d.pyx":1020 * * rns = runs(cc_labels) * del cc_labels # <<<<<<<<<<<<<< @@ -29537,7 +29862,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_DECREF(__pyx_v_cc_labels); __pyx_v_cc_labels = NULL; - /* "cc3d.pyx":1005 + /* "cc3d.pyx":1022 * del cc_labels * * for label in to_mask: # <<<<<<<<<<<<<< @@ -29548,24 +29873,24 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj for (;;) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1022, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":1006 + /* "cc3d.pyx":1023 * * for label in to_mask: * erase(rns[label], img) # <<<<<<<<<<<<<< * * return img */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_erase); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1006, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_erase); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_rns, __pyx_v_label); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_rns, __pyx_v_label); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = NULL; __pyx_t_11 = 0; @@ -29582,7 +29907,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_5, __pyx_v_img}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -29591,14 +29916,14 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_5, __pyx_v_img}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; @@ -29609,14 +29934,14 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_GIVEREF(__pyx_v_img); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_img); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":1005 + /* "cc3d.pyx":1022 * del cc_labels * * for label in to_mask: # <<<<<<<<<<<<<< @@ -29626,7 +29951,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":1008 + /* "cc3d.pyx":1025 * erase(rns[label], img) * * return img # <<<<<<<<<<<<<< @@ -29638,7 +29963,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj __pyx_r = __pyx_v_img; goto __pyx_L0; - /* "cc3d.pyx":960 + /* "cc3d.pyx":977 * ## common tasks efficiently. * * def dust( # <<<<<<<<<<<<<< @@ -29671,7 +29996,7 @@ static PyObject *__pyx_pf_4cc3d_28dust(CYTHON_UNUSED PyObject *__pyx_self, PyObj return __pyx_r; } -/* "cc3d.pyx":1010 +/* "cc3d.pyx":1027 * return img * * def largest_k( # <<<<<<<<<<<<<< @@ -29700,7 +30025,7 @@ static PyObject *__pyx_pw_4cc3d_31largest_k(PyObject *__pyx_self, PyObject *__py PyObject* values[5] = {0,0,0,0,0}; values[2] = ((PyObject *)__pyx_int_26); - /* "cc3d.pyx":1015 + /* "cc3d.pyx":1032 * connectivity:int = 26, * delta:float = 0, * return_N:bool = False, # <<<<<<<<<<<<<< @@ -29734,7 +30059,7 @@ static PyObject *__pyx_pw_4cc3d_31largest_k(PyObject *__pyx_self, PyObject *__py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("largest_k", 0, 2, 5, 1); __PYX_ERR(0, 1010, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("largest_k", 0, 2, 5, 1); __PYX_ERR(0, 1027, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -29756,7 +30081,7 @@ static PyObject *__pyx_pw_4cc3d_31largest_k(PyObject *__pyx_self, PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "largest_k") < 0)) __PYX_ERR(0, 1010, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "largest_k") < 0)) __PYX_ERR(0, 1027, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -29776,7 +30101,7 @@ static PyObject *__pyx_pw_4cc3d_31largest_k(PyObject *__pyx_self, PyObject *__py __pyx_v_k = values[1]; __pyx_v_connectivity = values[2]; if (values[3]) { - __pyx_v_delta = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_delta == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L3_error) + __pyx_v_delta = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_delta == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L3_error) } else { __pyx_v_delta = ((double)0.0); } @@ -29784,7 +30109,7 @@ static PyObject *__pyx_pw_4cc3d_31largest_k(PyObject *__pyx_self, PyObject *__py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("largest_k", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1010, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("largest_k", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1027, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cc3d.largest_k", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -29792,7 +30117,7 @@ static PyObject *__pyx_pw_4cc3d_31largest_k(PyObject *__pyx_self, PyObject *__py __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4cc3d_30largest_k(__pyx_self, __pyx_v_img, __pyx_v_k, __pyx_v_connectivity, __pyx_v_delta, __pyx_v_return_N); - /* "cc3d.pyx":1010 + /* "cc3d.pyx":1027 * return img * * def largest_k( # <<<<<<<<<<<<<< @@ -29805,7 +30130,7 @@ static PyObject *__pyx_pw_4cc3d_31largest_k(PyObject *__pyx_self, PyObject *__py return __pyx_r; } -/* "cc3d.pyx":1045 +/* "cc3d.pyx":1062 * cts = statistics(cc_labels)["voxel_counts"] * preserve = [ (i,ct) for i,ct in enumerate(cts) if i > 0 ] * preserve.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< @@ -29836,7 +30161,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -29853,7 +30178,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, return __pyx_r; } -/* "cc3d.pyx":1010 +/* "cc3d.pyx":1027 * return img * * def largest_k( # <<<<<<<<<<<<<< @@ -29896,7 +30221,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("largest_k", 0); - /* "cc3d.pyx":1029 + /* "cc3d.pyx":1046 * in the image. * """ * assert k >= 0 # <<<<<<<<<<<<<< @@ -29905,30 +30230,30 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 1029, __pyx_L1_error) + __PYX_ERR(0, 1046, __pyx_L1_error) } } #endif - /* "cc3d.pyx":1031 + /* "cc3d.pyx":1048 * assert k >= 0 * * if k == 0: # <<<<<<<<<<<<<< * return np.zeros(img.shape, dtype=np.uint16) * */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_k, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_k, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "cc3d.pyx":1032 + /* "cc3d.pyx":1049 * * if k == 0: * return np.zeros(img.shape, dtype=np.uint16) # <<<<<<<<<<<<<< @@ -29936,28 +30261,28 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, * cc_labels, N = connected_components( */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_img, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_img, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1032, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -29966,7 +30291,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_6 = 0; goto __pyx_L0; - /* "cc3d.pyx":1031 + /* "cc3d.pyx":1048 * assert k >= 0 * * if k == 0: # <<<<<<<<<<<<<< @@ -29975,53 +30300,53 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "cc3d.pyx":1034 + /* "cc3d.pyx":1051 * return np.zeros(img.shape, dtype=np.uint16) * * cc_labels, N = connected_components( # <<<<<<<<<<<<<< * img, connectivity=connectivity, * return_N=True, delta=delta, */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_connected_components); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_connected_components); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "cc3d.pyx":1035 + /* "cc3d.pyx":1052 * * cc_labels, N = connected_components( * img, connectivity=connectivity, # <<<<<<<<<<<<<< * return_N=True, delta=delta, * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_img); __Pyx_GIVEREF(__pyx_v_img); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_img); - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_connectivity, __pyx_v_connectivity) < 0) __PYX_ERR(0, 1035, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_connectivity, __pyx_v_connectivity) < 0) __PYX_ERR(0, 1052, __pyx_L1_error) - /* "cc3d.pyx":1036 + /* "cc3d.pyx":1053 * cc_labels, N = connected_components( * img, connectivity=connectivity, * return_N=True, delta=delta, # <<<<<<<<<<<<<< * ) * if N <= k: */ - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return_N, Py_True) < 0) __PYX_ERR(0, 1035, __pyx_L1_error) - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1036, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return_N, Py_True) < 0) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_delta, __pyx_t_3) < 0) __PYX_ERR(0, 1035, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_delta, __pyx_t_3) < 0) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":1034 + /* "cc3d.pyx":1051 * return np.zeros(img.shape, dtype=np.uint16) * * cc_labels, N = connected_components( # <<<<<<<<<<<<<< * img, connectivity=connectivity, * return_N=True, delta=delta, */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -30032,7 +30357,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1034, __pyx_L1_error) + __PYX_ERR(0, 1051, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -30045,15 +30370,15 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; @@ -30061,7 +30386,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1051, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; @@ -30069,7 +30394,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1034, __pyx_L1_error) + __PYX_ERR(0, 1051, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_cc_labels = __pyx_t_4; @@ -30077,29 +30402,29 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_N = __pyx_t_1; __pyx_t_1 = 0; - /* "cc3d.pyx":1038 + /* "cc3d.pyx":1055 * return_N=True, delta=delta, * ) * if N <= k: # <<<<<<<<<<<<<< * if return_N: * return cc_labels, N */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_N, __pyx_v_k, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_N, __pyx_v_k, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1055, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "cc3d.pyx":1039 + /* "cc3d.pyx":1056 * ) * if N <= k: * if return_N: # <<<<<<<<<<<<<< * return cc_labels, N * return cc_labels */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_N); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_N); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1056, __pyx_L1_error) if (__pyx_t_2) { - /* "cc3d.pyx":1040 + /* "cc3d.pyx":1057 * if N <= k: * if return_N: * return cc_labels, N # <<<<<<<<<<<<<< @@ -30107,7 +30432,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_cc_labels); __Pyx_GIVEREF(__pyx_v_cc_labels); @@ -30119,7 +30444,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = 0; goto __pyx_L0; - /* "cc3d.pyx":1039 + /* "cc3d.pyx":1056 * ) * if N <= k: * if return_N: # <<<<<<<<<<<<<< @@ -30128,7 +30453,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "cc3d.pyx":1041 + /* "cc3d.pyx":1058 * if return_N: * return cc_labels, N * return cc_labels # <<<<<<<<<<<<<< @@ -30140,7 +30465,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_r = __pyx_v_cc_labels; goto __pyx_L0; - /* "cc3d.pyx":1038 + /* "cc3d.pyx":1055 * return_N=True, delta=delta, * ) * if N <= k: # <<<<<<<<<<<<<< @@ -30149,14 +30474,14 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "cc3d.pyx":1043 + /* "cc3d.pyx":1060 * return cc_labels * * cts = statistics(cc_labels)["voxel_counts"] # <<<<<<<<<<<<<< * preserve = [ (i,ct) for i,ct in enumerate(cts) if i > 0 ] * preserve.sort(key=lambda x: x[1]) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_statistics_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_statistics_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -30170,16 +30495,16 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_cc_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_cc_labels); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1043, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_voxel_counts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_voxel_counts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_cts = __pyx_t_1; __pyx_t_1 = 0; - /* "cc3d.pyx":1044 + /* "cc3d.pyx":1061 * * cts = statistics(cc_labels)["voxel_counts"] * preserve = [ (i,ct) for i,ct in enumerate(cts) if i > 0 ] # <<<<<<<<<<<<<< @@ -30187,7 +30512,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, * preserve = [ x[0] for x in preserve[-k:] ] */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; @@ -30195,26 +30520,26 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_4 = __pyx_v_cts; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_cts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_cts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1061, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1061, __pyx_L10_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1061, __pyx_L10_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1061, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1061, __pyx_L10_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1061, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_6); #endif } @@ -30224,7 +30549,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1044, __pyx_L10_error) + else __PYX_ERR(0, 1061, __pyx_L10_error) } break; } @@ -30234,16 +30559,16 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_6 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_i, __pyx_t_3); - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1061, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_8genexpr3__pyx_v_i, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1044, __pyx_L10_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_8genexpr3__pyx_v_i, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1061, __pyx_L10_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1061, __pyx_L10_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1044, __pyx_L10_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1061, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_8genexpr3__pyx_v_i); __Pyx_GIVEREF(__pyx_8genexpr3__pyx_v_i); @@ -30251,7 +30576,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_8genexpr3__pyx_v_ct); __Pyx_GIVEREF(__pyx_8genexpr3__pyx_v_ct); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_8genexpr3__pyx_v_ct); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1044, __pyx_L10_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1061, __pyx_L10_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } @@ -30269,28 +30594,28 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_preserve = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":1045 + /* "cc3d.pyx":1062 * cts = statistics(cc_labels)["voxel_counts"] * preserve = [ (i,ct) for i,ct in enumerate(cts) if i > 0 ] * preserve.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< * preserve = [ x[0] for x in preserve[-k:] ] * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_preserve, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_preserve, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4cc3d_9largest_k_lambda, 0, __pyx_n_s_largest_k_locals_lambda, NULL, __pyx_n_s_cc3d, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4cc3d_9largest_k_lambda, 0, __pyx_n_s_largest_k_locals_lambda, NULL, __pyx_n_s_cc3d, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cc3d.pyx":1046 + /* "cc3d.pyx":1063 * preserve = [ (i,ct) for i,ct in enumerate(cts) if i > 0 ] * preserve.sort(key=lambda x: x[1]) * preserve = [ x[0] for x in preserve[-k:] ] # <<<<<<<<<<<<<< @@ -30298,35 +30623,35 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, * shape, dtype = cc_labels.shape, cc_labels.dtype */ { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L17_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1063, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Negative(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L17_error) + __pyx_t_3 = PyNumber_Negative(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__pyx_t_3 == Py_None); if (__pyx_t_2) { __pyx_t_8 = 0; } else { - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1046, __pyx_L17_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1063, __pyx_L17_error) __pyx_t_8 = __pyx_t_10; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_preserve, __pyx_t_8, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L17_error) + __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_preserve, __pyx_t_8, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1046, __pyx_L17_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1063, __pyx_L17_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L17_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_x, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_8genexpr4__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L17_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_8genexpr4__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1046, __pyx_L17_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1063, __pyx_L17_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -30340,30 +30665,30 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF_SET(__pyx_v_preserve, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "cc3d.pyx":1048 + /* "cc3d.pyx":1065 * preserve = [ x[0] for x in preserve[-k:] ] * * shape, dtype = cc_labels.shape, cc_labels.dtype # <<<<<<<<<<<<<< * rns = runs(cc_labels) * del cc_labels */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cc_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1048, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cc_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cc_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cc_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_dtype = __pyx_t_1; __pyx_t_1 = 0; - /* "cc3d.pyx":1049 + /* "cc3d.pyx":1066 * * shape, dtype = cc_labels.shape, cc_labels.dtype * rns = runs(cc_labels) # <<<<<<<<<<<<<< * del cc_labels * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_runs_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_runs_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -30377,13 +30702,13 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_cc_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_cc_labels); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_rns = __pyx_t_1; __pyx_t_1 = 0; - /* "cc3d.pyx":1050 + /* "cc3d.pyx":1067 * shape, dtype = cc_labels.shape, cc_labels.dtype * rns = runs(cc_labels) * del cc_labels # <<<<<<<<<<<<<< @@ -30393,27 +30718,27 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF(__pyx_v_cc_labels); __pyx_v_cc_labels = NULL; - /* "cc3d.pyx":1052 + /* "cc3d.pyx":1069 * del cc_labels * * cc_out = np.zeros(shape, dtype=dtype) # <<<<<<<<<<<<<< * for i, label in enumerate(preserve): * draw(i+1, rns[label], cc_out) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1052, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1069, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -30421,7 +30746,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_cc_out = __pyx_t_6; __pyx_t_6 = 0; - /* "cc3d.pyx":1053 + /* "cc3d.pyx":1070 * * cc_out = np.zeros(shape, dtype=dtype) * for i, label in enumerate(preserve): # <<<<<<<<<<<<<< @@ -30434,33 +30759,33 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, for (;;) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1053, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1070, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; __pyx_t_1 = 0; - /* "cc3d.pyx":1054 + /* "cc3d.pyx":1071 * cc_out = np.zeros(shape, dtype=dtype) * for i, label in enumerate(preserve): * draw(i+1, rns[label], cc_out) # <<<<<<<<<<<<<< * * if return_N: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_draw_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1054, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_draw_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_rns, __pyx_v_label); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_rns, __pyx_v_label); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_13 = 0; @@ -30477,7 +30802,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_5, __pyx_t_11, __pyx_v_cc_out}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -30487,7 +30812,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_5, __pyx_t_11, __pyx_v_cc_out}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -30495,7 +30820,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, } else #endif { - __pyx_t_14 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL; @@ -30509,14 +30834,14 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_13, __pyx_v_cc_out); __pyx_t_5 = 0; __pyx_t_11 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":1053 + /* "cc3d.pyx":1070 * * cc_out = np.zeros(shape, dtype=dtype) * for i, label in enumerate(preserve): # <<<<<<<<<<<<<< @@ -30527,17 +30852,17 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cc3d.pyx":1056 + /* "cc3d.pyx":1073 * draw(i+1, rns[label], cc_out) * * if return_N: # <<<<<<<<<<<<<< * return cc_out, N * return cc_out */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_N); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1056, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_N); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1073, __pyx_L1_error) if (__pyx_t_2) { - /* "cc3d.pyx":1057 + /* "cc3d.pyx":1074 * * if return_N: * return cc_out, N # <<<<<<<<<<<<<< @@ -30545,7 +30870,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1057, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_cc_out); __Pyx_GIVEREF(__pyx_v_cc_out); @@ -30557,7 +30882,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_6 = 0; goto __pyx_L0; - /* "cc3d.pyx":1056 + /* "cc3d.pyx":1073 * draw(i+1, rns[label], cc_out) * * if return_N: # <<<<<<<<<<<<<< @@ -30566,7 +30891,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "cc3d.pyx":1058 + /* "cc3d.pyx":1075 * if return_N: * return cc_out, N * return cc_out # <<<<<<<<<<<<<< @@ -30577,7 +30902,7 @@ static PyObject *__pyx_pf_4cc3d_30largest_k(CYTHON_UNUSED PyObject *__pyx_self, __pyx_r = __pyx_v_cc_out; goto __pyx_L0; - /* "cc3d.pyx":1010 + /* "cc3d.pyx":1027 * return img * * def largest_k( # <<<<<<<<<<<<<< @@ -31268,7 +31593,7 @@ static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self __Pyx_RefNannyFinishContext(); } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":734 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -31285,7 +31610,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":735 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":736 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -31293,13 +31618,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":734 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -31318,7 +31643,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":737 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -31335,7 +31660,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":738 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":739 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -31343,13 +31668,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":737 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -31368,7 +31693,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":740 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -31385,7 +31710,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":741 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":742 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -31393,13 +31718,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":740 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -31418,7 +31743,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":743 +/* "../../.virtualenvs/cc3d/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): # <<<<<<<<<<<<<< @@ -31435,7 +31760,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":744 + /* "../../.virtualenvs/cc3d/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) # <<<<<<<<<<<<<< @@ -31443,13 +31768,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":743 + /* "../../.virtualenvs/cc3d/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): # <<<<<<<<<<<<<< @@ -31468,7 +31793,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":746 +/* "../../.virtualenvs/cc3d/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): # <<<<<<<<<<<<<< @@ -31485,7 +31810,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":747 + /* "../../.virtualenvs/cc3d/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) # <<<<<<<<<<<<<< @@ -31493,13 +31818,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":746 + /* "../../.virtualenvs/cc3d/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): # <<<<<<<<<<<<<< @@ -31518,7 +31843,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":749 +/* "../../.virtualenvs/cc3d/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): # <<<<<<<<<<<<<< @@ -31532,7 +31857,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":750 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -31542,7 +31867,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":751 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":752 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -31554,7 +31879,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":750 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -31563,7 +31888,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":753 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":754 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -31577,7 +31902,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":749 + /* "../../.virtualenvs/cc3d/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): # <<<<<<<<<<<<<< @@ -31592,7 +31917,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":868 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -31604,7 +31929,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":869 + /* "../../.virtualenvs/cc3d/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! # <<<<<<<<<<<<<< @@ -31613,7 +31938,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":870 + /* "../../.virtualenvs/cc3d/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) # <<<<<<<<<<<<<< @@ -31622,7 +31947,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":868 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -31634,7 +31959,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":872 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -31649,7 +31974,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":873 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":934 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -31658,7 +31983,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":874 + /* "../../.virtualenvs/cc3d/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: # <<<<<<<<<<<<<< @@ -31668,7 +31993,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":875 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":936 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -31679,7 +32004,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":874 + /* "../../.virtualenvs/cc3d/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: # <<<<<<<<<<<<<< @@ -31688,7 +32013,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":876 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":937 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -31700,7 +32025,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":872 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -31715,7 +32040,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":880 +/* "../../.virtualenvs/cc3d/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: # <<<<<<<<<<<<<< @@ -31739,7 +32064,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":881 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -31755,16 +32080,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":882 + /* "../../.virtualenvs/cc3d/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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":881 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -31778,7 +32103,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":883 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":944 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -31788,28 +32113,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":884 + /* "../../.virtualenvs/cc3d/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__15, 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__16, 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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":881 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -31824,7 +32149,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":880 + /* "../../.virtualenvs/cc3d/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: # <<<<<<<<<<<<<< @@ -31847,7 +32172,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":886 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -31871,7 +32196,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":887 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -31887,16 +32212,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":888 + /* "../../.virtualenvs/cc3d/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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":887 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -31910,7 +32235,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":889 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":950 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -31920,28 +32245,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":890 + /* "../../.virtualenvs/cc3d/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__16, 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__17, 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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":887 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -31956,7 +32281,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":886 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -31979,7 +32304,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":892 +/* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -32003,7 +32328,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":893 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -32019,16 +32344,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":894 + /* "../../.virtualenvs/cc3d/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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":893 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -32042,7 +32367,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":895 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":956 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -32052,28 +32377,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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":896 + /* "../../.virtualenvs/cc3d/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__16, 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__17, 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/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":893 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -32088,7 +32413,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":892 + /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -32111,6 +32436,180 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } +/* "../../.virtualenvs/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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/cc3d/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; +} + /* "pair.from_py":145 * * @cname("__pyx_convert_pair_from_py_size_t__and_size_t") @@ -33139,7 +33638,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__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 133, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, 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; @@ -33171,7 +33670,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__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 136, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, 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; @@ -33298,7 +33797,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 148, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, 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; @@ -33572,7 +34071,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__20, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 176, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, 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; @@ -33816,7 +34315,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__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 192, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, 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; @@ -34550,7 +35049,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__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, 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; @@ -34606,7 +35105,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__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, 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; @@ -36316,7 +36815,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__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 418, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, 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; @@ -37364,7 +37863,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__25, 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__26, 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; @@ -37726,7 +38225,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__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 520, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, 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; @@ -38275,7 +38774,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__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 570, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, 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; @@ -38392,7 +38891,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__28, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __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; @@ -39430,7 +39929,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__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, 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; @@ -39486,7 +39985,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__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, 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; @@ -39843,9 +40342,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__31); - __Pyx_GIVEREF(__pyx_slice__31); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__31); + __Pyx_INCREF(__pyx_slice__32); + __Pyx_GIVEREF(__pyx_slice__32); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32); } } __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) @@ -39878,7 +40377,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__31); 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__32); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 685, __pyx_L1_error) } __pyx_L7:; @@ -40018,9 +40517,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__31); - __Pyx_GIVEREF(__pyx_slice__31); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__31); + __Pyx_INCREF(__pyx_slice__32); + __Pyx_GIVEREF(__pyx_slice__32); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32); } } __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) @@ -40147,7 +40646,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 703, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, 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; @@ -42331,7 +42830,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__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, 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; @@ -42387,7 +42886,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__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, 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; @@ -47110,6 +47609,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, {&__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_k_Expected_at_least_d_argument_s_g, sizeof(__pyx_k_Expected_at_least_d_argument_s_g), 0, 0, 1, 0}, + {&__pyx_kp_u_Explicitly_defined_out_dtype, __pyx_k_Explicitly_defined_out_dtype, sizeof(__pyx_k_Explicitly_defined_out_dtype), 0, 1, 0, 0}, {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1}, {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS, sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1}, {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0}, @@ -47143,9 +47643,10 @@ 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_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 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_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, {&__pyx_n_s_all_runs, __pyx_k_all_runs, sizeof(__pyx_k_all_runs), 0, 0, 1, 1}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, @@ -47235,6 +47736,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_int64_t, __pyx_k_int64_t, sizeof(__pyx_k_int64_t), 0, 0, 1, 1}, {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, {&__pyx_n_s_int8_t, __pyx_k_int8_t, sizeof(__pyx_k_int8_t), 0, 0, 1, 1}, + {&__pyx_kp_u_is_too_small_to_contain_the_est, __pyx_k_is_too_small_to_contain_the_est, sizeof(__pyx_k_is_too_small_to_contain_the_est), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 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}, @@ -47260,6 +47762,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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_mul, __pyx_k_mul, sizeof(__pyx_k_mul), 0, 0, 1, 1}, + {&__pyx_kp_u_must_be_one_of_np_uint16_np_uin, __pyx_k_must_be_one_of_np_uint16_np_uin, sizeof(__pyx_k_must_be_one_of_np_uint16_np_uin), 0, 1, 0, 0}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1}, @@ -47377,10 +47880,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 205, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 261, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1053, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1070, __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) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(3, 832, __pyx_L1_error) @@ -47393,99 +47896,99 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "cc3d.pyx":266 + /* "cc3d.pyx":271 * * if data.size == 0: * return np.zeros(shape=(0,), dtype=data.dtype) # <<<<<<<<<<<<<< * * order = 'F' if data.flags['F_CONTIGUOUS'] else 'C' */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "cc3d.pyx":321 + /* "cc3d.pyx":326 * if connectivity in (4,6): * max_labels = min(max_labels, (union_find_voxels // 2) + 1) * elif connectivity == (8,18): # <<<<<<<<<<<<<< * max_labels = min(max_labels, (union_find_voxels // 4) + 1) * else: # 26 */ - __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_8, __pyx_int_18); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_8, __pyx_int_18); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "cc3d.pyx":580 + /* "cc3d.pyx":597 * @cython.wraparound(False) * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): # <<<<<<<<<<<<<< * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 580, __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, 580, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); - /* "cc3d.pyx":931 + /* "cc3d.pyx":948 * * class ImageIterator(): * def __len__(self): # <<<<<<<<<<<<<< * return len(all_runs) - int(0 in all_runs) * def __iter__(self): */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 931, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cc3d_pyx, __pyx_n_s_len, 931, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 931, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cc3d_pyx, __pyx_n_s_len, 948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 948, __pyx_L1_error) - /* "cc3d.pyx":933 + /* "cc3d.pyx":950 * def __len__(self): * return len(all_runs) - int(0 in all_runs) * def __iter__(self): # <<<<<<<<<<<<<< * for key, rns in all_runs.items(): * if key == 0: */ - __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_rns, __pyx_n_s_img); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 933, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cc3d_pyx, __pyx_n_s_iter, 933, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_rns, __pyx_n_s_img); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cc3d_pyx, __pyx_n_s_iter, 950, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 950, __pyx_L1_error) - /* "cc3d.pyx":942 + /* "cc3d.pyx":959 * * class InPlaceImageIterator(ImageIterator): * def __iter__(self): # <<<<<<<<<<<<<< * img = np.zeros(labels.shape, dtype=dtype, order=order) * for key, rns in all_runs.items(): */ - __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_img, __pyx_n_s_key, __pyx_n_s_rns); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cc3d_pyx, __pyx_n_s_iter, 942, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_img, __pyx_n_s_key, __pyx_n_s_rns); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cc3d_pyx, __pyx_n_s_iter, 959, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 959, __pyx_L1_error) - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":884 + /* "../../.virtualenvs/cc3d/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__15 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 945, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); - /* "../../.virtualenvs/cc3d/lib/python3.9/site-packages/numpy/__init__.pxd":890 + /* "../../.virtualenvs/cc3d/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__16 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 951, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "View.MemoryView":133 * @@ -47494,9 +47997,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if itemsize <= 0: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "View.MemoryView":136 * @@ -47505,9 +48008,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if not isinstance(format, bytes): */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "View.MemoryView":148 * @@ -47516,9 +48019,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "View.MemoryView":176 * self.data = malloc(self.len) @@ -47527,9 +48030,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if self.dtype_is_object: */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "View.MemoryView":192 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -47538,9 +48041,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * info.buf = self.data * info.len = self.len */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(3, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -47548,18 +48051,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__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(3, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "(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__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "View.MemoryView":418 * def __setitem__(memoryview self, object index, object value): @@ -47568,9 +48071,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "View.MemoryView":495 * result = struct.unpack(self.view.format, bytesitem) @@ -47579,9 +48082,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * else: * if len(self.view.format) == 1: */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "View.MemoryView":520 * def __getbuffer__(self, Py_buffer *info, int flags): @@ -47590,9 +48093,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if flags & PyBUF_ND: */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "View.MemoryView":570 * if self.view.strides == NULL: @@ -47601,9 +48104,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "View.MemoryView":577 * def suboffsets(self): @@ -47612,12 +48115,12 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__28 = PyTuple_New(1); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); + __pyx_tuple__29 = PyTuple_New(1); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__28, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__28); + PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__29); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -47625,18 +48128,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__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); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "(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__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); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); /* "View.MemoryView":682 * if item is Ellipsis: @@ -47645,9 +48148,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * seen_ellipsis = True * else: */ - __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(3, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__31); - __Pyx_GIVEREF(__pyx_slice__31); + __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(3, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__32); + __Pyx_GIVEREF(__pyx_slice__32); /* "View.MemoryView":703 * for suboffset in suboffsets[:ndim]: @@ -47656,9 +48159,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(3, 703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(3, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -47666,18 +48169,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__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(3, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(3, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); /* "(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__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(3, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(3, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); /* "cc3d.pyx":106 * @@ -47686,10 +48189,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """ * If the array is contiguous, attempt an in place reshape */ - __pyx_tuple__35 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_shape, __pyx_n_s_order, __pyx_n_s_nbytes, __pyx_n_s_strides, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 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_cc3d_pyx, __pyx_n_s_reshape, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_tuple__36 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_shape, __pyx_n_s_order, __pyx_n_s_nbytes, __pyx_n_s_strides, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 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_cc3d_pyx, __pyx_n_s_reshape, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 106, __pyx_L1_error) /* "cc3d.pyx":141 * return N @@ -47698,10 +48201,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef uint8_t[:] arr_memview8u * cdef uint16_t[:] arr_memview16u */ - __pyx_tuple__37 = PyTuple_Pack(14, __pyx_n_s_data, __pyx_n_s_arr_memview8u, __pyx_n_s_arr_memview16u, __pyx_n_s_arr_memview32u, __pyx_n_s_arr_memview64u, __pyx_n_s_arr_memviewf, __pyx_n_s_arr_memviewd, __pyx_n_s_first_foreground_row, __pyx_n_s_last_foreground_row, __pyx_n_s_writable, __pyx_n_s_dtype, __pyx_n_s_sx, __pyx_n_s_linear_data, __pyx_n_s_epl); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 14, 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_cc3d_pyx, __pyx_n_s_estimate_provisional_labels, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(14, __pyx_n_s_data, __pyx_n_s_arr_memview8u, __pyx_n_s_arr_memview16u, __pyx_n_s_arr_memview32u, __pyx_n_s_arr_memview64u, __pyx_n_s_arr_memviewf, __pyx_n_s_arr_memviewd, __pyx_n_s_first_foreground_row, __pyx_n_s_last_foreground_row, __pyx_n_s_writable, __pyx_n_s_dtype, __pyx_n_s_sx, __pyx_n_s_linear_data, __pyx_n_s_epl); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 14, 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_cc3d_pyx, __pyx_n_s_estimate_provisional_labels, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 141, __pyx_L1_error) /* "cc3d.pyx":212 * return (epl, first_foreground_row, last_foreground_row) @@ -47710,166 +48213,166 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * data, int64_t max_labels=-1, * int64_t connectivity=26, native_bool return_N=False, */ - __pyx_tuple__39 = PyTuple_Pack(30, __pyx_n_s_data, __pyx_n_s_max_labels, __pyx_n_s_connectivity, __pyx_n_s_return_N, __pyx_n_s_delta, __pyx_n_s_dims, __pyx_n_s_order, __pyx_n_s_shape, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_arr_memview8u, __pyx_n_s_arr_memview16u, __pyx_n_s_arr_memview32u, __pyx_n_s_arr_memview64u, __pyx_n_s_arr_memviewf, __pyx_n_s_arr_memviewd, __pyx_n_s_voxels, __pyx_n_s_out_labels16, __pyx_n_s_out_labels32, __pyx_n_s_out_labels64, __pyx_n_s_epl, __pyx_n_s_first_foreground_row, __pyx_n_s_last_foreground_row, __pyx_n_s_union_find_voxels, __pyx_n_s_out_dtype, __pyx_n_s_out_labels, __pyx_n_s_dtype, __pyx_n_s_N, __pyx_n_s_writable); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(5, 0, 30, 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_cc3d_pyx, __pyx_n_s_connected_components, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(30, __pyx_n_s_data, __pyx_n_s_max_labels, __pyx_n_s_connectivity, __pyx_n_s_return_N, __pyx_n_s_delta, __pyx_n_s_out_dtype, __pyx_n_s_dims, __pyx_n_s_order, __pyx_n_s_shape, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_arr_memview8u, __pyx_n_s_arr_memview16u, __pyx_n_s_arr_memview32u, __pyx_n_s_arr_memview64u, __pyx_n_s_arr_memviewf, __pyx_n_s_arr_memviewd, __pyx_n_s_voxels, __pyx_n_s_out_labels16, __pyx_n_s_out_labels32, __pyx_n_s_out_labels64, __pyx_n_s_epl, __pyx_n_s_first_foreground_row, __pyx_n_s_last_foreground_row, __pyx_n_s_union_find_voxels, __pyx_n_s_out_labels, __pyx_n_s_dtype, __pyx_n_s_N, __pyx_n_s_writable); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(6, 0, 30, 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_cc3d_pyx, __pyx_n_s_connected_components, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 212, __pyx_L1_error) - /* "cc3d.pyx":493 + /* "cc3d.pyx":510 * return out_labels * * def _final_reshape(out_labels, sx, sy, sz, dims, order): # <<<<<<<<<<<<<< * if dims == 3: * if order == 'C': */ - __pyx_tuple__41 = PyTuple_Pack(6, __pyx_n_s_out_labels, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_dims, __pyx_n_s_order); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 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_cc3d_pyx, __pyx_n_s_final_reshape, 493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_tuple__42 = PyTuple_Pack(6, __pyx_n_s_out_labels, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_dims, __pyx_n_s_order); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 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_cc3d_pyx, __pyx_n_s_final_reshape, 510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 510, __pyx_L1_error) - /* "cc3d.pyx":547 + /* "cc3d.pyx":564 * * * def statistics(out_labels): # <<<<<<<<<<<<<< * """ * statistics(cnp.ndarray[UINT, ndim=3] out_labels): */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_out_labels); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_cc3d_pyx, __pyx_n_s_statistics_2, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_out_labels); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_cc3d_pyx, __pyx_n_s_statistics_2, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 564, __pyx_L1_error) - /* "cc3d.pyx":580 + /* "cc3d.pyx":597 * @cython.wraparound(False) * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): # <<<<<<<<<<<<<< * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] */ - __pyx_tuple__45 = PyTuple_Pack(20, __pyx_n_s_out_labels, __pyx_n_s_voxels, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_N, __pyx_n_s_counts, __pyx_n_s_bounding_boxes, __pyx_n_s_centroids, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_label, __pyx_n_s_slices, __pyx_n_s_xs, __pyx_n_s_xe, __pyx_n_s_ys, __pyx_n_s_ye, __pyx_n_s_zs, __pyx_n_s_ze); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 20, 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_cc3d_pyx, __pyx_n_s_statistics, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_tuple__46 = PyTuple_Pack(20, __pyx_n_s_out_labels, __pyx_n_s_voxels, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_N, __pyx_n_s_counts, __pyx_n_s_bounding_boxes, __pyx_n_s_centroids, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_label, __pyx_n_s_slices, __pyx_n_s_xs, __pyx_n_s_xe, __pyx_n_s_ys, __pyx_n_s_ye, __pyx_n_s_zs, __pyx_n_s_ze); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 20, 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_cc3d_pyx, __pyx_n_s_statistics, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 597, __pyx_L1_error) - /* "cc3d.pyx":646 + /* "cc3d.pyx":663 * } * * def voxel_connectivity_graph(data, int64_t connectivity=26): # <<<<<<<<<<<<<< * """ * Extracts the voxel connectivity graph from a multi-label image. */ - __pyx_tuple__47 = PyTuple_Pack(17, __pyx_n_s_data, __pyx_n_s_connectivity, __pyx_n_s_dims, __pyx_n_s_out_dtype, __pyx_n_s_shape, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_arr_memview8u, __pyx_n_s_arr_memview16u, __pyx_n_s_arr_memview32u, __pyx_n_s_arr_memview64u, __pyx_n_s_voxels, __pyx_n_s_graph8, __pyx_n_s_graph32, __pyx_n_s_graph, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 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_cc3d_pyx, __pyx_n_s_voxel_connectivity_graph, 646, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_tuple__48 = PyTuple_Pack(17, __pyx_n_s_data, __pyx_n_s_connectivity, __pyx_n_s_dims, __pyx_n_s_out_dtype, __pyx_n_s_shape, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_arr_memview8u, __pyx_n_s_arr_memview16u, __pyx_n_s_arr_memview32u, __pyx_n_s_arr_memview64u, __pyx_n_s_voxels, __pyx_n_s_graph8, __pyx_n_s_graph32, __pyx_n_s_graph, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 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_cc3d_pyx, __pyx_n_s_voxel_connectivity_graph, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 663, __pyx_L1_error) - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< * cnp.ndarray[INTEGER, ndim=3, cast=True] labels, * int connectivity=26 */ - __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_labels, __pyx_n_s_connectivity, __pyx_n_s_res, __pyx_n_s_output, __pyx_n_s_i); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 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_cc3d_pyx, __pyx_n_s_region_graph, 801, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_labels, __pyx_n_s_connectivity, __pyx_n_s_res, __pyx_n_s_output, __pyx_n_s_i); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 818, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 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_cc3d_pyx, __pyx_n_s_region_graph, 818, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 818, __pyx_L1_error) - /* "cc3d.pyx":839 + /* "cc3d.pyx":856 * ## of a densely labeled image into a series of binary images. * * def runs(labels): # <<<<<<<<<<<<<< * """ * runs(labels) */ - __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_labels); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_cc3d_pyx, __pyx_n_s_runs_2, 839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_labels); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_cc3d_pyx, __pyx_n_s_runs_2, 856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 856, __pyx_L1_error) - /* "cc3d.pyx":848 + /* "cc3d.pyx":865 * return _runs(reshape(labels, (labels.size,))) * * def _runs( # <<<<<<<<<<<<<< * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_labels); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_cc3d_pyx, __pyx_n_s_runs, 848, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_labels); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_cc3d_pyx, __pyx_n_s_runs, 865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 865, __pyx_L1_error) - /* "cc3d.pyx":862 + /* "cc3d.pyx":879 * raise TypeError("Unsupported type: " + str(labels.dtype)) * * def draw( # <<<<<<<<<<<<<< * label, * vector[cpp_pair[size_t, size_t]] runs, */ - __pyx_tuple__55 = PyTuple_Pack(3, __pyx_n_s_label, __pyx_n_s_runs_2, __pyx_n_s_image); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 862, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); - __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 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_cc3d_pyx, __pyx_n_s_draw_2, 862, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_label, __pyx_n_s_runs_2, __pyx_n_s_image); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 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_cc3d_pyx, __pyx_n_s_draw_2, 879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 879, __pyx_L1_error) - /* "cc3d.pyx":875 + /* "cc3d.pyx":892 * return _draw(label, runs, reshape(image, (image.size,))) * * def _draw( # <<<<<<<<<<<<<< * label, * vector[cpp_pair[size_t, size_t]] runs, */ - __pyx_tuple__57 = PyTuple_Pack(3, __pyx_n_s_label, __pyx_n_s_runs_2, __pyx_n_s_image); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 875, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 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_cc3d_pyx, __pyx_n_s_draw, 875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_tuple__58 = PyTuple_Pack(3, __pyx_n_s_label, __pyx_n_s_runs_2, __pyx_n_s_image); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 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_cc3d_pyx, __pyx_n_s_draw, 892, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 892, __pyx_L1_error) - /* "cc3d.pyx":895 + /* "cc3d.pyx":912 * return image * * def erase( # <<<<<<<<<<<<<< * vector[cpp_pair[size_t, size_t]] runs, * image */ - __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_s_runs_2, __pyx_n_s_image); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 895, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_cc3d_pyx, __pyx_n_s_erase, 895, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 895, __pyx_L1_error) + __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_runs_2, __pyx_n_s_image); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_cc3d_pyx, __pyx_n_s_erase, 912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 912, __pyx_L1_error) - /* "cc3d.pyx":907 + /* "cc3d.pyx":924 * return draw(0, runs, image) * * def each(labels, binary=False, in_place=False): # <<<<<<<<<<<<<< * """ * each(labels, binary=False, in_place=False) */ - __pyx_tuple__61 = PyTuple_Pack(8, __pyx_n_s_labels, __pyx_n_s_binary, __pyx_n_s_in_place, __pyx_n_s_all_runs, __pyx_n_s_order, __pyx_n_s_dtype, __pyx_n_s_ImageIterator, __pyx_n_s_InPlaceImageIterator); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 907, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 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_cc3d_pyx, __pyx_n_s_each, 907, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 907, __pyx_L1_error) + __pyx_tuple__62 = PyTuple_Pack(8, __pyx_n_s_labels, __pyx_n_s_binary, __pyx_n_s_in_place, __pyx_n_s_all_runs, __pyx_n_s_order, __pyx_n_s_dtype, __pyx_n_s_ImageIterator, __pyx_n_s_InPlaceImageIterator); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 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_cc3d_pyx, __pyx_n_s_each, 924, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 924, __pyx_L1_error) - /* "cc3d.pyx":960 + /* "cc3d.pyx":977 * ## common tasks efficiently. * * def dust( # <<<<<<<<<<<<<< * img:np.ndarray, * threshold:Union[int,float], */ - __pyx_tuple__63 = PyTuple_Pack(12, __pyx_n_s_img, __pyx_n_s_threshold, __pyx_n_s_connectivity, __pyx_n_s_in_place, __pyx_n_s_cc_labels, __pyx_n_s_N, __pyx_n_s_stats, __pyx_n_s_mask_sizes, __pyx_n_s_to_mask, __pyx_n_s_label, __pyx_n_s_rns, __pyx_n_s_i); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 960, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 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_cc3d_pyx, __pyx_n_s_dust, 960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(12, __pyx_n_s_img, __pyx_n_s_threshold, __pyx_n_s_connectivity, __pyx_n_s_in_place, __pyx_n_s_cc_labels, __pyx_n_s_N, __pyx_n_s_stats, __pyx_n_s_mask_sizes, __pyx_n_s_to_mask, __pyx_n_s_label, __pyx_n_s_rns, __pyx_n_s_i); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 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_cc3d_pyx, __pyx_n_s_dust, 977, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 977, __pyx_L1_error) - /* "cc3d.pyx":1010 + /* "cc3d.pyx":1027 * return img * * def largest_k( # <<<<<<<<<<<<<< * img:np.ndarray, * k:int, */ - __pyx_tuple__65 = PyTuple_Pack(18, __pyx_n_s_img, __pyx_n_s_k, __pyx_n_s_connectivity, __pyx_n_s_delta, __pyx_n_s_return_N, __pyx_n_s_cc_labels, __pyx_n_s_N, __pyx_n_s_cts, __pyx_n_s_preserve, __pyx_n_s_shape, __pyx_n_s_dtype, __pyx_n_s_rns, __pyx_n_s_cc_out, __pyx_n_s_i, __pyx_n_s_label, __pyx_n_s_i, __pyx_n_s_ct, __pyx_n_s_x); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1010, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); - __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cc3d_pyx, __pyx_n_s_largest_k, 1010, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 1010, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(18, __pyx_n_s_img, __pyx_n_s_k, __pyx_n_s_connectivity, __pyx_n_s_delta, __pyx_n_s_return_N, __pyx_n_s_cc_labels, __pyx_n_s_N, __pyx_n_s_cts, __pyx_n_s_preserve, __pyx_n_s_shape, __pyx_n_s_dtype, __pyx_n_s_rns, __pyx_n_s_cc_out, __pyx_n_s_i, __pyx_n_s_label, __pyx_n_s_i, __pyx_n_s_ct, __pyx_n_s_x); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1027, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 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_cc3d_pyx, __pyx_n_s_largest_k, 1027, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1027, __pyx_L1_error) /* "View.MemoryView":286 * return self.name @@ -47878,9 +48381,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(3, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); + __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 * @@ -47889,9 +48392,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef indirect = Enum("") * */ - __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(3, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); + __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("") @@ -47900,9 +48403,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(3, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); + __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 * @@ -47911,9 +48414,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(3, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); + __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 * @@ -47922,19 +48425,19 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(3, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); + __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__72 = 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__72)) __PYX_ERR(3, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__72); - __Pyx_GIVEREF(__pyx_tuple__72); - __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __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:; @@ -48003,7 +48506,7 @@ static int __Pyx_modinit_type_init_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_4cc3d___pyx_scope_struct__each) < 0) __PYX_ERR(0, 907, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4cc3d___pyx_scope_struct__each) < 0) __PYX_ERR(0, 924, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4cc3d___pyx_scope_struct__each.tp_print = 0; #endif @@ -48011,7 +48514,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4cc3d___pyx_scope_struct__each.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4cc3d___pyx_scope_struct__each = &__pyx_type_4cc3d___pyx_scope_struct__each; - if (PyType_Ready(&__pyx_type_4cc3d___pyx_scope_struct_1___iter__) < 0) __PYX_ERR(0, 933, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4cc3d___pyx_scope_struct_1___iter__) < 0) __PYX_ERR(0, 950, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4cc3d___pyx_scope_struct_1___iter__.tp_print = 0; #endif @@ -48019,7 +48522,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4cc3d___pyx_scope_struct_1___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4cc3d___pyx_scope_struct_1___iter__ = &__pyx_type_4cc3d___pyx_scope_struct_1___iter__; - if (PyType_Ready(&__pyx_type_4cc3d___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(0, 942, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4cc3d___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(0, 959, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4cc3d___pyx_scope_struct_2___iter__.tp_print = 0; #endif @@ -48119,18 +48622,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; @@ -48531,345 +49054,345 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_connected_components, __pyx_t_1) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":493 + /* "cc3d.pyx":510 * return out_labels * * def _final_reshape(out_labels, sx, sy, sz, dims, order): # <<<<<<<<<<<<<< * if dims == 3: * if order == 'C': */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_7_final_reshape, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_7_final_reshape, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_final_reshape, __pyx_t_1) < 0) __PYX_ERR(0, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_final_reshape, __pyx_t_1) < 0) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":547 + /* "cc3d.pyx":564 * * * def statistics(out_labels): # <<<<<<<<<<<<<< * """ * statistics(cnp.ndarray[UINT, ndim=3] out_labels): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_9statistics, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_9statistics, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_statistics_2, __pyx_t_1) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_statistics_2, __pyx_t_1) < 0) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":580 + /* "cc3d.pyx":597 * @cython.wraparound(False) * @cython.nonecheck(False) * def _statistics(cnp.ndarray[UINT, ndim=3] out_labels): # <<<<<<<<<<<<<< * cdef uint64_t voxels = out_labels.size; * cdef uint64_t sx = out_labels.shape[0] */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_4cc3d_33_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_4cc3d_33_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_4cc3d_35_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_4cc3d_35_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_4cc3d_37_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_4cc3d_37_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_4cc3d_39_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_4cc3d_39_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __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, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_4cc3d_11_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_4cc3d_11_statistics, 0, __pyx_n_s_statistics, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __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_statistics, __pyx_t_2) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_statistics, __pyx_t_2) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cc3d.pyx":646 + /* "cc3d.pyx":663 * } * * def voxel_connectivity_graph(data, int64_t connectivity=26): # <<<<<<<<<<<<<< * """ * Extracts the voxel connectivity graph from a multi-label image. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_13voxel_connectivity_graph, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_13voxel_connectivity_graph, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_voxel_connectivity_graph, __pyx_t_2) < 0) __PYX_ERR(0, 646, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_voxel_connectivity_graph, __pyx_t_2) < 0) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cc3d.pyx":803 + /* "cc3d.pyx":820 * def region_graph( * cnp.ndarray[INTEGER, ndim=3, cast=True] labels, * int connectivity=26 # <<<<<<<<<<<<<< * ): * """ */ - __pyx_t_2 = __Pyx_PyInt_From_long(26); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(26); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< * cnp.ndarray[INTEGER, ndim=3, cast=True] labels, * int connectivity=26 */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "cc3d.pyx":803 + /* "cc3d.pyx":820 * def region_graph( * cnp.ndarray[INTEGER, ndim=3, cast=True] labels, * int connectivity=26 # <<<<<<<<<<<<<< * ): * """ */ - __pyx_t_2 = __Pyx_PyInt_From_long(26); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(26); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_k__8 = __pyx_t_2; + __pyx_k__9 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cc3d.pyx":801 + /* "cc3d.pyx":818 * return graph.reshape( (sx), order='F') * * def region_graph( # <<<<<<<<<<<<<< * cnp.ndarray[INTEGER, ndim=3, cast=True] labels, * int connectivity=26 */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_4cc3d_43region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_4cc3d_43region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults8), 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults8), 0)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_3)->__pyx_arg_connectivity = 26; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_1); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4cc3d_96__defaults__); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_4cc3d_45region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_4cc3d_45region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults9), 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults9), 0)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_t_3)->__pyx_arg_connectivity = 26; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_1); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4cc3d_98__defaults__); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_4cc3d_47region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_4cc3d_47region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults10), 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults10), 0)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_3)->__pyx_arg_connectivity = 26; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_1); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4cc3d_100__defaults__); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_4cc3d_49region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_4cc3d_49region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults11), 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults11), 0)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_3)->__pyx_arg_connectivity = 26; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_1); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4cc3d_102__defaults__); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_4cc3d_51region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_4cc3d_51region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults12), 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults12), 0)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_t_3)->__pyx_arg_connectivity = 26; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_1); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4cc3d_104__defaults__); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_4cc3d_53region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_4cc3d_53region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults13), 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults13), 0)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_3)->__pyx_arg_connectivity = 26; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_1); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4cc3d_106__defaults__); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_4cc3d_55region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_4cc3d_55region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults14), 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults14), 0)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_3)->__pyx_arg_connectivity = 26; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_1); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4cc3d_108__defaults__); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_4cc3d_57region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_4cc3d_57region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults15), 0)) __PYX_ERR(0, 801, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults15), 0)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_t_3)->__pyx_arg_connectivity = 26; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_1); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4cc3d_110__defaults__); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_4cc3d_15region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_4cc3d_15region_graph, 0, __pyx_n_s_region_graph, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_1); ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_region_graph, __pyx_t_3) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_region_graph, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":839 + /* "cc3d.pyx":856 * ## of a densely labeled image into a series of binary images. * * def runs(labels): # <<<<<<<<<<<<<< * """ * runs(labels) */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_17runs, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_17runs, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_runs_2, __pyx_t_1) < 0) __PYX_ERR(0, 839, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_runs_2, __pyx_t_1) < 0) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":848 + /* "cc3d.pyx":865 * return _runs(reshape(labels, (labels.size,))) * * def _runs( # <<<<<<<<<<<<<< * cnp.ndarray[UINT, ndim=1, cast=True] labels * ): */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_4cc3d_61_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_4cc3d_61_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 848, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_4cc3d_63_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_4cc3d_63_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 848, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_4cc3d_65_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_4cc3d_65_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 848, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_4cc3d_67_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_4cc3d_67_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 848, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_4cc3d_19_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_4cc3d_19_runs, 0, __pyx_n_s_runs, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_runs, __pyx_t_3) < 0) __PYX_ERR(0, 848, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_runs, __pyx_t_3) < 0) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":862 + /* "cc3d.pyx":879 * raise TypeError("Unsupported type: " + str(labels.dtype)) * * def draw( # <<<<<<<<<<<<<< * label, * vector[cpp_pair[size_t, size_t]] runs, */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_21draw, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_21draw, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_draw_2, __pyx_t_3) < 0) __PYX_ERR(0, 862, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_draw_2, __pyx_t_3) < 0) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cc3d.pyx":875 + /* "cc3d.pyx":892 * return _draw(label, runs, reshape(image, (image.size,))) * * def _draw( # <<<<<<<<<<<<<< * label, * vector[cpp_pair[size_t, size_t]] runs, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_4cc3d_71_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_4cc3d_71_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 875, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_4cc3d_73_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_4cc3d_73_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 875, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_4cc3d_75_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_4cc3d_75_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 875, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_4cc3d_77_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_4cc3d_77_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 875, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_4cc3d_23_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_4cc3d_23_draw, 0, __pyx_n_s_draw, NULL, __pyx_n_s_cc3d, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_1)->__signatures__ = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_draw, __pyx_t_1) < 0) __PYX_ERR(0, 875, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_draw, __pyx_t_1) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":895 + /* "cc3d.pyx":912 * return image * * def erase( # <<<<<<<<<<<<<< * vector[cpp_pair[size_t, size_t]] runs, * image */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_25erase, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_25erase, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_erase, __pyx_t_1) < 0) __PYX_ERR(0, 895, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_erase, __pyx_t_1) < 0) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":907 + /* "cc3d.pyx":924 * return draw(0, runs, image) * * def each(labels, binary=False, in_place=False): # <<<<<<<<<<<<<< * """ * each(labels, binary=False, in_place=False) */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_27each, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_27each, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_each, __pyx_t_1) < 0) __PYX_ERR(0, 907, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_each, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":960 + /* "cc3d.pyx":977 * ## common tasks efficiently. * * def dust( # <<<<<<<<<<<<<< * img:np.ndarray, * threshold:Union[int,float], */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_29dust, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_29dust, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dust, __pyx_t_1) < 0) __PYX_ERR(0, 960, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dust, __pyx_t_1) < 0) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cc3d.pyx":1010 + /* "cc3d.pyx":1027 * return img * * def largest_k( # <<<<<<<<<<<<<< * img:np.ndarray, * k:int, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_31largest_k, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cc3d_31largest_k, NULL, __pyx_n_s_cc3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_largest_k, __pyx_t_1) < 0) __PYX_ERR(0, 1010, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_largest_k, __pyx_t_1) < 0) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cc3d.pyx":1 @@ -48902,7 +49425,7 @@ if (!__Pyx_RefNanny) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 286, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_1); @@ -48916,7 +49439,7 @@ if (!__Pyx_RefNanny) { * cdef indirect = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 287, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_1); @@ -48930,7 +49453,7 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_1); @@ -48944,7 +49467,7 @@ if (!__Pyx_RefNanny) { * cdef indirect_contiguous = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_1); @@ -48958,7 +49481,7 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 292, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); @@ -51147,6 +51670,68 @@ fail:; return q; } +/* JoinPyUnicode */ + static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + CYTHON_UNUSED Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind; + Py_ssize_t i, char_pos; + void *result_udata; +#if CYTHON_PEP393_ENABLED + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + result_udata = PyUnicode_DATA(result_uval); +#else + result_uval = PyUnicode_FromUnicode(NULL, result_ulength); + if (unlikely(!result_uval)) return NULL; + result_ukind = sizeof(Py_UNICODE); + result_udata = PyUnicode_AS_UNICODE(result_uval); +#endif + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); + if (unlikely(__Pyx_PyUnicode_READY(uval))) + goto bad; + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + if (unlikely(!ulength)) + continue; + if (unlikely(char_pos + ulength < 0)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind)); + } else { + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + result_ulength++; + value_count++; + return PyUnicode_Join(__pyx_empty_unicode, value_tuple); +#endif +} + /* BufferFallbackError */ static void __Pyx_RaiseBufferFallbackError(void) { PyErr_SetString(PyExc_ValueError, diff --git a/cc3d.pyx b/cc3d.pyx index d6bfcbf..338802f 100644 --- a/cc3d.pyx +++ b/cc3d.pyx @@ -4,7 +4,7 @@ with 26-connectivity and handling for multiple labels. Author: William Silversmith Affiliation: Seung Lab, Princeton Neuroscience Institute -Date: August 2018 - October 2020 +Date: August 2018 - Februrary 2022 --- This program is free software: you can redistribute it and/or modify @@ -212,13 +212,13 @@ def estimate_provisional_labels(data): def connected_components( data, int64_t max_labels=-1, int64_t connectivity=26, native_bool return_N=False, - delta=0 + delta=0, out_dtype=None ): """ ndarray connected_components( data, max_labels=-1, connectivity=26, return_N=False, - delta=0 + delta=0, out_dtype=None ) Connected components applied to 3D images with @@ -239,6 +239,11 @@ def connected_components( delta (same as data): >= 0. Connect together values whose difference in value is <= delta. Useful for rough segmentations of continuously valued images. + out_dtype: if specified, must be one of np.uint16, np.uint32, np.uint64. + If not specified, it will be automatically determined. Most of the time, + you should leave this off so that the smallest safe dtype will be used. + However, in some applications you can save an up-conversion in the next + operation by outputting the appropriately sized type instead. let OUT = 1D, 2D or 3D numpy array remapped to reflect the connected components sequentially numbered from 1 to N. @@ -323,7 +328,19 @@ def connected_components( else: # 26 max_labels = min(max_labels, (union_find_voxels // 8) + 1) - if max_labels < np.iinfo(np.uint16).max: + if out_dtype is not None: + out_dtype = np.dtype(out_dtype) + if out_dtype not in (np.uint16, np.uint32, np.uint64): + raise ValueError( + f"Explicitly defined out_dtype ({out_dtype}) must be one of: " + f"np.uint16, np.uint32, np.uint64" + ) + if np.iinfo(out_dtype).max < max_labels: + raise ValueError( + f"Explicitly defined out_dtype ({out_dtype}) is too small " + f"to contain the estimated maximum number of labels ({max_labels})." + ) + elif max_labels < np.iinfo(np.uint16).max: out_dtype = np.uint16 elif max_labels < np.iinfo(np.uint32).max: out_dtype = np.uint32 From 809ae61b6dea106a340bdc35062112e888f0b31e Mon Sep 17 00:00:00 2001 From: William Silversmith Date: Fri, 18 Feb 2022 18:30:08 -0500 Subject: [PATCH 2/2] docs: show how to use out_dtype --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index fd7a715..054db18 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,12 @@ labels_out = cc3d.connected_components(labels_in) # 26-connected connectivity = 6 # only 4,8 (2D) and 26, 18, and 6 (3D) are allowed labels_out = cc3d.connected_components(labels_in, connectivity=connectivity) +# If you need a particular dtype you can specify np.uint16, np.uint32, or np.uint64 +# You can go bigger, not smaller, than the default which is selected +# to be the smallest that can be safely used. This can save you the copy +# operation needed by labels_out.astype(...). +labels_out = cc3d.connected_components(labels_in, out_dtype=np.uint64) + # If you're working with continuously valued images like microscopy # images you can use cc3d to perform a very rough segmentation. # If delta = 0, standard high speed processing. If delta > 0, then