impy-array 2.4.1__py3-none-any.whl → 2.4.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- impy/__init__.py +1 -1
- impy/arrays/_utils/_glcm.py +1 -1
- impy/arrays/_utils/_structures.py +1 -1
- impy/arrays/lazy.py +8 -2
- impy/arrays/tiled.py +5 -1
- impy/core.py +5 -2
- impy/utils/gauss.py +1 -1
- {impy_array-2.4.1.dist-info → impy_array-2.4.2.dist-info}/METADATA +2 -2
- {impy_array-2.4.1.dist-info → impy_array-2.4.2.dist-info}/RECORD +12 -12
- {impy_array-2.4.1.dist-info → impy_array-2.4.2.dist-info}/WHEEL +1 -1
- {impy_array-2.4.1.dist-info → impy_array-2.4.2.dist-info}/entry_points.txt +0 -0
- {impy_array-2.4.1.dist-info → impy_array-2.4.2.dist-info}/licenses/LICENSE +0 -0
impy/__init__.py
CHANGED
impy/arrays/_utils/_glcm.py
CHANGED
impy/arrays/lazy.py
CHANGED
|
@@ -281,6 +281,12 @@ class LazyImgArray(AxesMixin):
|
|
|
281
281
|
chunk_info = ", ".join([f"{s}({o})" for s, o in zip(self.chunksize, self.axes)])
|
|
282
282
|
return chunk_info
|
|
283
283
|
|
|
284
|
+
def astype(self, dtype: DTypeLike, copy: bool = True) -> LazyImgArray:
|
|
285
|
+
"""Convert the array to the specified data type."""
|
|
286
|
+
out = self.__class__(self.value.astype(dtype, copy=copy))
|
|
287
|
+
out._set_info(self)
|
|
288
|
+
return out
|
|
289
|
+
|
|
284
290
|
def _repr_dict_(self):
|
|
285
291
|
return {
|
|
286
292
|
"name": self.name,
|
|
@@ -555,9 +561,9 @@ class LazyImgArray(AxesMixin):
|
|
|
555
561
|
dtype = self.dtype
|
|
556
562
|
all_axes = str(self.axes)
|
|
557
563
|
def _func(input: xp.ndarray, *args, **kwargs):
|
|
558
|
-
out = xp.empty(input.shape,
|
|
564
|
+
out = xp.empty(input.shape, dtype=dtype)
|
|
559
565
|
for sl in iter_slice(input.shape, c_axes, all_axes):
|
|
560
|
-
out[sl] = func(input[sl], *args, **kwargs)
|
|
566
|
+
out[sl] = func(input[sl], *args, **kwargs).astype(dtype, copy=False)
|
|
561
567
|
return out
|
|
562
568
|
depth = switch_slice(c_axes, self.axes, 0, depth)
|
|
563
569
|
return da.map_overlap(
|
impy/arrays/tiled.py
CHANGED
|
@@ -94,9 +94,12 @@ class TiledImage(Generic[_T]):
|
|
|
94
94
|
from dask import array as da
|
|
95
95
|
|
|
96
96
|
input = da.from_array(img.value, chunks=self._chunks)
|
|
97
|
+
|
|
98
|
+
def _func(arr: np.ndarray, *args, **kwargs) -> np.ndarray:
|
|
99
|
+
return func(arr, *args, **kwargs).astype(arr.dtype, copy=False)
|
|
97
100
|
out: np.ndarray = xp.asnumpy(
|
|
98
101
|
da.map_overlap(
|
|
99
|
-
|
|
102
|
+
_func,
|
|
100
103
|
input,
|
|
101
104
|
*args,
|
|
102
105
|
depth=self.depth,
|
|
@@ -114,6 +117,7 @@ class TiledImage(Generic[_T]):
|
|
|
114
117
|
c_axes="",
|
|
115
118
|
depth=self.depth,
|
|
116
119
|
boundary=self.boundary,
|
|
120
|
+
dtype=img.dtype,
|
|
117
121
|
args=args,
|
|
118
122
|
kwargs=kwargs,
|
|
119
123
|
)
|
impy/core.py
CHANGED
|
@@ -121,8 +121,11 @@ def array(
|
|
|
121
121
|
dtype = arr.dtype
|
|
122
122
|
|
|
123
123
|
axes, name = _normalize_params(axes, name, like)
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
|
|
125
|
+
if copy:
|
|
126
|
+
_arr = np.array(arr, dtype=dtype)
|
|
127
|
+
else:
|
|
128
|
+
_arr = np.asarray(arr, dtype=dtype)
|
|
126
129
|
|
|
127
130
|
# Automatically determine axes
|
|
128
131
|
if axes is None:
|
impy/utils/gauss.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: impy-array
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.2
|
|
4
4
|
Summary: Speed up coding/extending image analysis in Python.
|
|
5
5
|
Project-URL: Download, https://github.com/hanjinliu/impy
|
|
6
6
|
Author-email: Hanjin Liu <liuhanjin-sc@g.ecc.u-tokyo.ac.jp>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
impy/__init__.py,sha256=
|
|
1
|
+
impy/__init__.py,sha256=M7Oaq8B-E8YxJ8pV2_YZtQ9BJ-6TNAyFhtOp-lCu0m8,1156
|
|
2
2
|
impy/__main__.py,sha256=BAQkQ4X8EFo42pbNx__EqpZ5KL4MTfTUWsVbJIQF0O0,4974
|
|
3
3
|
impy/_const.py,sha256=XFkgkyqs_clQJDqr2vdh5rCyfM83iMFChOLJjwNWHtM,3736
|
|
4
4
|
impy/_types.py,sha256=gO4l0hx9qxe6eI0PyC4ukW3k4IYxCEZ9gT-rQ3jj3zU,808
|
|
5
5
|
impy/array_api.py,sha256=ADhMON5xTpjBG5MDOjUTthXzYSvm9zJNy8bL8RliI64,5843
|
|
6
6
|
impy/binder.py,sha256=CTMb11g6uYDVVQV5Wtef865IO0G2V3vGXc8SiGYRD5k,9651
|
|
7
7
|
impy/collections.py,sha256=2e55bLjZN7W4LFUCkyxekcDfLwZodMaU4JG5NQ3RS54,10946
|
|
8
|
-
impy/core.py,sha256=
|
|
8
|
+
impy/core.py,sha256=k4l4DY-kYE_6Kr6cVoZ2OPDP16XJVyShE2i0vaHGBNM,25639
|
|
9
9
|
impy/correlation.py,sha256=CoNboXiZjO1VYqA0rHe4Jp6gDYt6hyJtSgI3TWepxKk,28398
|
|
10
10
|
impy/io.py,sha256=TFdGD3sGfmbkFI4FwfsemiTmk6cIgksbvhnFt7F24ac,22269
|
|
11
11
|
impy/random.py,sha256=TqPL8oFYGtZlr4phWyMSgP7KLqsXLH9LM3Fx1LxQWjA,6973
|
|
@@ -17,22 +17,22 @@ impy/arrays/big.py,sha256=0KPG_V7yKiVYLFwzGfHRxyFD2kysIyVppsq6hh7TFPg,2809
|
|
|
17
17
|
impy/arrays/imgarray.py,sha256=oqFXASNXJ2neVy3HWp8uaPdncojgvLNsc5UvaW4tbWE,155622
|
|
18
18
|
impy/arrays/label.py,sha256=l0SZXcZxU8qwUgj0QZPZ32XsNaoBtenlrn6hNR03SPI,6406
|
|
19
19
|
impy/arrays/labeledarray.py,sha256=4WBzorvLM9mmrkuytjMJb7ucqJqK62ioY6eTZlbNh3M,56540
|
|
20
|
-
impy/arrays/lazy.py,sha256=
|
|
20
|
+
impy/arrays/lazy.py,sha256=kDQvH2dwLO5C6nXwrzWhUtkje2tMjy6T2Dnx7x7R8Fk,55436
|
|
21
21
|
impy/arrays/phasearray.py,sha256=IojWaNs5sEujn6Lhgqe00H0xF-4CZEFWt5cVW6U_DWQ,13981
|
|
22
22
|
impy/arrays/specials.py,sha256=4sNg_zeJUce_rwnasPoyL2eZ0-gx_4Z-KwitmLB4a5k,7896
|
|
23
|
-
impy/arrays/tiled.py,sha256=
|
|
23
|
+
impy/arrays/tiled.py,sha256=4uGQKmZ0w2ZHlZNB1kl_4XP4hU1AftO21k6DgyJ1cUw,7767
|
|
24
24
|
impy/arrays/_utils/__init__.py,sha256=M5HogfyUBvV8kp-X1ZthS8vDLUP7-O2f9Gvsc1ZXdT8,271
|
|
25
25
|
impy/arrays/_utils/_corr.py,sha256=8RM_OeaDsrewhiYhf6wFkDYRfl1gQ8Sg2TTK4CT22K4,10031
|
|
26
26
|
impy/arrays/_utils/_deconv.py,sha256=dCFWDPY6pkJxmqec5H0i1wtJECACvnz5vv1YIVLbnSY,2985
|
|
27
27
|
impy/arrays/_utils/_docs.py,sha256=AT6tRxXcX433FCfPXhE9wsaeduy_Um44KOqrYHYTFZE,4968
|
|
28
28
|
impy/arrays/_utils/_filters.py,sha256=aigQnaURbUnmOXGDxkWksISWQbKAUdwtS8kzbaMzgoQ,7226
|
|
29
|
-
impy/arrays/_utils/_glcm.py,sha256=
|
|
29
|
+
impy/arrays/_utils/_glcm.py,sha256=AoUP-p1MPtAzP0Eyt_DEE_wZYwezNICzdkXMBY-OEBo,4150
|
|
30
30
|
impy/arrays/_utils/_linalg.py,sha256=06jnv-P6nwUjYVTHX2f9i-KDSYZ0bxwNfWWP8A8e_Vw,3233
|
|
31
31
|
impy/arrays/_utils/_misc.py,sha256=jB16bZOYPEx_3JHGA-EIVziBjmaySPv66oyT_PZg_cI,2839
|
|
32
32
|
impy/arrays/_utils/_plot.py,sha256=AzY33TBzQ97DaTZu_EIu5GpN-sUTLKY1tY2qu76Ro10,5077
|
|
33
33
|
impy/arrays/_utils/_process_numba.py,sha256=1WjNRwqggSMYyKLeXo6W97lm93A47cAFvR6sBF086PI,3428
|
|
34
34
|
impy/arrays/_utils/_skimage.py,sha256=p10aiqIgXvPH8j_7iy_fbWD08jMolHSd1WJZAemDAEk,808
|
|
35
|
-
impy/arrays/_utils/_structures.py,sha256=
|
|
35
|
+
impy/arrays/_utils/_structures.py,sha256=K0gHjv9lF90wizAvFZQyHF02l2TC-texdYJTfB5I2H8,1301
|
|
36
36
|
impy/arrays/_utils/_transform.py,sha256=fdee-qTWbdnQec-o9f2Z9HPjfsJVaVNn5sDPcNeVyLg,12682
|
|
37
37
|
impy/arrays/bases/__init__.py,sha256=aHsAYta5CQkEDlbFShEtEGYN89N2qYedg99SM6Oo7wk,99
|
|
38
38
|
impy/arrays/bases/metaarray.py,sha256=2ob-t2bZqOgMYdt0AN02p3eAGtcQPhehuOLtoDs442k,29832
|
|
@@ -50,15 +50,15 @@ impy/lazy/random.py,sha256=2rwHRsHPOvi8tI9kTtGuZ5SzN0MA7yn-30bZSvHeLVc,7713
|
|
|
50
50
|
impy/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
51
|
impy/utils/axesop.py,sha256=c86XdNlUBFLrwHhAT2j0eELxopNe2QEVaNeOQhXr2do,3076
|
|
52
52
|
impy/utils/deco.py,sha256=lItN0UdadZsjI9eW3fI402k7DNR9jcnD6ZgjdkYsDdg,5946
|
|
53
|
-
impy/utils/gauss.py,sha256=
|
|
53
|
+
impy/utils/gauss.py,sha256=_jvmaUYSRB8KvX9Qp36rhNaNw9lllf68g_43wshpAMo,4713
|
|
54
54
|
impy/utils/misc.py,sha256=zV_NeqEaiTW4Rki5fqWfspQjczRaoTJ5MxTOUx6qstY,622
|
|
55
55
|
impy/utils/slicer.py,sha256=OR-PMILYBihY0jE38wIpS4QI30fk1c7D6LxaG_fDi_w,2423
|
|
56
56
|
impy/utils/utilcls.py,sha256=3Td9G2ZkU4C0BiW2LH0sq7RBjdco_BtyxNr-s-seLhs,437
|
|
57
57
|
impy/viewer/__init__.py,sha256=NTVonxd7HMfbRXHhjLBMG_07NjFia-O1QCv5IOKdbgw,286
|
|
58
58
|
impy/viewer/utils.py,sha256=BUQ-hUN_j_hNON9F3B63670b-h6fIPxOB4fbAJnbSGg,12236
|
|
59
59
|
impy/viewer/viewer.py,sha256=Sfq-obSLoHkBkIW0NDWCxEEaX7-YsC4ifAJ-nxpvJws,17632
|
|
60
|
-
impy_array-2.4.
|
|
61
|
-
impy_array-2.4.
|
|
62
|
-
impy_array-2.4.
|
|
63
|
-
impy_array-2.4.
|
|
64
|
-
impy_array-2.4.
|
|
60
|
+
impy_array-2.4.2.dist-info/METADATA,sha256=-EtubqJsd6j1ep3ncb6wBKMz17HV7YrXqD6qJSzgJQ8,7526
|
|
61
|
+
impy_array-2.4.2.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
|
62
|
+
impy_array-2.4.2.dist-info/entry_points.txt,sha256=reyrgy4odXvi1CcPOIIyRYBmsNGG2tO7ZkFOdG5CBkU,44
|
|
63
|
+
impy_array-2.4.2.dist-info/licenses/LICENSE,sha256=rpxKafH9r42sxLLYYB5VbZBHOdtYeLuYJjVU1LBwrxk,1546
|
|
64
|
+
impy_array-2.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|