Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/nifreeze/analysis/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import numpy as np


def normalize(x: np.ndarray):
def normalize(x: np.ndarray) -> np.ndarray:
r"""Normalize data using the z-score.

The z-score normalization is computed as:
Expand Down
4 changes: 3 additions & 1 deletion src/nifreeze/analysis/motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#
"""Motion analysis."""

from typing import Tuple

import numpy as np
from scipy.stats import zscore

Expand Down Expand Up @@ -61,7 +63,7 @@ def compute_percentage_change(
return rel_diff


def identify_spikes(fd: np.ndarray, threshold: float = 2.0):
def identify_spikes(fd: np.ndarray, threshold: float = 2.0) -> Tuple[np.ndarray, np.ndarray]:
"""Identify motion spikes in framewise displacement data.

Identifies high-motion frames as timepoint exceeding a given threshold value
Expand Down