//find the multiresolution filter
// typedef typename RegistrationFilterType::FixedImageType InternalImageType;
// typedef typename RegistrationFilterType::MovingImageType MovingImageType;
-#if ITK_VERSION_MAJOR >= 4
typedef typename RegistrationFilterType::DisplacementFieldType DisplacementFieldType;
-#else
- typedef typename RegistrationFilterType::DeformationFieldType DisplacementFieldType;
-#endif
typedef clitk::MultiResolutionPDEDeformableRegistration<FixedImageType, MovingImageType, DisplacementFieldType> MultiResolutionRegistrationType;
typedef CommandResolutionLevelUpdate<MultiResolutionRegistrationType> LevelObserver;
// =======================================================
// The multiresolution scheme
// =======================================================
- if (threadsGiven) multiResolutionFilter->SetNumberOfThreads(threads);
+ if (threadsGiven) {
+#if ITK_VERSION_MAJOR <= 4
+ multiResolutionFilter->SetNumberOfThreads(threads);
+#else
+ multiResolutionFilter->SetNumberOfWorkUnits(threads);
+#endif
+ }
unsigned int nLevels=m_ArgsInfo.levels_arg;
if (m_Verbose) std::cout<<"Setting the number of resolution levels to "<<nLevels<<"..."<<std::endl;
multiResolutionFilter->SetFixedImage( fixedImage );
multiResolutionFilter->SetNumberOfLevels( nLevels );
multiResolutionFilter->SetFixedImagePyramid( fixedImagePyramid );
multiResolutionFilter->SetMovingImagePyramid( movingImagePyramid );
- if (threadsGiven) multiResolutionFilter->SetNumberOfThreads( threads );
-
+ if (threadsGiven) {
+#if ITK_VERSION_MAJOR <= 4
+ multiResolutionFilter->SetNumberOfThreads( threads );
+#else
+ multiResolutionFilter->SetNumberOfWorkUnits( threads );
+#endif
+ }
+
//------------------------------------
//Set the number of iterations
//------------------------------------
//JV TODO
// pdeFilter->SetMaximumError(m_ArgsInfo.maxError_arg);
// pdeFilter->SetMaximumKernelWidth(m_ArgsInfo.maxError_arg);
-#if ITK_VERSION_MAJOR >= 4
pdeFilter->SetSmoothDisplacementField(!m_ArgsInfo.fluid_flag);
-#else
- pdeFilter->SetSmoothDeformationField(!m_ArgsInfo.fluid_flag);
-#endif
pdeFilter->SetSmoothUpdateField(m_ArgsInfo.fluid_flag);
pdeFilter->SetUseImageSpacing( m_ArgsInfo.spacing_flag );
typedef itk::WarpImageFilter< MovingImageType, FixedImageType, DeformationFieldType > WarpFilterType;
typename WarpFilterType::Pointer warp = WarpFilterType::New();
-#if ITK_VERSION_MAJOR >= 4
warp->SetDisplacementField( deformationField );
-#else
- warp->SetDeformationField( deformationField );
-#endif
warp->SetInput( movingImageReader->GetOutput() );
warp->SetOutputOrigin( fixedImage->GetOrigin() );
warp->SetOutputSpacing( fixedImage->GetSpacing() );