34 #ifndef AIMS_UTILITY_MINMAX_H 35 #define AIMS_UTILITY_MINMAX_H 45 template <
typename ObjectType,
typename ValueType>
46 void minmax(
const ObjectType &, ValueType &min, ValueType &max );
49 template <
typename ObjectType,
typename ValueType>
50 void minmax(
const ObjectType &, ValueType &min, ValueType &max )
52 ObjectType::error_minmax_not_specialized;
59 template <
typename ValueType>
67 for (
int t = 0; t < volume.
dimT(); t++ ) {
68 for (
int z = 0; z < volume.
dimZ(); z++ ) {
69 for (
int y = 0; y < volume.
dimY(); y++ ) {
70 for (
int x = 0; x < volume.
dimX(); x++ ) {
71 if ( *it < min ) min = *it;
72 if ( *it > max ) max = *it;
87 template <
typename ValueType>
97 min = max = volume.
at( 0 );
98 for (
int t = 0; t < dt; t++ )
100 for (
int z = 0; z < dz; z++ )
102 for (
int y = 0; y < dy; y++ )
104 it = &volume.
at( 0, y, z, t );
105 for (
int x = 0; x < dx; x++ )
107 if ( *it < min ) min = *it;
108 if ( *it > max ) max = *it;
120 template <
typename ValueType>
122 ValueType &min, ValueType &max )
124 minmax( *volume, min, max );
131 template <
typename ValueType>
133 ValueType &min, ValueType &max )
135 minmax( *volume, min, max );
141 #endif // ifndef AIMS_UTILITY_MINMAX_H int oLineBetweenSlice() const
Number of lines between 2 consecutive slices.
const T * const_iterator
basic constant iterator
const T & at(long x, long y=0, long z=0, long t=0) const
int oPointBetweenLine() const
Offset between the end of a line and the start of the consecutive line.
The class for EcatSino data write operation.
int oSliceBetweenVolume() const
Number of slices between 2 consecutive volumes.
void minmax(const ObjectType &, ValueType &min, ValueType &max)
int oFirstPoint() const
Offset from the start of the allocated memory to the first point.