MCPcopy Create free account
hub / github.com/MITK/MITK / createDefaultFitFunctor

Function createDefaultFitFunctor

Modules/Pharmacokinetics/cmdapps/MRPerfusion.cpp:208–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208mitk::ModelFitFunctorBase::Pointer createDefaultFitFunctor(
209 const mitk::ModelParameterizerBase* parameterizer, const mitk::ModelFactoryBase* modelFactory)
210{
211 mitk::LevenbergMarquardtModelFitFunctor::Pointer fitFunctor =
212 mitk::LevenbergMarquardtModelFitFunctor::New();
213
214 mitk::NormalizedSumOfSquaredDifferencesFitCostFunction::Pointer chi2 =
215 mitk::NormalizedSumOfSquaredDifferencesFitCostFunction::New();
216 fitFunctor->RegisterEvaluationParameter("Chi^2", chi2);
217
218 fitFunctor->SetConstraintChecker(modelFactory->CreateDefaultConstraints().GetPointer());
219
220 mitk::ModelBase::Pointer refModel = parameterizer->GenerateParameterizedModel();
221
222 ::itk::LevenbergMarquardtOptimizer::ScalesType scales;
223 scales.SetSize(refModel->GetNumberOfParameters());
224 scales.Fill(1.0);
225 fitFunctor->SetScales(scales);
226
227 fitFunctor->SetDebugParameterMaps(true);
228
229 return fitFunctor.GetPointer();
230}
231
232/**Helper that ensures that the mask (if it exists) is always 3D image. If the mask is originally an 4D image, the first
233time step will be used.*/

Calls 8

GetPointerMethod · 0.80
NewFunction · 0.50
SetSizeMethod · 0.45
GetNumberOfParametersMethod · 0.45
FillMethod · 0.45

Tested by

no test coverage detected