roi fitting using the flim script - picoquant › images › ... › roi-fitting_using_the... ·...

17
Tutorial ROI Fitting Using the FLIM Script Summary This tutorial shows step-by-step, how the FLIM script of SymPhoTime 64 can be used to fit several regions of interest (ROIs), and how to extract and interpret the results. In detail, the FLIM script is started using a daisy pollen image from the "Samples" – workspace, then three regions of interest are defined which are finally fitted. Step-by-Step Tutorial Select a file and start the script Start SymPhoTime 64 software. Open the "Samples" workspace via "File\open Workspace" from the main menu. Response: The files of the sample workspace are displayed in the workspace panel on the left side of the main window. © PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 1 Note: The "Samples" workspace is delivered with the SymPhoTime 64 and on the CD-ROM drive and contains example data to show the function of the SymPhoTime data analysis. If you haven't installed it on your computer, copy it from the DVD onto a local drive before going through this tutorial.

Upload: others

Post on 05-Jul-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

Tutorial

ROI Fitting Using the FLIM Script

Summary

This tutorial shows step-by-step, how the FLIM script of SymPhoTime 64 can be used to fit several regions ofinterest (ROIs), and how to extract and interpret the results. In detail, the FLIM script is started using a daisy pollen image from the "Samples" – workspace, then three regions of interest are defined which are finally fitted.

Step-by-Step Tutorial

Select a file and start the script

• Start SymPhoTime 64 software.

• Open the "Samples" workspace via "File\open Workspace" from the main menu.

• Response: The files of the sample workspace are displayed in the workspace panel on the left side of the main window.

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 1

Note:The "Samples" workspace is delivered with the SymPhoTime 64 and on theCD-ROM drive and contains example data to show the function of theSymPhoTime data analysis. If you haven't installed it on your computer, copy itfrom the DVD onto a local drive before going through this tutorial.

Page 2: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Highlight the file "DaisyPollen_cells_FLIM.ptu" by a single mouse click.

• Select the "Analysis"-tab and in there, open the drop down menu "Imaging".

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 2

Page 3: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Start the FLIM script by clicking on "Start".

• Response: The FLIM script is applied to the file "DaisyPollen_cells_FLIM.ptu. Thereby, a new Window opens:

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 3

Note:The drop down menu can be opened and closed by clicking on the grey buttonon the left side of the header of the drop down menu:

Page 4: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• 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.

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 4

Note:The window contains five different regions:

Upper left: imaging analysis options.

Upper center: Fast FLIM image, displayed in false color scale. The brightnessencodes the intensity while the color encodes the average "Fast FLIM" lifetime,i.e. the mean arrival times of the photons after the laser pulse. When notdefined otherwise, intensity and color scale stretch from minimum to maximum.As the mean arrival time of the background photons in the areas where nofluorescence is detected, is randomly spread over the TCSPC window, themean photon arrival time of the dark background is usually very long (up to 1/2of the TCSPC window), which makes the color scale loaded by defaultsometimes unsuited for displaying the lifetime contrast in the actual sample. Inthis case, the scale has to be adapted.

Upper right: Fluorescence Lifetime Histogram. Here the frequency of photoncounts corresponding to the individual mean lifetimes is plotted. The settings ofthe plot can be adapted using the controls on the right of the plot.Lower left: Lifetime fitting parameters. Here lifetime fitting models can bedefined. Fitting is then applied to the lifetime graph(s) on the lower center(TCSPC histogram).

Lower center/left. By default, this set shows the TCSPC histogram of allphotons in the image in green (= dataset 0) and the TCSPC histogram of asingle pixel in grey (= dataset 1). In red an estimation of the instrumentresponse function (=IRF) is shown. The IRF reconstruction is deducted from therising edge of the images TCSPC histogram.

Page 5: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Response: The color scale in the image adapts and lifetime contrasts in the pollen become visible.

Select 3 Regions of Interest (ROI)

• Keep the mouse pointer over the image and open the context menu by a right mouse click.

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 5

Note:The default lifetime scale stretches from -0.5 to 41.6 ns. The physicallyimpossible value of -0.5 ns is explained by the fact, that SymPhoTime placesthe 0 value at the rising edge of the decay in the TCSPC window. As a meanarrival time is calculated, it is possible that in dark regions only one or twophotons caused dark count noise are detected which are randomly detectedbefore the laser pulse in the TCSPC window.

Reasonable limits can either be found by dragging the limit bars in the colorscale "Fast Lifetime" histogram or by considering the peaks of the "LifetimeHistogram". Entering fixed values has the advantage that different images canbe compared later.

Page 6: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Select a ROI tool in the context menu, e.g. the "FreeROI" tool.

• 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:

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 6

Note:The different ROI tools are used in the following way:

Paint ROI: highlights the pixels the mouse cursor is guided over while the leftmouse button is activated. The faster the cursor is moved the broader is thearea of pixels highlighted around the mouse.

Free ROI: moving while keeping the left mouse button activated marks the areawithin 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 asimilar Fast Lifetime. Especially useful for marking spotted structures.

Page 7: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• 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".

• On the upper left, open the drop down menu "Region of Interest" and click on "New".

• Response:

◦ In the "Region of Interest" drop down, the ROI number is set to "1".

◦ 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 "Overall decay", no new curve is displayed.

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 7

Page 8: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Place the cursor over the image, select in the context menu (right mouse click) the "Rectangle ROI" and mark a rectangular ROI in the green central part of the pollen.

• 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 "Region of Interest" and click on "New".

