Decimal separator in TPC
Blood and regional PET data in Turku PET Centre are saved in ASCII file format (file format DFT or the format used by PMOD), containing decimal numbers. The decimal separator is a symbol used to mark the boundary between the integral and the fractional parts of a decimal numeral. Terms implying the symbol used are decimal point and decimal comma. Both representations are accepted by SI, depending on the country.
Finland, Italy, Germany and France belong to the comma countries. United Kingdom, United States and Japan belong to the dot countries, and the programming tools and software for PET scanners and other devices have largely been developed there. Therefore, software in the PET field commonly assumes that decimal point is used, although modern software can be adapted to use the local separator. Since PET data can be sent across borders we can not assume that the data to be analyzed follows the local country settings.
Convention in TPC
At the present moment, most data analysis software in TPC writes decimal numbers with decimal point. Increasingly, "in-house" software can read data files using either comma or dot separator; dot separator is always accepted.
Problem is introduced, when Windows software (for example Excel), by default, uses local separator, which is comma in Finland. When these files are saved and used by analysis tools that assume decimal points, only the integer part of the decimal number may actually be read and the fractional part may be (silently) discarded, or, if you are lucky, program execution stops with an error.
Change the decimal separator setting in Windows from the control panel, or you can override the Windows decimal separator setting only in Excel, if you like. Note that in hospital network you may need to do this change again once a while!
Windows software is, by default, assuming that data files that you try to import are using local separator, which is comma in Finland. Our data files normally have dot separators, therefore the data is not imported correctly.
Change the decimal separator setting in Windows from the control panel, or you can override the Windows decimal separator setting only in Excel, if you like.
Use the latest versions of tacformat, parformat, dft2html, or res2html to convert data files into XML or XHTML table format and import those in Excel. Or, use tacformat with appropriate command-line option to convert data into CSV format for importing into Excel.
Linux scripts are usually written assuming that decimal
separator is dot. When these scripts are executed on bash
shell on Windows, the default
locale setting may default to comma as decimal separator.
In that case, for example, command
printf "Pi %f\n" 3.14would lead to "invalid number" error, and
0,000000would be printed.
Change the decimal separator setting permanently in Windows from the control panel, or in the shell by adding
In case of bash script, add
LC_NUMERIC=C to the script to use dot as decimal
separator during execution of the script. It may be safe to start all bash scripts with
Updated at: 2018-11-11
Created at: 2007-01-12
Written by: Vesa Oikonen