Example #1
0
def test_moveaxis_rollaxis_keyword():
    x = np.random.random((10, 12, 7))
    d = da.from_array(x, chunks=(4, 5, 2))
    assert_eq(np.moveaxis(x, destination=1, source=0),
              da.moveaxis(d, destination=1, source=0))
    assert_eq(np.rollaxis(x, 2), da.rollaxis(d, 2))
    assert isinstance(da.rollaxis(d, 1), da.Array)
    assert_eq(np.rollaxis(x, start=1, axis=2), da.rollaxis(d, start=1, axis=2))
Example #2
0
    def _get_dask_image(self) -> List[da.Array]:
        dask_image = tifffile_to_dask(self._path, self.largest_series, level=0)
        dask_image = (dask_image.reshape(1, *dask_image.shape)
                      if len(dask_image.shape) == 2 else dask_image)

        if self._is_rgb and not self._is_interleaved:
            dask_image = da.rollaxis(dask_image, 0, 3)

        return dask_image