Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/rbc/bids/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
)
from rbc.bids.anatomical import export_anatomical
from rbc.bids.builder import Bids
from rbc.bids.functional import export_functional, resolve_functional
from rbc.bids.metrics import export_metrics, resolve_metrics
from rbc.bids.qc import export_qc, resolve_qc
from rbc.bids.functional import FunctionalInputs, export_functional, resolve_functional
from rbc.bids.metrics import MetricsInputs, export_metrics, resolve_metrics
from rbc.bids.qc import QCInputs, export_qc, resolve_qc
from rbc.bids.query import find_file, find_files, get_extra_entity, load_table

__all__ = [
Expand All @@ -40,7 +40,10 @@
"Datatype",
"EntityKwargs",
"Extension",
"FunctionalInputs",
"MetricsInputs",
"Modality",
"QCInputs",
"Suffix",
"TemplateSpace",
"bids_name",
Expand Down
15 changes: 13 additions & 2 deletions src/rbc/bids/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, TypedDict

from rbc.bids import Suffix, TemplateSpace, bids_safe_label

Expand All @@ -16,10 +16,21 @@
from rbc.workflows.functional import FunctionalOutputs


class FunctionalInputs(TypedDict):
"""Resolved anatomical inputs for the functional workflow."""

t1w_brain: Path
wm_bbr_mask: Path
brain_mask: Path
csf_mask: Path
wm_mask: Path
anat_to_template: Path


def resolve_functional(
anat_q: Bids,
anat_df: pl.DataFrame,
) -> dict[str, Path]:
) -> FunctionalInputs:
"""Resolve anatomical prerequisites needed by functional preprocessing.

Args:
Expand Down
12 changes: 10 additions & 2 deletions src/rbc/bids/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, TypedDict

from rbc.bids import Suffix, bids_safe_label

Expand All @@ -16,12 +16,20 @@
from rbc.workflows.metrics import MetricsOutputs


class MetricsInputs(TypedDict):
"""Resolved functional inputs for the metrics workflow."""

template_brain_mask: Path
regressed_bold: Path
cleaned_bold: Path


def resolve_metrics(
mni_q: Bids,
deriv_df: pl.DataFrame,
*,
regressor: str,
) -> dict[str, Path]:
) -> MetricsInputs:
"""Resolve functional derivatives needed by the metrics workflow.

Args:
Expand Down
Loading