STIR  6.2.0
write_data.h
Go to the documentation of this file.
1 #ifndef __stir_IO_write_data_H__
2 #define __stir_IO_write_data_H__
3 /*
4  Copyright (C) 2004- 2007, Hammersmith Imanet Ltd
5  This file is part of STIR.
6 
7  SPDX-License-Identifier: Apache-2.0
8 
9  See STIR/LICENSE.txt for details
10 */
20 #include "stir/ByteOrder.h"
21 START_NAMESPACE_STIR
22 
23 class Succeeded;
24 class NumericType;
25 template <class T>
26 class NumericInfo;
27 template <int num_dimensions, class elemT>
28 class Array;
29 
51 template <int num_dimensions, class OStreamT, class elemT>
52 inline Succeeded write_data(OStreamT& s,
53  const Array<num_dimensions, elemT>& data,
54  const ByteOrder byte_order = ByteOrder::native,
55  const bool can_corrupt_data = false);
72 template <int num_dimensions, class OStreamT, class elemT, class OutputType, class ScaleT>
73 inline Succeeded write_data(OStreamT& s,
74  const Array<num_dimensions, elemT>& data,
75  NumericInfo<OutputType> output_type,
76  ScaleT& scale_factor,
77  const ByteOrder byte_order = ByteOrder::native,
78  const bool can_corrupt_data = false);
79 
97 template <int num_dimensions, class OStreamT, class elemT, class OutputType, class ScaleT>
98 inline Succeeded write_data_with_fixed_scale_factor(OStreamT& s,
99  const Array<num_dimensions, elemT>& data,
100  NumericInfo<OutputType> output_type,
101  const ScaleT scale_factor,
102  const ByteOrder byte_order = ByteOrder::native,
103  const bool can_corrupt_data = false);
104 
121 template <int num_dimensions, class OStreamT, class elemT, class ScaleT>
122 inline Succeeded write_data(OStreamT& s,
123  const Array<num_dimensions, elemT>& data,
124  NumericType type,
125  ScaleT& scale,
126  const ByteOrder byte_order = ByteOrder::native,
127  const bool can_corrupt_data = false);
128 
129 END_NAMESPACE_STIR
130 
131 #include "stir/IO/write_data.inl"
132 
133 #endif
This file declares the stir::ByteOrder class.
Succeeded write_data(OStreamT &s, const Array< num_dimensions, elemT > &data, NumericType type, ScaleT &scale, const ByteOrder byte_order=ByteOrder::native, const bool can_corrupt_data=false)
Write the data of an Array to file as a different type.
Definition: write_data.inl:115
Succeeded write_data_with_fixed_scale_factor(OStreamT &s, const Array< num_dimensions, elemT > &data, NumericInfo< OutputType > output_type, const ScaleT scale_factor, const ByteOrder byte_order=ByteOrder::native, const bool can_corrupt_data=false)
Write the data of an Array to file as a different type but using a given scale factor.
Definition: write_data.inl:82
Implementation of stir::write_data() functions for writing stir::Array&#39;s to file. ...