From: Simon Rit Date: Mon, 27 Jun 2011 08:01:30 +0000 (+0200) Subject: Allowed arithmetic operations between 2 inputs even if they don't have the same spacing. X-Git-Tag: v1.3.0~307 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=20d8d555087b02db304197fb5fb6556847a59432;p=clitk.git Allowed arithmetic operations between 2 inputs even if they don't have the same spacing. --- diff --git a/tools/clitkImageArithmGenericFilter.txx b/tools/clitkImageArithmGenericFilter.txx index 38f7c50..24ebbbd 100644 --- a/tools/clitkImageArithmGenericFilter.txx +++ b/tools/clitkImageArithmGenericFilter.txx @@ -128,9 +128,12 @@ void ImageArithmGenericFilter::UpdateWithInputImageType() // Set input image iterator it2 = IteratorType(input2, input2->GetLargestPossibleRegion()); // Check dimension - if (!clitk::HaveSameSizeAndSpacing(input1, input2)) { - std::cerr << "* ERROR * the images (input and input2) must have the same size & spacing"; - return; + if (!clitk::HaveSameSize(input1, input2)) { + itkExceptionMacro(<< "The images (input and input2) must have the same size"); + } + if(!clitk::HaveSameSpacing(input1, input2)) { + itkWarningMacro(<< "The images (input and input2) do not have the same spacing. " + << "Using first input's information."); } }