-/*=========================================================================
+/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
Authors belong to:
#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
{
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];
-/*=========================================================================
+/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
Authors belong to:
for(unsigned int r=0; r<ImageDimension; r++)
{
chosenSpacing[r]= m_ArgsInfo.spacing_arg[r];
- gridSizeOnImage[r] = ceil( (double) transformRegion.GetSize()[r] / ( round(chosenSpacing[r]/fixedImageSpacing[r]) ) );
- adaptedSpacing[r]= ( round(chosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ;
+ gridSizeOnImage[r] = ceil( (double) transformRegion.GetSize()[r] / ( itk::Math::Round<double>(chosenSpacing[r]/fixedImageSpacing[r]) ) );
+ adaptedSpacing[r]= ( itk::Math::Round<double>(chosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ;
}
if (m_Verbose) std::cout<<"The chosen control point spacing "<<chosenSpacing<<"..."<<std::endl;
if (m_Verbose) std::cout<<"The control points spacing was adapted to "<<adaptedSpacing<<"..."<<std::endl;
-/*=========================================================================
+/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
Authors belong to:
#ifndef __clitkBSplineDeformableTransformInitializer_txx
#define __clitkBSplineDeformableTransformInitializer_txx
#include "clitkBSplineDeformableTransformInitializer.h"
+#include "itkMath.h"
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<double>(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] ) )
-/*=========================================================================
+/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
Authors belong to:
{
// JV
m_ChosenSpacing[r]= m_ControlPointSpacing[r];
- m_ControlPointSpacing[r]= ( round(m_ChosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ;
+ m_ControlPointSpacing[r]= ( itk::Math::Round<double>(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] ) )
-/*=========================================================================
+/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
Authors belong to:
{
// JV
m_ChosenSpacing[r]= m_ControlPointSpacing[r];
- m_ControlPointSpacing[r]= ( round(m_ChosenSpacing[r]/fixedImageSpacing[r]) *fixedImageSpacing[r] ) ;
+ m_ControlPointSpacing[r]= ( itk::Math::Round<double>(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] ) )
#include "clitkCommon.h"
#include "clitkPadImage_ggo.h"
#include <string>
+#include "itkMath.h"
enum
{
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<PointValueType>(((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<PointValueType>(((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;
typedef itk::ImageFileReader<ImageType> ImageReaderType;
typedef itk::ImageFileWriter<ImageType> ImageWriterType;
typedef itk::ConstantPadImageFilter<ImageType, ImageType> 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<ImageType, PadBoundType, dim>(input, args_info.like_arg, pad_lower, pad_upper);
if (err) {
}
}
- 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();