clearex.filter.filters

Functions

dog(sigma_high, sigma_low, vol)

Difference of Gaussian (DoG) filter.

dog_cv2(sigma_high, sigma_low, vol)

Difference of Gaussian (DoG) filter using OpenCV.

fwhm_to_sigma(fwhm_px)

Convert from FWHM to sigma.

meijering_filter(slice2d, sigmas, black_ridges)

Apply the Meijering filter to a 2D slice.

clearex.filter.filters.fwhm_to_sigma(fwhm_px)

Convert from FWHM to sigma.

FWHM = 2*sqrt(2*ln2)*sigma ≈ 2.35482*sigma

Parameters:

fwhm_px (float) – The full width at half maximum in pixels.

Returns:

The standard deviation sigma.

Return type:

float

clearex.filter.filters.dog(sigma_high, sigma_low, vol)

Difference of Gaussian (DoG) filter.

Parameters:
  • sigma_high (float) – The standard deviation of the high-pass filter.

  • sigma_low (float) – The standard deviation of the low-pass filter.

  • vol (np.ndarray) – The volume to filter.

Returns:

The DoG filtered volume.

Return type:

np.ndarray

clearex.filter.filters.dog_cv2(sigma_high, sigma_low, vol)

Difference of Gaussian (DoG) filter using OpenCV.

Parameters:
  • sigma_high (float) – The standard deviation of the high-pass filter.

  • sigma_low (float) – The standard deviation of the low-pass filter.

  • vol (np.ndarray) – The volume to filter.

Returns:

The DoG filtered volume.

Return type:

np.ndarray

clearex.filter.filters.meijering_filter(slice2d, sigmas, black_ridges)

Apply the Meijering filter to a 2D slice.

Parameters:
  • slice2d (np.ndarray) – A 2D slice of the data.

  • sigmas (list of float) – Standard deviations for Gaussian smoothing.

  • black_ridges (bool) – If True, return black ridges on a white background.

Returns:

The filtered 2D slice.

Return type:

np.ndarray