ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkBlockMatchingSearchRegionImageInitializer.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 itkBlockMatchingSearchRegionImageInitializer_h
19#define itkBlockMatchingSearchRegionImageInitializer_h
20
21#include "itkImageSource.h"
22
23namespace itk
24{
25namespace BlockMatching
26{
27
41template <typename TFixedImage, typename TMovingImage>
42class ITK_TEMPLATE_EXPORT SearchRegionImageInitializer
43 : public ImageSource<Image<typename TMovingImage::RegionType, TMovingImage::ImageDimension>>
44{
45public:
46 ITK_DISALLOW_COPY_AND_MOVE(SearchRegionImageInitializer);
47
49 static constexpr unsigned int ImageDimension = TMovingImage::ImageDimension;
50
52 using FixedImageType = TFixedImage;
53 using FixedRegionType = typename FixedImageType::RegionType;
54
56 using RadiusType = typename FixedImageType::SizeType;
57
59 using MovingImageType = TMovingImage;
60 using MovingRegionType = typename MovingImageType::RegionType;
61
65
71
73 itkNewMacro(Self);
74
76 itkOverrideGetNameOfClassMacro(SearchRegionImageInitializer);
77
79 void
81 const FixedImageType *
83 {
84 return this->m_FixedImage.GetPointer();
85 }
86
88 void
90 const MovingImageType *
92 {
93 return this->m_MovingImage.GetPointer();
94 }
95
98 virtual void
100 {
101 m_FixedBlockRadius = radius;
102 this->Modified();
103 }
104 itkGetConstMacro(FixedBlockRadius, RadiusType);
106 virtual void
107 SetFixedBlockRadius(const unsigned int rad)
108 {
109 RadiusType radius;
110 radius.Fill(rad);
111 this->SetFixedBlockRadius(radius);
112 }
113
116 virtual void
118 {
119 m_SearchRegionRadius = radius;
120 this->Modified();
121 }
122 itkGetConstMacro(SearchRegionRadius, RadiusType);
124 virtual void
125 SetSearchRegionRadius(const unsigned int rad)
126 {
127 RadiusType radius;
128 radius.Fill(rad);
129 this->SetSearchRegionRadius(radius);
130 }
131
136 itkSetMacro(Overlap, double);
137 itkGetConstMacro(Overlap, double);
138
139 // @todo make overlap into a SpacingType so the overlap can be specified
140 // differently in every direction.
141
142protected:
144
145 void
147
148 void
150
151 void
152 DynamicThreadedGenerateData(const OutputRegionType & outputRegion) override;
153
154 typename FixedImageType::Pointer m_FixedImage;
155 typename MovingImageType::Pointer m_MovingImage;
156
159
160 double m_Overlap;
161
162private:
163};
164
165} // end namespace BlockMatching
166} // end namespace itk
167
168#ifndef ITK_MANUAL_INSTANTIATION
169# include "itkBlockMatchingSearchRegionImageInitializer.hxx"
170#endif
171
172#endif
Image< typename MovingImageType::RegionType, ImageDimension > OutputImageType
void SetFixedImage(FixedImageType *fixedImage)
void DynamicThreadedGenerateData(const OutputRegionType &outputRegion) override
void SetMovingImage(MovingImageType *movingImage)
Templated n-dimensional image class.
Definition itkImage.h:89
virtual void Modified() const
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)