From: Brent Huisman Date: Tue, 8 Sep 2015 14:38:42 +0000 (+0200) Subject: Added PixelTypeDownCast specialization for double to double 'conversion'. X-Git-Tag: v1.4.0~98 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3b6b49593e7293aa8f10e7f8951742c73b31ab38;p=clitk.git Added PixelTypeDownCast specialization for double to double 'conversion'. --- diff --git a/common/clitkCommon.cxx b/common/clitkCommon.cxx index 10f608e..57be29e 100644 --- a/common/clitkCommon.cxx +++ b/common/clitkCommon.cxx @@ -104,6 +104,15 @@ float clitk::PixelTypeDownCast(const double & x) } //------------------------------------------------------------------ +//------------------------------------------------------------------ +// Convert a pixel type without casting +template<> +double clitk::PixelTypeDownCast(const double & x) +{ + return x; +} +//------------------------------------------------------------------ + //------------------------------------------------------------------ double clitk::rad2deg(const double anglerad) { diff --git a/common/clitkCommon.h b/common/clitkCommon.h index 2f5b26f..113bdfb 100644 --- a/common/clitkCommon.h +++ b/common/clitkCommon.h @@ -117,6 +117,8 @@ namespace clitk { TPixelDown PixelTypeDownCast(const TPixelUp & x); template<> float PixelTypeDownCast(const double & x); + template<> + double PixelTypeDownCast(const double & x); //-------------------------------------------------------------------- // Return the indexes of sorted values in a vector