Skip to content

Commit

Permalink
Check 2D spaces against list from templateflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Aug 5, 2024
1 parent d44bae0 commit 74cc164
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion niworkflows/utils/spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
]
"""List of supported nonstandard reference spaces."""

NONSTANDARD_2D_REFERENCES = ["fsnative"]
"""List of supported nonstandard 2D reference spaces."""

FSAVERAGE_DENSITY = {
"fsaverage3": "642",
Expand Down Expand Up @@ -138,6 +140,7 @@ class Reference:
"""

_standard_spaces = tuple(_tfapi.templates())
_spaces_2d = tuple(_tfapi.templates(suffix="sphere"))

space = attr.ib(default=None, type=str)
"""Name designating this space."""
Expand Down Expand Up @@ -165,7 +168,7 @@ def __attrs_post_init__(self):
spec["den"] = FSAVERAGE_DENSITY[space]
object.__setattr__(self, "spec", spec)

if self.space.startswith("fs"):
if (self.space in self._spaces_2d) or (self.space in NONSTANDARD_2D_REFERENCES):
object.__setattr__(self, "dim", 2)

if self.space in self._standard_spaces:
Expand Down

0 comments on commit 74cc164

Please sign in to comment.