]> Creatis software - clitk.git/blobdiff - registration/clitkDemonsDeformableRegistrationGenericFilter.txx
Debug RTStruct conversion with empty struc
[clitk.git] / registration / clitkDemonsDeformableRegistrationGenericFilter.txx
old mode 100755 (executable)
new mode 100644 (file)
index 90d5319..0c49dd7
@@ -151,8 +151,8 @@ namespace clitk
     //find the multiresolution filter
     //     typedef typename  RegistrationFilterType::FixedImageType InternalImageType;
     //     typedef typename  RegistrationFilterType::MovingImageType MovingImageType;
-    typedef typename  RegistrationFilterType::DeformationFieldType DeformationFieldType;
-    typedef clitk::MultiResolutionPDEDeformableRegistration<FixedImageType, MovingImageType, DeformationFieldType> MultiResolutionRegistrationType; 
+    typedef typename  RegistrationFilterType::DisplacementFieldType DisplacementFieldType;
+    typedef clitk::MultiResolutionPDEDeformableRegistration<FixedImageType, MovingImageType, DisplacementFieldType> MultiResolutionRegistrationType;
     typedef CommandResolutionLevelUpdate<MultiResolutionRegistrationType> LevelObserver;
     
   protected:
@@ -335,7 +335,13 @@ namespace clitk
     // =======================================================
     // 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 );
@@ -343,8 +349,14 @@ namespace clitk
     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
     //------------------------------------
@@ -533,7 +545,7 @@ namespace clitk
     //JV TODO
     // pdeFilter->SetMaximumError(m_ArgsInfo.maxError_arg);
     // pdeFilter->SetMaximumKernelWidth(m_ArgsInfo.maxError_arg);
-    pdeFilter->SetSmoothDeformationField(!m_ArgsInfo.fluid_flag);
+    pdeFilter->SetSmoothDisplacementField(!m_ArgsInfo.fluid_flag);
     pdeFilter->SetSmoothUpdateField(m_ArgsInfo.fluid_flag);
     pdeFilter->SetUseImageSpacing( m_ArgsInfo.spacing_flag );
 
@@ -599,7 +611,7 @@ namespace clitk
     typedef itk::WarpImageFilter< MovingImageType, FixedImageType, DeformationFieldType >    WarpFilterType;
     typename WarpFilterType::Pointer warp = WarpFilterType::New();
 
-    warp->SetDeformationField( deformationField );
+    warp->SetDisplacementField( deformationField );
     warp->SetInput( movingImageReader->GetOutput() );
     warp->SetOutputOrigin(  fixedImage->GetOrigin() );
     warp->SetOutputSpacing( fixedImage->GetSpacing() );