Loading...
Searching...
No Matches
itkScaledSingleValuedCostFunction.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 itkScaledSingleValuedCostFunction_h
#define itkScaledSingleValuedCostFunction_h
#include "itkSingleValuedCostFunction.h"
#include "itkIntTypes.h" //temp, needed for IdentifierType
namespace itk
{
class ScaledSingleValuedCostFunction : public SingleValuedCostFunction
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ScaledSingleValuedCostFunction);
using Self = ScaledSingleValuedCostFunction;
using Superclass = SingleValuedCostFunction;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(ScaledSingleValuedCostFunction, SingleValuedCostFunction);
using Superclass::MeasureType;
using Superclass::DerivativeType;
using Superclass::ParametersType;
// temporary, untill it is fixed in the ITK4
// typedef IdentifierType NumberOfParametersType; // temp, copied from itk::TransformBase
using NumberOfParametersType = unsigned int; // temp, copied from itk::CostFunction
using SingleValuedCostFunctionPointer = Superclass::Pointer;
using ScalesType = Array<double>;
MeasureType
GetValue(const ParametersType & parameters) const override;
void
GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const override;
void
GetValueAndDerivative(const ParametersType & parameters,
MeasureType & value,
DerivativeType & derivative) const override;
NumberOfParametersType
GetNumberOfParameters() const override;
itkSetObjectMacro(UnscaledCostFunction, Superclass);
itkGetModifiableObjectMacro(UnscaledCostFunction, Superclass);
virtual void
SetScales(const ScalesType & scales);
itkGetConstReferenceMacro(Scales, ScalesType);
virtual void
SetSquaredScales(const ScalesType & squaredScales);
itkGetConstReferenceMacro(SquaredScales, ScalesType);
itkSetMacro(UseScales, bool);
itkGetConstMacro(UseScales, bool);
itkBooleanMacro(NegateCostFunction);
itkSetMacro(NegateCostFunction, bool);
itkGetConstMacro(NegateCostFunction, bool);
virtual void
ConvertScaledToUnscaledParameters(ParametersType & parameters) const;
virtual void
ConvertUnscaledToScaledParameters(ParametersType & parameters) const;
protected:
ScaledSingleValuedCostFunction();
~ScaledSingleValuedCostFunction() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
private:
ScalesType m_Scales{};
ScalesType m_SquaredScales{};
SingleValuedCostFunctionPointer m_UnscaledCostFunction{ nullptr };
bool m_UseScales{ false };
bool m_NegateCostFunction{ false };
};
} // end namespace itk
#endif // #ifndef itkScaledSingleValuedCostFunction_h
int
itk::ScaledSingleValuedCostFunction::SetScales
virtual void SetScales(const ScalesType &scales)
itk::ScaledSingleValuedCostFunction::itkGetModifiableObjectMacro
itkGetModifiableObjectMacro(UnscaledCostFunction, Superclass)
itk::ScaledSingleValuedCostFunction::ConvertUnscaledToScaledParameters
virtual void ConvertUnscaledToScaledParameters(ParametersType &parameters) const
itk::ScaledSingleValuedCostFunction::Superclass
SingleValuedCostFunction Superclass
Definition itkScaledSingleValuedCostFunction.h:46
itk::ScaledSingleValuedCostFunction::m_UseScales
bool m_UseScales
Definition itkScaledSingleValuedCostFunction.h:150
itk::ScaledSingleValuedCostFunction::Pointer
SmartPointer< Self > Pointer
Definition itkScaledSingleValuedCostFunction.h:47
itk::ScaledSingleValuedCostFunction::ScalesType
Array< double > ScalesType
Definition itkScaledSingleValuedCostFunction.h:65
itk::ScaledSingleValuedCostFunction::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(ScaledSingleValuedCostFunction)
itk::ScaledSingleValuedCostFunction::ConvertScaledToUnscaledParameters
virtual void ConvertScaledToUnscaledParameters(ParametersType &parameters) const
itk::ScaledSingleValuedCostFunction::NumberOfParametersType
unsigned int NumberOfParametersType
Definition itkScaledSingleValuedCostFunction.h:62
itk::ScaledSingleValuedCostFunction::SingleValuedCostFunctionPointer
Superclass::Pointer SingleValuedCostFunctionPointer
Definition itkScaledSingleValuedCostFunction.h:63
itk::ScaledSingleValuedCostFunction::m_UnscaledCostFunction
SingleValuedCostFunctionPointer m_UnscaledCostFunction
Definition itkScaledSingleValuedCostFunction.h:149
itk::ScaledSingleValuedCostFunction::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::ScaledSingleValuedCostFunction::SetSquaredScales
virtual void SetSquaredScales(const ScalesType &squaredScales)
itk::ScaledSingleValuedCostFunction::m_Scales
ScalesType m_Scales
Definition itkScaledSingleValuedCostFunction.h:147
itk::ScaledSingleValuedCostFunction::m_NegateCostFunction
bool m_NegateCostFunction
Definition itkScaledSingleValuedCostFunction.h:151
itk::ScaledSingleValuedCostFunction::ScaledSingleValuedCostFunction
ScaledSingleValuedCostFunction()
itk::ScaledSingleValuedCostFunction::~ScaledSingleValuedCostFunction
~ScaledSingleValuedCostFunction() override=default
itk::ScaledSingleValuedCostFunction::GetDerivative
void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const override
itk::ScaledSingleValuedCostFunction::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkScaledSingleValuedCostFunction.h:48
itk::ScaledSingleValuedCostFunction::GetNumberOfParameters
NumberOfParametersType GetNumberOfParameters() const override
itk::ScaledSingleValuedCostFunction::GetValue
MeasureType GetValue(const ParametersType &parameters) const override
itk::ScaledSingleValuedCostFunction::m_SquaredScales
ScalesType m_SquaredScales
Definition itkScaledSingleValuedCostFunction.h:148
itk::ScaledSingleValuedCostFunction::GetValueAndDerivative
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
itk::ScaledSingleValuedCostFunction::Self
ScaledSingleValuedCostFunction Self
Definition itkScaledSingleValuedCostFunction.h:45
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |