TITLE: Protocol (C): Automated segmentation of the otic vesicle and image analysis
AUTHORS: Désirée A. Schmitz, Tobias Wechsler, Hongwei Bran Li, Bjoern Menze, Rolf Kümmerli

[DESCRIPTION]
This protocol details the automated segmentation of the otic vesicle and image analysis. 

[STEPS]
SECTION: Automated segmentation of the otic vesicle and image analysis
2. Organize your images in a folder with two subfolders: 

one for the brightfield images named ‘Images’, 
one for all fluorescence images named ‘Fluor’. 

The image file names have to contain the slice number with a Z as a prefix and the channel number (0-based) with a C as a prefix (e.g., PositionName_Z00_C00.tif). For example, for measuring two different fluorophores and the brightfield image, we have three channels, C00 (e.g., brightfield), C01 (e.g., GFP), C02 (e.g., mCherry). We include an example script to convert Leica image files accordingly (sort_images_lif.py), which can be used as an example of how to organize all images automatically as described. 
SECTION: Automated segmentation of the otic vesicle and image analysis
3. For the segmentation of the otic vesicle, run the segmentation.sh (segmentation.ps1 for Windows) script with the previously created directory as input (e.g. for Mac: in Terminal). Make sure the shell script is executable (e.g. for Mac: by typing 
 
 in Terminal). The script will start a docker container and the segmentation model on the specified brightfield images. 
SECTION: Automated segmentation of the otic vesicle and image analysis
4. In the same directory that contains your brightfield (Images) and fluorescence (Fluor) images, a directory named output_real_value is created that contains the segmentation masks. 
SECTION: Automated segmentation of the otic vesicle and image analysis
5. Start FIJI and open the check_measure.py script. 
SECTION: Automated segmentation of the otic vesicle and image analysis
6. Run the script and select the directory with your brightfield (Images) and fluorescence (Fluor) images and segmentation masks (output_real_value) as input. 
SECTION: Automated segmentation of the otic vesicle and image analysis
7. FIJI will display the brightfield images and the corresponding segmentation. In the ROI Manager window untick the box “Show All” and select one of the ROIs in the list to only show the segmentation for a single ROI. Go through the ROI sequence and delete inaccurate segmentations.  
SECTION: Automated segmentation of the otic vesicle and image analysis
8. Complete the manual review of the segmentations by pressing OK. 
SECTION: Automated segmentation of the otic vesicle and image analysis
9. The script creates six files: 

SECTION: Automated segmentation of the otic vesicle and image analysis
9.1. an image with an overlay of the strain partitioning based on fluorescence (e.g. Sample1_overlay.tif),
SECTION: Automated segmentation of the otic vesicle and image analysis
9.2.  a text file containing the log to check what has been done up until here (e.g. Sample1_log.txt) 
SECTION: Automated segmentation of the otic vesicle and image analysis
9.3. a zip file with the ROIs (Sample1_rois.zip) 
SECTION: Automated segmentation of the otic vesicle and image analysis
9.4. a table with fluorescence values within the whole otic vesicle (mean and integrated density for both GFP and mCherry; e.g. Sample1 ov_data.csv)
SECTION: Automated segmentation of the otic vesicle and image analysis
9.5. A table with the size of the area occupied by tagged strains (e.g. Sample1_strain_count.csv) → e.g. needed to calculate co-localization 
SECTION: Automated segmentation of the otic vesicle and image analysis
9.6. A table with the fluorescence values of individual pixels within the otic vesicle (e.g. Sample1 pixel_data.csv).

 

SECTION: Automated segmentation of the otic vesicle and image analysis
10. Use the accompanying R-script to visualize the size of the area occupied by each tagged bacterial species and the overlap between the two species to quantify their co-localization (script: co_localization.R).
SECTION: Automated segmentation of the otic vesicle and image analysis
11. Check whether the fluorescence images in FIJI correspond to the values in R by dropping the Fluor folder into FIJI and comparing it to the R plot. 
SECTION: Automated segmentation of the otic vesicle and image analysis
1.