X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=filters%2FclitkImageArithmGenericFilter.txx;h=e925f21ee177af3d5f34738891f209402ac794ff;hb=494bc435f0dc573e18f347c270f2058573380e53;hp=99f7f32bc9d1af553f34883b9a6ce1ec64af277b;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/filters/clitkImageArithmGenericFilter.txx b/filters/clitkImageArithmGenericFilter.txx index 99f7f32..e925f21 100644 --- a/filters/clitkImageArithmGenericFilter.txx +++ b/filters/clitkImageArithmGenericFilter.txx @@ -17,6 +17,9 @@ ======================================================================-====*/ #ifndef CLITKIMAGEARITHMGENERICFILTER_TXX #define CLITKIMAGEARITHMGENERICFILTER_TXX + +#include "clitkImageCommon.h" + namespace clitk { @@ -107,6 +110,12 @@ void ImageArithmGenericFilter::UpdateWithInputImageType() typename ImageType::Pointer input2 = this->template GetInput(1); IteratorType it2; + // Check dimension + if (!clitk::HaveSameSizeAndSpacing(input1, input2)) { + std::cerr << "* ERROR * the images (input and input2) must have the same size & spacing"; + return; + } + if (mIsOperationUseASecondImage) { // Read input2 input2 = this->template GetInput(1); @@ -220,6 +229,7 @@ void ImageArithmGenericFilter::ComputeImage(Iter1 it1, Iter2 it } break; case 5: // Absolute difference + DD("AbsoluteDifff"); while (!ito.IsAtEnd()) { ito.Set(PixelTypeDownCast(fabs((double)it2.Get()-(double)it1.Get()))); ++it1;