ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLinearLeastSquaresGradientImageFilter.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 itkLinearLeastSquaresGradientImageFilter_h
19#define itkLinearLeastSquaresGradientImageFilter_h
20
23#include "itkCovariantVector.h"
25
26namespace itk
27{
28
46template <typename TInputImage, typename TOperatorValueType = double, typename TOutputValueType = double>
48 : public ImageToImageFilter<
49 TInputImage,
50 Image<CovariantVector<TOutputValueType, TInputImage::ImageDimension>, TInputImage::ImageDimension>>
51{
52public:
54 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
55
58
60 using InputImageType = TInputImage;
61 using InputImagePointer = typename InputImageType::Pointer;
65
70
72 itkNewMacro(Self);
73
75 itkOverrideGetNameOfClassMacro(LinearLeastSquaresGradientImageFilter);
76
78 using InputPixelType = typename InputImageType::PixelType;
79 using OperatorValueType = TOperatorValueType;
80 using OutputValueType = TOutputValueType;
83 using RadiusType = typename InputImageType::SizeType;
84
87 itkSetMacro(UseImageSpacing, bool);
88 itkGetConstMacro(UseImageSpacing, bool);
89 itkBooleanMacro(UseImageSpacing);
90
92 virtual void
93 SetRadius(const RadiusType & radius)
94 {
95 m_Radius = radius;
96 this->Modified();
97 }
98
99 virtual void
100 SetRadius(const unsigned int rad)
101 {
102 RadiusType radius;
103 radius.Fill(rad);
104 this->SetRadius(radius);
105 }
106 itkGetConstReferenceMacro(Radius, RadiusType);
107
108#ifdef ITK_USE_CONCEPT_CHECKING
111 itkConceptMacro(OutputHasNumericTraitsCheck, (Concept::HasNumericTraits<OutputValueType>));
113#endif
114
115protected:
118
120
121 inline TOutputValueType
122 GetDerivative(const std::slice & s, const NeighborhoodIteratorType & nit);
123
130 void
132
133
144 void
145 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
146
157 itkSetMacro(UseImageDirection, bool);
158 itkGetConstMacro(UseImageDirection, bool);
159 itkBooleanMacro(UseImageDirection);
160
161private:
162 LinearLeastSquaresGradientImageFilter(const Self &); // purposely not implemented
163 void
164 operator=(const Self &); // purposely not implemented
165
168 // flag to take or not the image direction into account
169 // when computing the derivatives.
171};
172
173} // end namespace itk
174
175#ifndef ITK_MANUAL_INSTANTIATION
176# include "itkLinearLeastSquaresGradientImageFilter.hxx"
177#endif
178
179#endif
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
A templated class holding a n-Dimensional covariant vector.
Templated n-dimensional image class.
Definition itkImage.h:89
ImageRegion< VImageDimension > RegionType
SmartPointer< Self > Pointer
Definition itkImage.h:96
TOutputValueType GetDerivative(const std::slice &s, const NeighborhoodIteratorType &nit)
~LinearLeastSquaresGradientImageFilter() override=default
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
Image< CovariantVector< MetricPixelType, Self::OutputImageDimension >, Self::OutputImageDimension > OutputImageType
virtual void Modified() const
Implements transparent reference counting.
#define itkConceptMacro(name, conceptType)
Compile-time check that a template argument satisfies an itk::Concept.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)