baseline
baseline
¶
Baseline correction for time-series data.
This module provides functions for baseline estimation and correction in perfusion time-series data.
GPU/CPU agnostic using the xp array module pattern.
baseline_correction
¶
Correct baseline in time-series data.
Estimates baseline from initial frames and subtracts or normalizes the signal relative to baseline.
GPU/CPU agnostic - operates on same device as input data.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Time-series data. Last dimension is time.
TYPE:
|
baseline_frames
|
Number of initial frames for baseline estimation.
TYPE:
|
method
|
Correction method: - "mean": Subtract mean baseline (additive correction) - "median": Subtract median baseline - "normalize": Divide by mean baseline (multiplicative) - "percent": Convert to percent change from baseline
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[floating]
|
Baseline-corrected data with same shape as input. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If baseline_frames exceeds data length or invalid method. |
Examples:
estimate_baseline_std
¶
Estimate noise standard deviation from baseline frames.
GPU/CPU agnostic - operates on same device as input data.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Time-series data. Last dimension is time.
TYPE:
|
baseline_frames
|
Number of initial frames for noise estimation.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[floating]
|
Standard deviation estimate for each voxel. Shape is data.shape[:-1]. |
Examples: