From 20d8d555087b02db304197fb5fb6556847a59432 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Mon, 27 Jun 2011 10:01:30 +0200 Subject: [PATCH] Allowed arithmetic operations between 2 inputs even if they don't have the same spacing. --- tools/clitkImageArithmGenericFilter.txx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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."); } } -- 2.47.1