STIR 6.4.0
convert_array.h
Go to the documentation of this file.
1//
2//
3/*
4 Copyright (C) 2000 PARAPET partners
5 Copyright (C) 2000- 2007, Hammersmith Imanet Ltd
6 This file is part of STIR.
7
8 SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
9
10 See STIR/LICENSE.txt for details
11*/
12#ifndef __stir_convert_array_H__
13#define __stir_convert_array_H__
14
27
28#include "stir/ArrayFwd.h"
29
30START_NAMESPACE_STIR
31
32template <class T>
33class NumericInfo;
34
64template <int num_dimensions, class T1, class T2, class scaleT>
65inline void
66find_scale_factor(scaleT& scale_factor, const Array<num_dimensions, T1>& data_in, const NumericInfo<T2> info_for_out_type);
67
100template <int num_dimensions, class T1, class T2, class scaleT>
101inline Array<num_dimensions, T2>
102convert_array(scaleT& scale_factor, const Array<num_dimensions, T1>& data_in, const NumericInfo<T2> info2);
115
116template <int num_dimensions, class T1, class T2, class scaleT>
117inline void convert_array(Array<num_dimensions, T2>& data_out, scaleT& scale_factor, const Array<num_dimensions, T1>& data_in);
118
119END_NAMESPACE_STIR
120
121#include "stir/convert_array.inl"
122
123#endif
forward declaration of stir::Array class for multi-dimensional (numeric) arrays
implementation of stir::convert_array
void find_scale_factor(scaleT &scale_factor, const Array< num_dimensions, T1 > &data_in, const NumericInfo< T2 > info_for_out_type)
A function that finds a scale factor to use when converting data to a new type.
Definition convert_array.inl:28
Array< num_dimensions, T2 > convert_array(scaleT &scale_factor, const Array< num_dimensions, T1 > &data_in, const NumericInfo< T2 > info2)
A function that returns a new Array (of the same dimension) with elements of type T2.
Definition convert_array.inl:35