diff --git a/Code/Algorithms/ITK/include/mapITKMattesMutualInformationImageToImageMetric.h b/Code/Algorithms/ITK/include/mapITKMattesMutualInformationImageToImageMetric.h index 6631f40..dd2b135 100644 --- a/Code/Algorithms/ITK/include/mapITKMattesMutualInformationImageToImageMetric.h +++ b/Code/Algorithms/ITK/include/mapITKMattesMutualInformationImageToImageMetric.h @@ -1,87 +1,88 @@ // ----------------------------------------------------------------------- // MatchPoint - DKFZ translational registration framework // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See mapCopyright.txt or // http://www.dkfz.de/en/sidt/projects/MatchPoint/copyright.html // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file // @version $Revision$ (last changed revision) // @date $Date$ (last change date) // @author $Author$ (last changed by) // Subversion HeadURL: $HeadURL$ */ #ifndef __MAP_ITK_MATTES_MUTUAL_INFORMATION_IMAGE_TO_IMAGE_METRIC_H #define __MAP_ITK_MATTES_MUTUAL_INFORMATION_IMAGE_TO_IMAGE_METRIC_H #include "mapITKMetricControl.h" #include "mapITKImageToImageMetricControlBase.h" #include "itkMattesMutualInformationImageToImageMetric.h" namespace map { namespace algorithm { namespace itk { + using LightObject = ::itk::LightObject; /*! This class is the template specialization for the itk::MattesMutualInformationImageToImageMetric. @ingroup ITK @ingroup MetricControl */ template class ITKMetricControl< ::itk::MattesMutualInformationImageToImageMetric > : public ITKImageToImageMetricControlBase< ::itk::MattesMutualInformationImageToImageMetric > { public: typedef ITKMetricControl< ::itk::MattesMutualInformationImageToImageMetric > Self; typedef ITKImageToImageMetricControlBase< ::itk::MattesMutualInformationImageToImageMetric > Superclass; using Pointer = ::itk::SmartPointer; using ConstPointer = ::itk::SmartPointer; itkTypeMacro(ITKMetricControl, ITKImageToImageMetricControlBase); itkNewMacro(Self); virtual bool getMinimizeToOptimize() const { return true; }; virtual bool getMaximizeToOptimize() const { return false; }; protected: virtual ~ITKMetricControl() { Superclass::_spMetric->ReinitializeSeed(); }; ITKMetricControl() {}; private: //No copy constructor allowed ITKMetricControl(const Self& source); void operator=(const Self&); //purposely not implemented }; } // namespace itk } // namespace algorithm } // namespace map #endif diff --git a/Code/Algorithms/ITK/include/mapITKMeanSquaresImageToImageMetric.h b/Code/Algorithms/ITK/include/mapITKMeanSquaresImageToImageMetric.h index 8cd7051..65a0823 100644 --- a/Code/Algorithms/ITK/include/mapITKMeanSquaresImageToImageMetric.h +++ b/Code/Algorithms/ITK/include/mapITKMeanSquaresImageToImageMetric.h @@ -1,84 +1,85 @@ // ----------------------------------------------------------------------- // MatchPoint - DKFZ translational registration framework // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See mapCopyright.txt or // http://www.dkfz.de/en/sidt/projects/MatchPoint/copyright.html // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file // @version $Revision$ (last changed revision) // @date $Date$ (last change date) // @author $Author$ (last changed by) // Subversion HeadURL: $HeadURL$ */ #ifndef __MAP_ITK_MEAN_SQUARES_IMAGE_TO_IMAGE_METRIC_CONTROL_H #define __MAP_ITK_MEAN_SQUARES_IMAGE_TO_IMAGE_METRIC_CONTROL_H #include "mapITKMetricControl.h" #include "mapITKImageToImageMetricControlBase.h" #include "itkMeanSquaresImageToImageMetric.h" namespace map { namespace algorithm { namespace itk { + using LightObject = ::itk::LightObject; /*! This class is the template specialization for the itk::MeanSquaresImageToImageMetric. @ingroup ITK @ingroup MetricControl */ template class ITKMetricControl< ::itk::MeanSquaresImageToImageMetric > : public ITKImageToImageMetricControlBase< ::itk::MeanSquaresImageToImageMetric > { public: typedef ITKMetricControl< ::itk::MeanSquaresImageToImageMetric > Self; typedef ITKImageToImageMetricControlBase< ::itk::MeanSquaresImageToImageMetric > Superclass; typedef ::itk::SmartPointer Pointer; typedef ::itk::SmartPointer ConstPointer; itkTypeMacro(ITKMetricControl, ITKImageToImageMetricControlBase); itkNewMacro(Self); virtual bool getMinimizeToOptimize() const { return true; }; virtual bool getMaximizeToOptimize() const { return false; }; protected: virtual ~ITKMetricControl() {}; ITKMetricControl() {}; private: //No copy constructor allowed ITKMetricControl(const Self& source); void operator=(const Self&); //purposely not implemented }; } } } #endif diff --git a/Code/Algorithms/ITK/include/mapITKRegularStepGradientDescentOptimizer.h b/Code/Algorithms/ITK/include/mapITKRegularStepGradientDescentOptimizer.h index 5554059..1aef674 100644 --- a/Code/Algorithms/ITK/include/mapITKRegularStepGradientDescentOptimizer.h +++ b/Code/Algorithms/ITK/include/mapITKRegularStepGradientDescentOptimizer.h @@ -1,170 +1,172 @@ // ----------------------------------------------------------------------- // MatchPoint - DKFZ translational registration framework // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See mapCopyright.txt or // http://www.dkfz.de/en/sidt/projects/MatchPoint/copyright.html // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file // @version $Revision$ (last changed revision) // @date $Date$ (last change date) // @author $Author$ (last changed by) // Subversion HeadURL: $HeadURL$ */ #ifndef __ITK_REGULAR_STEP_GRADIENT_DESCENT_OPTIMIZER_CONTROL_H #define __ITK_REGULAR_STEP_GRADIENT_DESCENT_OPTIMIZER_CONTROL_H #include "mapITKOptimizerControl.h" #include "mapITKSVNLOptimizerControlBase.h" #include "itkRegularStepGradientDescentOptimizer.h" namespace map { namespace algorithm { namespace itk { + using LightObject = ::itk::LightObject; + template using ObjectFactory = ::itk::ObjectFactory; /*! This class is the template specialization for the itk::PowellOptimizer. @ingroup ITK @ingroup OptimizerControl */ template<> class ITKOptimizerControl< ::itk::RegularStepGradientDescentOptimizer> : public ITKSVNLOptimizerControlBase< ::itk::RegularStepGradientDescentOptimizer> { public: using Self = ITKOptimizerControl< ::itk::RegularStepGradientDescentOptimizer>; using Superclass = ITKSVNLOptimizerControlBase< ::itk::RegularStepGradientDescentOptimizer>; using Pointer = ::itk::SmartPointer; using ConstPointer = ::itk::SmartPointer; itkTypeMacro(ITKOptimizerControl, ITKSVNLOptimizerControlBase); itkNewMacro(Self); using ConcreteOptimizerType = Superclass::ConcreteOptimizerType; using ConcreteOptimizerPointer = ConcreteOptimizerType::Pointer; protected: ~ITKOptimizerControl() override = default; ITKOptimizerControl() = default; private: //No copy constructor allowed ITKOptimizerControl(const Self& source) = delete; void operator=(const Self&) = delete; //purposely not implemented public: bool isStoppable() const override { return true; }; bool hasIterationCount() const override { return true; }; bool hasMaxIterationCount() const override { return true; }; bool hasCurrentValue() const override { return true; }; bool canMinimize() const override { return true; }; bool canMaximize() const override { return true; }; bool getMinimize() const override { return _spOptimizer->GetMinimize(); }; bool getMaximize() const override { return _spOptimizer->GetMaximize(); }; void setMinimize(bool minimize) override { _spOptimizer->SetMinimize(minimize); }; void setMaximize(bool maximize) override { _spOptimizer->SetMaximize(maximize); }; protected: bool doStop() override { _spOptimizer->StopOptimization(); return true; }; IterationCountType doGetCurrentIteration() const override { return _spOptimizer->GetCurrentIteration(); }; IterationCountType doGetMaxIterations() const override { return _spOptimizer->GetNumberOfIterations(); }; SVNLMeasureType doGetCurrentMeasure() const override { return _spOptimizer->GetValue(); }; void copyProperties(const ConcreteOptimizerType* source, ConcreteOptimizerType* destination) const override { Superclass::copyProperties(source, destination); destination->SetMaximize(source->GetMaximize()); destination->SetMaximumStepLength(source->GetMaximumStepLength()); destination->SetMinimumStepLength(source->GetMinimumStepLength()); destination->SetRelaxationFactor(source->GetRelaxationFactor()); destination->SetNumberOfIterations(source->GetNumberOfIterations()); destination->SetGradientMagnitudeTolerance(source->GetGradientMagnitudeTolerance()); }; Superclass::Pointer doCloneControl() const override { Pointer spClone = Self::New(); Superclass::Pointer spResult = spClone.GetPointer(); return spResult; }; }; using RegularStepGradientDescentOptimizerControl = ITKOptimizerControl< ::itk::RegularStepGradientDescentOptimizer>; } // namespace itk } // namespace algorithm } // namespace map #endif