# Plotting PET TACs

There are many ways to visualize regional and plasma time-activity curves (PTACs and TTACs). This page describes just a few tools that may make the process easier.

All spreadsheet programs (MS Excel, OpenOffice, …) can be used to plot the (x,y) curve data. Files of TAC data can be imported to spreadsheet programs as ASCII text files, but to prevent problems with formatting and decimal separator, it is recommended that TAC files are first converted into HTML table or CSV format: program tacformat can be used to convert data files into XML or CSV format, entering appropriate options to deal with decimal and column separators, when necessary; at least MS Excel can then correctly import these .csv files. Option -mid will save the data with middle frame time.

Alternatively, program dft2html can be used to convert data files into HTML table format. These can then be opened in spreadsheet programs (also drag-and-drop works).

## Origin

Simple plots can be easily made with spreadsheet programs, but use Origin for drawing publication quality graphics. Turku PET Centre and University of Turku have licences to Origin, please ask IT group to install it to your PC. User’s manual is available in PET Centre Intranet > Instructions > Origin75. Spreadsheet data can be copy-pasted from Excel into Origin worksheet.

## Plotting TACs in SVG format

PET curves can be quickly drawn in SVG files and then the saved SVG files can be viewed or printed with any up-to-date web browser, or edited further or converted to other formats as explained here.

### Plotting fitted curves

When a model or mathematical function is fitted to the time-activity curves, it is necessary to check by eye the goodness of the fit. Most in-house analysis programs can optionally save the measured data points and fitted curves in SVG format.

Alternatively, fitted curve data can be saved as data file (optionally) by most analysis programs. When mathematical functions are fitted to data and fitted parameters are saved in *.fit files, the fitted TAC can later be computed and saved in TAC format using fit2dat.

Fitted curves saved as TAC files can then be imported to spreadsheet program as above. Program tac2svg can be used to plot both the measured data and fitted curve(s) in the same graph.

Patlak and Logan plots can be optionally saved in SVG or HTML table format in programs patlak and logan, or viewed in Carimas.

#### Viewing PET frames

If TAC data needs to be plotted with bars representing the PET frames, program tac4frpl can be used to transform TAC files into versions that contain both frame start and and end times in the x axis. These can then be easily plotted with previously mentioned programs.

Adams C: Learning Python Data Visualization. Packt Publishing, 2014. ISBN 978-1-78355-333-4.

Devert A: matplotlib Plotting Cookbook. Packt Publishing, 2014. ISBN 978-1-84951-326-5.

Janert PK: Gnuplot in Action - Understanding Data with Graphs. Manning Publications Co, 2010. ISBN 978-1-933988-39-9.

Phillips L: gnuplot Cookbook. Packt Publishing, 2012. ISBN 978-1-84951-724-9.

Rahlf T: Data Visualization with R - 100 Examples. Springer, 2017. doi: 10.1007/978-3-319-49751-8.

Tags: , , , ,

Updated at: 2018-03-16
Created at: 2010-08-11
Written by: Vesa Oikonen