From: unknown Date: Wed, 20 Jul 2011 14:39:26 +0000 (+0200) Subject: replaces round by itk:Math:Round (because round not found in Msvc2008) X-Git-Tag: v1.3.0~277 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=303195f7f56d1fa1256af63faeb4f452bf42faf2;p=clitk.git replaces round by itk:Math:Round (because round not found in Msvc2008) replaces uint by clitk::uint because uint not available in windows replaces typename outside template declaration (msvc compilation error) --- diff --git a/itk/itkRayCastInterpolateImageFunctionWithOrigin.txx b/itk/itkRayCastInterpolateImageFunctionWithOrigin.txx index 72dcc31..e89579e 100644 --- a/itk/itkRayCastInterpolateImageFunctionWithOrigin.txx +++ b/itk/itkRayCastInterpolateImageFunctionWithOrigin.txx @@ -1,4 +1,4 @@ -/*========================================================================= +/*========================================================================= Program: vv http://www.creatis.insa-lyon.fr/rio/vv Authors belong to: @@ -20,7 +20,7 @@ #include "itkRayCastInterpolateImageFunctionWithOrigin.h" #include "vnl/vnl_math.h" - +#include "clitkCommon.h" // Put the helper class in an anonymous namespace so that it is not // exposed to the user @@ -498,8 +498,8 @@ RayCastHelper { double maxInterDist, interDist; double cornerVect[4][3]; - for(uint i=0; i<4; i++) - for(uint j=0; j<3; j++) + for(clitk::uint i=0; i<4; i++) + for(clitk::uint j=0; j<3; j++) cornerVect[i][j] = 0.0; // to avoid warning int cross[4][3], noInterFlag[6]; int nSidesCrossed, crossFlag, c[4]; diff --git a/registration/clitkBSplineDeformableRegistrationGenericFilter.txx b/registration/clitkBSplineDeformableRegistrationGenericFilter.txx index 5de043f..0c05e0a 100644 --- a/registration/clitkBSplineDeformableRegistrationGenericFilter.txx +++ b/registration/clitkBSplineDeformableRegistrationGenericFilter.txx @@ -1,4 +1,4 @@ -/*========================================================================= +/*========================================================================= Program: vv http://www.creatis.insa-lyon.fr/rio/vv Authors belong to: @@ -354,8 +354,8 @@ namespace clitk for(unsigned int r=0; r(chosenSpacing[r]/fixedImageSpacing[r]) ) ); + adaptedSpacing[r]= ( itk::Math::Round(chosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ; } if (m_Verbose) std::cout<<"The chosen control point spacing "<(m_ChosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ; m_NumberOfControlPointsInsideTheImage[r] = ceil( (double)fixedImageSize[r]*fixedImageSpacing[r]/ m_ControlPointSpacing[r] ); if ( ( ceil( (double)fixedImageSize[r]*fixedImageSpacing[r]/ m_ControlPointSpacing[r] ) ) == ( (double)fixedImageSize[r]*fixedImageSpacing[r]/ m_ControlPointSpacing[r] ) ) diff --git a/registration/clitkMultipleBSplineDeformableTransformInitializer.txx b/registration/clitkMultipleBSplineDeformableTransformInitializer.txx index 7c9bd5a..1b75fbb 100644 --- a/registration/clitkMultipleBSplineDeformableTransformInitializer.txx +++ b/registration/clitkMultipleBSplineDeformableTransformInitializer.txx @@ -1,4 +1,4 @@ -/*========================================================================= +/*========================================================================= Program: vv http://www.creatis.insa-lyon.fr/rio/vv Authors belong to: @@ -79,7 +79,7 @@ namespace clitk { // JV m_ChosenSpacing[r]= m_ControlPointSpacing[r]; - m_ControlPointSpacing[r]= ( round(m_ChosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ; + m_ControlPointSpacing[r]= ( itk::Math::Round(m_ChosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ; m_NumberOfControlPointsInsideTheImage[r] = ceil( (double)fixedImageSize[r]*fixedImageSpacing[r]/ m_ControlPointSpacing[r] ); if ( ( ceil( (double)fixedImageSize[r]*fixedImageSpacing[r]/ m_ControlPointSpacing[r] ) ) == ( (double)fixedImageSize[r]*fixedImageSpacing[r]/ m_ControlPointSpacing[r] ) ) diff --git a/registration/clitkShapedBLUTSpatioTemporalDeformableTransformInitializer.txx b/registration/clitkShapedBLUTSpatioTemporalDeformableTransformInitializer.txx index 17ff27c..5ff2532 100644 --- a/registration/clitkShapedBLUTSpatioTemporalDeformableTransformInitializer.txx +++ b/registration/clitkShapedBLUTSpatioTemporalDeformableTransformInitializer.txx @@ -1,4 +1,4 @@ -/*========================================================================= +/*========================================================================= Program: vv http://www.creatis.insa-lyon.fr/rio/vv Authors belong to: @@ -85,7 +85,7 @@ namespace clitk { // JV m_ChosenSpacing[r]= m_ControlPointSpacing[r]; - m_ControlPointSpacing[r]= ( round(m_ChosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ; + m_ControlPointSpacing[r]= ( itk::Math::Round(m_ChosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ; m_NumberOfControlPointsInsideTheImage[r] = ceil( (double)fixedImageSize[r]*fixedImageSpacing[r]/ m_ControlPointSpacing[r] ); if ( ( ( ceil( (double)fixedImageSize[r]*fixedImageSpacing[r]/ m_ControlPointSpacing[r] ) ) == ( (double)fixedImageSize[r]*fixedImageSpacing[r]/ m_ControlPointSpacing[r] ) ) diff --git a/tools/clitkPadImage.cxx b/tools/clitkPadImage.cxx index 6f26350..ad93eaa 100644 --- a/tools/clitkPadImage.cxx +++ b/tools/clitkPadImage.cxx @@ -5,6 +5,7 @@ #include "clitkCommon.h" #include "clitkPadImage_ggo.h" #include +#include "itkMath.h" enum { @@ -47,11 +48,11 @@ int pad_like(typename ImageType::Pointer input, const std::string& likeFile, Pad for (DimType i = 0; i < dim; i++) { lower_bound[i] = origin[i]; like_lower_bound[i] = like_origin[i]; - auxl = round(((lower_bound[i] - like_lower_bound[i])/spacing[i])); + auxl = itk::Math::Round(((lower_bound[i] - like_lower_bound[i])/spacing[i])); upper_bound[i] = (lower_bound[i] + size[i]*spacing[i]); like_upper_bound[i] = (like_lower_bound[i] + like_size[i]*spacing[i]); - auxu = round(((like_upper_bound[i] - upper_bound[i])/spacing[i])); + auxu = itk::Math::Round(((like_upper_bound[i] - upper_bound[i])/spacing[i])); if (auxl < 0 || auxu < 0) { std::cerr << "Like-image's bounding box must be larger than input's" << std::endl; @@ -73,16 +74,16 @@ int main(int argc, char** argv) typedef itk::ImageFileReader ImageReaderType; typedef itk::ImageFileWriter ImageWriterType; typedef itk::ConstantPadImageFilter PadFilterType; - typedef typename PadFilterType::SizeValueType PadBoundType; + typedef PadFilterType::SizeValueType PadBoundType; GGO(clitkPadImage, args_info); - typename ImageReaderType::Pointer reader = ImageReaderType::New(); + ImageReaderType::Pointer reader = ImageReaderType::New(); reader->SetFileName(args_info.input_arg); reader->Update(); PadBoundType pad_lower[dim], pad_upper[dim]; - typename ImageType::Pointer input = reader->GetOutput(); + ImageType::Pointer input = reader->GetOutput(); if (args_info.like_given) { int err = pad_like(input, args_info.like_arg, pad_lower, pad_upper); if (err) { @@ -97,15 +98,15 @@ int main(int argc, char** argv) } } - typename PadFilterType::Pointer filter = PadFilterType::New(); + PadFilterType::Pointer filter = PadFilterType::New(); filter->SetPadLowerBound(pad_lower); filter->SetPadUpperBound(pad_upper); filter->SetInput(input); filter->SetConstant(args_info.value_arg); filter->Update(); - typename ImageType::Pointer output = filter->GetOutput(); - typename ImageWriterType::Pointer writer = ImageWriterType::New(); + ImageType::Pointer output = filter->GetOutput(); + ImageWriterType::Pointer writer = ImageWriterType::New(); writer->SetInput(output); writer->SetFileName(args_info.output_arg); writer->Update();