multiScaleAnalysis.Tools package
Submodules
multiScaleAnalysis.Tools.PSF_measurements module
Script to analyze the PSF values over an entire image.
- multiScaleAnalysis.Tools.PSF_measurements.Gauss(x, a, b, c, d)[source]
Definition of a Gaussian function for fitting: # y = a + (b-a) * np.exp(-(x-c)**2/(2 * d ** 2))
- Parameters:
x – x variable
a – a parameter
b – b parameter
c – c parameter
d – d parameter
- multiScaleAnalysis.Tools.PSF_measurements.binarize_label_image(image, threshold)[source]
Binarize and label individual beads in image.
- Parameters:
image – np.array /3D image to analyze
threshold – selected threshold to identify beads
- Returns:
np.array with labelled beads
- multiScaleAnalysis.Tools.PSF_measurements.determinePSFvalues(croppedimage, lateralstepsize=0.117, axialstepsize=0.2)[source]
Determine the point spread function (PSF) value of a single bead in a cropped image.
- Parameters:
croppedimage – image containing a single bead.
lateralstepsize – Physical dimension of voxel in lateral direction.
axialstepsize – Physical dimension of voxel in axial direction.
- Returns:
PSF value array: [lateralX_FWHM, lateralY_FWHM, axial_FWHM], returns nan if no Gaussian fit to the function could be found.
- multiScaleAnalysis.Tools.PSF_measurements.filter_centroidpositions(centroidlist, areaarray, im_shape, axial_dist=5, lateral_dist=10, areacutoff=300)[source]
Filter the centroid positions to remove beads at the edge and beads that are too big (not point sources) or too small.
- Parameters:
centroidlist – list of centroid positions
areaarray
im_shape
axial_dist
lateral_dist
areacutoff – largest area/volume acceptable for a bead
- multiScaleAnalysis.Tools.PSF_measurements.filter_psfvalues(psf_list, highestlateralvalue=1, highestaxialvalue=2)[source]
Filter the PSF values to remove clustered beads/aggregates etc.
- Parameters:
psf_list – list of psf values
highestlateralvalue – highest expected lateral value from a single bead
highestaxialvalue – highest expected axial value from a single bead
- Returns:
filtered list of psf values
- multiScaleAnalysis.Tools.PSF_measurements.get_centroidpositions(props)[source]
Return the centroids as an array from region props.
- Parameters:
props – Region properties construct
- Returns:
np.array(n beads, 3) with centroid positions
- multiScaleAnalysis.Tools.PSF_measurements.get_psfvalues(image, centroidlist_filtered, axial_dist=5, lateral_dist=10, lateralstepsize=0.117, axialstepsize=0.2)[source]
Iterate over all beads in an image and generate an image crop for each bead. Calls the determinePSFvalues function to calculate the point spread function (PSF) value of the bead in the image crop, and enter the obtained PSF value into a list of PSF values.
- Parameters:
image – np.array/image with beads
centroidlist_filtered – List of centroid positions.
axial_dist – An image crop is generated with extend of centroid_z +/- axial_dist to calculate the PSF.
lateral_dist – An image crop is generated with extend of centroid_x +/- lateral_dist and centroid_y +/- lateral_dist to calculate the PSF.
lateralstepsize – Physical dimension of voxel in lateral direction.
axialstepsize – Physical dimension of voxel in axial direction.
- Returns:
An array of PSF values
multiScaleAnalysis.Tools.ShannonEntropyAnalysis module
Script to analyze the Shannon entropy over an entire image series.
- multiScaleAnalysis.Tools.ShannonEntropyAnalysis.fast_normalized_dct_shannon_entropy(input_image, frequencycutoff)[source]
Calculates the normalized DCT Shannon entropy of an image. Function from https://github.com/TheDeanLab/navigate/tree/develop/src/navigate/model/analysis
- Parameters:
input_image – np.ndarray
frequencycutoff – determines which percentage of all frequencies are contributing to the entropy (rationale: you don’t want to include noise/high frequencies in the image metric)
- Returns:
entropy value