From 12c3f8d07b35e980dafe509baab20bdad35f54cd Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Wed, 3 May 2023 06:10:24 -0400 Subject: [PATCH] Support lh. and rh. prefixes --- ep_surface_fit.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ep_surface_fit.py b/ep_surface_fit.py index 6cc0f94..b8f328b 100644 --- a/ep_surface_fit.py +++ b/ep_surface_fit.py @@ -11,7 +11,7 @@ from chris_plugin import chris_plugin, PathMapper from loguru import logger -__version__ = '0.5.0' +__version__ = '0.5.1' DISPLAY_TITLE = r""" @@ -133,7 +133,12 @@ def run_surface_fit(grid: Path, output_surf: Path, params: list[str]) -> bool: def locate_surface_for(mask: Path) -> Optional[Path]: - glob = mask.parent.glob('*.obj') + if any(mask.name.startswith(p) for p in ('lh.', 'rh.')): + prefix = mask.name[:3] + else: + prefix = '' + + glob = mask.parent.glob(f'{prefix}*.obj') first = next(glob, None) second = next(glob, None) if second is not None: