Skip to content

Q&A: The detected ciliary objects (_RP_3D.tif file) are much wider and deformed compared to how I see the cilia in the image? Why?

Jan Hansen edited this page Dec 3, 2024 · 1 revision

Question: "The detected ciliary objects (_RP_3D.tif file) are much wider and deformed compared to how I see the cilia in the image. Skeleton measurements seem inaccurate. Why and how to fix it?"

This question relates to an image acquired with a fluorescence microscopy (non-confocal!):

Example views of the submitted 3D image (DAPI = blue, Cilia = green), and the output files for the 3D object and the 3D skeleton:

Settings for CiliaQ Preparator: default settings but Canny3D as segmentation method.
Credit for microscopy image: © Gadadhar lab, 2024.

Montage showing all planes (plane position noted on bottom center) for a selected region of the submitted 3D image (DAPI = blue, Cilia = green):


Credit for microscopy image: © Gadadhar lab, 2024.

Answer provided on June 2024 based on a Question submitted by Email.


Reason for error:

The reason for the faulty detection of ciliary objects and lengths relates to sub-optimal segmentation settings for epifluorescence images. Epifluorescence microscopy images typically also contain off-focus blur in the focal planes where the cilia are not present, which with default or common segmentation settings leads to the inclusion of off-focus blurring as part of the cilium (see the montage figure above, where the off-focus blurring in the planes where the cilia are out of focus are visible).

Solution

To get rid of the off-focus-blur in the image before generating the masks and thereby, avoid that the off-focused cilium is included in the cilium mask, I tried different subtract background radii manually (Process > Subtract Background) on the original cilia channel. Such a method could also be setup in CiliaQ Preparator, if it works to remove it. I found out that with a radius of 5 px you remove the off-focus blur but keep the sharp cilia in the sharpest plane. As seen in the screenshot below, the off-focus blur disappears in the processed image and the cilia remain only present where they are sharpest. When applying such a small radius in background subtraction, not only background but any objects wider than 10 px in diameter (5 px radius times two) are removed, which removes also widened up off-focus images of cilia.

Left: Original channel, Right: After background subtraction with 5 px:

Credit for microscopy image: © Gadadhar lab, 2024.

The disadvantage of the Subtract Background method is that it will increase the risk of cilia being detected as multiple individual fractions and not as a continuous cilium (under the circumstance that ciliary labeling is not continuous and spotty as in the present image). Thus to better connect the spotty cilia to a single-cilium object, I will use an additional Gaussian Blur preprocessing of 1 px after the background subtraction. See screenshot below; You barely see a difference but it connects the cilia already a bit better. You can even go higher with the blur in case you will find cilia split up in multiple objects in the final CiliaQ results.

Left: Original channel, Right: After Gaussian Blur filter - sigma 1 px:

Credit for microscopy image: © Gadadhar lab, 2024.

I next applied these processing steps that I tested manual (Subtract Background, Gaussian Blur) in CiliaQ Preparator to process the images. These two settings can be set up in CiliaQ Preparator as follows:

This setting will do what I did manually above above - before segmenting the channel with Canny 3D. In the resulting CQP file you can see that it now does no longer have the off focus blur in the segmentation mask and the off-focus artifacts in the segmentation masks are gone. In this screenshot here you see just the ciliary channel displayed using the Image > Color > Channels tool. And I increased brightness contrast to better display it. You see on the left the mask in the CQP file generated with my setting above, on the right you see the CQP file generated by you (without the preprocessing steps activated in CiliaQ Preparator).

Screenshots from the CQP.tif output from CiliaQ Preparator run without Subtract Background and Gaussian Blur (Left) or with the Subtract Background (5 px) and Gaussian Blur (1 px) preprocessing (Right). Arrows mark examples where segmentation is erroneous due to off-focus blur.

Credit for microscopy image: © Gadadhar lab, 2024.

Next, I sent this new CQP file to CiliaQ under the same settings that you had (30 voxel variant - you could go for a higher voxel number to further remove the too small cilia spots that may represent debris and not cilia). In the resulting output files I see that the skeleton, which represents the length better follows the original cilia (which is probably also the case in 3D).

Left: Original image as max intensity projection for reference. Right: Old output Skl 3D file (no Subtract Background or Gaussian Blur used for pre-segmentation image processing) that shows how length is measured.

Credit for microscopy image: © Gadadhar lab, 2024.

You can see that often the skeleton and thus length measures do not correctly follow the cilia (they follow some extra kinks in beginning and end). Now with the new setting that works better:

Left: Original image as max intensity projection for reference. Right: New output Skl 3D file (where Subtract Background and Gaussian Blur were used for pre-segmentation image processing) that shows how length is measured.

Credit for microscopy image: © Gadadhar lab, 2024.

And this is due to the better and more correct cilium detection without distraction from off focus blur:

Left: Old RP_3D.tif output. Right: New, improved RP_3D.tif output.

Credit for original microscopy image: © Gadadhar lab, 2024.

This analysis now features much more precise length estimates.


Please note that the exact values for the subtract background and Gaussian blur are dependent on the image. Consider optimizing this for your individual image as shown above.