• Response:

◦ In the "Region of Interest" drop down, the ROI number is set to "2".

◦ 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.

• 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".

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 8

Page 9: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• 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 "Invert ROI":

• Response: Everything except the originally selected pixels for ROI 2 are displayed in color scale.

• Keep the <CRTL>-button pressed while clicking on the other red dots in the image. With every selection, the corresponding red dot is greyed out.

• Again, select "Invert ROI" in the context menu.

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 9

Note:The new decay wich stems from the last and smaller ROI contains considerablyless photons. Ideally, decays selected for ROI fitting should contain ~10000 –50000 photons in the peak.

Page 10: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Response: Now only the red dots of the pollen image are highlighted, everything else is greyed out. The decay corresponding to ROI 2 contains now the photons from all marked dots.

Perform a Lifetime Fit on the Selected Regions (ROIs)

• In the decay form on the lower left, select n-exponential reconvolution as fitting model.

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 10

Note:To review the different regions, go to the drop down menu "Regions of Interest"and change the number between 0 and 2. The image will display thecorresponding image with the selected ROI.

To export the images with a marked ROI, keep the cursor over the image withthe selected ROI, open the context menu with a right mouse click and selectone of the export options:

Bitmap exports the image as a bmp file. If the scale bar is displayed, the imageincluding the scale bar is exported.

Bitmap with color scale exports the image as a bmp file including the intensityand color scale next to the image.

1x1 bitmap exports the image as a bmp file with one pixel of the image beingexported as one pixel in the image file. In the other bitmap export options, theimage is exported as displayed.

ASCII exports the image as ASCII array using a text file format. Thereby onearray encodes the intensity values, while a second array encodes the FastLifetime values. After removal of the header and the unwanted array, individualarrays can be imported in graphic programs, e.g. ImageJ as a text image.These images contain the full count resolution of the raw image.

Page 11: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• 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.

• Under "Decay" select "ROI 0".

• Response: The TCSPC curve of ROI 0 is highlighted in green.

• Click: "Initial Fit" (marked in orange).

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 11

Note:The software offers the possibility to fit the data using a n-exponential tailfit or an-exponential reconvolution fit. A tailfit can be used when the fitted lifetimes aresignificantly longer than the instrument response function. A reconvolution fit isusually preferable, because the complete decay is fitted, while for a tailfit, thestart of the fitting range is usually a bit arbitrary.

For explanation about the fitting model and the used equations, click on the"Help" button next to the selected model. This opens a help window containingthe fitting equation and the explanation of the different parameters.

Page 12: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• 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.

• Increase the "Model Parameters" to n = 2.

• Again, click on "Initial fit":

• Response: The fit quality increases, but still the fit quality is not sufficient.

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 12

Note:Usually, a decent fit is characterized by the following criteria:

The fitted curve overlays well with the decay curve. In the residual window, thevalues 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 fitis not suited to fit the decay curve.

Page 13: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Increase the "Model Parameters" to n = 3.

• Again, click on "Initial fit".

• Response: Now a good fit result is achieved.

• To check whether this is really the best possible fit, increase the "Model Parameters" to n = 4.

• Again, click on "Initial fit".

• Response: The fit becomes even slightly better, but looking at the fitting parameters, we find an amplitude A4 with a negative value "-40". This is not expected, and not physically logical. Therefore, this decay is best described by a 3-exponential model.

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 13

Page 14: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Decrease the "Model Parameters" to n = 3.

• Again, click on "Initial fit".

• Response: Now a good fit is achieved.

• To compare the fit with other ROIs, we select: "Fit all".

• 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 "Decay" ROI 0, ROI 1 or ROI 2 or click on "Parameter Plot" (right next to the TCSPC graph).

• 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).

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 14

Page 15: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Keep the cursor over the graph, and after a right mouse click, select from the context menu the "Export ASCII (All Cells)" option.

• Respond: A window opens, asking for a file name to store the fitting values. The data are stored as a .dat file.

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 15

Note:On the x-axis, the dataset name is plotted. The order is the same as in thedecay menu:1 = Overall decay, generated from all photons of the image.2 = Pixel decay, including the photons from the last selected pixel.3 = ROI 04 = ROI 15 = ROI 2

Page 16: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• 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.

• Store the result file by selecting: "Save Results".

• Response: A result file ("FLIM.pqres") is stored under the raw data file ("DaisyPollen_FLIM.ptu").

© PicoQuant 2013 Tutorial: ROI Fitting Using the FLIM Script 16

Page 17: ROI Fitting Using the FLIM Script - PicoQuant › images › ... › roi-fitting_using_the... · • Response: Now a good fit result is achieved. • To check whether this is really

• Later, clicking on the result file reopens the file in the same way as it was stored.

PicoQuant GmbH Phone: +49-(0)30-6392-6929Rudower Chaussee 29 (IGZ) Fax: +49-(0)30-6392-656112489 Berlin Email: [email protected] WWW: http://www.picoquant.com

Copyright of this document belongs to PicoQuant GmbH. No parts of it may be reproduced, translated or transferred to third parties without written permission of PicoQuant GmbH. All Information given here is reliable to our best knowledge. However, no responsibility is assumed for possible inaccuracies or ommisions. Specifications and external appearences are subject to change without notice.

© PicoQuant GmbH, 2013

Note:This tutorial explains only a subset of the functions of the FLIM script. Alsocheck the script explaining pixel fitting (Lifetime-fitting_Using_the_FLIM-script_Step_by_Step).

fff