nifreeze.analysis.measure_agreement module¶
Measure agreement computation.
- class nifreeze.analysis.measure_agreement.BASalientEntity(self, *args, **kwds)[source]¶
Bases:
Enum- LEFT_INDICES = 'left_indices'¶
- LEFT_MASK = 'left_mask'¶
- RELIABILITY_INDICES = 'reliability_indices'¶
- RELIABILITY_MASK = 'reliability_mask'¶
- RIGHT_INDICES = 'right_indices'¶
- RIGHT_MASK = 'right_mask'¶
- nifreeze.analysis.measure_agreement.compute_bland_altman_features(data1: ndarray, data2: ndarray, ci: float) tuple[ndarray, ndarray, float, float, float, float, float, float][source]¶
Compute quantities of interest for the Bland-Altman plot.
- Parameters:
- Returns:
diff (
ndarray) – Differences.mean (
ndarray) – Mean values (across both data arrays).mean_diff (
float) – Mean differences.std_diff (
float) – Standard deviation of differences.loa_lower (
float) – Lower limit of agreement.loa_upper (
float) – Upper limit of agreement.ci_mean (
float) – Confidence interval of mean values.ci_loa (
float) – Confidence interval of limits of agreement.
- nifreeze.analysis.measure_agreement.compute_z_score(ci: float) float[source]¶
Compute the critical z-score for being outside a confidence interval.
- nifreeze.analysis.measure_agreement.get_reliability_mask(diff: ndarray, loa_lower: float, loa_upper: float) ndarray[source]¶
Get reliability mask as the data within the lower and upper limits of agreement.
Boundaries are inclusive.
- nifreeze.analysis.measure_agreement.identify_bland_altman_salient_data(data1: ndarray, data2: ndarray, ci: float, top_n: int, percentile: float = 0.75) dict[source]¶
Identify the Bland-Altman (BA) plot salient data.
Given the Bland-Altman data arrays, identifies the left- and right-most top_n data points from the BA plot.
Once the left-most data points identified, the right-most percentile data points are considered from the remaining data points. The
top_ndata points closest to the zero mean difference are identified among these.- Parameters:
- Returns:
Reliability, left- and right-most data point indices, and corresponding data masks as specified by the
BASalientEntitykeys.- Return type: