diff --git a/sources/nd2/large_image_source_nd2/__init__.py b/sources/nd2/large_image_source_nd2/__init__.py index 420d9539a..2ec505b05 100644 --- a/sources/nd2/large_image_source_nd2/__init__.py +++ b/sources/nd2/large_image_source_nd2/__init__.py @@ -134,12 +134,12 @@ def __init__(self, path, **kwargs): _lazyImport() try: - # We use dask to allow lazy reading of large images - self._nd2 = nd2.ND2File(self._largeImagePath) + self._nd2 = nd2.ND2File(self._largeImagePath, validate_frames=True) except Exception: if not os.path.isfile(self._largeImagePath): raise TileSourceFileNotFoundError(self._largeImagePath) from None raise TileSourceError('File cannot be opened via nd2reader.') + # We use dask to allow lazy reading of large images self._nd2array = self._nd2.to_dask(copy=False) arrayOrder = list(self._nd2.sizes) # Reorder this so that it is XY (P), T, Z, C, Y, X, S (or at least end diff --git a/sources/nd2/setup.py b/sources/nd2/setup.py index bc2dc699d..58dd380c1 100644 --- a/sources/nd2/setup.py +++ b/sources/nd2/setup.py @@ -53,7 +53,7 @@ def prerelease_local_scheme(version): install_requires=[ f'large-image{limit_version}', 'dask[array]', - 'nd2[legacy]<0.2.3 ; python_version >= "3.7"', + 'nd2[legacy]>=0.2.3 ; python_version >= "3.7"', 'importlib-metadata ; python_version < "3.8"', ], extras_require={