Commit 7b82b5fd authored by Emilie Harquel's avatar Emilie Harquel
Browse files

Updated ImagesBlend : added tolerance for spacing and origin comparison

--HG--
branch : fw4spl_0.8.2
parent fdac830c
......@@ -212,7 +212,14 @@ bool ImagesBlend::checkImageInformations()
}
else
{
if (size != img->getSize() || spacing != img->getSpacing() || origin != img->getOrigin())
double epsilon = 0.00001;
if (size != img->getSize() ||
!((spacing[0] < img->getSpacing()[0] + epsilon && spacing[0] > img->getSpacing()[0] - epsilon) ||
(spacing[1] < img->getSpacing()[1] + epsilon && spacing[1] > img->getSpacing()[1] - epsilon) ||
(spacing[2] < img->getSpacing()[2] + epsilon && spacing[2] > img->getSpacing()[2] - epsilon) ||
(origin[0] < img->getOrigin()[0] + epsilon && origin[0] > img->getOrigin()[0] - epsilon) ||
(origin[1] < img->getOrigin()[1] + epsilon && origin[1] > img->getOrigin()[1] - epsilon) ||
(origin[2] < img->getOrigin()[2] + epsilon && origin[2] > img->getOrigin()[2] - epsilon) ) )
{
OSLM_ERROR("imgA size : " << size[0] << " / " << size[1] << " / "<< size[2] );
OSLM_ERROR("imgA spacing : " << spacing[0] << " / " << spacing[1] << " / "<< spacing[2] );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment