#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <math.h>#include <ctype.h>#include <string.h>#include <strings.h>#include "decpoint.h"#include "backup.h"#include "include/dftio.h"#include "include/dftunit.h"#include "include/ncifile.h"#include "include/idwc.h"#include "include/if.h"#include "include/csv.h"Go to the source code of this file.
Functions | |
| int | dftRead (char *filename, DFT *data) |
| int | dftFormat (char *fname) |
| int | dftType (FILE *fp) |
| void | dftPrint (DFT *data) |
| int | dftWrite (DFT *data, char *filename) |
| int | dftWriteHTML (DFT *dft, char *fname, int orientation) |
| int | dftWriteXHTML11_doctype (FILE *fp) |
| int | dftWriteXHTML11_head (FILE *fp, char *author_name) |
| int | dft_fill_hdr_from_IFT (DFT *dft, IFT *ift) |
| int | dftGetPmodTitle (DFT *dft, char *title_line) |
Variables | |
| int | DFT_NR_OF_DECIMALS = 3 |
| int dft_fill_hdr_from_IFT | ( | DFT * | dft, |
| IFT * | ift | ||
| ) |
Read certain keys from IFT and set DFT fields accordingly.
| dft | Pointer to allocated DFT struct where information will be written |
| ift | Pointer to IFT struct from where information is retrieved |
Definition at line 1093 of file dftio.c.
References DFT::decayCorrected, DFT_DECAY_CORRECTED, DFT_DECAY_NOTCORRECTED, Voi::hemisphere, DFT::injectionTime, DFT::isotope, Voi::name, Voi::place, DFT::radiopharmaceutical, DFT::scanStartTime, Voi::size, DFT::studynr, DFT::timeunit, DFT::unit, DFT::voi, and Voi::voiname.
Referenced by dftRead().
| int dftFormat | ( | char * | fname | ) |
Determine the type of DFT file. This will replace dftType(). Note that only some of formats are currently identified, and identification does not mean that dftRead() supports the format.
| fname | Pointer to filename; this string is not modified. |
Definition at line 426 of file dftio.c.
References DFT_FORMAT_CSV_UK, DFT_FORMAT_FIT, DFT_FORMAT_IDWC, DFT_FORMAT_IF, DFT_FORMAT_NCI, DFT_FORMAT_PLAIN, DFT_FORMAT_PMOD, DFT_FORMAT_STANDARD, and DFT_FORMAT_UNKNOWN.
Referenced by dftRead().
| int dftGetPmodTitle | ( | DFT * | dft, |
| char * | title_line | ||
| ) |
Read single title line from PMOD files and set DFT fields accordingly.
| dft | Pointer to allocated DFT struct where information will be written |
| title_line | Pointer to string containing the title line; string is not modified |
Definition at line 1229 of file dftio.c.
References DFT_TIME_MIDDLE, DFT_TIME_STARTEND, Voi::hemisphere, Voi::name, Voi::place, DFT::timetype, DFT::timeunit, DFT::unit, DFT::voi, and Voi::voiname.
Referenced by dftRead().
Prints to stdout the contents of DFT data structure. Mainly for testing purposes.
Definition at line 508 of file dftio.c.
References DFT::_dataSize, DFT::comments, DFT::decayCorrected, DFT_DECAY_CORRECTED, DFT_DECAY_NOTCORRECTED, DFT::frameNr, Voi::hemisphere, DFT::injectionTime, DFT::isotope, DFT::isweight, Voi::name, Voi::place, DFT::radiopharmaceutical, DFT::scanStartTime, Voi::size, DFT::studynr, DFT::timetype, DFT::timeunit, DFT::unit, DFT::voi, Voi::voiname, DFT::voiNr, DFT::w, DFT::x, DFT::x1, DFT::x2, Voi::y, Voi::y2, and Voi::y3.
Read TAC file contents into specified DFT data structure. Reads standard DFT files, plain DFT files, and some other formats.
| filename | Name of file to be read |
| data | Pointer to initiated DFT struct where data will be written; any old content is deleted. |
Definition at line 108 of file dftio.c.
References _DFT_COMMENT_LEN, DFT::_type, DFT::comments, csv2dft(), csvEmpty(), csvInit(), csvRead(), dft_fill_hdr_from_IFT(), DFT_FORMAT_CSV_INT, DFT_FORMAT_CSV_UK, DFT_FORMAT_FIT, DFT_FORMAT_IDWC, DFT_FORMAT_IF, DFT_FORMAT_IFT, DFT_FORMAT_NCI, DFT_FORMAT_PLAIN, DFT_FORMAT_PMOD, DFT_FORMAT_STANDARD, DFT_FORMAT_UNKNOWN, DFT_NR_OF_DECIMALS, DFT_TIME_END, DFT_TIME_MIDDLE, DFT_TIME_START, DFT_TIME_STARTEND, dftCopyvoi(), dftEmpty(), dfterrmsg, dftFormat(), dftFrametimes(), dftGetPmodTitle(), dftSetmem(), DFT::frameNr, Voi::hemisphere, idwcRead(), ifRead(), DFT::isweight, Voi::name, Voi::place, roikbqRead(), Voi::size, DFT::studynr, DFT::timetype, DFT::timeunit, DFT::unit, DFT::voi, Voi::voiname, DFT::voiNr, DFT::w, DFT::x, DFT::x1, DFT::x2, and Voi::y.
| int dftType | ( | FILE * | fp | ) |
Write DFT data, usualyy containing regional time-activity curves (TACs) into specified file. The file format specified in data is applied. Number of decimals can be determined by changing global variable DFT_NR_OF_DECIMALS.
| data | Pointer to DFT struct which contents are to be written |
| filename | Filename where DFT contents are written. If file exists, original file is renamed to a backup file |
Definition at line 563 of file dftio.c.
References DFT::_type, DFT::comments, DFT_FORMAT_HTML, DFT_FORMAT_PLAIN, DFT_FORMAT_PMOD, DFT_FORMAT_STANDARD, DFT_NR_OF_DECIMALS, DFT_TIME_END, DFT_TIME_MIDDLE, DFT_TIME_START, DFT_TIME_STARTEND, DFT_VER, dfterrmsg, dftWriteHTML(), DFT::frameNr, Voi::hemisphere, DFT::isweight, Voi::name, Voi::place, Voi::size, DFT::studynr, DFT::timetype, DFT::timeunit, DFT::unit, DFT::voi, Voi::voiname, DFT::voiNr, DFT::w, DFT::x, DFT::x1, DFT::x2, and Voi::y.
| int dftWriteHTML | ( | DFT * | dft, |
| char * | fname, | ||
| int | orientation | ||
| ) |
Write DFT contents in HTML table format If file exists, a backup file (+BACKUP_EXTENSION) is written also. If "stdout" is given as filename, output is directed to stdout In case of an error, description is written in dfterrmsg.
| dft | Input DFT |
| fname | HTML filename |
| orientation | Table orientation: 1=original, 2=transposed |
Definition at line 900 of file dftio.c.
References DFT::_type, BACKUP_EXTENSION, DFT_FORMAT_PLAIN, dfterrmsg, dftWriteXHTML11_doctype(), dftWriteXHTML11_head(), DFT::frameNr, Voi::hemisphere, Voi::place, Voi::size, DFT::studynr, DFT::timeunit, DFT::unit, DFT::voi, Voi::voiname, DFT::voiNr, DFT::x, and Voi::y.
Referenced by dftWrite().
| int dftWriteXHTML11_doctype | ( | FILE * | fp | ) |
Write XHTML 1.1 doctype into an opened file pointer.
Definition at line 1032 of file dftio.c.
Referenced by dftWriteHTML().
| int dftWriteXHTML11_head | ( | FILE * | fp, |
| char * | author_name | ||
| ) |
Write XHTML 1.1 head for DFT file into an opened file pointer.
| fp | File pointer where to write |
| author_name | Author name, for example software name |
Definition at line 1049 of file dftio.c.
Referenced by dftWriteHTML().
| int DFT_NR_OF_DECIMALS = 3 |
Definition at line 90 of file dftio.c.
Referenced by dftRead(), and dftWrite().
1.8.0