Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

corrections

corrections

Multiple comparison corrections and thresholding.

Methods:

NameDescription
fdrDetermine an FDR threshold for an array of p-values.
holm_bonfCompute Holm-Bonferroni-corrected p-values.
multi_thresholdThreshold test image by multiple p-values from p image.
thresholdThreshold test image by p-value from p image.

Methods

fdr

fdr(p, q = 0.05)

Determine an FDR threshold for an array of p-values.

Uses the desired false discovery rate q. Written by Tal Yarkoni.

Parameters:

NameTypeDescriptionDefault
p(np.array) vector of p-valuesrequired
q(float) false discovery rate level0.05

Returns:

NameTypeDescription
fdr_p(float) p-value threshold based on independence or positive dependence

holm_bonf

holm_bonf(p, alpha = 0.05)

Compute Holm-Bonferroni-corrected p-values.

This step-down procedure applies iteratively less correction to the highest p-values. It is a bit more conservative than FDR, but much more powerful than vanilla Bonferroni correction.

Parameters:

NameTypeDescriptionDefault
p(np.array) vector of p-valuesrequired
alpha(float) alpha level0.05

Returns:

NameTypeDescription
bonf_p(float) p-value threshold based on bonferroni step-down procedure

multi_threshold

multi_threshold(t_map, p_map, thresh)

Threshold test image by multiple p-values from p image.

Parameters:

NameTypeDescriptionDefault
t_map(BrainData) BrainData instance of statistic metric (e.g., t-statistic, beta, etc)required
p_map(BrainData) BrainData instance of p-valuesrequired
thresh(list) list of p-values to threshold stat imagerequired

Returns:

NameTypeDescription
outThresholded BrainData instance with cumulative map - Positive values indicate how many thresholds were passed for positive stats - Negative values indicate how many thresholds were passed for negative stats
Note

This function provides unique cumulative threshold map functionality:

  • Creates a single map showing which thresholds were passed

  • Different from calling threshold() multiple times (which would give separate images)

  • Useful for visualizing threshold hierarchies

  • nilearn.threshold_img() does not support cumulative multi-threshold maps

threshold

threshold(stat, p, thr = 0.05, return_mask = False)

Threshold test image by p-value from p image.

Parameters:

NameTypeDescriptionDefault
stat(BrainData) BrainData instance of arbitrary statistic metric (e.g., beta, t, etc)required
p(BrainData) BrainData instance of p-valuesrequired
thr(float) p-value threshold to apply0.05
return_mask(bool) optionally return the thresholding mask; default FalseFalse

Returns:

NameTypeDescription
outThresholded BrainData instance
mask(optional) BrainData instance of thresholding mask if return_mask=True
Note

This function provides unique functionality not available in nilearn:

  • Thresholds stat image based on p-values from separate p-value image

  • Neither nilearn.threshold_img nor BrainData.threshold() support this

  • BrainData.threshold() thresholds based on stat values themselves

  • nilearn.threshold_img() thresholds based on image intensity values