Lines Matching refs:_xp

52         self._xp = None  # either numpy or cupy, to match the image data
148 if self._xp is None:
153 levels = self._xp.asarray(levels)
178 if self._xp is not None:
179 lut = self._ensure_proper_substrate(lut, self._xp)
308 if self._xp == getCupy():
309 self._processingBuffer = self._xp.empty(shape[:2] + (4,), dtype=self._xp.ubyte)
363 old_xp = self._xp
365 self._xp = cp.get_array_module(image) if cp else numpy
367 processingSubstrateChanged = old_xp != self._xp
393 if mn == mx or self._xp.isnan(mn) or self._xp.isnan(mx):
476 return self._xp.nanmin(data), self._xp.nanmax(data)
497 self.lut = self._ensure_proper_substrate(self.lut, self._xp)
499 lut = self._ensure_proper_substrate(self.lut(self.image), self._xp)
533 if lut is not None and lut.dtype != self._xp.uint8:
552 elif image.dtype in (self._xp.ubyte, self._xp.uint16):
569 if self._xp == getCupy():
577 xp = self._xp
635 xp = self._xp
722 xp = self._xp
759 xp = self._xp
776 xp = self._xp
792 if self._xp == getCupy():
890 step = (max(1, int(self._xp.ceil(self.image.shape[0] / targetImageSize))),
891 max(1, int(self._xp.ceil(self.image.shape[1] / targetImageSize))))
892 if self._xp.isscalar(step):
897 mn = self._xp.nanmin(stepData).item()
898 mx = self._xp.nanmax(stepData).item()
902 if self._xp.isnan(mn) or self._xp.isnan(mx):
907 step = int(self._xp.ceil((mx - mn) / 500.))
910 bins = self._xp.arange(mn, mx + 1.01 * step, step, dtype=int)
913 bins = self._xp.linspace(mn, mx, 500)
916 bins = self._xp.asarray((mn, mx))
925 stepChan = stepChan[self._xp.isfinite(stepChan)]
926 h = self._xp.histogram(stepChan, **kwds)
933 stepData = stepData[self._xp.isfinite(stepData)]
934 hist = self._xp.histogram(stepData, **kwds)