X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FclitkAffineRegistrationGenericFilter.cxx;h=d034912f7eea9497942f11d63100bfcde79e2760;hb=b50c4ae3e2850ad593d2c991b56e04ed22748f99;hp=6b0ecffbfdba87541e128945fceae0b13a0fcd5d;hpb=99d643fbdd3571c562f90b47a2a8790c4aead5f8;p=clitk.git diff --git a/registration/clitkAffineRegistrationGenericFilter.cxx b/registration/clitkAffineRegistrationGenericFilter.cxx index 6b0ecff..d034912 100644 --- a/registration/clitkAffineRegistrationGenericFilter.cxx +++ b/registration/clitkAffineRegistrationGenericFilter.cxx @@ -45,11 +45,11 @@ public: } // Execute - void Execute(itk::Object *caller, const itk::EventObject & event) { + void Execute(itk::Object *caller, const itk::EventObject & event) ITK_OVERRIDE { Execute( (const itk::Object *)caller, event); } - void Execute(const itk::Object * object, const itk::EventObject & event) { + void Execute(const itk::Object * object, const itk::EventObject & event) ITK_OVERRIDE { if ( !(itk::IterationEvent().CheckEvent( &event )) ) { return; } @@ -108,7 +108,7 @@ public: // Two arguments are passed to the Execute() method: the first // is the pointer to the object which invoked the event and the // second is the event that was invoked. - void Execute(itk::Object * object, const itk::EventObject & event) { + void Execute(itk::Object * object, const itk::EventObject & event) ITK_OVERRIDE { if ( !(itk::IterationEvent().CheckEvent( &event )) ) { return; } @@ -138,7 +138,7 @@ public: } } - void Execute(const itk::Object * , const itk::EventObject & ) { + void Execute(const itk::Object * , const itk::EventObject & ) ITK_OVERRIDE { return; } @@ -175,11 +175,8 @@ void AffineRegistrationGenericFilter::UpdateWithInputImageType() typedef typename InputImageType::PixelType PixelType; //typedef typename InputImageType::ImageDimension Dimension; - -#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4 bool threadsGiven=m_ArgsInfo.threads_given; int threads=m_ArgsInfo.threads_arg; -#endif //Coordinate Representation typedef double TCoordRep; @@ -324,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; @@ -345,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; @@ -396,11 +393,13 @@ void AffineRegistrationGenericFilter::UpdateWithInputImageType() typename MetricType::Pointer metric=genericMetric->GetMetricPointer(); if (movingMask) metric->SetMovingImageMask(movingMask); -#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4 - if (threadsGiven) metric->SetNumberOfThreads( threads ); + if (threadsGiven) { +#if ITK_VERSION_MAJOR <= 4 + metric->SetNumberOfThreads( threads ); #else - if (m_Verbose) std::cout<<"Not setting the number of threads (not compiled with USE_OPTIMIZED_REGISTRATION_METHODS)..."<SetNumberOfWorkUnits( threads ); #endif + } //============================================================================ // Initialize using image moments. @@ -541,11 +540,7 @@ void AffineRegistrationGenericFilter::UpdateWithInputImageType() if (m_Verbose) std::cout << "Starting the registration now..." << std::endl; try { -#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 2) - registration->StartRegistration(); -#else registration->Update(); -#endif } catch ( itk::ExceptionObject & err ) { std::cerr << "ExceptionObject caught !" << std::endl; std::cerr << err << std::endl;