17 #include "itkImageRegionIterator.h" 32 typedef std::vector<double> ValueArrayType;
34 ValueArrayType sample1(10);
35 ValueArrayType sample2(10);
37 for (
int i = 0; i < 10; ++i)
41 sample2[i] = 2 * i + 10;
45 model->SetTimeGrid(grid);
48 initParams.SetSize(2);
59 CPPUNIT_ASSERT_MESSAGE(
"Check number of outputs with model set.", 4 == testFunctor->GetNumberOfOutputs(model));
61 ValueArrayType output = testFunctor->Compute(sample1, model, initParams);
63 CPPUNIT_ASSERT_MESSAGE(
"Check number of values in functor output.", 4 == output.size());
66 "Check fitted parameter 1 (slope) for sample 1.");
68 "Check fitted parameter 2 (offset) for sample 1.");
70 "Check derived parameter 1 (x-intercept) for sample 1.");
73 output = testFunctor->Compute(sample2, model, initParams);
75 CPPUNIT_ASSERT_MESSAGE(
"Check number of values in functor output.", 4 == output.size());
78 "Check fitted parameter 1 (slope) for sample 2.");
80 "Check fitted parameter 2 (offset) for sample 2.")
82 "Check derived parameter 1 (x-intercept) for sample 2.");
ModelTraitsInterface::ParametersType ParametersType
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
itk::Array< double > TimeGridType
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
#define MITK_TEST_FOR_EXCEPTION(EXCEPTIONCLASS, STATEMENT)
Simplified version of MITK_TEST_FOR_EXCEPTION_BEGIN / END for a single statement. ...
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
int mitkLevenbergMarquardtModelFitFunctorTest(int, char *[])