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.

Adaptive local thresholding

Local adaptive thresholding computes a threshold for each voxel using the intensity range of neighboring voxels. This contrast with fixed global thresholding — adopted in the Gaussian and LaplaceHamming filter — which uses a single threshold value for the entire image.

Function

To use local adaptive thresholding with the default input settings, use the following commands:

from ormir_xct.core.segmentation.adaptive_local_threshold import adaptive_local_thresholding

adaptive-local-threshold(
    structuring_element_shape,
    structuring_element_size,
    lower_threshold,
    upper_threshold,
    local_threshold_method,
    sigma,
    minimum_structure_size,)

Input settings

HR-pQCT
PCD-CT
µCT

image_sitk : Image to threshold, accepts string paths
structuring_element_shape: Shape of the structuring element, accepts ball or cube. Default = ball
structuring_element_size: Size of structuring element. Default = 6 lower_threshold: The lower threshold. Default = 190
upper_threshold: The upper threshold. Default = 450
local_threshold_method: The method to use for identifying local thresholds. Accepts mean, minmax, or both. Default = mean
sigma: The sigma to use for the gaussian filter. Default = None
minimum_structure_size: The minimum size of structures to keep in the segmentation. Default = 64

Further information about the function and its inputs can be found here (link to the API coming soon!)

Examples and workflows

HR-pQCT
PCD-CT
µCT

Workflows that include the local adaptive thresholding:

Citation

HR-pQCT
PCD-CT
µCT

If you use this function, please cite it as follows:

We used the adaptive local thresholding as implemented in ORMIR-XCT (Kuczynski et al. (2024)).

References
  1. Kuczynski, M. T., Neeteson, N. J., Stok, K. S., Burghardt, A. J., Hernandez, M. A. E., Vicory, J., Tse, J. J., Durongbhan, P., Bonaretti, S., Wong, A. K. O., Boyd, S. K., & Manske, S. L. (2024). ORMIR_XCT: A Python package for high resolution peripheral quantitative computed tomography image processing. Journal of Open Source Software, 9(97), 6084. 10.21105/joss.06084