X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=filters%2FclitkImageArithmGenericFilter.txx;h=9679d028e4ffa1cd5dd4f846954b79a2c999371d;hb=e6add2e56013846bcf4368013c4aaf4eb36991ec;hp=61aa066c61ce8a9aa329926840ddbec93a4c4894;hpb=0083c3fb2c66812489631c7551709d121de51625;p=clitk.git diff --git a/filters/clitkImageArithmGenericFilter.txx b/filters/clitkImageArithmGenericFilter.txx index 61aa066..9679d02 100644 --- a/filters/clitkImageArithmGenericFilter.txx +++ b/filters/clitkImageArithmGenericFilter.txx @@ -1,3 +1,20 @@ +/*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv + + Authors belong to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + + - BSD See included LICENSE.txt file + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +======================================================================-====*/ #ifndef CLITKIMAGEARITHMGENERICFILTER_TXX #define CLITKIMAGEARITHMGENERICFILTER_TXX namespace clitk @@ -20,10 +37,7 @@ namespace clitk template template void ImageArithmGenericFilter::InitializeImageType() { - ADD_IMAGE_TYPE(Dim, char); - ADD_IMAGE_TYPE(Dim, uchar); - ADD_IMAGE_TYPE(Dim, short); - ADD_IMAGE_TYPE(Dim, float); + ADD_DEFAULT_IMAGE_TYPES(Dim); } //-------------------------------------------------------------------- @@ -79,7 +93,6 @@ namespace clitk void ImageArithmGenericFilter::UpdateWithInputImageType() { // Read input1 typename ImageType::Pointer input1 = this->template GetInput(0); - typename ImageType::PixelType PixelType; // Set input image iterator typedef itk::ImageRegionIterator IteratorType; @@ -97,7 +110,7 @@ namespace clitk } // Check if overwrite and outputisfloat and pixeltype is not float -> do not overwrite - if (mOverwriteInputImage && mOutputIsFloat && (typeid(PixelType) != typeid(float))) { + if (mOverwriteInputImage && mOutputIsFloat && (typeid(typename ImageType::PixelType) != typeid(float))) { // std::cerr << "Warning. Could not use both mOverwriteInputImage and mOutputIsFloat, because input is " // << typeid(PixelType).name() // << std::endl; @@ -193,7 +206,7 @@ namespace clitk break; case 5: // Absolute difference while (!ito.IsAtEnd()) { - ito.Set(PixelTypeDownCast(fabs(it2.Get()-it1.Get()))); + ito.Set(PixelTypeDownCast(fabs((double)it2.Get()-(double)it1.Get()))); ++it1; ++it2; ++ito; } break;