Skip to content

Commit

Permalink
Merge pull request #12 from RSIP-Vision/elazarcoh/issue11
Browse files Browse the repository at this point in the history
Bug in `read_img` using `itk-io` backend: 'NoneType' object has no attribute 'CanReadFile'
  • Loading branch information
elazarcoh committed May 15, 2022
2 parents 68a025a + 2b7347b commit f95f23c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion medio/backends/itk_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def read_img(
)
elif input_path.is_file():
# If the input file is not a dicom (e.g. NIfTI), fallback to not use imageio.
use_dicom_imageio = imageio.CanReadFile(str(input_path))
use_dicom_imageio = imageio is not None and imageio.CanReadFile(str(input_path))
if use_dicom_imageio:
# we need to set the imageio to the reader, but with fallback_only=True it will not set it unless it fails
fallback_only = False
Expand Down

0 comments on commit f95f23c

Please sign in to comment.