foa3d.preprocessing

foa3d.preprocessing.config_anisotropy_correction(px_sz, psf_fwhm)

Scanning and light-sheet fluorescence microscopes provide 3D data characterized by a lower resolution along the optical axis (i.e. the z-axis). However, the longitudinal anisotropy of the PSF introduces a strong bias in the estimated 3D orientations as discussed by Morawski et al. (NeuroImage, 2018). Thus, for obtaining a uniform 3D resolution, the X and Y axes of the input microscopy volume images need in general to be blurred.

Parameters
  • px_sz (numpy.ndarray (shape=(3,), dtype=float)) – pixel size [μm]

  • psf_fwhm (numpy.ndarray (shape=(3,), dtype=float)) – 3D FWHM of the PSF [μm]

Returns

  • smooth_sigma (numpy.ndarray (shape=(3,), dtype=int)) – 3D standard deviation of the low-pass Gaussian filter [px] (resolution anisotropy correction)

  • px_sz_iso (numpy.ndarray (shape=(3,), dtype=float)) – new isotropic pixel size [μm]

foa3d.preprocessing.correct_anisotropy(img, rsz, sigma=None, pad=None, ts_msk=None)

Smooth and downsample the raw microscopy image to uniform the lateral sizes of the optical system’s PSF and the original voxel size.

Parameters
  • img (numpy.ndarray (axis order=(Z,Y,X))) – 3D microscopy image

  • rsz (numpy.ndarray (shape=(3,), dtype=float)) – 3D resize ratio

  • sigma (numpy.ndarray (shape=(3,), dtype=int)) – 3D standard deviation of the smoothing Gaussian filter [px] (resolution anisotropy correction)

  • pad (numpy.ndarray (shape=(3,2), dtype=int)) – image padding array to be resized

  • ts_msk (numpy.ndarray (dtype=bool)) – tissue binary mask

Returns

  • iso_img (numpy.ndarray (axis order=(Z,Y,X))) – isotropic microscopy image

  • pad_rsz (numpy.ndarray (shape=(3,2), dtype=int)) – resized image padding array

  • ts_msk_rsz (numpy.ndarray (dtype=bool)) – resized tissue binary mask