]> Creatis software - clitk.git/blobdiff - registration/clitkMultiResolutionPDEDeformableRegistration.txx
Debug RTStruct conversion with empty struc
[clitk.git] / registration / clitkMultiResolutionPDEDeformableRegistration.txx
index 43fd978b92e8e39bcc8020a30ef33ded70c86855..73cb497f90607af1fdf4f599ac8c16482bb2e347 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "itkRecursiveMultiResolutionPyramidImageFilter.h"
 #include "itkImageRegionIterator.h"
-#include "vnl/vnl_math.h"
 
 namespace clitk {
 
@@ -43,7 +42,7 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
   m_MovingImagePyramid  = MovingImagePyramidType::New();
   m_FixedImagePyramid     = FixedImagePyramidType::New();
   m_FieldExpander     = FieldExpanderType::New();
-  m_InitialDeformationField = NULL;
+  m_InitialDeformationField = ITK_NULLPTR;
 
   m_NumberOfLevels = 3;
   m_NumberOfIterations.resize( m_NumberOfLevels );
@@ -219,7 +218,7 @@ void
 MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationField,TRealType>
 ::GenerateData()
 {
-  // Check for NULL images and pointers
+  // Check for ITK_NULLPTR images and pointers
   MovingImageConstPointer movingImage = this->GetMovingImage();
   FixedImageConstPointer  fixedImage = this->GetFixedImage();
 
@@ -260,13 +259,13 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
   m_CurrentLevel = 0;
   m_StopRegistrationFlag = false;
 
-  unsigned int movingLevel = vnl_math_min( (int) m_CurrentLevel, 
+  unsigned int movingLevel = std::min( (int) m_CurrentLevel,
                                           (int) m_MovingImagePyramid->GetNumberOfLevels() );
 
-  unsigned int fixedLevel = vnl_math_min( (int) m_CurrentLevel, 
+  unsigned int fixedLevel = std::min( (int) m_CurrentLevel,
                                          (int) m_FixedImagePyramid->GetNumberOfLevels() );
 
-  DeformationFieldPointer tempField = NULL;
+  DeformationFieldPointer tempField = ITK_NULLPTR;
 
   DeformationFieldPointer inputPtr =
     const_cast< DeformationFieldType * >( this->GetInput(0) );
@@ -323,7 +322,7 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
     m_FieldExpander->SetOutputDirection( fi->GetDirection());
 
     m_FieldExpander->UpdateLargestPossibleRegion();
-    m_FieldExpander->SetInput( NULL );
+    m_FieldExpander->SetInput( ITK_NULLPTR );
     tempField = m_FieldExpander->GetOutput();
     tempField->DisconnectPipeline();
     }
@@ -335,7 +334,7 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
       
       if( tempField.IsNull() )
        {
-         m_RegistrationFilter->SetInitialDisplacementField( NULL );
+         m_RegistrationFilter->SetInitialDisplacementField( ITK_NULLPTR );
        }
       else
        {
@@ -353,7 +352,7 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
       m_FieldExpander->SetOutputSpacing( fi->GetSpacing());
 
       m_FieldExpander->UpdateLargestPossibleRegion();
-      m_FieldExpander->SetInput( NULL );
+      m_FieldExpander->SetInput( ITK_NULLPTR );
       tempField = m_FieldExpander->GetOutput();
       tempField->DisconnectPipeline();
 
@@ -387,9 +386,9 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
 
     // Increment level counter.  
     m_CurrentLevel++;
-    movingLevel = vnl_math_min( (int) m_CurrentLevel, 
+    movingLevel = std::min( (int) m_CurrentLevel,
                                (int) m_MovingImagePyramid->GetNumberOfLevels() );
-    fixedLevel = vnl_math_min( (int) m_CurrentLevel, 
+    fixedLevel = std::min( (int) m_CurrentLevel,
                               (int) m_FixedImagePyramid->GetNumberOfLevels() );
 
     // We can release data from pyramid which are no longer required.
@@ -430,9 +429,9 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
       }
 
     // Release memory
-    m_FieldExpander->SetInput( NULL );
+    m_FieldExpander->SetInput( ITK_NULLPTR );
     m_FieldExpander->GetOutput()->ReleaseData();
-    m_RegistrationFilter->SetInput( NULL );
+    m_RegistrationFilter->SetInput( ITK_NULLPTR );
     m_RegistrationFilter->GetOutput()->ReleaseData();
 
 }