From 3b6b49593e7293aa8f10e7f8951742c73b31ab38 Mon Sep 17 00:00:00 2001 From: Brent Huisman Date: Tue, 8 Sep 2015 16:38:42 +0200 Subject: [PATCH] Added PixelTypeDownCast specialization for double to double 'conversion'. --- common/clitkCommon.cxx | 9 +++++++++ common/clitkCommon.h | 2 ++ 2 files changed, 11 insertions(+) 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 -- 2.47.1