# MultiMetric returns only value of first component metric

**URL:** <https://discourse.itk.org/t/multimetric-returns-only-value-of-first-component-metric/2646>\
**Category:** Algorithms\
**Created:** [January 22, 2020, 4:50pm UTC](https://discourse.itk.org/t/multimetric-returns-only-value-of-first-component-metric/2646 "2020-01-22T16:50:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Kavec](https://discourse.itk.org/user_avatar/discourse.itk.org/martin_kavec/32/1194_2.png) [@Martin\_Kavec](https://discourse.itk.org/u/Martin_Kavec)\
**Post date:** [January 22, 2020, 4:50pm UTC](https://discourse.itk.org/t/multimetric-returns-only-value-of-first-component-metric/2646/1 "2020-01-22T16:50:36Z")

</div>

Hi,

I am setting up a registration using ObjectToObjectMultiMetricv4. I add two component metrices of the same type (m1 and m2), set equal weights (0.5) for each of them, and add two different datasets d1 and d2.  
In the [API description](https://itk.org/Doxygen/html/classitk_1_1ObjectToObjectMultiMetricv4.html#aef2ab317c0aa2a4371ffc75ebae09362) I read that GetValueAndDerivative() or GetValue(), which is passed to the optimizer, returns value of the first metric (m1) only.  
My current understanding (also observed by debugging the code) is that no matter how m2 gets worse or better, it has no effect on optimization, since only m1 is passed to the optimizer.

Please, help me to understand.

Thanks
