X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=filters%2FclitkImageArithmGenericFilter.txx;h=9679d028e4ffa1cd5dd4f846954b79a2c999371d;hb=a97c480d25285a6d143bd035d6b5fa0804a7d068;hp=643fe1359d708bc87ffd784f73343de23d8274b5;hpb=ec98e4a8aed11c9daa9bd7e2439d1ac489c933c7;p=clitk.git diff --git a/filters/clitkImageArithmGenericFilter.txx b/filters/clitkImageArithmGenericFilter.txx index 643fe13..9679d02 100644 --- a/filters/clitkImageArithmGenericFilter.txx +++ b/filters/clitkImageArithmGenericFilter.txx @@ -1,18 +1,22 @@ -/*------------------------------------------------------------------------- - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. - +/*========================================================================= + 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 above copyright notices for more information. - - -------------------------------------------------------------------------*/ + 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 { @@ -33,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); } //-------------------------------------------------------------------- @@ -92,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; @@ -110,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; @@ -206,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;