The member m_UseMultiThread in the AdvancedImageToImageMetric is not initialized which causes ValGrind errors. Adding the line: `this->m_UseMultiThread = false;` to the constructor will fix this.