]> Creatis software - clitk.git/commitdiff
itk4 Rename DeformationField to DisplacementField when necessary
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Mon, 29 Aug 2011 15:56:18 +0000 (17:56 +0200)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Mon, 29 Aug 2011 15:56:18 +0000 (17:56 +0200)
17 files changed:
registration/clitkBLUTDIRGenericFilter.cxx
registration/clitkBLUTDIRGenericFilter.h
registration/clitkConvertBSplineDeformableTransformToVFGenericFilter.cxx
registration/clitkConvertBSplineDeformableTransformToVFGenericFilter.h
registration/clitkDemonsDeformableRegistrationGenericFilter.txx
registration/clitkMatrixTransformToVFGenericFilter.h
registration/clitkMatrixTransformToVFGenericFilter.txx
registration/clitkMultiResolutionPDEDeformableRegistration.txx
registration/clitkShapedBLUTSpatioTemporalDIRGenericFilter.txx
tools/clitkBSplineCoefficientsToValuesGenericFilter.h
tools/clitkBSplineCoefficientsToValuesGenericFilter.txx
tools/clitkInvertVFGenericFilter.h
tools/clitkInvertVFGenericFilter.txx
tools/clitkJacobianImageGenericFilter.h
tools/clitkWarpImageGenericFilter.txx
vv/vvImageWarp.cxx
vv/vvMidPosition.cxx

index 15afacf1b475b6f734bee22854a01dc6d6625ae8..0822bd9f3f0c434325d4995ed711d8e3e6133ba3 100644 (file)
@@ -747,21 +747,25 @@ namespace clitk
       // Compute the DVF (only deformable transform)
       //=======================================================
       typedef itk::Vector< float, SpaceDimension >  DisplacementType;
-      typedef itk::Image< DisplacementType, InputImageType::ImageDimension >  DeformationFieldType;
-      typedef itk::TransformToDeformationFieldSource<DeformationFieldType, double> ConvertorType;
+      typedef itk::Image< DisplacementType, InputImageType::ImageDimension >  DisplacementFieldType;
+#if ITK_VERSION_MAJOR >= 4
+      typedef itk::TransformToDisplacementFieldSource<DisplacementFieldType, double> ConvertorType;
+#else
+      typedef itk::TransformToDeformationFieldSource<DisplacementFieldType, double> ConvertorType;
+#endif
       typename ConvertorType::Pointer filter= ConvertorType::New();
       filter->SetNumberOfThreads(1);
       transform->SetBulkTransform(NULL);
       filter->SetTransform(transform);
       filter->SetOutputParametersFromImage(fixedImage);
       filter->Update();
-      typename DeformationFieldType::Pointer field = filter->GetOutput();
+      typename DisplacementFieldType::Pointer field = filter->GetOutput();
 
 
       //=======================================================
       // Write the DVF
       //=======================================================
-      typedef itk::ImageFileWriter< DeformationFieldType >  FieldWriterType;
+      typedef itk::ImageFileWriter< DisplacementFieldType >  FieldWriterType;
       typename FieldWriterType::Pointer fieldWriter = FieldWriterType::New();
       fieldWriter->SetFileName( m_ArgsInfo.vf_arg );
       fieldWriter->SetInput( field );
index d867caababdff328074dc460770638c9368fc270..eda242f5b4d7d843a91cb2809dbbe319536d06db 100644 (file)
 #include "itkLabelGeometryImageFilter.h"
 #include "itkImageDuplicator.h"
 #include "itkExtractImageFilter.h"
-#include "itkTransformToDeformationFieldSource.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkTransformToDisplacementFieldSource.h"
+#else
+  #include "itkTransformToDeformationFieldSource.h"
+#endif
 
 namespace clitk
 {
index 261a9d8ac092fadd8786298a6e0fea3a675138dc..169de13db8d6fffe219c18b04adb3b3be160baab 100644 (file)
@@ -80,7 +80,11 @@ namespace clitk
     // -----------------------------------------------
     // Filter
     // -----------------------------------------------
+#if ITK_VERSION_MAJOR >= 4
+    typedef itk::TransformToDisplacementFieldSource<OutputImageType, double> ConvertorType;
+#else
     typedef itk::TransformToDeformationFieldSource<OutputImageType, double> ConvertorType;
+#endif
     ConvertorType::Pointer filter= ConvertorType::New();
 
     //Output image info
index e976f642a2039635856c1af7d4ed79370515ee9a..bcdf67ba43670a1b2b3efa0ca63f264d39ceb29e 100644 (file)
 //itk include
 #include "itkLightObject.h"
 #include "itkImageMaskSpatialObject.h"
-#include "itkTransformToDeformationFieldSource.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkTransformToDisplacementFieldSource.h"
+#else
+  #include "itkTransformToDeformationFieldSource.h"
+#endif
 
 
 namespace clitk 
index 90d5319717de2c7bcaf281599cf44104875a1e61..6132dc5897ae115d57fd9117e93cfd954a024307 100644 (file)
@@ -151,8 +151,12 @@ 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; 
+#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;
     
   protected:
@@ -533,7 +537,11 @@ namespace clitk
     //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 );
 
@@ -599,7 +607,11 @@ namespace clitk
     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() );
