STIR  6.2.0
Functions
convecat6_if.cxx File Reference

Conversion from ECAT 6 cti to interfile (image and sinogram data) More...

#include "stir/utilities.h"
#include "stir/IO/InterfileOutputFileFormat.h"
#include "stir/shared_ptr.h"
#include "stir/VoxelsOnCartesianGrid.h"
#include "stir/IO/stir_ecat6.h"
#include "stir/IO/ecat6_utils.h"
#include "stir/Scanner.h"
#include "stir/Succeeded.h"
#include "stir/error.h"
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>

Functions

int main (int argc, char *argv[])
 

Detailed Description

Conversion from ECAT 6 cti to interfile (image and sinogram data)

Author
Kris Thielemans
Damien Sauge
Sanida Mustafovic
PARAPET project
Usage:
convecat6_if [output_file_name_without_extension cti_data_file_name [scanner_name]]
The optional scanner_name can be used to force to a particular scanner (ignoring the system_type in the main header). scanner_name has to be recognised by the Scanner class. Examples are : ECAT 953, RPT, ECAT HR+, Advance etc. If the scanner_name contains a space, the scanner name has to be surrounded by double quotes (") when used as a command line argument.
The program asks if all frames should be written or not. If so, all sinograms/images are converted for a fixed 'data' number. For each data set, a suffix is added to the output_filename of the form "_f#g#b#d#" where the # are replaced by the corresponding number of the frame, gate, bed, data.
Warning
CTI ECAT files seem to have a peculiarity that frames and gates are numbered from 1, while bed positions are numbered from 0. Similarly, the number of bed positions in the main header seems to be 1 less than the actual number present. This is at least the case for single bed studies. If this is not true for multi-bed studies, the code would have to be adapted.
Most of the data in the ECAT 6 headers is ignored (except dimensions)
Data are multiplied with the subheader.scale_factor, In addition, for emission sinograms, the data are multiplied with subheader.loss_correction_fctr (unless the loss correction factor is < 0, in which case it is assumed to be 1).
Currently, the decay correction factor is ignored.
Todo:
This could easily be used to convert to other file formats. For images, this simply involves changing the OutputFileFormat. For projection data, we would have to extend OutputFileFormat to handle projection data.