diff --git a/navis/transforms/cmtk.py b/navis/transforms/cmtk.py index 8ec48b1b..2334f06d 100644 --- a/navis/transforms/cmtk.py +++ b/navis/transforms/cmtk.py @@ -52,8 +52,7 @@ def find_cmtkbin(tool: str = 'streamxform') -> str: continue try: - next(path.glob(tool)) - return path + return next(path.glob(tool)).resolve().parent except StopIteration: continue except BaseException: diff --git a/navis/transforms/elastix.py b/navis/transforms/elastix.py index 868c22ee..07639b86 100644 --- a/navis/transforms/elastix.py +++ b/navis/transforms/elastix.py @@ -38,8 +38,7 @@ def find_elastixbin(tool: str = 'transformix') -> str: continue try: - next(path.glob(tool)) - return path + return next(path.glob(tool)).resolve().parent except StopIteration: continue except BaseException: