# Attempt to find gengetopt. If not found, compile it.
FIND_PROGRAM(GENGETOPT gengetopt)
IF (GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
- ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/cmake/gengetopt)
+ ADD_SUBDIRECTORY(${CMAKE_CURRENT_LIST_DIR}/gengetopt ${CMAKE_CURRENT_BINARY_DIR}/gengetopt)
ELSE(GENGETOPT STREQUAL "GENGETOPT-NOTFOUND")
ADD_EXECUTABLE(gengetopt IMPORTED)
SET_PROPERTY(TARGET gengetopt PROPERTY IMPORTED_LOCATION ${GENGETOPT})
typedef itk::ImageRegionConstIterator<typename TransformType::CoefficientImageType> Iterator;
Iterator it (coefficientImage, coefficientImage->GetLargestPossibleRegion() );
it.GoToBegin();
- unsigned int i = 0;
+ unsigned int k = 0;
while (! it.IsAtEnd()) {
for (unsigned int j = 0; j < dim; j++)
- params[i+j]=it.Get()[j];
+ params[k+j]=it.Get()[j];
++it;
- i += dim;
+ k += dim;
}
transform->SetParameters(params);
// Compute index in precomputed weights table
TCoefficientType t2 = mSamplingFactors[l]*t1;
- index[l] = (IndexValueType)lrint(t2);
+ index[l] = (IndexValueType)itk::Math::Floor<IndexValueType,TCoefficientType>(t2);
// For even order : test if too close to 0.5 (but lower). In this
// case : take the next coefficient
indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
evaluateIndex[l] = indx;
} else { // Use this index calculation for even splineOrder
- if (mSplineOrders[l] == 0) evaluateIndex[l] = (long)rint(x[l]);
+ if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round<long,ContinuousIndexType::ValueType>(x[l]);
else {
indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
evaluateIndex[l] = indx;
indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
evaluateIndex[l] = indx;
} else { // Use this index calculation for even splineOrder
- if (mSplineOrders[l] == 0) evaluateIndex[l] = (long)rint(x[l]);
+ if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round<long,ContinuousIndexType::ValueType>(x[l]);
else {
indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
evaluateIndex[l] = indx;
GGO(clitkCoeffsToDVF, args_info);
CLITK_INIT;
- typename itk::ImageIOBase::Pointer image_io = itk::ImageIOFactory::CreateImageIO(args_info.input_arg, itk::ImageIOFactory::ReadMode);
+ itk::ImageIOBase::Pointer image_io = itk::ImageIOFactory::CreateImageIO(args_info.input_arg, itk::ImageIOFactory::ReadMode);
image_io->SetFileName(args_info.input_arg);
image_io->ReadImageInformation();
unsigned const dim = 2;
typedef itk::Vector<double, dim> PixelType;
typedef itk::Image<PixelType, dim> DVFType;
- typename DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF<DVFType>(args_info.input_arg, args_info.like_arg);
+ DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF<DVFType>(args_info.input_arg, args_info.like_arg);
Write<DVFType>(dvf, args_info.output_arg);
}
break;
unsigned const dim = 3;
typedef itk::Vector<double, dim> PixelType;
typedef itk::Image<PixelType, dim> DVFType;
- typename DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF<DVFType>(args_info.input_arg, args_info.like_arg);
+ DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF<DVFType>(args_info.input_arg, args_info.like_arg);
Write<DVFType>(dvf, args_info.output_arg);
}
break;