Skip to content

(part 1) Step 1: detecting basal bodies (BB) in 3D

Eugene Katrukha edited this page Mar 12, 2025 · 11 revisions

First, for this step, make sure that the Correlescence plugin version >= 0.0.7 is installed on your FIJI.

  1. Start Fiji and open a tiff file with the volume containing the apical part of a cell with basal bodies in ImageJ.

  2. Draw ROIs (of any type, preferably rectangular) around basal bodies (BB) cross-sections at corresponding slice positions and add them to the ROI Manager. The center of the ROI should approximately overlap with the center of BB. It is recommended to save the whole list of ROIs from ROI Manager to a disk. Alternatively, you can generate them at (part 1) Step 0: auto ROIs generation.
    It is important that all ROIs have unique, different names.
    rois

  3. Run s1_detect_BB_BigTrace_single.ijm macro and a parameter dialog will appear. The parameters are described here.
    Additional options are:

    • If you select "Extract stacks?", the macro will save corresponding detected BB volumes without straightening. It is not necessary for the next steps, but could be nice to examine sometimes;
    • Option "Show detection (in overlay)" will add to the original image ROI circles at the detected BB positions. If you re-save the original image, these circles of detection will be stored (recommended).

After clicking OK, a dialog with the choice of output storage folder will appear. Please select an individual proteinName1_proteinName2_decov_001 folder with tif file and ROIs file, as described here.

NB: While this macro is running, it is a good idea to 'leave Fiji and PC alone', i.e. do not perform any other tasks, since it will break the execution of the macro.
Sometimes some errors may appear in the Console log window, they can be ignored, the data will be saved.

output

In the proteinName1_proteinName2_decov_001 folder (specified in the last step), the macro will create s1_detected subfolder,
where it will store .csv files with coordinates of BB central axis in 3D, required for the next step.
Filenames would be the same as ROIs names.

It could be that for some ROIs BBs were not detected. You can check the end of the corresponding generated log file (in logs subfolder).

If you opted for "Show detection", in the initial file circular ROIs should appear in the overlay at places/depths of detection. If you re-save this file as tif, they will be stored.
detections

Next is (part 1) Step 2: extracting basal bodies.

what happens

The macro cycles through provided ROIs and for each of them performs the following.
At the initial z-slice of ROI, it crops out a region with the center the same as the ROI center,
and the XY size estimated from the maximum diameter parameter (top left panel in the movie below).
Only the "total protein stain" channel is used.
Let's call it "BB slice".

A "template" Z-stack is made (top middle panel), containing images of concentric circles
ranging from the maximum till the minimum diameter.
The images of circles are convolved with the 2D Gaussian filter.
Its standard deviation is equal to the user-specified SD of the ring.
The minimum diameter is equal to 3*SD, smaller circles after convolution will look the same.

The macro calculates normalized cross-correlation (NCC) between the "BB slice" image
and all circles of the "template". Then it looks for the maximum value of NCC (bottom plot).
The maximum value provides the position of Z-slice in the template that fits "BB slice" the best (diameter).
Since CC is also calculated in space, in addition, the maximum gives XY coordinates
of the center of the ring in the "BB slice" image.

detection

At the top right panel of the movie, one can see a corresponding template
image (cyan) shifted according to XY maximum NCC position overlayed with
the "BB slice" image (gray).

These XY coordinates are re-calculated to the frame of the original image.
Then the macro goes one slice up (or down) and crops the next ROI
with the center being newly determined XY coordinates.
The process continues until the end of a stack is reached
or the XY shift between adjacent slices exceeds 2*SD.

As a result, for each ROI macro stores the values of Z slices
where the rings were successfully detected + the XY center coordinates +
diameter at each slice and max NCC values.

At this stage, we basically determined XYZ coordinates
of the BB's centerline.

Clone this wiki locally