STIR
6.2.0
|
Modules | |
Implementation details for functions that implement IO for Array objects | |
Files | |
file | read_data.h |
declarations of stir::read_data() functions for reading Arrays from file | |
file | read_data.inl |
Implementation of stir::read_data() functions for reading stir::Array's from file. | |
file | write_data.h |
declarations of stir::write_data() functions for writing Arrays to file | |
file | write_data.inl |
Implementation of stir::write_data() functions for writing stir::Array's to file. | |
Functions | |
template<int num_dimensions, class IStreamT , class elemT > | |
Succeeded | stir::read_data (IStreamT &s, Array< num_dimensions, elemT > &data, const ByteOrder byte_order=ByteOrder::native) |
Read the data of an Array from file. More... | |
template<int num_dimensions, class IStreamT , class elemT , class InputType , class ScaleT > | |
Succeeded | stir::read_data (IStreamT &s, Array< num_dimensions, elemT > &data, NumericInfo< InputType > input_type, ScaleT &scale_factor, const ByteOrder byte_order=ByteOrder::native) |
Read the data of an Array from file as a different type. More... | |
template<int num_dimensions, class IStreamT , class elemT , class ScaleT > | |
Succeeded | stir::read_data (IStreamT &s, Array< num_dimensions, elemT > &data, NumericType type, ScaleT &scale, const ByteOrder byte_order=ByteOrder::native) |
Read the data of an Array from file as a different type. More... | |
template<int num_dimensions, class OStreamT , class elemT > | |
Succeeded | stir::write_data (OStreamT &s, const Array< num_dimensions, elemT > &data, const ByteOrder byte_order=ByteOrder::native, const bool can_corrupt_data=false) |
Write the data of an Array to file. More... | |
template<int num_dimensions, class OStreamT , class elemT , class OutputType , class ScaleT > | |
Succeeded | stir::write_data (OStreamT &s, const Array< num_dimensions, elemT > &data, NumericInfo< OutputType > output_type, 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. More... | |
template<int num_dimensions, class OStreamT , class elemT , class OutputType , class ScaleT > | |
Succeeded | stir::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. More... | |
template<int num_dimensions, class OStreamT , class elemT , class ScaleT > | |
Succeeded | stir::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. More... | |
|
inline |
Read the data of an Array from file.
Only the data will be written, not the dimensions, start indices, nor byte-order. Hence, this should only used for low-level IO.
IStreamT is supposed to be stream or file type (see implementations for read_data_1d()).
Referenced by stir::ProjDataFromStream::get_bin_value(), stir::ProjDataFromStream::get_segment_by_sinogram(), stir::ProjDataFromStream::get_segment_by_view(), stir::ProjDataFromStream::get_sinogram(), stir::ProjDataFromStream::get_viewgram(), stir::VoxelsOnCartesianGrid< elemT >::grow_z_range(), stir::read_data(), stir::ProjMatrixByBinFromFile::set_up(), and stir::ecat::BinNormalisationFromECAT8::set_up().
|
inline |
Read the data of an Array from file as a different type.
This function essentially first calls convert_data() to construct an array with elements of type InputType, and then calls read_data(IStreamT&, const Array<num_dimensions,elemT>&, const ByteOrder, const bool).
References stir::convert_array(), and stir::read_data().
|
inline |
Read the data of an Array from file as a different type.
References stir::NumericType::id.
|
inline |
Write the data of an Array to file.
Only the data will be written, not the dimensions, start indices, nor byte-order. Hence, this should only used for low-level IO.
OStreamT is supposed to be stream or file type (see implementations for detail::write_data_1d()).
If can_corrupt_data = true
, the data in the array can be byte-swapped after writing, and hence should no longer be used. This is useful for saving (a little bit of) time.
num_dimensions
, but explicitly defined for a few dimensions (see the source). References stir::write_data_with_fixed_scale_factor().
Referenced by stir::ProjDataFromStream::set_bin_value(), stir::ProjDataFromStream::set_segment(), stir::ProjDataFromStream::set_sinogram(), stir::ColsherFilter::set_up(), and stir::write_data().
|
inline |
Write the data of an Array to file as a different type.
This function essentially first calls convert_data() to construct an array with elements of type OutputType, and then calls write_data(OstreamT&, const Array<num_dimensions,elemT>&, const ByteOrder, const bool).
num_dimensions
, but explicitly defined for a few dimensions (see the source). References stir::find_scale_factor(), and stir::write_data_with_fixed_scale_factor().
|
inline |
Write the data of an Array to file as a different type but using a given scale factor.
If scale_factor is such that the data/scale_factor
does not fit in the range for OutputType, the writing will fail. However, data might have been partially written to file anyway.
num_dimensions
, but explicitly defined for a few dimensions (see the source). Referenced by stir::write_data().
|
inline |
Write the data of an Array to file as a different type.
num_dimensions
, but explicitly defined for a few dimensions (see the source). References stir::NumericType::id, and stir::write_data().