diff --git a/_includes/datatypes/inspect_12bit_saturation.md b/_includes/datatypes/inspect_12bit_saturation.md index 25a185d6..9dd51e73 100644 --- a/_includes/datatypes/inspect_12bit_saturation.md +++ b/_includes/datatypes/inspect_12bit_saturation.md @@ -1,4 +1,4 @@ -

Find saturated pixels in an 12-bit image

+

Inspect a 12-bit image

Saturation, i.e. pixel value at the upper end of the datatype, is a typical problem in fluorescence microscopy images. diff --git a/_includes/datatypes/inspect_8bit_saturation.md b/_includes/datatypes/inspect_8bit_saturation.md index bd2d78de..2b014253 100644 --- a/_includes/datatypes/inspect_8bit_saturation.md +++ b/_includes/datatypes/inspect_8bit_saturation.md @@ -1,4 +1,4 @@ -

Find saturated pixels in an 8-bit image

+

Inspect an 8-bit image

Saturation, i.e. pixel value at the upper end of the datatype, is a typical problem in fluorescence microscopy images. diff --git a/_includes/pixels/pixels_act1_skimage_napari.py b/_includes/pixels/pixels_act1_skimage_napari.py index 6e32de1c..d032dc87 100644 --- a/_includes/pixels/pixels_act1_skimage_napari.py +++ b/_includes/pixels/pixels_act1_skimage_napari.py @@ -60,10 +60,11 @@ print(image.min(), image.max()) # %% -# Compute the image histogram +# Compute and show the image histogram import matplotlib.pyplot as plt import numpy as np -plt.hist(image.flatten(), bins=np.arange(image.min(), image.max() + 1)); +plt.hist(image.flatten(), bins=np.arange(image.min(), image.max() + 1)) +plt.show() # instead, we could end the above line with ";" # %% # Napari: diff --git a/_includes/spatial_calibration/spatial_calibration_act1_skimage_napari.py b/_includes/spatial_calibration/spatial_calibration_act1_skimage_napari.py index fdb31474..072b9fd7 100644 --- a/_includes/spatial_calibration/spatial_calibration_act1_skimage_napari.py +++ b/_includes/spatial_calibration/spatial_calibration_act1_skimage_napari.py @@ -68,15 +68,8 @@ print("Calibrated points:\n", points_cal) # %% -# Compute distance between points in voxel indices -# - Pythagoras: sqrt( (z1-z0)^2 + (y1-y0)^2 + (x1-x0)^2 ) -diff_vector = points_cal[1] - points_cal[0] -print("diff_vector:", diff_vector) - -# %% -sqr_diff_vector = diff_vector**2 -print("sqr_diff_vector:", sqr_diff_vector) - -# %% -distance = np.sqrt(sqr_diff_vector.sum()) -print("distance:", distance) +# Compute the distance between the first and second point +print("First point:" , points_cal[0]) +print("Second point:" , points_cal[1]) +from scipy.spatial import distance +distance.euclidean(points_cal[0], points_cal[1])