STIR 6.4.0
stir_ecat6.h
Go to the documentation of this file.
1//
2//
14/*
15 Copyright (C) 2000 PARAPET partners
16 Copyright (C) 2000- 2011, Hammersmith Imanet Ltd
17 This file is part of STIR.
18
19 SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
20
21 See STIR/LICENSE.txt for details
22*/
23
24#ifndef __stir_IO_stir_ecat6_H__
25#define __stir_IO_stir_ecat6_H__
26
28#include "stir/IO/ecat6_types.h"
29#include <string>
30#include <stdio.h>
31#include "stir/shared_ptr.h"
32
33START_NAMESPACE_STIR
34
35class Succeeded;
36class NumericType;
37class ByteOrder;
38class Scanner;
39class ExamInfo;
40template <int num_dimensions, typename elemT>
41class DiscretisedDensity;
42template <typename elemT>
43class VoxelsOnCartesianGrid;
44template <typename elemT>
45class Sinogram;
46class ProjData;
47class ProjDataInfo;
48
49START_NAMESPACE_ECAT
50START_NAMESPACE_ECAT6
51
64bool is_ECAT6_file(const std::string& filename);
69bool is_ECAT6_image_file(const std::string& filename);
75bool is_ECAT6_emission_file(const std::string& filename);
81bool is_ECAT6_attenuation_file(const std::string& filename);
82
83/*
84 \brief Convert image data
85 \ingroup ECAT
86 \param cti_fptr a FILE pointer to the ECAT6 file.
87 \param mhead the ECAT6 main header. Note that this parameter will be used
88 to get system and size info, not the main header in the file.
89*/
90VoxelsOnCartesianGrid<float>* ECAT6_to_VoxelsOnCartesianGrid(const int frame_num,
91 const int gate_num,
92 const int data_num,
93 const int bed_num,
94 FILE* cti_fptr,
95 const ECAT6_Main_header& mhead);
96/*
97 \brief Convert sinogram data
98 \ingroup ECAT
99 \param max_ring_diff if less than 0, the maximum is used (i.e. num_rings-1)
100 \param arccorrected tells the function if the data is (assumed to be) arc-corrected. Note
101 that the ECAT6 file format does not have any flag to indicate this.
102 \param output_file_name filename for output. A .s extension will be added (for the
103 binary file) if no extension is present.
104 \param cti_fptr a FILE pointer to the ECAT6 file.
105 \param mhead the ECAT6 main header. Note that this parameter will be used
106 to get system and size info, not the main header in the file.
107 \warning multiplies the data with the loss_correction_factor in the subheader.
108*/
109void ECAT6_to_PDFS(const int frame_num,
110 const int gate_num,
111 const int data_num,
112 const int bed_num,
113 int max_ring_diff,
114 bool arccorrected,
115 const std::string& output_file_name,
116 FILE* cti_fptr,
117 const ECAT6_Main_header& mhead);
118
120
123Scanner* find_scanner_from_ECAT6_Main_header(const ECAT6_Main_header& mhead);
124
126
127Succeeded DiscretisedDensity_to_ECAT6(DiscretisedDensity<3, float> const& density,
128 std::string const& cti_name,
129 std::string const& orig_name,
130 const Scanner& scanner,
131 const int frame_num = 1,
132 const int gate_num = 1,
133 const int data_num = 0,
134 const int bed_num = 0);
135
137
142Succeeded DiscretisedDensity_to_ECAT6(FILE* fptr,
143 DiscretisedDensity<3, float> const& density,
144 const ECAT6_Main_header& mhead,
145 const int frame_num = 1,
146 const int gate_num = 1,
147 const int data_num = 0,
148 const int bed_num = 0);
149
151
157Succeeded ProjData_to_ECAT6(ProjData const& proj_data,
158 std::string const& cti_name,
159 std::string const& orig_name,
160 const int frame_num = 1,
161 const int gate_num = 1,
162 const int data_num = 0,
163 const int bed_num = 0,
164 const bool write_2D_sinograms = false);
165
167
175Succeeded ProjData_to_ECAT6(FILE* fptr,
176 ProjData const& proj_data,
177 const ECAT6_Main_header& mhead,
178 const int frame_num = 1,
179 const int gate_num = 1,
180 const int data_num = 0,
181 const int bed_num = 0,
182 const bool write_2D_sinograms = false);
183
185
188void make_ECAT6_Main_header(ECAT6_Main_header&, const Scanner&, const std::string& orig_name, ExamInfo const& exam_info);
189
191
194void make_ECAT6_Main_header(ECAT6_Main_header& mhead,
195 Scanner const& scanner,
196 const std::string& orig_name,
197 DiscretisedDensity<3, float> const& density);
198
200
204void make_ECAT6_Main_header(ECAT6_Main_header& mhead, const std::string& orig_name, ProjDataInfo const& proj_data_info);
205END_NAMESPACE_ECAT
206END_NAMESPACE_ECAT6
207END_NAMESPACE_STIR
208#endif
ECAT 6 CTI matrix parameters.
Scanner * find_scanner_from_ECAT6_Main_header(const ECAT6_Main_header &mhead)
determine scanner type from the ECAT6_Main_header
Definition stir_ecat6.cxx:161
Succeeded DiscretisedDensity_to_ECAT6(DiscretisedDensity< 3, float > const &density, std::string const &cti_name, std::string const &orig_name, const Scanner &scanner, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0)
Create a new ECAT6 image file and write the data in there.
Definition stir_ecat6.cxx:772
bool is_ECAT6_emission_file(const std::string &filename)
checks if the file is in ECAT6 format and if the file contains emission sinograms (or blank/transmisi...
Definition stir_ecat6.cxx:147
bool is_ECAT6_file(const std::string &filename)
checks if the file is in ECAT6 format
Definition stir_ecat6.cxx:133
bool is_ECAT6_attenuation_file(const std::string &filename)
checks if the file is in ECAT6 format and if the file contains attenuation correction factors
Definition stir_ecat6.cxx:154
Succeeded ProjData_to_ECAT6(ProjData const &proj_data, std::string const &cti_name, std::string const &orig_name, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0, const bool write_2D_sinograms=false)
Create a new ECAT6 sinogram file and write the data in there.
Definition stir_ecat6.cxx:979
void make_ECAT6_Main_header(ECAT6_Main_header &, const Scanner &, const std::string &orig_name, ExamInfo const &exam_info)
Fill in most of the main header given a Scanner object and orig_name.
Definition stir_ecat6.cxx:171
bool is_ECAT6_image_file(const std::string &filename)
checks if the file is in ECAT6 format and if the file contains images
Definition stir_ecat6.cxx:140
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...
Declaration of routines which convert ECAT things into our building blocks and vice versa.