I discovered open3D and I am trying to use it to render and analyze confocal microscope images without relying on commercial software. I have experience in 2D image analysis but I am new to 3D, I am looking to maybe find advice and share what I do.
I work with confocal microscopy, which is a technique that acquire an image in each focal plane of a sample. A typical datasets is composed by stack of images in which each stack represent a deeper position in a sample (the gif below shows a cell with vesicles acquired with a confocal microscope and rendered with 3D viewer in ImageJ).
For what I understand, in a case like this everything start by extracting a point cloud and then render the volumes from it.
To convert a stack of images to a point cloud, I iterate* through the stack of image and extract the coordinate and intensity** value for each pixel above a certain threshold.
My output look like:
[x, y, z, r, g, b]
…multiples rows later…
[xn, yn, zn, rn, gn, bn]
Usually the results are very dense point cloud mainly where are located structure of interest. What could be a strategy to render them and create volumes?
// I add these notes that might be helpful to somebody else //
1* To get the coordinates of pixel above a certain threshold in an image, I use
numpy.where(image > threshold)
that return two array, one for the x and y position. The depth (z-position) will depend on the stack number (each images is acquired at a further depth).
2* It’s trivial but took me some time to get to it, a grayscale image can be converted to RGB by putting the same grayscale intensity in each channel (R, G and B). Since o3D works with float divide the intensity by the byte resolution (e.g. divide the pixel intensity by 255 if you are in 8bit).