Skip to content

(part 2) Step 2: Segmentation verification

Eugene Katrukha edited this page Mar 17, 2025 · 3 revisions

At this step, the main goal is to verify BB shape segmentation along Z axis
and determine its XY parameters.

Open in FIJI script editor a2_verification.ijm macro and run it.

The parameters dialog will appear:
parameter dialog
A description of the parameters is provided below.

The next dialog will prompt the selection of all_data_folder
and the next dialog will allow you to select an output folder (the same as in the previous step).

input

The macro will iterate through all folders in all_data_folder,
using their names as references.
It will also use subfolders BB_marks, BB_channel and
summary_fit_params.csv file from the previous step.

what happens

From the "cleaned" CVS files of the previous step, using Z marks of BB and transition zone,
macro will calculate the average height of BB and transition zone.
The marks are also used to calculate the middle z-position of the BB (used below).
Normalizing these heights by their average values provides BB and transition zone
correcting scales: factors for shrinking or stretching these regions along Z axis.

For each file/folder/cell, the macro will take the reference "total protein stain" channel
and take two XZ and YZ middle "single slice" cross-section planes along all Z
at X_cent and Y_cent coordinates (determined during the previous step).
It will calculate the middle of the basal body (part excluding the transition zone) and
draw a horizontal line ROI with XY middle line width (px) thickness.
XZ and YZ cross sections

In the intensity profile along this line ROI, it will find two highest maxima
and determine BB diameter along X and Y axis (bottom panels).
These are used to calculate average X and Y diameters of BBs.

output

The macro will create an a2_verification subfolder in the output folder.

Inside, it will make a BB_marks subfolder. It contains maximum intensity YZ
projections with "marks" of BB and transition zone in Z (horizontal lines)
and determined Y diameter (vertical lines).
marks
These are helpful visual verifications of the final "scale marks".

In the additional rescaleZ folder located YZ maximum projections
where the height of BB and transition zone were adjusted by correcting scales
(normalized by the average corresponding height).

The most important output is in the summary_XYZ_scales.csv file.
It contains Z-"marks" positions of the BB's top, bottom, and boundary
of the transition zone. Using these values, the heights of BB and transition zone
are calculated (ZSize1 and Zsize2 colums) and corresponding correcting scales (ZScale1 and ZScale2).
The same normalization and "scale correction" procedure is applied to the BB diameters
along the X and Y axes (XSize and YSize), with correcting scales XScale and YScale.

Calculated data is used in the next (part 2) Step 3: Rescaling shapes.

Clone this wiki locally