|
4 | 4 | * \date 2018/08/01 |
5 | 5 | */ |
6 | 6 |
|
| 7 | +#include <OxFitterLevenbergMarquardtVnl.h> |
7 | 8 | #include "gtest/gtest.h" |
8 | 9 | #include "OxTestData.h" |
9 | 10 |
|
|
16 | 17 | #include "OxStartPointCalculatorDefault3Dims.h" |
17 | 18 | #include "OxCalculatorT1Molli.h" |
18 | 19 |
|
| 20 | +#ifdef USE_ITK |
| 21 | +#include "itkTimeProbe.h" |
| 22 | +#endif |
| 23 | + |
19 | 24 | //TODO: make sure correctSDs are accually correct |
20 | 25 |
|
21 | 26 | #ifdef USE_VNL |
@@ -268,3 +273,63 @@ TEST(OxCalculatorT1Molli, correctSDs) { |
268 | 273 | } |
269 | 274 |
|
270 | 275 | #endif |
| 276 | + |
| 277 | +////TODO: no difference between 5 samples and 7 samples here. |
| 278 | +//#ifdef USE_ITK |
| 279 | +// |
| 280 | +//TEST(OxCalculatorT1Molli, samples5) { |
| 281 | +// |
| 282 | +// typedef double TYPE; |
| 283 | +// int nRepetitions = 10000; |
| 284 | +// |
| 285 | +// char filePath5 [] = "testData/blood_5samples.yaml"; |
| 286 | +// Ox::TestData<TYPE> testData5(filePath5); |
| 287 | +// int nSamples5 = testData5.getNSamples(); |
| 288 | +// |
| 289 | +// char filePath7 [] = "testData/blood.yaml"; |
| 290 | +// Ox::TestData<TYPE> testData7(filePath7); |
| 291 | +// int nSamples7 = testData7.getNSamples(); |
| 292 | +// |
| 293 | +// // init the necessary objects |
| 294 | +// Ox::FunctionsT1Basic<TYPE> functionsObject; |
| 295 | +// Ox::FitterLevenbergMarquardtVnl<TYPE> fitterAmoebaVnl; |
| 296 | +// Ox::SignCalculatorRealImag<TYPE> signCalculator; |
| 297 | +// Ox::StartPointCalculatorDefault3Dims<TYPE> startPointCalculator; |
| 298 | +// Ox::CalculatorT1Molli<TYPE> calculatorT1Molli; |
| 299 | +// |
| 300 | +// // configure |
| 301 | +// calculatorT1Molli.setFunctionsT1(&functionsObject); |
| 302 | +// calculatorT1Molli.setFitter(&fitterAmoebaVnl); |
| 303 | +// calculatorT1Molli.setSignCalculator(&signCalculator); |
| 304 | +// calculatorT1Molli.setStartPointCalculator(&startPointCalculator); |
| 305 | +// |
| 306 | +// // set the data |
| 307 | +// calculatorT1Molli.setNSamples(nSamples5); |
| 308 | +// calculatorT1Molli.setInvTimes(testData5.getInvTimesPtr()); |
| 309 | +// calculatorT1Molli.setSigPha(testData5.getSignalPhaPtr()); |
| 310 | +// calculatorT1Molli.setSigMag(testData5.getSignalMagPtr()); |
| 311 | +// |
| 312 | +// printf("\n"); |
| 313 | +// itk::TimeProbe clock; |
| 314 | +// clock.Start(); |
| 315 | +// for (int i = 0; i < nRepetitions; i++) |
| 316 | +// calculatorT1Molli.calculate(); |
| 317 | +// clock.Stop(); |
| 318 | +// printf("Calculation5 time: %.12fs.\n", clock.GetTotal()); |
| 319 | +// |
| 320 | +// // set the data |
| 321 | +// calculatorT1Molli.setNSamples(nSamples7); |
| 322 | +// calculatorT1Molli.setInvTimes(testData7.getInvTimesPtr()); |
| 323 | +// calculatorT1Molli.setSigPha(testData7.getSignalPhaPtr()); |
| 324 | +// calculatorT1Molli.setSigMag(testData7.getSignalMagPtr()); |
| 325 | +// |
| 326 | +// clock.Reset(); |
| 327 | +// clock.Start(); |
| 328 | +// for (int i = 0; i < nRepetitions; i++) |
| 329 | +// calculatorT1Molli.calculate(); |
| 330 | +// clock.Stop(); |
| 331 | +// printf("Calculation7 time: %.12fs.\n", clock.GetTotal()); |
| 332 | +// |
| 333 | +//} |
| 334 | +// |
| 335 | +//#endif |
0 commit comments