index 34648cb928e7035329a764b79c9f4b5ed8f67adc..717e938a4b667b86dfaebc3eea570d578789e222 100644 (file)
 
 //itk include
 #include "itkLightObject.h"
-#include "itkTransformToDeformationFieldSource.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkTransformToDisplacementFieldSource.h"
+#else
+  #include "itkTransformToDeformationFieldSource.h"
+#endif
 #include "itkAffineTransform.h"
 
 namespace clitk 
index 0540a134a12018a2935b6977435cba68fbe47596..ebc0e45c3ba6ba0beaf9d30dd05b5a954444ebad 100644 (file)
@@ -78,7 +78,11 @@ namespace clitk
     typedef itk::Image<Displacement, Dimension> OutputImageType;
     
     // Filter
+#if ITK_VERSION_MAJOR >= 4
+    typedef itk::TransformToDisplacementFieldSource<OutputImageType, double> ConvertorType;
+#else
     typedef itk::TransformToDeformationFieldSource<OutputImageType, double> ConvertorType;
+#endif
     typename   ConvertorType::Pointer filter= ConvertorType::New();
 
     // Output image info
index a10942c1db04dbc1c150d9d6ad66c4159c0b683f..5c6b0aeaf55c38e2e3361f2d683a15a4c7d1b927 100644 (file)
@@ -335,7 +335,11 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
       
       if( tempField.IsNull() )
        {
+#if ITK_VERSION_MAJOR >= 4
+         m_RegistrationFilter->SetInitialDisplacementField( NULL );
+#else
          m_RegistrationFilter->SetInitialDeformationField( NULL );
+#endif
        }
       else
        {
@@ -357,7 +361,11 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
       tempField = m_FieldExpander->GetOutput();
       tempField->DisconnectPipeline();
 
+#if ITK_VERSION_MAJOR >= 4
+      m_RegistrationFilter->SetInitialDisplacementField( tempField );
+#else
       m_RegistrationFilter->SetInitialDeformationField( tempField );
+#endif
 
       }
 
index 5434b228f470c0ba02ae2efe8aca47d43ce9e1f8..963fb7811cbc5f0d24d5298c6478ec01aac4d218 100644 (file)
@@ -819,7 +819,11 @@ namespace clitk
     typedef itk::WarpImageFilter< MovingImageType, FixedImageType, DeformationField4DType >    WarpFilterType;
     typename WarpFilterType::Pointer warp = WarpFilterType::New();
 
+#if ITK_VERSION_MAJOR >= 4
+    warp->SetDisplacementField( field4D );
+#else
     warp->SetDeformationField( field4D );
+#endif
     warp->SetInput( movingImageReader->GetOutput() );
     warp->SetOutputOrigin(  fixedImage->GetOrigin() );
     warp->SetOutputSpacing( fixedImage->GetSpacing() );
index ff102320daf38582f1a15afe40881b4a65bfbd4c..184cc4f4374bfb51f68bfad91b12da166b3433ca 100644 (file)
 #include "itkBSplineResampleImageFunction.h"
 #include "clitkVectorBSplineResampleImageFunction.h"
 #include "itkAddImageFilter.h"
