3 #ifndef __stir_Interfile_h__ 4 #define __stir_Interfile_h__ 40 template <
int num_dimensions>
42 template <
int num_dimensions,
typename elemT>
43 class DiscretisedDensity;
44 template <
typename elemT>
45 class VectorWithOffset;
46 template <
typename elemT>
47 class CartesianCoordinate3D;
48 template <
typename elemT>
50 template <
typename elemT>
51 class VoxelsOnCartesianGrid;
52 class ProjDataFromStream;
53 class DynamicDiscretisedDensity;
54 template <
typename elemT>
55 class ParametricDiscretisedDensity;
56 template <
typename elemT>
57 class VoxelsOnCartesianGrid;
58 template <
int num_dimensions,
typename elemT>
59 class KineticParameters;
91 VoxelsOnCartesianGrid<float>*
read_interfile_image(std::istream& input,
const std::string& directory_for_data =
"");
112 ParametricDiscretisedDensity<VoxelsOnCartesianGrid<KineticParameters<2, float>>>*
116 ParametricDiscretisedDensity<VoxelsOnCartesianGrid<KineticParameters<2, float>>>*
139 const std::string& image_file_name,
140 const ExamInfo& exam_info,
141 const IndexRange<3>& index_range,
142 const CartesianCoordinate3D<float>& voxel_size,
143 const CartesianCoordinate3D<float>& origin,
144 const NumericType output_type,
145 const ByteOrder byte_order,
146 const VectorWithOffset<float>& scaling_factors,
147 const VectorWithOffset<unsigned long>& file_offsets,
148 const std::vector<std::string>& data_type_descriptions = std::vector<std::string>());
155 const NumericType output_type,
156 const Coordinate3D<int>& dim,
157 unsigned long initial_offset = 0);
166 template <
class elemT>
168 const ArrayType<3, elemT>& image,
169 const CartesianCoordinate3D<float>& voxel_size,
170 const CartesianCoordinate3D<float>& origin,
171 const NumericType output_type = NumericType::FLOAT,
172 const float scale = 0,
173 const ByteOrder byte_order = ByteOrder::native);
182 template <
class elemT>
184 const ExamInfo& exam_info,
185 const ArrayType<3, elemT>& image,
186 const CartesianCoordinate3D<float>& voxel_size,
187 const CartesianCoordinate3D<float>& origin,
188 const NumericType output_type = NumericType::FLOAT,
189 const float scale = 0,
190 const ByteOrder byte_order = ByteOrder::native);
203 template <
class elemT>
205 const ArrayType<3, elemT>& image,
206 const NumericType output_type = NumericType::FLOAT,
207 const float scale = 0,
208 const ByteOrder byte_order = ByteOrder::native);
217 const VoxelsOnCartesianGrid<float>& image,
218 const NumericType output_type = NumericType::FLOAT,
219 const float scale = 0,
220 const ByteOrder byte_order = ByteOrder::native);
232 const DiscretisedDensity<3, float>& image,
233 const NumericType output_type = NumericType::FLOAT,
234 const float scale = 0,
235 const ByteOrder byte_order = ByteOrder::native);
238 const ParametricDiscretisedDensity<VoxelsOnCartesianGrid<KineticParameters<2, float>>>& image,
239 const NumericType output_type = NumericType::FLOAT,
240 const float scale = 0,
241 const ByteOrder byte_order = ByteOrder::native);
244 const DynamicDiscretisedDensity& image,
245 const NumericType output_type = NumericType::FLOAT,
246 const float scale = 0,
247 const ByteOrder byte_order = ByteOrder::native);
265 const std::string& directory_for_data =
"",
266 const std::ios::openmode openmode = std::ios::in);
278 ProjDataFromStream*
read_interfile_PDFS(
const std::string& filename,
const std::ios::openmode open_mode);
287 const std::string& data_filename,
288 const ProjDataFromStream& pdfs);
301 #endif // __Interfile_h__ This file declares the stir::ByteOrder class.
forward declaration of stir::Array class for multi-dimensional (numeric) arrays
bool is_interfile_signature(const char *const signature)
Checks if the signature corresponds to the start of an interfile header.
Definition: interfile.cxx:77
Declaration of class stir::Succeeded.
ParametricDiscretisedDensity< VoxelsOnCartesianGrid< KineticParameters< 2, float > > > * read_interfile_parametric_image(const std::string &filename)
Read parametric image.
Definition: interfile.cxx:319
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:287
DynamicDiscretisedDensity * read_interfile_dynamic_image(const std::string &filename)
Read dynamic image.
Definition: interfile.cxx:302
Succeeded write_basic_interfile(const std::string &filename, const ArrayType< 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 ArrayType<3,elemT> object.
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:1417
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:522
This file declares the stir::NumericType class.