converting funcs to hidden...possibly breaks things
@@ -1909,7 +1909,7 @@ def snow_partitioning_parallel(im,
# Stitching watershed chunks
# print('-' * 80)
print('Stitching watershed chunks')
- regions = watershed_stitching(im=regions, chunk_shape=chunk_shape)
+ regions = _watershed_stitching(im=regions, chunk_shape=chunk_shape)
print('=' * 80)
if return_all:
tup.regions = regions
@@ -2056,14 +2056,13 @@ def relabel_chunks(im, chunk_shape): # pragma: no cover
return im
-def trim_internal_slice(im, chunk_shape): # pragma: no cover
+def _trim_internal_slice(im, chunk_shape): # pragma: no cover
r"""
Delete extra slices from image that were used to stitch two or more chunks
together.
Parameters:
-----------
-
im : ND-array
image that contains extra slices in x, y, z direction.
@@ -2106,7 +2105,7 @@ def trim_internal_slice(im, chunk_shape): # pragma: no cover
return out
-def watershed_stitching(im, chunk_shape):
+def _watershed_stitching(im, chunk_shape):
r"""
Stitch individual sub-domains of watershed segmentation into one big
segmentation with all boundary labels of each sub-domain relabeled to merge
@@ -2150,21 +2149,21 @@ def watershed_stitching(im, chunk_shape):
'or manually input value.')
keys.append(sl1_labels)
values.append(sl2_labels)
- im = replace_labels(array=im, keys=keys, values=values)
+ im = _replace_labels(array=im, keys=keys, values=values)
im = im.swapaxes(axis, 0)
- im = trim_internal_slice(im=im, chunk_shape=chunk_shape)
- im = resequence_labels(array=im)
+ im = _trim_internal_slice(im=im, chunk_shape=chunk_shape)
+ im = _resequence_labels(array=im)
return im
@njit(parallel=True)
-def copy(im, output): # pragma: no cover
+def _copy(im, output): # pragma: no cover
r"""
The function copy the input array and make output array that is allocated
in different memory space. This a numba version of copy function of numpy.
Because each element is copied using parallel approach this implementation
- is facter than numpy version of copy.
+ is faster than numpy version of copy.
parameter:
----------
@@ -2224,7 +2223,7 @@ def _replace(array, keys, values, ind_sort): # pragma: no cover
array[i] = values_sorted[ind]
-def replace_labels(array, keys, values):
+def _replace_labels(array, keys, values):
r"""
Replace labels in array provided as keys to values.
@@ -2288,7 +2287,7 @@ def _sequence(array, count): # pragma: no cover
@njit(parallel=True)
-def amax(array): # pragma: no cover
+def _amax(array): # pragma: no cover
r"""
Find largest element in an array using fast parallel numba technique
@@ -2305,7 +2304,7 @@ def amax(array): # pragma: no cover
return np.max(array)
-def resequence_labels(array):
+def _resequence_labels(array):
r"""
Resequence the lablels to make them contigious.
@@ -2321,7 +2320,7 @@ def resequence_labels(array):
"""
a_shape = array.shape
array = array.ravel()
- max_num = amax(array) + 1
+ max_num = _amax(array) + 1
count = np.zeros(max_num, dtype=np.uint32)
_sequence(array, count)
