STIR  6.2.0
centre_of_gravity.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2003- 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/common.h"
21 
22 START_NAMESPACE_STIR
23 // predeclerations to avoid having to include the files and create unnecessary
24 // dependencies
25 template <int num_dimensions, class T>
26 class BasicCoordinate;
27 template <int num_dimensions, class T>
28 class Array;
29 template <class elemT>
30 class VectorWithOffset;
31 template <class coordT>
32 class CartesianCoordinate3D;
33 template <class elemT>
34 class VoxelsOnCartesianGrid;
35 
37 
43 template <class T>
44 T find_unweighted_centre_of_gravity_1d(const VectorWithOffset<T>& row);
45 
47 
53 template <int num_dimensions, class T>
54 BasicCoordinate<num_dimensions, T> find_unweighted_centre_of_gravity(const Array<num_dimensions, T>&);
55 
57 
61 template <class T>
62 T find_unweighted_centre_of_gravity(const Array<1, T>&);
63 
65 
72 template <int num_dimensions, class T>
73 BasicCoordinate<num_dimensions, T> find_centre_of_gravity(const Array<num_dimensions, T>&);
74 
76 
87 template <class T>
88 void find_centre_of_gravity_in_mm_per_plane(VectorWithOffset<CartesianCoordinate3D<float>>& allCoG,
89  VectorWithOffset<T>& weights,
90  const VoxelsOnCartesianGrid<T>& image);
91 
93 
96 template <class T>
97 CartesianCoordinate3D<float> find_centre_of_gravity_in_mm(const VoxelsOnCartesianGrid<T>& image);
98 
99 END_NAMESPACE_STIR
CartesianCoordinate3D< float > find_centre_of_gravity_in_mm(const VoxelsOnCartesianGrid< T > &image)
Computes centre of gravity of an image.
Definition: centre_of_gravity.cxx:123
BasicCoordinate< num_dimensions, T > find_centre_of_gravity(const Array< num_dimensions, T > &array)
Compute centre of gravity of an Array.
Definition: centre_of_gravity.cxx:86
T find_unweighted_centre_of_gravity(const Array< 1, T > &row)
Compute centre of gravity of a 1D Array but without dividing by its sum.
Definition: centre_of_gravity.cxx:45
basic configuration include file
T find_unweighted_centre_of_gravity_1d(const VectorWithOffset< T > &row)
Compute centre of gravity of a vector but without dividing by its sum.
Definition: centre_of_gravity.cxx:34
void find_centre_of_gravity_in_mm_per_plane(VectorWithOffset< CartesianCoordinate3D< float >> &allCoG, VectorWithOffset< T > &weights, const VoxelsOnCartesianGrid< T > &image)
Computes centre of gravity for each plane.
Definition: centre_of_gravity.cxx:97