Skip to content

Commit

Permalink
[utils] Fix SimpleITK read_image(); force pull in read_polydata()
Browse files Browse the repository at this point in the history
  • Loading branch information
aschuh-hf committed Sep 4, 2023
1 parent 0ba0e88 commit 4aad3a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/deepali/utils/simpleitk/imageio.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def read_image(path: PathUri) -> sitk.Image:
r"""Read image from file."""
with StorageObject.from_path(path) as obj:
if not path.exists():
if not obj.is_file():
raise FileNotFoundError(f"No such file or no access: '{path}'")
obj.pull(force=True)
image = sitk.ReadImage(str(obj.path))
Expand Down
2 changes: 1 addition & 1 deletion src/deepali/utils/vtk/polydataio.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def read_polydata(path: PathUri) -> vtkPolyData:
with StorageObject.from_path(path) as obj:
if not obj.is_file():
raise FileNotFoundError(f"File not found: {obj.uri}")
obj = obj.pull()
obj = obj.pull(force=True)
if not obj.path.is_file():
raise FileNotFoundError(f"File not found: {obj.path}")
suffix = obj.path.suffix.lower()
Expand Down

0 comments on commit 4aad3a8

Please sign in to comment.