ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkSingleImageCostFunction.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkSingleImageCostFunction_h
19#define itkSingleImageCostFunction_h
20
21#include "itkNumericTraits.h"
22#include "itkMacro.h"
23#include "itkContinuousIndex.h"
29
30namespace itk
31{
32
52template <typename TImage>
53class ITK_TEMPLATE_EXPORT SingleImageCostFunction : public SingleValuedCostFunction
54{
55public:
56 ITK_DISALLOW_COPY_AND_MOVE(SingleImageCostFunction);
57
63
65 itkNewMacro(Self);
66
68 itkOverrideGetNameOfClassMacro(SingleImageCostFunction);
69
73
77
81
83 using ImageType = TImage;
84 using ImagePixelType = typename TImage::PixelType;
85 using ImageConstPointer = typename ImageType::ConstPointer;
86
88 static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
89
92
97
101
104
106 itkSetObjectMacro(Interpolator, InterpolatorType);
107 itkGetConstObjectMacro(Interpolator, InterpolatorType);
108
110 itkSetConstObjectMacro(Image, ImageType);
111 itkGetConstObjectMacro(Image, ImageType);
112
114 itkSetMacro(DerivativeThreshold, DerivativeType::ValueType);
115 itkGetConstReferenceMacro(DerivativeThreshold, DerivativeType::ValueType);
116
118 virtual void
120
122 unsigned int
123 GetNumberOfParameters() const override
124 {
125 return ImageDimension;
126 }
127
130 MeasureType
131 GetValue(const ParametersType & parameters) const override;
132
135 void
136 GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const override;
137
138 // Set these depending on whether you will be minimizing or maximizing.
139 // They control the value returned when the point isn't inside the buffer.
140 void
145 void
150
151
152protected:
154 ~SingleImageCostFunction() override = default;
155 void
156 PrintSelf(std::ostream & os, Indent indent) const override;
157
158private:
165 typename DerivativeType::ValueType m_DerivativeThreshold;
166};
167
168} // end namespace itk
169
170#ifndef ITK_MANUAL_INSTANTIATION
171# include "itkSingleImageCostFunction.hxx"
172#endif
173
174#endif
A templated class holding a point in n-Dimensional image space.
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:53
Base class for all image interpolators.
Linearly interpolate an image at specified positions.
static constexpr T NonpositiveMin()
static constexpr T max(const T &)
Calculate the derivative by central differencing in physical space.
A templated class holding a geometric point in n-Dimensional space.
Definition itkPoint.h:54
PhysicalCentralDifferenceImageFunction< ImageType, CoordinateType > GradientImageFunctionType
InterpolateImageFunction< ImageType, CoordinateType > InterpolatorType
GradientImageFunctionType::Pointer m_GradientImageFunction
Point< CoordinateType, ImageDimension > PointType
unsigned int GetNumberOfParameters() const override
void PrintSelf(std::ostream &os, Indent indent) const override
~SingleImageCostFunction() override=default
LinearInterpolateImageFunction< ImageType, CoordinateType > DefaultInterpolatorType
MeasureType GetValue(const ParametersType &parameters) const override
ContinuousIndex< CoordinateType, ImageDimension > ContinuousIndexType
void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const override
Array< ParametersValueType > DerivativeType
Superclass::ParametersValueType ParametersValueType
Superclass::ParametersType ParametersType
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)
Represent a n-dimensional index in a n-dimensional image.
Definition itkIndex.h:69