It would be great if someone could me help me to write code in Python (which I am gradually learning) to solve the problem I am facing.
We are using high-throughput microscope, and I am imaging 96 well plates – a z-stacks of various locations in multiple wells. When I extract images, their name encodes row (rXX, it is from 01 to 08), column (cXX it is from 01 to 12) field (fxx, it is from 01 to any number), plane (pXX, its from 01 to a number of steps in z-stack), ch1 – ch6 imaging channels. Example is below:
as following this example, I would like to get Z-stack of each channel and MAX intensity projection of each channel, likes this:
There are usually 30+ field imaged per one well, and about 60 wells, thus there about 1800 fields of view.
I tried to something like this:
import numpy as np import os import matplotlib.pyplot as plt import numpy as np import multiprocessing import pandas as pd from tifffile import imsave from skimage import io import skimage.io import skimage.exposure import skimage.morphology import skimage.measure import skimage.transform import skimage.segmentation from PIL import Image, TiffTags dir = 'D:/ listfiles = for img_files in os.listdir(dir): if img_files.endswith(".tiff"): listfiles.append(img_files) first_image = io.imread(dir+listfiles) io.imshow(first_image) first_image.shape stack = np.zeros((5,first_image.shape,first_image.shape),np.uint16) for n in range(0,5): stack[n,:,:]= io.imread(dir+listfiles[n]) io.imshow(stack) IM_MAX= np.max(stack, axis=0) plt.imshow(IM_MAX)
However, I want to select specific images as oppose to first 8 or something on a list.
Please let me know if you have any suggestions or solutions to this problem.
Thank you for the help in advance!