-#include "itkTransformToDeformationFieldSource.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkTransformToDisplacementFieldSource.h"
+#else
+  #include "itkTransformToDeformationFieldSource.h"
+#endif
 
 namespace clitk 
 {
index a2156499773160bd62d6b430ac762688361ca22c..0111db24da506afa39a3bec1286af876104002df 100644 (file)
@@ -284,7 +284,11 @@ namespace clitk
     // Matrix Transform
     if(m_ArgsInfo.matrix_given)
       {
+#if ITK_VERSION_MAJOR >= 4
+       typedef itk::TransformToDisplacementFieldSource<OutputImageType, double> ConvertorType;
+#else
        typedef itk::TransformToDeformationFieldSource<OutputImageType, double> ConvertorType;
+#endif
        typename   ConvertorType::Pointer filter= ConvertorType::New();
        filter->SetOutputParametersFromImage(output);
        
index a3207984487684a769fcab7696af7ee5e7885b1d..012524c8fc266d817b9cda408cde4259def6d5d9 100644 (file)
 
 //itk include
 #include "itkLightObject.h"
-#include "itkInverseDeformationFieldImageFilter.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkInverseDisplacementFieldImageFilter.h"
+#else
+  #include "itkInverseDeformationFieldImageFilter.h"
+#endif
 
 namespace clitk 
 {
index b9641fad1f376cf85d7b046f36f95e01958b734b..9835c2e739f64d3edd1af378e7955efc43059ba7 100644 (file)
@@ -148,7 +148,11 @@ InvertVFGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
 
   case 1: {
     // Create the InverseDeformationFieldFilter
+#if ITK_VERSION_MAJOR >= 4
+    typedef itk::InverseDisplacementFieldImageFilter<InputImageType,OutputImageType> FilterType;
+#else
     typedef itk::InverseDeformationFieldImageFilter<InputImageType,OutputImageType> FilterType;
+#endif
     typename FilterType::Pointer filter =FilterType::New();
     filter->SetInput(input);
     filter->SetOutputOrigin(input->GetOrigin());
index f54971952d01ca30dc262b2cc6378464e55143a5..73e9b64a289653e1d503706ae7cbfcd6592deb43 100644 (file)
 
 //itk include
 #include "itkLightObject.h"
-#include "itkInverseDeformationFieldImageFilter.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkInverseDisplacementFieldImageFilter.h"
+#else
+  #include "itkInverseDeformationFieldImageFilter.h"
+#endif
 
 namespace clitk 
 {
index 2ecc5d5dc0eabf20fc3a23c9f99974e1099fbf95..8544df2ba33bf859c827513c4219ac8e6301a42b 100644 (file)
@@ -192,7 +192,11 @@ WarpImageGenericFilter::UpdateWithDimAndPixelType()
     //Backward mapping
     typedef itk::WarpImageFilter<InputImageType, InputImageType, DeformationFieldType> BackwardWarpFilterType;
     typename BackwardWarpFilterType::Pointer backwardWarpFilter= BackwardWarpFilterType::New();
+#if ITK_VERSION_MAJOR >= 4
+    backwardWarpFilter->SetDisplacementField( deformationField );
+#else
     backwardWarpFilter->SetDeformationField( deformationField );
+#endif
     backwardWarpFilter->SetEdgePaddingValue( static_cast<PixelType>(m_ArgsInfo.pad_arg) );
     backwardWarpFilter->SetOutputSpacing( deformationField->GetSpacing() );
     backwardWarpFilter->SetOutputOrigin( input->GetOrigin() );
index 1cfde1612b0ce77dacaf911b0d52dc9e584f4a8f..ff6580387a3c93aaef6c0af3a17c023f57a413d6 100644 (file)
@@ -101,7 +101,11 @@ void vvImageWarp::Update_WithDimAndPixelType()
     jacobian_filter->SetUseImageSpacingOn();
     vf_connector->SetInput(mVF->GetVTKImages()[num]);
     warp_filter->SetInput(input[num]);
+#if ITK_VERSION_MAJOR >= 4
+    warp_filter->SetDisplacementField(vf_connector->GetOutput());
+#else
     warp_filter->SetDeformationField(vf_connector->GetOutput());
+#endif
     jacobian_filter->SetInput(vf_connector->GetOutput());
     warp_filter->SetOutputSpacing(input[num]->GetSpacing());
     warp_filter->SetOutputOrigin(input[num]->GetOrigin());
index 88b176d360194d3406b462629225fde3be1f48f8..b4582e2275cb52ae8a59375329b537eda3fcfb11 100644 (file)
@@ -108,7 +108,11 @@ vvImage::Pointer WarpRefImage(OutputVFType::Pointer vf,vvImage::Pointer image,in
 
   typename FilterType::Pointer warp_filter = FilterType::New();
   warp_filter->SetInput(input);
+#if ITK_VERSION_MAJOR >= 4
+  warp_filter->SetDisplacementField(resampler->GetOutput());
+#else
   warp_filter->SetDeformationField(resampler->GetOutput());
+#endif
   warp_filter->SetOutputSpacing(input->GetSpacing());
   warp_filter->SetOutputOrigin(input->GetOrigin());
   warp_filter->SetOutputSize(input->GetLargestPossibleRegion().GetSize());