Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| roi_fitting_using_the_flim_script [2014/02/11 14:04] – rosario | roi_fitting_using_the_flim_script [2026/08/18 22:16] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== ROI fitting using the FLIM script ====== | ||
| - | |||
| - | |||
| - | ===== Summary ===== | ||
| - | |||
| - | |||
| - | This tutorial shows step-by-step, | ||
| - | |||
| - | ==== Step-by-Step Tutorial ==== | ||
| - | |||
| - | |||
| - | === Select a file and start the script === | ||
| - | |||
| - | * Start [[products: | ||
| - | * Open the " | ||
| - | |||
| - | **Note:** The " | ||
| - | |||
| - | **Response: | ||
| - | {{ roi_fitting_using_the_flim_script_Image_1.png }} | ||
| - | |||
| - | * Highlight the file '' | ||
| - | {{ roi_fitting_using_the_flim_script_Image_2.png }} | ||
| - | |||
| - | * Select the " | ||
| - | {{ roi_fitting_using_the_flim_script_Image_3.png? | ||
| - | |||
| - | **Note:** The drop down menu can be opened and closed by clicking on the grey button on the left side of the header of the drop down menu: {{grey_button.png}} | ||
| - | |||
| - | * Start the [[glossary: | ||
| - | {{ roi_fitting_using_the_flim_script_Image_4.png }} | ||
| - | |||
| - | **Response: | ||
| - | {{ roi_fitting_using_the_flim_script_Image_5.png? | ||
| - | |||
| - | **Note:** The window contains five different regions:\\ | ||
| - | - **Upper left:** imaging analysis options.\\ | ||
| - | - **Upper center:** [[glossary: | ||
| - | - **Upper right:** Fluorescence Lifetime Histogram. Here the frequency of photon counts corresponding to the individual mean lifetimes is plotted. The settings of the plot can be adapted using the controls on the right of the plot.\\ | ||
| - | - **Lower left:** Lifetime fitting parameters. Here lifetime fitting models can be defined. Fitting is then applied to the lifetime graph(s) on the lower center (TCSPC histogram).\\ | ||
| - | - **Lower center/ | ||
| - | |||
| - | * To enhance the lifetime contrast within the daisy pollen, adapt the color scale from 0.7 to 2 ns by typing these values as limits for the Fast Lifetime color scale. | ||
| - | |||
| - | **Note:** The default lifetime scale stretches from -0.5 to 41.6 ns. The physically impossible value of -0.5 ns is explained by the fact, that SymPhoTime places the 0 value at the rising edge of the decay in the TCSPC window. As a mean arrival time is calculated, it is possible that in dark regions only one or two photons caused dark count noise are detected which are randomly detected before the laser pulse in the TCSPC window.\\ | ||
| - | Reasonable limits can either be found by dragging the limit bars in the color scale "Fast Lifetime" | ||
| - | |||
| - | {{ roi_fitting_using_the_flim_script_Image_6.png? | ||
| - | |||
| - | **Response: | ||
| - | |||
| - | === Select 3 Regions of Interest (ROI) === | ||
| - | |||
| - | |||
| - | * Keep the mouse pointer over the image and open the context menu by a right mouse click. | ||
| - | {{ roi_fitting_using_the_flim_script_Image_7.png? | ||
| - | |||
| - | * Select a ROI tool in the context menu, e.g. the " | ||
| - | |||
| - | **Note:** The different ROI tools are used in the following way:\\ | ||
| - | **Paint ROI:** highlights the pixels the mouse cursor is guided over while the left mouse button is activated. The faster the cursor is moved the broader is the area of pixels highlighted around the mouse.\\ | ||
| - | **Free ROI:** moving while keeping the left mouse button activated marks the area within the drawn shape.\\ | ||
| - | **Rectangle ROI:** to draw rectangular ROIs.\\ | ||
| - | **Ellipse ROI:** to draw elliptic ROIs.\\ | ||
| - | **Magic Wand ROI:** when activated, clicking activates all neighboring pixels with a similar Fast Lifetime. Especially useful for marking spotted structures. | ||
| - | |||
| - | * Draw a ROI in the blue rim of the pollen by maintaining the left mouse button activated while circling the selected part of the image as shown: | ||
| - | {{ roi_fitting_using_the_flim_script_Image_8.png? | ||
| - | |||
| - | **Response: **\\ | ||
| - | * Everything except the circled area is displayed only in grey scale. | ||
| - | * In the lower part of the window, a new decay appears in grey, which contains the photons from the selected pixels. This new decay is labeled "ROI 0". | ||
| - | {{ roi_fitting_using_the_flim_script_Image_9.png? | ||
| - | |||
| - | * On the upper left, open the drop down menu " | ||
| - | {{ roi_fitting_using_the_flim_script_Image_10.png }} | ||
| - | |||
| - | **Response: **\\ | ||
| - | * In the " | ||
| - | * The whole image is displayed in color scale again. | ||
| - | * In the decay legend, ROI 1 is added. | ||
| - | * As ROI 1 contains still all photons of the image and equals the " | ||
| - | * Place the cursor over the image, select in the context menu (right mouse click) the " | ||
| - | {{ roi_fitting_using_the_flim_script_Image_11.png }} | ||
| - | |||
| - | **Response: **\\ | ||
| - | * Everything except the marked area is displayed only in grey scale. | ||
| - | * In the lower part of the window, a new decay appears in grey, which contains the photons from the selected pixels. This new decay corresponds to "ROI 1". | ||
| - | * Mark a third ROI. Therefore, on the upper left, open the drop down menu " | ||
| - | **Response: **\\ | ||
| - | * In the " | ||
| - | * The whole image is displayed in color scale again. | ||
| - | * In the decay legend, ROI 2 is added. | ||
| - | * Place the cursor over the image, select in the context menu (right mouse click) the "Magic Wand ROI" and click on a red region in the pollen. | ||
| - | {{ roi_fitting_using_the_flim_script_Image_12.png }} | ||
| - | |||
| - | **Response: **\\ | ||
| - | * Everything except the marked area is displayed only in grey scale. | ||
| - | * In the lower part of the window, a new decay appears in grey, which contains the photons from the selected pixels. This new decay corresponds to "ROI 2". | ||
| - | |||
| - | **Note:** The new decay wich stems from the last and smaller ROI contains considerably less photons. Ideally, decays selected for ROI fitting should contain ~10000 – 50000 photons in the peak. | ||
| - | |||
| - | * As the decay contains much less photons than the other ROIs, we add other regions to the same ROI. In order to recognize the red regions, go to the context menu and select " | ||
| - | {{ roi_fitting_using_the_flim_script_Image_13.png }} | ||
| - | |||
| - | **Response: | ||
| - | * Everything except the originally selected pixels for ROI 2 are displayed in color scale. | ||
| - | * Keep the < | ||
| - | {{ roi_fitting_using_the_flim_script_Image_14.png }} | ||
| - | |||
| - | * Again, select " | ||
| - | {{ roi_fitting_using_the_flim_script_Image_15.png }} | ||
| - | |||
| - | **Response: | ||
| - | |||
| - | **Note:**\\ | ||
| - | To review the different regions, go to the drop down menu " | ||
| - | To export the images with a marked ROI, keep the cursor over the image with the selected ROI, open the context menu with a right mouse click and select one of the export options:\\ | ||
| - | **Bitmap** exports the image as a bmp file. If the scale bar is displayed, the image including the scale bar is exported.\\ | ||
| - | **Bitmap with color scale** exports the image as a bmp file including the intensity and color scale next to the image.\\ | ||
| - | **1x1 bitmap** exports the image as a bmp file with one pixel of the image being exported as one pixel in the image file. In the other bitmap export options, the image is exported as displayed.\\ | ||
| - | **ASCII** exports the image as ASCII array using a text file format. Thereby one array encodes the intensity values, while a second array encodes the Fast Lifetime values. After removal of the header and the unwanted array, individual arrays can be imported in graphic programs, e.g. ImageJ as a text image. These images contain the full count resolution of the raw image. | ||
| - | |||
| - | === Perform a Lifetime Fit on the Selected Regions (ROIs) === | ||
| - | |||
| - | * In the decay form on the lower left, select n-exponential reconvolution as fitting model. | ||
| - | {{ roi_fitting_using_the_flim_script_Image_16.png? | ||
| - | |||
| - | **Response: | ||
| - | * In the TCSPC window, the IRF is displayed in bright red, the data fitting limits are moved to the border of the TCSPC window. | ||
| - | * The new fitting parameters "Shift IRF" and "Bkgr IRF" (=background IRF) appear in the fitting parameter table. | ||
| - | {{ roi_fitting_using_the_flim_script_Image_17.png? | ||
| - | |||
| - | **Note:** The software offers the possibility to fit the data using a n-exponential tailfit or a n-exponential reconvolution fit. A tailfit can be used when the fitted lifetimes are significantly longer than the instrument response function. A reconvolution fit is usually preferable, because the complete decay is fitted, while for a tailfit, the start of the fitting range is usually a bit arbitrary.\\ | ||
| - | For explanation about the fitting model and the used equations, click on the " | ||
| - | |||
| - | * Under " | ||
| - | **Response: | ||
| - | * The TCSPC curve of ROI 0 is highlighted in green. | ||
| - | * Click: " | ||
| - | **Response: **\\ | ||
| - | * In the TCSPC window, the fit of ROI 0 is displayed as a black line. Below, the residuals (= raw data fit values) are displayed. | ||
| - | * Fit values appear in the fitting table. | ||
| - | {{ roi_fitting_using_the_flim_script_Image_18.png? | ||
| - | |||
| - | **Note:** Usually, a decent fit is characterized by the following criteria:\\ | ||
| - | The fitted curve overlays well with the decay curve. In the residual window, the values spread randomly around 0.\\ | ||
| - | The χ²-value approaches 1.\\ | ||
| - | The calculated fitting values are reasonable.\\ | ||
| - | Usually the fitting model with least parameters is selected.\\ | ||
| - | In this example it is obvious that the applied single exponential reconvolution fit is not suited to fit the decay curve. | ||
| - | |||
| - | * Increase the "Model Parameters" | ||
| - | * Again, click on " | ||
| - | **Response: | ||
| - | * The fit quality increases, but still the fit quality is not sufficient. | ||
| - | {{ roi_fitting_using_the_flim_script_Image_19.png? | ||
| - | |||
| - | * Increase the "Model Parameters" | ||
| - | * Again, click on " | ||
| - | **Response: | ||
| - | * Now a good fit result is achieved. | ||
| - | {{ roi_fitting_using_the_flim_script_Image_20.png? | ||
| - | |||
| - | * To check whether this is really the best possible fit, increase the "Model Parameters" | ||
| - | * Again, click on " | ||
| - | **Response: | ||
| - | * The fit becomes even slightly better, but looking at the fitting parameters, we find an amplitude A4 with a negative value " | ||
| - | {{ roi_fitting_using_the_flim_script_Image_21.png? | ||
| - | |||
| - | |||
| - | * Decrease the "Model Parameters" | ||
| - | * Again, click on " | ||
| - | **Response: | ||
| - | * Now a good fit is achieved. | ||
| - | {{ roi_fitting_using_the_flim_script_Image_22.png? | ||
| - | |||
| - | * To compare the fit with other ROIs, we select: "Fit all". | ||
| - | {{ roi_fitting_using_the_flim_script_Image_23.png? | ||
| - | |||
| - | **Response: **\\ | ||
| - | * Every decay is fitted with a 3-exponential fit. | ||
| - | * As the last fit is ROI 2, this curve is shown in green at the final window. | ||
| - | * To compare the fitting data, either toggle between the graphs by selecting as " | ||
| - | |||
| - | **Response: | ||
| - | * Instead of the TCPSC curve, the fitted parameters appear in a graph. | ||
| - | * Select the parameter you would like to display (e.g. T_av_Int, the intensity-weighted average lifetime, which - neglecting background photons – roughly corresponds to the Fast Lifetime). | ||
| - | {{ roi_fitting_using_the_flim_script_Image_24.png? | ||
| - | |||
| - | **Note:** On the x-axis, the dataset name is plotted. The order is the same as in the decay menu:\\ | ||
| - | 1 = Overall decay, generated from all photons of the image.\\ | ||
| - | 2 = Pixel decay, including the photons from the last selected pixel.\\ | ||
| - | 3 = ROI 0\\ | ||
| - | 4 = ROI 1\\ | ||
| - | 5 = ROI 2\\ | ||
| - | |||
| - | * Keep the cursor over the graph, and after a right mouse click, select from the context menu the " | ||
| - | {{ roi_fitting_using_the_flim_script_Image_25.png? | ||
| - | |||
| - | **Respond: | ||
| - | {{ roi_fitting_using_the_flim_script_Image_26.png? | ||
| - | |||
| - | * The .dat file contains the fitting values as table and can be opened e.g. using the Notepad program. They can also be imported into Excel or similar programs. | ||
| - | {{ roi_fitting_using_the_flim_script_Image_27.png? | ||
| - | |||
| - | * Store the result file by selecting: "Save Results" | ||
| - | {{ roi_fitting_using_the_flim_script_Image_28.png? | ||
| - | |||
| - | **Response: | ||
| - | * A result file ('' | ||
| - | {{ roi_fitting_using_the_flim_script_Image_29.png }} | ||
| - | |||
| - | * Later, clicking on the result file reopens the file in the same way as it was stored. | ||
| - | |||
| - | **Note:**\\ | ||
| - | This tutorial explains only a subset of the functions of the FLIM script. Also check the script explaining pixel fitting (Lifetime-fitting Using the FLIM-analysis). | ||
| - | |||
| - | |||