]> Creatis software - clitk.git/commitdiff
Minor corrections for compiling with VC++
authorsrit <srit>
Fri, 5 Feb 2010 08:51:04 +0000 (08:51 +0000)
committersrit <srit>
Fri, 5 Feb 2010 08:51:04 +0000 (08:51 +0000)
common/clitkCommon.cxx
common/clitkCommon.h
common/clitkImageCommon.txx
common/clitkListOfPair.cxx
common/vvToITK.h

index c80c095..fdfdd17 100644 (file)
@@ -84,7 +84,7 @@ int stage = current;
   sprintf(fmt,"%%%i.%if%%%%",prec<4?prec:prec+1,prec>3?prec-3:0);
   char ch[128];
   
-  snprintf(ch,2,fmt,s); 
+  _snprintf(ch,2,fmt,s); 
   //sxsVSCU_MESSAGE(2,ch);
   std::cout << ch << std::flush;
   for (int i=0;i<(prec>3?prec+2:prec+1);++i) 
@@ -117,7 +117,7 @@ void clitk::VerboseInProgressInPercentage(const int nb, const int current, const
   sprintf(fmt,"%%%i.%if%%%%",prec<4?prec:prec+1,prec>3?prec-3:0);
   char ch[128];
   
-  snprintf(ch,2,fmt,s); 
+  _snprintf(ch,2,fmt,s); 
   //sxsVSCU_MESSAGE(2,ch);
   std::cout << ch << std::flush;
   for (int i=0;i<(prec>3?prec+2:prec+1);++i) 
index 00a32cf..4f7a9fa 100644 (file)
 namespace clitk {
   
 #if defined(WIN32)
-#define lrint(x) (floor(x+(x>0) ? 0.5 : -0.5))
+#  define lrint(x) (floor(x+(x>0) ? 0.5 : -0.5))
 #endif
-  
+
+#ifndef M_PI
+#  define M_PI 3.141592653589793238462643
+#endif
+
+
   typedef unsigned char uchar;
   typedef unsigned short ushort;
   typedef unsigned int uint;
index 45e8c2e..caf173d 100644 (file)
@@ -126,7 +126,7 @@ typename ImageType::Pointer readImage(const std::vector<std::string> & filenames
 
 //--------------------------------------------------------------------
 template<class ImageType>
-void writeImage(const typename ImageType::Pointer image, const std::string & filename, const bool verbose=false) {
+void writeImage(const typename ImageType::Pointer image, const std::string & filename, const bool verbose) {
   typedef itk::ImageFileWriter<ImageType> WriterType;
   typename WriterType::Pointer writer = WriterType::New();
   writer->SetFileName(filename.c_str());
@@ -147,7 +147,7 @@ void writeImage(const typename ImageType::Pointer image, const std::string & fil
 
 //--------------------------------------------------------------------
 template<class ImageType>
-void writeImage(const ImageType* image, const std::string & filename, const bool verbose=false) {
+void writeImage(const ImageType* image, const std::string & filename, const bool verbose) {
   typedef itk::ImageFileWriter<ImageType> WriterType;
   typename WriterType::Pointer writer = WriterType::New();
   writer->SetFileName(filename.c_str());
index 25b254d..9b7bb77 100644 (file)
@@ -34,7 +34,7 @@
 double clitk::convertValue(double v, 
                            const std::multimap<double, double> & conversionTable, 
                            bool linear) {
-  std::map<double, double>::const_iterator i;
+  std::multimap<double, double>::const_iterator i;
   i = conversionTable.lower_bound(v);  
   if (i == conversionTable.end()) {
     std::cerr << "The value " << v << " is out of the table" << std::endl;
index b62503f..c48b212 100644 (file)
@@ -80,7 +80,7 @@ template<class ImageType> typename ImageType::ConstPointer vvImageToITK(vvImage:
     }
     else //Dim == 1,2,3
     {
-        assert(not vv_image->IsTimeSequence()); //This case isn't implemented
+        assert(!vv_image->IsTimeSequence()); //This case isn't implemented
         typedef ImageType  ConnectorImageType;
         typedef itk::VTKImageToImageFilter <ConnectorImageType> ConnectorType;
         typename ConnectorType::Pointer connector = ConnectorType::New();