Loading...
Searching...
No Matches
itkFullSearchOptimizer.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkFullSearchOptimizer_h
#define itkFullSearchOptimizer_h
#include "itkSingleValuedNonLinearOptimizer.h"
#include "itkMapContainer.h"
#include "itkImage.h"
#include "itkArray.h"
#include "itkFixedArray.h"
namespace itk
{
class FullSearchOptimizer : public SingleValuedNonLinearOptimizer
{
public:
ITK_DISALLOW_COPY_AND_MOVE(FullSearchOptimizer);
using Self = FullSearchOptimizer;
using Superclass = SingleValuedNonLinearOptimizer;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(FullSearchOptimizer, SingleValuedNonLinearOptimizer);
enum StopConditionType
{
FullRangeSearched,
MetricError
};
/* Typedefs inherited from superclass */
using Superclass::ParametersType;
using Superclass::CostFunctionType;
using Superclass::CostFunctionPointer;
using Superclass::MeasureType;
using ParameterValueType = ParametersType::ValueType; // = double
using RangeValueType = ParameterValueType;
using RangeType = FixedArray<RangeValueType, 3>;
using SearchSpaceType = MapContainer<unsigned int, RangeType>;
using SearchSpacePointer = SearchSpaceType::Pointer;
using SearchSpaceIteratorType = SearchSpaceType::ConstIterator;
using SearchSpacePointType = Array<ParameterValueType>;
using SearchSpaceIndexType = Array<IndexValueType>;
using SearchSpaceSizeType = Array<SizeValueType>;
itkGetConstMacro(Maximize, bool);
itkSetMacro(Maximize, bool);
itkBooleanMacro(Maximize);
bool
GetMinimize() const
{
return !m_Maximize;
}
void
SetMinimize(bool v)
{
this->SetMaximize(!v);
}
void
MinimizeOn()
{
this->MaximizeOff();
}
void
MinimizeOff()
{
this->MaximizeOn();
}
virtual void
UpdateCurrentPosition();
void
StartOptimization() override;
virtual void
ResumeOptimization();
virtual void
StopOptimization();
itkSetObjectMacro(SearchSpace, SearchSpaceType);
itkGetModifiableObjectMacro(SearchSpace, SearchSpaceType);
virtual void
AddSearchDimension(unsigned int param_nr, RangeValueType minimum, RangeValueType maximum, RangeValueType step);
virtual void
RemoveSearchDimension(unsigned int param_nr);
virtual unsigned long
GetNumberOfIterations();
virtual unsigned int
GetNumberOfSearchSpaceDimensions();
virtual const SearchSpaceSizeType &
GetSearchSpaceSize();
virtual ParametersType
PointToPosition(const SearchSpacePointType & point);
virtual ParametersType
IndexToPosition(const SearchSpaceIndexType & index);
virtual SearchSpacePointType
IndexToPoint(const SearchSpaceIndexType & index);
itkGetConstMacro(CurrentIteration, unsigned long);
itkGetConstReferenceMacro(CurrentPointInSearchSpace, SearchSpacePointType);
itkGetConstReferenceMacro(CurrentIndexInSearchSpace, SearchSpaceIndexType);
itkGetConstReferenceMacro(BestPointInSearchSpace, SearchSpacePointType);
itkGetConstReferenceMacro(BestIndexInSearchSpace, SearchSpaceIndexType);
itkGetConstMacro(Value, double);
itkGetConstMacro(BestValue, double);
itkGetConstMacro(StopCondition, StopConditionType);
protected:
FullSearchOptimizer();
~FullSearchOptimizer() override = default;
// void PrintSelf(std::ostream& os, Indent indent) const;
bool m_Maximize{ false };
bool m_Stop{ false };
double m_Value{ 0.0 };
double m_BestValue{ 0.0 };
StopConditionType m_StopCondition{ FullRangeSearched };
SearchSpacePointer m_SearchSpace{ nullptr };
SearchSpacePointType m_CurrentPointInSearchSpace{};
SearchSpaceIndexType m_CurrentIndexInSearchSpace{};
SearchSpacePointType m_BestPointInSearchSpace{};
SearchSpaceIndexType m_BestIndexInSearchSpace{};
SearchSpaceSizeType m_SearchSpaceSize{};
unsigned int m_NumberOfSearchSpaceDimensions{ 0 };
unsigned long m_LastSearchSpaceChanges{ 0 };
virtual void
ProcessSearchSpaceChanges();
private:
unsigned long m_CurrentIteration{ 0 };
};
} // end namespace itk
#endif
SingleValuedNonLinearOptimizer
itk::FullSearchOptimizer::SearchSpacePointType
Array< ParameterValueType > SearchSpacePointType
Definition itkFullSearchOptimizer.h:85
itk::FullSearchOptimizer::m_CurrentIteration
unsigned long m_CurrentIteration
Definition itkFullSearchOptimizer.h:244
itk::FullSearchOptimizer::Self
FullSearchOptimizer Self
Definition itkFullSearchOptimizer.h:52
itk::FullSearchOptimizer::GetNumberOfSearchSpaceDimensions
virtual unsigned int GetNumberOfSearchSpaceDimensions()
itk::FullSearchOptimizer::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(FullSearchOptimizer)
itk::FullSearchOptimizer::RemoveSearchDimension
virtual void RemoveSearchDimension(unsigned int param_nr)
itk::FullSearchOptimizer::ParameterValueType
ParametersType::ValueType ParameterValueType
Definition itkFullSearchOptimizer.h:76
itk::FullSearchOptimizer::m_NumberOfSearchSpaceDimensions
unsigned int m_NumberOfSearchSpaceDimensions
Definition itkFullSearchOptimizer.h:237
itk::FullSearchOptimizer::GetMinimize
bool GetMinimize() const
Definition itkFullSearchOptimizer.h:101
itk::FullSearchOptimizer::PointToPosition
virtual ParametersType PointToPosition(const SearchSpacePointType &point)
itk::FullSearchOptimizer::MinimizeOn
void MinimizeOn()
Definition itkFullSearchOptimizer.h:111
itk::FullSearchOptimizer::SearchSpaceSizeType
Array< SizeValueType > SearchSpaceSizeType
Definition itkFullSearchOptimizer.h:92
itk::FullSearchOptimizer::m_SearchSpaceSize
SearchSpaceSizeType m_SearchSpaceSize
Definition itkFullSearchOptimizer.h:236
itk::FullSearchOptimizer::GetNumberOfIterations
virtual unsigned long GetNumberOfIterations()
itk::FullSearchOptimizer::m_SearchSpace
SearchSpacePointer m_SearchSpace
Definition itkFullSearchOptimizer.h:231
itk::FullSearchOptimizer::StopConditionType
StopConditionType
Definition itkFullSearchOptimizer.h:65
itk::FullSearchOptimizer::MetricError
@ MetricError
Definition itkFullSearchOptimizer.h:67
itk::FullSearchOptimizer::FullRangeSearched
@ FullRangeSearched
Definition itkFullSearchOptimizer.h:66
itk::FullSearchOptimizer::StopOptimization
virtual void StopOptimization()
itk::FullSearchOptimizer::m_Stop
bool m_Stop
Definition itkFullSearchOptimizer.h:226
itk::FullSearchOptimizer::Superclass
SingleValuedNonLinearOptimizer Superclass
Definition itkFullSearchOptimizer.h:53
itk::FullSearchOptimizer::m_StopCondition
StopConditionType m_StopCondition
Definition itkFullSearchOptimizer.h:229
itk::FullSearchOptimizer::m_Value
double m_Value
Definition itkFullSearchOptimizer.h:227
itk::FullSearchOptimizer::MaximizeOff
virtual void MaximizeOff()
itk::FullSearchOptimizer::m_CurrentIndexInSearchSpace
SearchSpaceIndexType m_CurrentIndexInSearchSpace
Definition itkFullSearchOptimizer.h:233
itk::FullSearchOptimizer::SearchSpacePointer
SearchSpaceType::Pointer SearchSpacePointer
Definition itkFullSearchOptimizer.h:80
itk::FullSearchOptimizer::SetMinimize
void SetMinimize(bool v)
Definition itkFullSearchOptimizer.h:106
itk::FullSearchOptimizer::itkGetModifiableObjectMacro
itkGetModifiableObjectMacro(SearchSpace, SearchSpaceType)
itk::FullSearchOptimizer::FullSearchOptimizer
FullSearchOptimizer()
itk::FullSearchOptimizer::m_BestIndexInSearchSpace
SearchSpaceIndexType m_BestIndexInSearchSpace
Definition itkFullSearchOptimizer.h:235
itk::FullSearchOptimizer::SetMaximize
virtual void SetMaximize(bool _arg)
itk::FullSearchOptimizer::~FullSearchOptimizer
~FullSearchOptimizer() override=default
itk::FullSearchOptimizer::m_CurrentPointInSearchSpace
SearchSpacePointType m_CurrentPointInSearchSpace
Definition itkFullSearchOptimizer.h:232
itk::FullSearchOptimizer::m_BestValue
double m_BestValue
Definition itkFullSearchOptimizer.h:228
itk::FullSearchOptimizer::m_BestPointInSearchSpace
SearchSpacePointType m_BestPointInSearchSpace
Definition itkFullSearchOptimizer.h:234
itk::FullSearchOptimizer::IndexToPosition
virtual ParametersType IndexToPosition(const SearchSpaceIndexType &index)
itk::FullSearchOptimizer::GetSearchSpaceSize
virtual const SearchSpaceSizeType & GetSearchSpaceSize()
itk::FullSearchOptimizer::m_Maximize
bool m_Maximize
Definition itkFullSearchOptimizer.h:225
itk::FullSearchOptimizer::StartOptimization
void StartOptimization() override
itk::FullSearchOptimizer::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkFullSearchOptimizer.h:55
itk::FullSearchOptimizer::SearchSpaceIteratorType
SearchSpaceType::ConstIterator SearchSpaceIteratorType
Definition itkFullSearchOptimizer.h:81
itk::FullSearchOptimizer::UpdateCurrentPosition
virtual void UpdateCurrentPosition()
itk::FullSearchOptimizer::SearchSpaceType
MapContainer< unsigned int, RangeType > SearchSpaceType
Definition itkFullSearchOptimizer.h:79
itk::FullSearchOptimizer::RangeValueType
ParameterValueType RangeValueType
Definition itkFullSearchOptimizer.h:77
itk::FullSearchOptimizer::SearchSpaceIndexType
Array< IndexValueType > SearchSpaceIndexType
Definition itkFullSearchOptimizer.h:89
itk::FullSearchOptimizer::ProcessSearchSpaceChanges
virtual void ProcessSearchSpaceChanges()
itk::FullSearchOptimizer::AddSearchDimension
virtual void AddSearchDimension(unsigned int param_nr, RangeValueType minimum, RangeValueType maximum, RangeValueType step)
itk::FullSearchOptimizer::MinimizeOff
void MinimizeOff()
Definition itkFullSearchOptimizer.h:116
itk::FullSearchOptimizer::MaximizeOn
virtual void MaximizeOn()
itk::FullSearchOptimizer::IndexToPoint
virtual SearchSpacePointType IndexToPoint(const SearchSpaceIndexType &index)
itk::FullSearchOptimizer::m_LastSearchSpaceChanges
unsigned long m_LastSearchSpaceChanges
Definition itkFullSearchOptimizer.h:239
itk::FullSearchOptimizer::ResumeOptimization
virtual void ResumeOptimization()
itk::FullSearchOptimizer::Pointer
SmartPointer< Self > Pointer
Definition itkFullSearchOptimizer.h:54
itk::FullSearchOptimizer::RangeType
FixedArray< RangeValueType, 3 > RangeType
Definition itkFullSearchOptimizer.h:78
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |