#ifndef CLITKCOMMON_CXX
#define CLITKCOMMON_CXX
+#include <itksys/SystemTools.hxx>
+
+#ifdef _WIN32
+ #define _USE_MATH_DEFINES
+ #include <cmath>
+ const double M_PI = std::acos(-1.0);
+#endif
+
// clitk include
#include "clitkCommon.h"
} ////
//------------------------------------------------------------------
+
+//------------------------------------------------------------------
+// Return filename splitting in 1 or 2 parts : directory name (if exists) & filename
+std::vector<std::string> clitk::SplitFilename(const std::string& filename)
+{
+ std::vector<std::string> dirname;
+ std::string path = itksys::SystemTools::GetFilenamePath(filename);
+ std::vector<std::string> pathComponents;
+ itksys::SystemTools::SplitPath(filename.c_str(), pathComponents);
+ std::string fileName = pathComponents.back();
+ if (path != "")
+ dirname.push_back(path);
+ dirname.push_back(fileName);
+ return( dirname );
+} ////
+//------------------------------------------------------------------
+
+
//------------------------------------------------------------------
// Display progression
void clitk::VerboseInProgress(const int nb, const int current, const int percentage)
}
//------------------------------------------------------------------
+//------------------------------------------------------------------
+// Convert a pixel type without casting
+template<>
+double clitk::PixelTypeDownCast(const double & x)
+{
+ return x;
+}
+//------------------------------------------------------------------
+
//------------------------------------------------------------------
double clitk::rad2deg(const double anglerad)
{