3 #ifndef __stir_Interfile_h__ 4 #define __stir_Interfile_h__ 39 template <
int num_dimensions>
41 template <
int num_dimensions,
typename elemT>
43 template <
int num_dimensions,
typename elemT>
44 class DiscretisedDensity;
45 template <
typename elemT>
46 class VectorWithOffset;
47 template <
typename elemT>
48 class CartesianCoordinate3D;
49 template <
typename elemT>
51 template <
typename elemT>
52 class VoxelsOnCartesianGrid;
53 class ProjDataFromStream;
54 class DynamicDiscretisedDensity;
55 template <
typename elemT>
56 class ParametricDiscretisedDensity;
57 template <
typename elemT>
58 class VoxelsOnCartesianGrid;
59 template <
int num_dimensions,
typename elemT>
60 class KineticParameters;
92 VoxelsOnCartesianGrid<float>*
read_interfile_image(std::istream& input,
const std::string& directory_for_data =
"");
113 ParametricDiscretisedDensity<VoxelsOnCartesianGrid<KineticParameters<2, float>>>*
117 ParametricDiscretisedDensity<VoxelsOnCartesianGrid<KineticParameters<2, float>>>*
140 const std::string& image_file_name,
141 const ExamInfo& exam_info,
142 const IndexRange<3>& index_range,
143 const CartesianCoordinate3D<float>& voxel_size,
144 const CartesianCoordinate3D<float>& origin,
145 const NumericType output_type,
146 const ByteOrder byte_order,
147 const VectorWithOffset<float>& scaling_factors,
148 const VectorWithOffset<unsigned long>& file_offsets,
149 const std::vector<std::string>& data_type_descriptions = std::vector<std::string>());
156 const NumericType output_type,
157 const Coordinate3D<int>& dim,
158 unsigned long initial_offset = 0);
167 template <
class elemT>
169 const Array<3, elemT>& image,
170 const CartesianCoordinate3D<float>& voxel_size,
171 const CartesianCoordinate3D<float>& origin,
172 const NumericType output_type = NumericType::FLOAT,
173 const float scale = 0,
174 const ByteOrder byte_order = ByteOrder::native);
183 template <
class elemT>
185 const ExamInfo& exam_info,
186 const Array<3, elemT>& image,
187 const CartesianCoordinate3D<float>& voxel_size,
188 const CartesianCoordinate3D<float>& origin,
189 const NumericType output_type = NumericType::FLOAT,
190 const float scale = 0,
191 const ByteOrder byte_order = ByteOrder::native);
204 template <
class elemT>
206 const Array<3, elemT>& image,
207 const NumericType output_type = NumericType::FLOAT,
208 const float scale = 0,
209 const ByteOrder byte_order = ByteOrder::native);
218 const VoxelsOnCartesianGrid<float>& image,
219 const NumericType output_type = NumericType::FLOAT,
220 const float scale = 0,
221 const ByteOrder byte_order = ByteOrder::native);
233 const DiscretisedDensity<3, float>& image,
234 const NumericType output_type = NumericType::FLOAT,
235 const float scale = 0,
236 const ByteOrder byte_order = ByteOrder::native);
239 const ParametricDiscretisedDensity<VoxelsOnCartesianGrid<KineticParameters<2, float>>>& image,
240 const NumericType output_type = NumericType::FLOAT,
241 const float scale = 0,
242 const ByteOrder byte_order = ByteOrder::native);
245 const DynamicDiscretisedDensity& image,
246 const NumericType output_type = NumericType::FLOAT,
247 const float scale = 0,
248 const ByteOrder byte_order = ByteOrder::native);
266 const std::string& directory_for_data =
"",
267 const std::ios::openmode openmode = std::ios::in);
279 ProjDataFromStream*
read_interfile_PDFS(
const std::string& filename,
const std::ios::openmode open_mode);
288 const std::string& data_filename,
289 const ProjDataFromStream& pdfs);
302 #endif // __Interfile_h__ This file declares the stir::ByteOrder class.
bool is_interfile_signature(const char *const signature)
Checks if the signature corresponds to the start of an interfile header.
Definition: interfile.cxx:75
Declaration of class stir::Succeeded.
ParametricDiscretisedDensity< VoxelsOnCartesianGrid< KineticParameters< 2, float > > > * read_interfile_parametric_image(const std::string &filename)
Read parametric image.
Definition: interfile.cxx:311
Succeeded write_basic_interfile(const std::string &filename, const Array< 3, elemT > &image, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native)
This outputs an Interfile header and data for a Array<3,elemT> object.
VoxelsOnCartesianGrid< float > * read_interfile_image(const std::string &filename)
This reads the first 3d image in an Interfile header file, given as a filename.
Definition: interfile.cxx:281
DynamicDiscretisedDensity * read_interfile_dynamic_image(const std::string &filename)
Read dynamic image.
Definition: interfile.cxx:296
const VectorWithOffset< unsigned long > compute_file_offsets(int number_of_time_frames, const NumericType output_type, const Coordinate3D< int > &dim, unsigned long initial_offset=0)
a utility function that computes the file offsets of subsequent images
Succeeded write_basic_interfile_PDFS_header(const std::string &data_filename, const ProjDataFromStream &pdfs)
This function writes an Interfile header for the pdfs object.
Definition: interfile.cxx:1446
ProjDataFromStream * read_interfile_PDFS(const std::string &filename, const std::ios::openmode open_mode)
This reads the first 3D sinogram from an Interfile header, given as a filename.
Succeeded write_basic_interfile_image_header(const std::string &header_file_name, const std::string &image_file_name, const ExamInfo &exam_info, const IndexRange< 3 > &index_range, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type, const ByteOrder byte_order, const VectorWithOffset< float > &scaling_factors, const VectorWithOffset< unsigned long > &file_offsets, const std::vector< std::string > &data_type_descriptions=std::vector< std::string >())
This outputs an Interfile header for an image.
Definition: interfile.cxx:512
This file declares the stir::NumericType class.