Loading...
Searching...
No Matches
itkSingleValuedPointSetToPointSetMetric.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.
*
*=========================================================================*/
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkSingleValuedPointSetToPointSetMetric.h,v $
Date: $Date: 2009-01-26 21:45:56 $
Version: $Revision: 1.2 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
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.
=========================================================================*/
#ifndef itkSingleValuedPointSetToPointSetMetric_h
#define itkSingleValuedPointSetToPointSetMetric_h
#include "itkImageBase.h"
#include "itkAdvancedTransform.h"
#include "itkSingleValuedCostFunction.h"
#include "itkMacro.h"
#include "itkImageMaskSpatialObject.h"
#include "itkPointSet.h"
namespace itk
{
template <class TFixedPointSet, class TMovingPointSet>
class ITK_TEMPLATE_EXPORT SingleValuedPointSetToPointSetMetric : public SingleValuedCostFunction
{
public:
ITK_DISALLOW_COPY_AND_MOVE(SingleValuedPointSetToPointSetMetric);
using Self = SingleValuedPointSetToPointSetMetric;
using Superclass = SingleValuedCostFunction;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
using CoordinateRepresentationType = Superclass::ParametersValueType;
itkTypeMacro(SingleValuedPointSetToPointSetMetric, SingleValuedCostFunction);
using FixedPointSetType = TFixedPointSet;
using FixedPointSetPixelType = typename FixedPointSetType::PixelType;
using FixedPointSetConstPointer = typename FixedPointSetType::ConstPointer;
using MovingPointSetType = TMovingPointSet;
using MovingPointSetPixelType = typename MovingPointSetType::PixelType;
using MovingPointSetConstPointer = typename MovingPointSetType::ConstPointer;
using PointIterator = typename FixedPointSetType::PointsContainer::ConstIterator;
using PointDataIterator = typename FixedPointSetType::PointDataContainer::ConstIterator;
itkStaticConstMacro(FixedPointSetDimension, unsigned int, TFixedPointSet::PointDimension);
itkStaticConstMacro(MovingPointSetDimension, unsigned int, TMovingPointSet::PointDimension);
using TransformType =
AdvancedTransform<CoordinateRepresentationType, Self::FixedPointSetDimension, Self::MovingPointSetDimension>;
using TransformPointer = typename TransformType::Pointer;
using InputPointType = typename TransformType::InputPointType;
using OutputPointType = typename TransformType::OutputPointType;
using TransformParametersType = typename TransformType::ParametersType;
using TransformJacobianType = typename TransformType::JacobianType;
using FixedImageMaskType = ImageMaskSpatialObject<Self::FixedPointSetDimension>;
using FixedImageMaskPointer = typename FixedImageMaskType::Pointer;
using FixedImageMaskConstPointer = typename FixedImageMaskType::ConstPointer;
using MovingImageMaskType = ImageMaskSpatialObject<Self::MovingPointSetDimension>;
using MovingImageMaskPointer = typename MovingImageMaskType::Pointer;
using MovingImageMaskConstPointer = typename MovingImageMaskType::ConstPointer;
using Superclass::MeasureType;
using Superclass::DerivativeType;
using DerivativeValueType = typename DerivativeType::ValueType;
using Superclass::ParametersType;
using NonZeroJacobianIndicesType = typename TransformType::NonZeroJacobianIndicesType;
itkSetConstObjectMacro(FixedPointSet, FixedPointSetType);
itkGetConstObjectMacro(FixedPointSet, FixedPointSetType);
itkSetConstObjectMacro(MovingPointSet, MovingPointSetType);
itkGetConstObjectMacro(MovingPointSet, MovingPointSetType);
itkSetObjectMacro(Transform, TransformType);
itkGetConstObjectMacro(Transform, TransformType);
void
SetTransformParameters(const ParametersType & parameters) const;
unsigned int
GetNumberOfParameters() const override
{
return this->m_Transform->GetNumberOfParameters();
}
virtual void
Initialize();
// \todo: currently not used
itkSetConstObjectMacro(FixedImageMask, FixedImageMaskType);
itkGetConstObjectMacro(FixedImageMask, FixedImageMaskType);
itkSetConstObjectMacro(MovingImageMask, MovingImageMaskType);
itkGetConstObjectMacro(MovingImageMask, MovingImageMaskType);
virtual void
BeforeThreadedGetValueAndDerivative(const TransformParametersType & parameters) const;
itkSetMacro(UseMetricSingleThreaded, bool);
itkGetConstReferenceMacro(UseMetricSingleThreaded, bool);
itkBooleanMacro(UseMetricSingleThreaded);
protected:
SingleValuedPointSetToPointSetMetric() = default;
~SingleValuedPointSetToPointSetMetric() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
FixedPointSetConstPointer m_FixedPointSet{ nullptr };
MovingPointSetConstPointer m_MovingPointSet{ nullptr };
FixedImageMaskConstPointer m_FixedImageMask{ nullptr };
MovingImageMaskConstPointer m_MovingImageMask{ nullptr };
mutable TransformPointer m_Transform{ nullptr };
mutable unsigned int m_NumberOfPointsCounted{ 0 };
bool m_UseMetricSingleThreaded{ true };
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkSingleValuedPointSetToPointSetMetric.hxx"
#endif
#endif
itk::AdvancedTransform
Transform maps points, vectors and covariant vectors from an input space to an output space.
Definition itkAdvancedTransform.h:84
itk::AdvancedTransform< CoordinateRepresentationType, Self::FixedPointSetDimension, Self::MovingPointSetDimension >::Pointer
SmartPointer< Self > Pointer
Definition itkAdvancedTransform.h:91
itk::AdvancedTransform< CoordinateRepresentationType, Self::FixedPointSetDimension, Self::MovingPointSetDimension >::NonZeroJacobianIndicesType
std::vector< unsigned long > NonZeroJacobianIndicesType
Definition itkAdvancedTransform.h:133
itk::SingleValuedPointSetToPointSetMetric::FixedPointSetPixelType
typename FixedPointSetType::PixelType FixedPointSetPixelType
Definition itkSingleValuedPointSetToPointSetMetric.h:80
itk::SingleValuedPointSetToPointSetMetric::FixedImageMaskPointer
typename FixedImageMaskType::Pointer FixedImageMaskPointer
Definition itkSingleValuedPointSetToPointSetMetric.h:102
itk::SingleValuedPointSetToPointSetMetric::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkSingleValuedPointSetToPointSetMetric.h:70
itk::SingleValuedPointSetToPointSetMetric::PointDataIterator
typename FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator
Definition itkSingleValuedPointSetToPointSetMetric.h:86
itk::SingleValuedPointSetToPointSetMetric::MovingImageMaskConstPointer
typename MovingImageMaskType::ConstPointer MovingImageMaskConstPointer
Definition itkSingleValuedPointSetToPointSetMetric.h:106
itk::SingleValuedPointSetToPointSetMetric::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(SingleValuedPointSetToPointSetMetric)
itk::SingleValuedPointSetToPointSetMetric::MovingPointSetPixelType
typename MovingPointSetType::PixelType MovingPointSetPixelType
Definition itkSingleValuedPointSetToPointSetMetric.h:83
itk::SingleValuedPointSetToPointSetMetric::itkStaticConstMacro
itkStaticConstMacro(FixedPointSetDimension, unsigned int, TFixedPointSet::PointDimension)
itk::SingleValuedPointSetToPointSetMetric::Initialize
virtual void Initialize()
itk::SingleValuedPointSetToPointSetMetric::NonZeroJacobianIndicesType
typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Definition itkSingleValuedPointSetToPointSetMetric.h:115
itk::SingleValuedPointSetToPointSetMetric< FixedPointSetType, MovingPointSetType >::m_MovingPointSet
MovingPointSetConstPointer m_MovingPointSet
Definition itkSingleValuedPointSetToPointSetMetric.h:184
itk::SingleValuedPointSetToPointSetMetric::FixedImageMaskConstPointer
typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
Definition itkSingleValuedPointSetToPointSetMetric.h:103
itk::SingleValuedPointSetToPointSetMetric::itkStaticConstMacro
itkStaticConstMacro(MovingPointSetDimension, unsigned int, TMovingPointSet::PointDimension)
itk::SingleValuedPointSetToPointSetMetric::InputPointType
typename TransformType::InputPointType InputPointType
Definition itkSingleValuedPointSetToPointSetMetric.h:96
itk::SingleValuedPointSetToPointSetMetric::TransformPointer
typename TransformType::Pointer TransformPointer
Definition itkSingleValuedPointSetToPointSetMetric.h:95
itk::SingleValuedPointSetToPointSetMetric::DerivativeValueType
typename DerivativeType::ValueType DerivativeValueType
Definition itkSingleValuedPointSetToPointSetMetric.h:111
itk::SingleValuedPointSetToPointSetMetric::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::SingleValuedPointSetToPointSetMetric::MovingPointSetConstPointer
typename MovingPointSetType::ConstPointer MovingPointSetConstPointer
Definition itkSingleValuedPointSetToPointSetMetric.h:84
itk::SingleValuedPointSetToPointSetMetric::FixedPointSetConstPointer
typename FixedPointSetType::ConstPointer FixedPointSetConstPointer
Definition itkSingleValuedPointSetToPointSetMetric.h:81
itk::SingleValuedPointSetToPointSetMetric< FixedPointSetType, MovingPointSetType >::m_NumberOfPointsCounted
unsigned int m_NumberOfPointsCounted
Definition itkSingleValuedPointSetToPointSetMetric.h:189
itk::SingleValuedPointSetToPointSetMetric::Pointer
SmartPointer< Self > Pointer
Definition itkSingleValuedPointSetToPointSetMetric.h:69
itk::SingleValuedPointSetToPointSetMetric::SingleValuedPointSetToPointSetMetric
SingleValuedPointSetToPointSetMetric()=default
itk::SingleValuedPointSetToPointSetMetric< FixedPointSetType, MovingPointSetType >::m_FixedPointSet
FixedPointSetConstPointer m_FixedPointSet
Definition itkSingleValuedPointSetToPointSetMetric.h:183
itk::SingleValuedPointSetToPointSetMetric::~SingleValuedPointSetToPointSetMetric
~SingleValuedPointSetToPointSetMetric() override=default
itk::SingleValuedPointSetToPointSetMetric::GetNumberOfParameters
unsigned int GetNumberOfParameters() const override
Definition itkSingleValuedPointSetToPointSetMetric.h:141
itk::SingleValuedPointSetToPointSetMetric::MovingImageMaskPointer
typename MovingImageMaskType::Pointer MovingImageMaskPointer
Definition itkSingleValuedPointSetToPointSetMetric.h:105
itk::SingleValuedPointSetToPointSetMetric::MovingImageMaskType
ImageMaskSpatialObject< Self::MovingPointSetDimension > MovingImageMaskType
Definition itkSingleValuedPointSetToPointSetMetric.h:104
itk::SingleValuedPointSetToPointSetMetric::MovingPointSetType
TMovingPointSet MovingPointSetType
Definition itkSingleValuedPointSetToPointSetMetric.h:82
itk::SingleValuedPointSetToPointSetMetric< FixedPointSetType, MovingPointSetType >::m_Transform
TransformPointer m_Transform
Definition itkSingleValuedPointSetToPointSetMetric.h:187
itk::SingleValuedPointSetToPointSetMetric::BeforeThreadedGetValueAndDerivative
virtual void BeforeThreadedGetValueAndDerivative(const TransformParametersType &parameters) const
itk::SingleValuedPointSetToPointSetMetric::TransformType
AdvancedTransform< CoordinateRepresentationType, Self::FixedPointSetDimension, Self::MovingPointSetDimension > TransformType
Definition itkSingleValuedPointSetToPointSetMetric.h:93
itk::SingleValuedPointSetToPointSetMetric::CoordinateRepresentationType
Superclass::ParametersValueType CoordinateRepresentationType
Definition itkSingleValuedPointSetToPointSetMetric.h:73
itk::SingleValuedPointSetToPointSetMetric::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition itkSingleValuedPointSetToPointSetMetric.h:98
itk::SingleValuedPointSetToPointSetMetric::FixedImageMaskType
ImageMaskSpatialObject< Self::FixedPointSetDimension > FixedImageMaskType
Definition itkSingleValuedPointSetToPointSetMetric.h:101
itk::SingleValuedPointSetToPointSetMetric::TransformJacobianType
typename TransformType::JacobianType TransformJacobianType
Definition itkSingleValuedPointSetToPointSetMetric.h:99
itk::SingleValuedPointSetToPointSetMetric< FixedPointSetType, MovingPointSetType >::m_UseMetricSingleThreaded
bool m_UseMetricSingleThreaded
Definition itkSingleValuedPointSetToPointSetMetric.h:192
itk::SingleValuedPointSetToPointSetMetric::FixedPointSetType
TFixedPointSet FixedPointSetType
Definition itkSingleValuedPointSetToPointSetMetric.h:79
itk::SingleValuedPointSetToPointSetMetric::OutputPointType
typename TransformType::OutputPointType OutputPointType
Definition itkSingleValuedPointSetToPointSetMetric.h:97
itk::SingleValuedPointSetToPointSetMetric::PointIterator
typename FixedPointSetType::PointsContainer::ConstIterator PointIterator
Definition itkSingleValuedPointSetToPointSetMetric.h:85
itk::SingleValuedPointSetToPointSetMetric< FixedPointSetType, MovingPointSetType >::m_MovingImageMask
MovingImageMaskConstPointer m_MovingImageMask
Definition itkSingleValuedPointSetToPointSetMetric.h:186
itk::SingleValuedPointSetToPointSetMetric::SetTransformParameters
void SetTransformParameters(const ParametersType &parameters) const
itk::SingleValuedPointSetToPointSetMetric< FixedPointSetType, MovingPointSetType >::m_FixedImageMask
FixedImageMaskConstPointer m_FixedImageMask
Definition itkSingleValuedPointSetToPointSetMetric.h:185
itk::SingleValuedPointSetToPointSetMetric::Superclass
SingleValuedCostFunction Superclass
Definition itkSingleValuedPointSetToPointSetMetric.h:68
itk::SingleValuedPointSetToPointSetMetric::Self
SingleValuedPointSetToPointSetMetric Self
Definition itkSingleValuedPointSetToPointSetMetric.h:67
itkAdvancedTransform.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |