From c0544f5b35f5527ca67da10c3317f99981cfd416 Mon Sep 17 00:00:00 2001 From: srit Date: Fri, 5 Feb 2010 08:51:04 +0000 Subject: [PATCH] Minor corrections for compiling with VC++ --- common/clitkCommon.cxx | 4 ++-- common/clitkCommon.h | 9 +++++++-- common/clitkImageCommon.txx | 4 ++-- common/clitkListOfPair.cxx | 2 +- common/vvToITK.h | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/common/clitkCommon.cxx b/common/clitkCommon.cxx index c80c095..fdfdd17 100644 --- a/common/clitkCommon.cxx +++ b/common/clitkCommon.cxx @@ -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) diff --git a/common/clitkCommon.h b/common/clitkCommon.h index 00a32cf..4f7a9fa 100644 --- a/common/clitkCommon.h +++ b/common/clitkCommon.h @@ -35,9 +35,14 @@ 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; diff --git a/common/clitkImageCommon.txx b/common/clitkImageCommon.txx index 45e8c2e..caf173d 100644 --- a/common/clitkImageCommon.txx +++ b/common/clitkImageCommon.txx @@ -126,7 +126,7 @@ typename ImageType::Pointer readImage(const std::vector & filenames //-------------------------------------------------------------------- template -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 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 -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 WriterType; typename WriterType::Pointer writer = WriterType::New(); writer->SetFileName(filename.c_str()); diff --git a/common/clitkListOfPair.cxx b/common/clitkListOfPair.cxx index 25b254d..9b7bb77 100644 --- a/common/clitkListOfPair.cxx +++ b/common/clitkListOfPair.cxx @@ -34,7 +34,7 @@ double clitk::convertValue(double v, const std::multimap & conversionTable, bool linear) { - std::map::const_iterator i; + std::multimap::const_iterator i; i = conversionTable.lower_bound(v); if (i == conversionTable.end()) { std::cerr << "The value " << v << " is out of the table" << std::endl; diff --git a/common/vvToITK.h b/common/vvToITK.h index b62503f..c48b212 100644 --- a/common/vvToITK.h +++ b/common/vvToITK.h @@ -80,7 +80,7 @@ template 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 ConnectorType; typename ConnectorType::Pointer connector = ConnectorType::New(); -- 2.47.1