40 template <
class elemT>
48 elemT max_value = v[index_at_max];
51 const elemT value = v[index];
52 if (value > max_value)
68 template <
class elemT>
72 const elemT current_maximum = input_array.
find_max();
78 for (
int k = min_index[1]; k <= max_index[1] && !found; ++k)
82 for (
int j = min_index[2]; j <= max_index[2] && !found; ++j)
86 for (
int i = min_index[3]; i <= max_index[3] && !found; ++i)
88 if (input_array[k][j][i] == current_maximum)
elemT find_max() const
return maximum of all the elements
Definition: Array.inl:364
int get_min_index() const
get value of first valid index
Definition: VectorWithOffset.inl:116
defines the Array class for multi-dimensional (numeric) arrays
This file declares class stir::BasicCoordinate and some functions acting on stir::BasicCoordinate obj...
int index_at_maximum(const VectorWithOffset< elemT > &v)
Finds the index where the maximum occurs in a (1-dimensional) vector.
Definition: index_at_maximum.h:42
defines the stir::VectorWithOffset class
size_t size() const
return number of elements in this vector
Definition: VectorWithOffset.inl:542
int get_max_index() const
get value of last valid index
Definition: VectorWithOffset.inl:123
BasicCoordinate< 3, int > indices_at_maximum(const Array< 3, elemT > &input_array)
Finds the first (3-dimensional) index where the maximum occurs in a (3-dimensional) array...
Definition: index_at_maximum.h:70