from skimage.exposure import rescale_intensityimport matplotlib.pyplot as pltdef gray2color(u,channel):"""Compute color image from intensity in fluorescence in a given channel.Arguments:-----------u: np.ndarrayInput fluorescence image (2D).channel: intChannel to code the image in (0: Red, 1: Green, 2: Blue).Returns:-----------u_color: np.ndarrayThe computed output image in color."""u_color = np.dstack((rescale_intensity(u if channel==0 else np.zeros_like(u), out_range='float'),rescale_intensity(u if channel==1 else np.zeros_like(u), out_range='float'),rescale_intensity(u if channel==2 else np.zeros_like(u), out_range='float'),))return u_colordef show_Green(img):plt.imshow(gray2color(img,1))plt.show()plt.figure()show_Green(inputImage)
Reference
https://www.jscholler.com/2020-04-20-Outer_segment_orientation/
