+/*=========================================================================
+ 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
template<class args_info_type>
template<unsigned int Dim>
void ImageArithmGenericFilter<args_info_type>::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);
}
//--------------------------------------------------------------------
void ImageArithmGenericFilter<args_info_type>::UpdateWithInputImageType() {
// Read input1
typename ImageType::Pointer input1 = this->template GetInput<ImageType>(0);
- typename ImageType::PixelType PixelType;
// Set input image iterator
typedef itk::ImageRegionIterator<ImageType> IteratorType;
}
// 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;
break;
case 5: // Absolute difference
while (!ito.IsAtEnd()) {
- ito.Set(PixelTypeDownCast<double, PixelType>(fabs(it2.Get()-it1.Get())));
+ ito.Set(PixelTypeDownCast<double, PixelType>(fabs((double)it2.Get()-(double)it1.Get())));
++it1; ++it2; ++ito;
}
break;