DOI: 10.5683/sp3/zkxqw8
title: Pemberton2023_ERMitoSegmentationcode

description: &lt;i&gt;See&lt;/i&gt; Pemberton et al., 2023 section “FLIM–FRET with ER or mitochondrial segmentation on INO-FHS platform” for more details. 
&lt;br&gt;&lt;br&gt;Data were collected using two imaging configurations that were rapidly exchanged in order to acquire signal from mCerulean3 and Venus (fluorescent proteins) by time-correlated single photon counting (TCSPC) FLIM, and Venus and mCherry by using a 64-channel hyperspectral detector. Though Venus protein expression was captured in both configurations, relative Venus expression was measured using the intensity (arbitrary units) from the TCSPC FLIM image. 
&lt;br&gt;&lt;br&gt;
BCL-XL protein localizes to the Endoplasmic Reticulum (ER), mitochondria and cytoplasm in cells. The purpose of this code was to employ the watershed ROI segmentation algorithm on the signal from mCherry-tagged landmarks for ER or mitochondria (Red channel) that were expressed in the same cells as mCerulean3-tagged BCL-XL and Venus-tagged PUMA. The intensity of the signal from mCherry was determined by summing the hyperspectral counts recorded in the detector (wavelengths 592-660nm. The same parameters were used to segment all images of mCherry expression (Red Channel): background threshold(1000), Laplacian of a Gaussian kernel size (9) with sigma (0.13), structural element size (15), minimum ROI size (30), erode factor (0). The ROIs selected from each mCherry-marker (ER or Mitochondria), were applied to all images collected in both configurations 1 and 2 to extract the average intensity and lifetime of mCerulean3 (donor) and the average intensity of Venus (acceptor). The resulting FLIM-FRET binding curves tell us whether PUMA binds BCL-XL in the ER versus mitochondria compartments of the cell.
&lt;br&gt;&lt;br&gt;
&lt;b&gt;INSTRUCTIONS &lt;/b&gt;
&lt;br&gt;
-Script was created in MATLAB Version 2022b. Ensure that you have installed the "Image Processing Toolbox" to run this code. 
&lt;br&gt;&lt;br&gt;
-Before starting the analysis, make two separate folders containing '.Tiff' images that were acquired on the INO-FLIM Hyperspectral microscope using configuration 1 (mCerulean3 + Venus) and configuration 2 (Venus + mCherry). The images were acquired by switching back and forth between configurations 1 and 2 so there should be the same number of images within each of these folders. &lt;b&gt;Troubleshoot: IFF not &lt;/b&gt; the script will not run and the user must identify where the missing or additional file is. To do this, open the first image (at the top, sorted by Time acquired), and so on, in each subfolder ** they should look like the same cells**. 
&lt;br&gt;&lt;br&gt;
-Download all files in Analysis.Zip folder, which contains 2 subfolders:
Step1_Multimodal_Image_Segmentation
Step2_Combine_Filter_Bin
&lt;br&gt;&lt;br&gt;
Step1_Multimodal_Image_Segmentation is the first part of the analysis where FLIM/HS cubes are analyzed.
&lt;br&gt;Open folder "Step1_Start_Here.m" in MATLAB
&lt;br&gt; specify the path to data from configuration 1 at line 7.
&lt;br&gt; specify the path to data from configuration 2 at line 8
&lt;br&gt; specify the path where you want to save analysis data at line 10.
&lt;br&gt;&lt;Run code. The script will create two lists indicating all .tif files in each folder, then it will run the first part of the analysis using AnalyzeTwoConfigurationScans(). This will extract Raw FLIM-FRET binding curves for ROIs selected based on applying a watershed algorithm on the 1. mCerulean3 channel and 2. the Red (mCherry) channel, which will be exported in two subfolders "mC3" and "Red", respectively. The script will also export the raw images and ROI segmentation maps for the user to examine. 
&lt;br&gt;&lt;br&gt;
&lt;b&gt; NOTE &lt;/b&gt; if you want to change the parameters for the watershed algorithm to customize your ROIs, see lines 59-77 of the "Step1_Start_Here.m" code.
&lt;br&gt;&lt;br&gt;
&lt;br&gt;-Open folder "Step2_Combine_Filter_Bin"
&lt;br&gt;&lt;i&gt;In this step, we bin the raw FLIM-FRET binding curves by Acceptor:Donor intensity ratio and extract the mean Acceptor:Donor intensity ratio and median % FRET at each bin. &lt;/i&gt;
&lt;br&gt;&lt;br&gt;-Specify the path to exported raw binding curves in mC3 subfolder at line 13.
&lt;br&gt;&lt;br&gt;-Specify a new path to where you want the exported binned binding curves line 14.
&lt;br&gt;-Run the code. Then rerun the code for raw data in the "Red" subfolder
&lt;br&gt;&lt;br&gt;-Specify the path to exported raw binding curves in Red subfolder at line 13.
&lt;br&gt;&lt;br&gt;-Specify a &lt;b&gt; new path &lt;/b&gt; to where you want the exported binned binding curves line 14.
&lt;br&gt; -Repeat all steps above for each biological replicate (n=3).