35 #define M_PI 3.14159265358979323846 42 template<
typename TYPE >
43 static void printKW(
bool doPrint,
char* fmt, ...);
48 template<
typename TYPE1,
typename TYPE2 >
49 static void copyArrayToArray(
int nSamples, TYPE1 *arrayTo,
const TYPE2 *arrayFrom);
60 template<
typename TYPE>
61 static void printVector(
const std::string& name,
const std::vector<TYPE> vector);
69 template<
typename TYPE>
70 static void printVectorNewline(
const std::string &name,
const std::vector<TYPE> vector);
75 template<
typename TYPE >
76 static void printArray(
int nSamples,
const TYPE *myarray);
78 template<
typename TYPE >
79 static void printArray(
int nSamples,
const TYPE *myarray,
int width);
81 template<
typename TYPE >
82 static void printArray(
int nSamples,
const TYPE *myarray,
char* text);
84 template<
typename TYPE >
85 static void printArray(
bool doPrint,
int nSamples,
const TYPE *myarray);
87 template<
typename TYPE >
88 static void printArray(
bool doPrint,
int nSamples,
const TYPE *myarray,
char* text);
93 template<
typename TYPE >
94 static void printArray2D(
int nRows,
int nCols, TYPE **myarray);
96 template<
typename TYPE >
97 static void printArray2D(
int nRows,
int nCols, TYPE **myarray,
char* text);
99 template<
typename TYPE >
100 static void printArray2D(
bool doPrint,
int nRows,
int nCols, TYPE **myarray);
102 template<
typename TYPE >
103 static void printArray2D(
bool doPrint,
int nRows,
int nCols, TYPE **myarray,
char* text);
109 template<
typename TYPE >
110 static void printStdVector(
const std::vector<TYPE> myvector);
112 template<
typename TYPE >
113 static void printStdVector(
const std::vector<TYPE> myvector,
char* text);
115 template<
typename TYPE >
116 static void printStdVector(
bool doPrint,
const std::vector<TYPE> myvector);
118 template<
typename TYPE >
119 static void printStdVector(
bool doPrint,
const std::vector<TYPE> myvector,
char* text);
126 template<
typename TYPE >
127 static void swap(TYPE &a, TYPE &b);
129 template<
typename TYPE >
130 static TYPE max(TYPE a, TYPE b);
132 template<
typename TYPE >
133 static TYPE min(TYPE a, TYPE b);
135 template<
typename TYPE >
136 static TYPE calcSumArray(
int nSamples,
const TYPE *myarray);
138 template<
typename TYPE >
139 static double calcMeanArray(
int nSamples,
const TYPE *myarray);
141 template<
typename TYPE >
142 static double calcMedianArray(
int nSamples,
const TYPE *myarray);
144 template<
typename TYPE >
145 static double calcStandardDeviationArray(
int nSamples,
const TYPE *myarray);
147 template<
typename TYPE >
148 static double calcR2ss (
int nSamples,
const TYPE *fitted,
const TYPE *ysignal);
150 template<
typename TYPE >
151 static double calcR2cor(
int nSamples,
const TYPE *fitted,
const TYPE *ysignal);
153 template<
typename TYPE >
154 static int linearFit(
165 template<
typename TYPE >
166 static double SKPLinReg(
const TYPE *datax,
const TYPE *datay,
int nSamples, TYPE &rslope, TYPE &roffset);
168 template<
typename TYPE >
169 static void SKPsort(
int nSamples,
const TYPE *myarray,
int *index);
171 template<
typename TYPE >
172 static void quickSort(
int nSamples, TYPE *myarray);
174 template<
typename TYPE >
175 static void quickSortIndex(
int nSamples, TYPE *myarray,
int *indexArray);
177 template<
typename TYPE >
178 static TYPE getChiSqrt(TYPE lastFValue,
int nSamples);
180 template<
typename TYPE >
181 static TYPE calcFeFromT2(TYPE T2);
183 template<
typename TYPE >
184 static TYPE calcFeErrorFromT2(TYPE T2, TYPE deltaT2);
186 template<
typename TYPE >
187 static int calculateFitError(
int nSamples,
int nDims,
const TYPE* jacobian, TYPE mFuncNorm, TYPE* fitError);
197 template<
typename TYPE >
208 template<
typename TYPE >
211 template<
typename TYPE >
212 static TYPE MOLLI_min(TYPE a[],
int n,
int *indm);
214 template<
typename TYPE >
215 static TYPE MOLLI_max(TYPE a[],
int n,
int *indm);
221 template <
typename TYPE >
222 static std::string NumberToString ( TYPE Number ){
223 std::ostringstream ss;
229 template <
typename TYPE >
230 static TYPE StringToNumber (
const std::string &Text ){
231 std::istringstream ss(Text);
233 return ss >> result ? result : 0;
237 template <
typename TYPE >
238 static TYPE dicomTime2Seconds(std::string dicomTimeString);
243 template <
typename TYPE >
244 static std::vector<int> bounds(
int parts,
int mem);
250 static std::string PathSeparator(){
251 #if defined(WIN32) || defined(_WIN32) || defined __CYGWIN__ 252 return std::string(
"\\");
254 return std::string(
"/");
291 template<
typename TYPE >
292 static bool array_expect_near(
297 const std::string& comment =
"");
313 template<
typename TYPE >
314 static void quickSort(TYPE arr[],
int left,
int right);
316 template<
typename TYPE >
317 static void quickSortIndex(TYPE arr[],
int indexArray[],
int left,
int right);
321 #include "KWUtil.hxx" static void printVectorNewline(const std::string &name, const std::vector< TYPE > vector)
Definition: KWUtil.hxx:44
static void printVector(const std::string &name, const std::vector< TYPE > vector)
Definition: KWUtil.hxx:35
static int calcMatrixInverse3x3(const TYPE *matrix, TYPE *matrixInverse)
Definition: KWUtil.hxx:542
static int calcMatrixInverse2x2(const TYPE *matrix, TYPE *matrixInverse)
Definition: KWUtil.hxx:522