Skip to content

Commit 55bdee9

Browse files
committed
BUG: use DICOM for reading directories only if imageio is not specified
Without this, a file-system-backed zarr container is attempted to be read as a DICOM directory: image2 = itk.imread("C:/Dev/ITKIOOME-py/Testing/Temporary/cthead1py.zarr", imageio=imageio) WARNING: In C:\Dev\ITK-git\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx, line 100 GDCMSeriesFileNames (0000027927F2B7E0): No Series were found Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Dev\ITK-py\Wrapping\Generators\Python\itk\support\extras.py", line 1194, in imread raise FileNotFoundError(f"no DICOMs in: {filename}.") FileNotFoundError: no DICOMs in: C:/Dev/ITKIOOME-py/Testing/Temporary/cthead1py.zarr.
1 parent 55dad2b commit 55bdee9

File tree

1 file changed

+1
-1
lines changed
  • Wrapping/Generators/Python/itk/support

1 file changed

+1
-1
lines changed

Wrapping/Generators/Python/itk/support/extras.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ def imread(
12401240
if type(filename) not in [list, tuple]:
12411241
import os
12421242

1243-
if os.path.isdir(filename):
1243+
if os.path.isdir(filename) and imageio is None:
12441244
# read DICOM series of 1 image in a folder, refer to: https://github.com/RSIP-Vision/medio
12451245
names_generator = itk.GDCMSeriesFileNames.New()
12461246
names_generator.SetUseSeriesDetails(True)

0 commit comments

Comments
 (0)