[BUG]: Cannot compute markers on AOMIC ID1000 using native space #487

Merged
synchon merged 2 commits from fix/mask-check-native into main 2026-03-03 15:07:05 +00:00
2 changed files with 11 additions and 4 deletions

View file

@ -0,0 +1 @@
Fix mask specification check involving dicts in `:class:`junifer.data.MaskRegistry` when working in native space by `Synchon Mandal`_

View file

@ -481,16 +481,22 @@ class MaskRegistry(BasePipelineDataRegistry):
# Extra data type requirement check if target space is native # Extra data type requirement check if target space is native
if target_space == "native": if target_space == "native":
# Fix for having dict in masks; flatten the dict keys for set
# conversion
ms = [
next(iter(x.keys())) if isinstance(x, dict) else x
for x in masks
]
# Check for in-built callable masks so that get_native_warper is # Check for in-built callable masks so that get_native_warper is
# not called in case only callable masks are used # not called in case only callable masks are used
if ( if (
set(masks) == {nilearn_callable_masks[0]} set(ms) == {nilearn_callable_masks[0]}
or set(masks) == {nilearn_callable_masks[1]} or set(ms) == {nilearn_callable_masks[1]}
or set(masks) == set(nilearn_callable_masks) or set(ms) == set(nilearn_callable_masks)
): ):
logger.debug( logger.debug(
"Target space is native. " "Target space is native. "
f"No warping will be done for: {masks}" f"No warping will be done for: {ms}"
) )
else: else:
# Check for extra inputs # Check for extra inputs