Skip to content

Commit 6c65260

Browse files
committed
FIX: Inspect if template has resolution instead of assuming
1 parent 9905f90 commit 6c65260

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

niworkflows/utils/misc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def get_template_specs(in_template, template_spec=None, default_resolution=1):
6262
...
6363
6464
"""
65-
from templateflow.api import get as get_template
65+
from templateflow.api import get as get_template, get_metadata
6666

6767
# Massage spec (start creating if None)
6868
template_spec = template_spec or {}
@@ -72,6 +72,11 @@ def get_template_specs(in_template, template_spec=None, default_resolution=1):
7272
"res", template_spec.get("resolution", default_resolution)
7373
)
7474

75+
metadata = get_metadata(in_template)
76+
if "res" not in metadata and "resolution" not in metadata:
77+
# template does not have any resolution fields
78+
template_spec["resolution"] = None
79+
7580
common_spec = {"resolution": template_spec["resolution"]}
7681
if "cohort" in template_spec:
7782
common_spec["cohort"] = template_spec["cohort"]

0 commit comments

Comments
 (0)