ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkBlockMatchingStrainWindowDisplacementCalculator.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 itkBlockMatchingStrainWindowDisplacementCalculator_h
19#define itkBlockMatchingStrainWindowDisplacementCalculator_h
20
22
23#include "itkAbsImageFilter.h"
28
29namespace itk
30{
31namespace BlockMatching
32{
33
57template <typename TMetricImage, typename TDisplacementImage, typename TStrainValueType>
58class ITK_TEMPLATE_EXPORT StrainWindowDisplacementCalculator
59 : public MetricImageToDisplacementCalculator<TMetricImage, TDisplacementImage>
60{
61public:
62 ITK_DISALLOW_COPY_AND_MOVE(StrainWindowDisplacementCalculator);
63
65 static constexpr unsigned int ImageDimension = TDisplacementImage::ImageDimension;
66
72
74 itkNewMacro(Self);
75
77 itkOverrideGetNameOfClassMacro(StrainWindowDisplacementCalculator);
78
80 using RegionType = typename DisplacementImageType::RegionType;
81
87
92
96 using MetricPixelType = typename MetricImageType::PixelType;
97
98 void
100 {
102 m_DisplacementCalculator->SetDisplacementImage(image);
103 }
104
105 void
106 SetMetricImagePixel(const PointType & point, const IndexType & index, MetricImageType * image) override;
107
108 void
109 Compute() override;
110
114 itkSetObjectMacro(DisplacementCalculator, Superclass);
115 itkGetConstObjectMacro(DisplacementCalculator, Superclass);
116
120 itkGetConstObjectMacro(StrainImageFilter, StrainImageFilterType);
121
125 virtual void
127 {
128 if (m_MaximumAbsStrain != max)
129 {
130 m_MaximumAbsStrain = max;
131 this->Modified();
132 }
133 }
134 itkGetConstReferenceMacro(MaximumAbsStrain, StrainTensorType);
135
139 itkSetMacro(MaximumIterations, unsigned int);
140 itkGetConstMacro(MaximumIterations, unsigned int);
141
144 itkGetConstMacro(CurrentIteration, unsigned int);
145
146protected:
148
152 unsigned long long
153 GenerateMask(const RegionType & region);
154
156 void
158
160
162
165
166 unsigned int m_CurrentIteration;
168
171
174
177
178 // There are cases where you will get a large negative pixel, followed by a
179 // normal pixel, followed by a large positive strain pixel, for instance.
180 // This filter helps address that problem.
183
184private:
185};
186
187} // namespace BlockMatching
188} // namespace itk
189
190#ifndef ITK_MANUAL_INSTANTIATION
191# include "itkBlockMatchingStrainWindowDisplacementCalculator.hxx"
192#endif
193
194#endif
Computes the absolute value of each pixel.
virtual void SetDisplacementImage(DisplacementImageType *image)
void ReplaceDisplacements(const RegionType &region)
unsigned long long GenerateMask(const RegionType &region)
ImageToImageFilter< DisplacementImageType, Image< SymmetricSecondRankTensor< MetricPixelType, ImageDimension >, ImageDimension > > StrainImageFilterType
void SetMetricImagePixel(const PointType &point, const IndexType &index, MetricImageType *image) override
Implements a fast rectangular mean filter using the accumulator approach.
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
typename OutputImageType::PixelType OutputImagePixelType
Templated n-dimensional image class.
Definition itkImage.h:89
SmartPointer< Self > Pointer
Definition itkImage.h:96
Presents an image as being composed of the N-th element of its pixels.
virtual void Modified() const
Implements transparent reference counting.
Generate a strain field image from a displacement field image.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)