MCPcopy Create free account
hub / github.com/SuperElastix/elastix / GetTestOutputResult

Function GetTestOutputResult

Testing/itkTestHelper.h:266–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264// Helper function to get test result from output images
265template <typename TScalarType, typename CPUImageType, typename GPUImageType>
266void
267GetTestOutputResult(const CPUImageType * cpuImage,
268 const GPUImageType * gpuImage,
269 const float allowedRMSerror,
270 TScalarType & rmsError,
271 TScalarType & rmsRelative,
272 bool & testPassed,
273 const bool skipCPU,
274 const bool skipGPU,
275 const TimeProbe::TimeStampType cpuTime,
276 const TimeProbe::TimeStampType gpuTime,
277 const bool updateExceptionCPU,
278 const bool updateExceptionGPU)
279{
280 rmsError = 0.0;
281 rmsRelative = 0.0;
282 testPassed = true;
283 if (updateExceptionCPU || updateExceptionGPU)
284 {
285 testPassed = false;
286 }
287 else
288 {
289 if (!skipCPU && !skipGPU && cpuImage && gpuImage)
290 {
291 rmsError = ComputeRMSE<TScalarType, CPUImageType, GPUImageType>(cpuImage, gpuImage, rmsRelative);
292
293 std::cout << ", speed up " << (cpuTime / gpuTime) << std::endl;
294 std::cout << std::fixed << std::setprecision(8);
295 std::cout << "Maximum allowed RMS Error: " << allowedRMSerror << std::endl;
296 std::cout << "Computed real RMS Error: " << rmsError << std::endl;
297 std::cout << "Computed real nRMS Error: " << rmsRelative << std::endl;
298
299 testPassed = (rmsError <= allowedRMSerror);
300 }
301 }
302}
303
304
305//------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected