]> Creatis software - clitk.git/commitdiff
COMP: fix compilation errors for ITKv5
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 10 Apr 2018 12:29:04 +0000 (14:29 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 10 Apr 2018 12:29:04 +0000 (14:29 +0200)
20 files changed:
common/clitkImageCommon.cxx
common/clitkImageToImageGenericFilterBase.cxx
registration/clitkAffineRegistrationGenericFilter.cxx
registration/clitkBLUTDIRGenericFilter.cxx
registration/clitkConvertBLUTCoeffsToVFFilter.txx
registration/clitkGenericMetric.txx
registration/clitkMultiResolutionPDEDeformableRegistration.txx
segmentation/clitkExtractBonesGenericFilter.txx
tools/clitkAnisotropicDiffusionGenericFilter.cxx
tools/clitkCropImageGenericFilter.cxx
tools/clitkImageArithmGenericFilter.txx
tools/clitkImageGradientMagnitudeGenericFilter.txx
tools/clitkImageIntensityWindowingGenericFilter.txx
tools/clitkImageLaplacianGenericFilter.txx
tools/clitkNormalizeImageFilterGenericFilter.txx
tools/clitkSplitImageGenericFilter.cxx
tools/clitkVFResampleGenericFilter.cxx
tools/clitkVectorArithmGenericFilter.txx
vv/vvMeshActor.cxx
vv/vvMeshActor.h

index 83b9435854ef3f7bec71e764ccee787ba314e0f9..9193160096169859f7a670bd8363eb1e44813669 100644 (file)
@@ -66,7 +66,7 @@ itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename, b
   if (!reader) {
     if (exit_on_error) { //default behavior for tools who don't handle the problem
       clitkExceptionMacro("Error reading file " << filename << ", exiting immediately");
-    } else return NULL;
+    } else return (itk::ImageIOBase *) ITK_NULLPTR;
   }
   reader->SetFileName(filename);
   reader->ReadImageInformation();
index 9db15b0902513c78b26992e788f43ac4cae18381..c538ac0d196a3773508918f110b093785a8be7e8 100644 (file)
@@ -412,7 +412,7 @@ typename ImageType::Pointer clitk::ImageToImageGenericFilterBase::GetInput(unsig
       return typename ImageType::Pointer(const_cast<ImageType*>(vvImageToITK<ImageType>(m_InputVVImages[n]).GetPointer()));
     else {
       assert(false); //No input, this shouldn't happen
-      return typename ImageType::Pointer(NULL);
+      return typename ImageType::Pointer((ImageType*)ITK_NULLPTR);
     }
   }
 }
index f369e0506e838492f560f5f8e525771bf8cd377c..17ebca95a720d5ec84b78286672fbdae2340dd05 100644 (file)
@@ -321,7 +321,7 @@ void AffineRegistrationGenericFilter::UpdateWithInputImageType()
   // If given, we connect a mask to reference or target
   //============================================================================
   typedef itk::ImageMaskSpatialObject<  InputImageType::ImageDimension >   MaskType;
-  typename MaskType::Pointer  fixedMask=NULL;
+  typename MaskType::Pointer  fixedMask=ITK_NULLPTR;
   if (m_ArgsInfo.referenceMask_given) {
     fixedMask= MaskType::New();
     typedef itk::Image< unsigned char, InputImageType::ImageDimension >   ImageMaskType;
@@ -342,7 +342,7 @@ void AffineRegistrationGenericFilter::UpdateWithInputImageType()
   }
 
   typedef itk::ImageMaskSpatialObject<  InputImageType::ImageDimension >   MaskType;
-  typename MaskType::Pointer  movingMask=NULL;
+  typename MaskType::Pointer  movingMask=ITK_NULLPTR;
   if (m_ArgsInfo.targetMask_given) {
     movingMask= MaskType::New();
     typedef itk::Image< unsigned char, InputImageType::ImageDimension >   ImageMaskType;
index 60cd30db0bc21024e3c187d642062be4b4bb88fe..35ac6eb9e58b52d5baa09d255108657b83beaf8b 100644 (file)
@@ -246,7 +246,7 @@ namespace clitk
           m_CommandIterationUpdate->SetOptimizer(m_GenericOptimizer);
 
           // Set the previous transform parameters to the registration
-          // if(m_Initializer->m_Parameters!=NULL )delete m_Initializer->m_Parameters;
+          // if(m_Initializer->m_Parameters!=ITK_NULLPTR )delete m_Initializer->m_Parameters;
           m_Initializer->SetInitialParameters(currentCoefficientImages, *newParameters);
           registration->SetInitialTransformParametersOfNextLevel(*newParameters);
         }
@@ -338,8 +338,8 @@ namespace clitk
       //============================================================================
       typedef itk::ImageMaskSpatialObject< InputImageType::ImageDimension >   MaskType;
       typedef itk::Image< unsigned char, InputImageType::ImageDimension >   ImageLabelType;
-      typename MaskType::Pointer        fixedMask = NULL;
-      typename ImageLabelType::Pointer  labels = NULL;
+      typename MaskType::Pointer        fixedMask = ITK_NULLPTR;
+      typename ImageLabelType::Pointer  labels = ITK_NULLPTR;
       if (m_ArgsInfo.referenceMask_given)
       {
         fixedMask = MaskType::New();
@@ -413,7 +413,7 @@ namespace clitk
       }
 
       typedef itk::ImageMaskSpatialObject< InputImageType::ImageDimension >   MaskType;
-      typename MaskType::Pointer  movingMask=NULL;
+      typename MaskType::Pointer  movingMask=ITK_NULLPTR;
       if (m_ArgsInfo.targetMask_given)
       {
         movingMask= MaskType::New();
@@ -486,7 +486,7 @@ namespace clitk
       // Rigid or Affine Transform
       //=======================================================
       typedef itk::AffineTransform <double,3> RigidTransformType;
-      RigidTransformType::Pointer rigidTransform=NULL;
+      RigidTransformType::Pointer rigidTransform=ITK_NULLPTR;
       if (m_ArgsInfo.initMatrix_given)
       {
         if(m_Verbose) std::cout<<"Reading the prior transform matrix "<< m_ArgsInfo.initMatrix_arg<<"..."<<std::endl;
@@ -623,7 +623,7 @@ namespace clitk
         sTransform->SetGridRegion( transform->GetTransforms()[0]->GetGridRegion() );
         sTransform->SetParameters( transform->GetTransforms()[0]->GetParameters() );
         regTransform = sTransform;
-        transform = NULL; // free memory
+        transform = ITK_NULLPTR; // free memory
       }
 
       //=======================================================
@@ -795,9 +795,9 @@ namespace clitk
       typename ConvertorType::Pointer filter= ConvertorType::New();
       filter->SetNumberOfThreads(1);
       if(m_ArgsInfo.itkbspline_flag)
-        sTransform->SetBulkTransform(NULL);
+        sTransform->SetBulkTransform(ITK_NULLPTR);
       else
-        transform->SetBulkTransform(NULL);
+        transform->SetBulkTransform(ITK_NULLPTR);
       filter->SetTransform(regTransform);
 #if ITK_VERSION_MAJOR > 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR >= 6)
       filter->SetReferenceImage(fixedImage);
index 9bda80f8ec0aa03d38b9031875955bc6fc5b584d..da20e6b9879e310a37a4072467de76a77d551e78 100644 (file)
@@ -107,7 +107,7 @@ namespace clitk
 
       // Mask
       typedef itk::ImageMaskSpatialObject<BLUTCoefficientImageType::ImageDimension >   MaskType;
-      typename MaskType::Pointer  spatialObjectMask=NULL;
+      typename MaskType::Pointer  spatialObjectMask=ITK_NULLPTR;
       if (!m_MaskFileName.empty())
       {
           typedef itk::Image< unsigned char, BLUTCoefficientImageType::ImageDimension >   ImageMaskType;
index 852c19f858b833fef34d584642e6b14ff52e50ae..d4a19c26d5f15a733e4838b3b6cfa1f110e78d72 100644 (file)
@@ -31,13 +31,13 @@ namespace clitk
 template <class args_info_type, class FixedImageType, class MovingImageType>
 GenericMetric<args_info_type, FixedImageType, MovingImageType>::GenericMetric()
 {
-  m_Metric=NULL;
+  m_Metric=ITK_NULLPTR;
   m_Maximize=false;
   m_Verbose=false;
   m_FixedImageRegionGiven=false;
   m_FixedImageSamplesIntensityThreshold=0;
   m_UseFixedImageSamplesIntensityThreshold=false;
-  m_FixedImageMask=NULL;
+  m_FixedImageMask=ITK_NULLPTR;
 }
 
 
@@ -255,7 +255,7 @@ GenericMetric<args_info_type,FixedImageType, MovingImageType>::GetMetricPointer(
 
 
   typedef itk::ImageMaskSpatialObject<itkGetStaticConstMacro(FixedImageDimension)> ImageMaskSpatialObjectType;
-  typename ImageMaskSpatialObjectType::ConstPointer mask = NULL;
+  typename ImageMaskSpatialObjectType::ConstPointer mask = ITK_NULLPTR;
   if (m_FixedImageMask.IsNotNull())
     mask = dynamic_cast<const ImageMaskSpatialObjectType*>(m_FixedImageMask.GetPointer());
 
index 43fd978b92e8e39bcc8020a30ef33ded70c86855..c8312e6e173085225a1a53181e01897c83123a6c 100644 (file)
@@ -43,7 +43,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 +219,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();
 
@@ -266,7 +266,7 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
   unsigned int fixedLevel = vnl_math_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 +323,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 +335,7 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
       
       if( tempField.IsNull() )
        {
-         m_RegistrationFilter->SetInitialDisplacementField( NULL );
+         m_RegistrationFilter->SetInitialDisplacementField( ITK_NULLPTR );
        }
       else
        {
@@ -353,7 +353,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();
 
@@ -430,9 +430,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();
 
 }
index c2efe5222ef30612463251afc27f16a231594996..47734300ea11185ba25dbcbb2509a8179a268944 100644 (file)
@@ -38,7 +38,7 @@ template<class ArgsInfoType>
 template<unsigned int Dim>
 void clitk::ExtractBonesGenericFilter<ArgsInfoType>::InitializeImageType() 
 {  
-  ADD_IMAGE_TYPE(Dim, short);
+  //ADD_IMAGE_TYPE(Dim, short);
   // ADD_IMAGE_TYPE(Dim, int);
   ADD_IMAGE_TYPE(Dim, float);
 }
index 408fe7fc654a58f3a49d56496588c33cd463a959..0960891f236f340898174be5c605f555ab3467f2 100644 (file)
@@ -44,7 +44,8 @@ AnisotropicDiffusionGenericFilter::AnisotropicDiffusionGenericFilter():
 template<unsigned int Dim>
 void AnisotropicDiffusionGenericFilter::InitializeImageType()
 {
-  ADD_DEFAULT_IMAGE_TYPES(Dim);
+  ADD_IMAGE_TYPE(Dim, float);
+  ADD_IMAGE_TYPE(Dim, double);
 }
 //--------------------------------------------------------------------
 
index c3343f6d3913b073a5bdec7070676e75366cf8ed..4adcb9bfadbae4ea0f1b5bc7fa6b9a385990f42e 100644 (file)
@@ -69,7 +69,7 @@ typename clitk::CropImageGenericFilter::AutoCrop<ImageType>::ImagePointer
 clitk::CropImageGenericFilter::AutoCrop<ImageType>::Do(args_info_type &, ImagePointer, PixelDimType<Dim> *)
 {
   clitkExceptionMacro("Autocrop is not implemented for vector fields");
-  return NULL;
+  return ITK_NULLPTR;
 }
 //--------------------------------------------------------------------
 
index eecbbccda4a9d83c16cec524efb9c0fb4eeb2497..ba1fc6f6eaa672aceb28d5186d7d708037544ca4 100644 (file)
@@ -109,7 +109,7 @@ void ImageArithmGenericFilter<args_info_type>::UpdateWithInputImageType()
   IteratorType it(input1, input1->GetLargestPossibleRegion());
 
   // typedef input2
-  typename ImageType::Pointer input2 = NULL;
+  typename ImageType::Pointer input2 = ITK_NULLPTR;
   IteratorType it2;
 
   // Special case for normalisation
index 1df5601732e76c5fd40683697039f841468edb33..7aecf99025de8963c95ffbedae28c342f999becd 100644 (file)
@@ -102,7 +102,7 @@ namespace clitk
         // Reading input
         typename InputImageType::Pointer input = this->template GetInput<InputImageType>(0);
 
-        typename MaskImageType::Pointer mask = NULL;
+        typename MaskImageType::Pointer mask = ITK_NULLPTR;
         if(mArgsInfo.mask_given) {
             mask = this->template GetInput<MaskImageType>(1);
         }
index 02f4acd3d07a01289abdae66d4c010a8a0a50fc6..96f7c7e65c4f0caea053c7e1053141c53717de1c 100644 (file)
@@ -95,7 +95,7 @@ ImageIntensityWindowingGenericFilter<args_info_type>::UpdateWithInputImageType()
   // Reading input
   typename OutputImageType::Pointer input = this->template GetInput<OutputImageType>(0);
 
-  typename MaskImageType::Pointer mask = NULL;
+  typename MaskImageType::Pointer mask = ITK_NULLPTR;
   if(mArgsInfo.mask_given) {
    mask = this->template GetInput<MaskImageType>(1);
   }
index ba36d18e0e0a77735b0aff4a32556276b91fbfb0..4ff1ef342f5855614946406c75c8fdb97a7cd5aa 100644 (file)
@@ -102,7 +102,7 @@ ImageLaplacianGenericFilter<args_info_type>::UpdateWithInputImageType()
     castFilter->SetInput(input);
     castFilter->Update();
 
-    typename MaskImageType::Pointer mask = NULL;
+    typename MaskImageType::Pointer mask = ITK_NULLPTR;
     if(mArgsInfo.mask_given) {
         mask = this->template GetInput<MaskImageType>(1);
     }
index 99a43a464ad8157367caf9f5ed7e301b0736ac64..e6911afde54adce2a07e5a3656d18520ca235b43 100644 (file)
@@ -94,7 +94,7 @@ namespace clitk
         // Reading input
         typename InputImageType::Pointer input = this->template GetInput<InputImageType>(0);
 
-        typename MaskImageType::Pointer mask = NULL;
+        typename MaskImageType::Pointer mask = ITK_NULLPTR;
         if(mArgsInfo.mask_given) {
             mask = this->template GetInput<MaskImageType>(1);
         }
index a73d3080e359d06eb462b26b589d32974b789334..58732ab27af434a5f5e2a4b9996bc173347953b4 100644 (file)
@@ -54,7 +54,7 @@ clitk::SplitImageGenericFilter::PngConversion<ImageType>::Do(double window,
                                                              ImagePointer input)
 {
   static const unsigned int PixelDimension = itk::PixelTraits<typename ImageType::PixelType>::Dimension;
-  return this->Do(window, level, input, static_cast< PixelDimType<PixelDimension> *>(NULL) );
+  return this->Do(window, level, input, static_cast< PixelDimType<PixelDimension> *>(ITK_NULLPTR) );
 }
 //--------------------------------------------------------------------
 
@@ -68,7 +68,7 @@ clitk::SplitImageGenericFilter::PngConversion<ImageType>::Do(double window,
                                                              PixelDimType<Dim> *)
 {
   clitkExceptionMacro("Png conversion is not implemented for vector fields");
-  return NULL;
+  return ITK_NULLPTR;
 }
 //--------------------------------------------------------------------
 
index 4175215526c030e19e5ba3c32d7bccd25ee79ce2..d287fec36e0b4047b64c7c5490b59536afcdb810 100644 (file)
@@ -92,17 +92,17 @@ clitk::VFResampleGenericFilter::ComputeImage(typename ImageType::Pointer inputIm
   static unsigned int dim = ImageType::ImageDimension;
   if (mOutputSize.size() != dim) {
     std::cerr << "Please set size with " << dim << " dimensions." << std::endl;
-    return NULL;
+    return ITK_NULLPTR;
   }
   if (mOutputSpacing.size() != dim) {
     std::cerr << "Please set spacing with " << dim << " dimensions." << std::endl;
-    return NULL;
+    return ITK_NULLPTR;
   }
   mOutputOrigin.resize(dim);
 
   if (mApplyGaussianFilterBefore && mSigma.size() != dim) {
     std::cerr << "Please set sigma with " << dim << " dimensions." << std::endl;
-    return NULL;
+    return ITK_NULLPTR;
   }
 
   // Some typedefs
index 50e36dda17fae29dfcc7e4d973765b6b51562786..b4d61279a86602d3ca1337949a89a60b288ba01a 100644 (file)
@@ -118,7 +118,7 @@ void VectorArithmGenericFilter<args_info_type>::UpdateWithInputImageType()
   IteratorType it(input1, input1->GetLargestPossibleRegion());
 
   // typedef input2
-  typename ImageType::Pointer input2 = NULL;
+  typename ImageType::Pointer input2 = ITK_NULLPTR;
   IteratorType it2;
 
   // Special case for normalisation
index 1d6f19b2465cf680439c19a440b890c4cd96f4b2..b3d3c7f24b2b18fee32a4624d794228cdea29f3e 100644 (file)
@@ -27,9 +27,9 @@
 #include <cassert>
 
 vvMeshActor::vvMeshActor() :
-  mCutDimension(0), mMesh(NULL),
-  mMarching(NULL), mMapper(NULL),
-  mActor(NULL),
+  mCutDimension(0), mMesh(ITK_NULLPTR),
+  mMarching(ITK_NULLPTR), mMapper(ITK_NULLPTR),
+  mActor(ITK_NULLPTR),
   mSuperpostionMode(false), mTimeSlice(0)
 {}
 
index 61cee8fcd1a9cdb00b07b48cb46b07f92d0b1825..37bb0dcc69376ed53056c71811bed04d889d7237 100644 (file)
@@ -37,7 +37,7 @@ public:
     void SetCutSlice(double slice);
     /**Initialize the actor and set the inputs. If vf is not null, will use
      **it to propagate the contour on all time frames */ 
-    void Init(vvMesh::Pointer mesh,int time_slice, vvImage::Pointer vf=NULL);
+    void Init(vvMesh::Pointer mesh,int time_slice, vvImage::Pointer vf=ITK_NULLPTR);
     ///Set the time slice (only useful when using a 4D contour)
     void SetTimeSlice(int time);
     ///Toggles between normal 4D mode and superposition mode