ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkRLERegionOfInterestImageFilter.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 itkRLERegionOfInterestImageFilter_h
19#define itkRLERegionOfInterestImageFilter_h
20
22#include "itkRLEImage.h"
24#include "itkSmartPointer.h"
25
26namespace itk
27{
47template <typename TPixel, unsigned int VImageDimension, typename CounterType>
48class RegionOfInterestImageFilter<RLEImage<TPixel, VImageDimension, CounterType>,
49 RLEImage<TPixel, VImageDimension, CounterType>>
50 : public ImageToImageFilter<RLEImage<TPixel, VImageDimension, CounterType>,
51 RLEImage<TPixel, VImageDimension, CounterType>>
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(RegionOfInterestImageFilter);
55
64
66 itkNewMacro(Self);
67
69 itkOverrideGetNameOfClassMacro(RegionOfInterestImageFilter);
70
75
79
81 itkSetMacro(RegionOfInterest, RegionType);
82 itkGetConstMacro(RegionOfInterest, RegionType);
83
85 static constexpr unsigned int ImageDimension = VImageDimension;
86 static constexpr unsigned int OutputImageDimension = VImageDimension;
87
88 static_assert(ImageDimension == OutputImageDimension);
90
91protected:
93 ~RegionOfInterestImageFilter() override = default;
94 void
95 PrintSelf(std::ostream & os, Indent indent) const override;
96
97 void
99
100 void
102
111 void
113
123 void
124 DynamicThreadedGenerateData(const RegionType & outputRegionForThread) override;
125
126private:
128};
129
130template <typename TPixelIn,
131 typename TPixelOut,
132 unsigned int VImageDimension,
133 typename CounterTypeIn,
134 typename CounterTypeOut>
135class RegionOfInterestImageFilter<RLEImage<TPixelIn, VImageDimension, CounterTypeIn>,
136 RLEImage<TPixelOut, VImageDimension, CounterTypeOut>>
137 : public ImageToImageFilter<RLEImage<TPixelIn, VImageDimension, CounterTypeIn>,
138 RLEImage<TPixelOut, VImageDimension, CounterTypeOut>>
139{
140public:
141 ITK_DISALLOW_COPY_AND_MOVE(RegionOfInterestImageFilter);
142
152
154 itkNewMacro(Self);
155
157 itkOverrideGetNameOfClassMacro(RegionOfInterestImageFilter);
158
163
167
169 itkSetMacro(RegionOfInterest, RegionType);
170 itkGetConstMacro(RegionOfInterest, RegionType);
171
173 static constexpr unsigned int ImageDimension = VImageDimension;
174 static constexpr unsigned int OutputImageDimension = VImageDimension;
175
176 static_assert(ImageDimension == OutputImageDimension);
178
179protected:
181 ~RegionOfInterestImageFilter() override = default;
182 void
183 PrintSelf(std::ostream & os, Indent indent) const override;
184
185 void
187
188 void
190
199 void
201
211 void
212 DynamicThreadedGenerateData(const RegionType & outputRegionForThread) override;
213
214private:
216};
217
218// not implemented on purpose, so it will produce a meaningful error message
219template <unsigned int VImageDimensionIn, unsigned int VImageDimensionOut>
221
222// input and output images must have the same dimension (e.g. both 2D or both 3D)
223// so disallow this by inheriting from unimplemented base class
224template <typename TPixelIn,
225 typename TPixelOut,
226 unsigned int VImageDimensionIn,
227 unsigned int VImageDimensionOut,
228 typename CounterTypeIn,
229 typename CounterTypeOut>
230class RegionOfInterestImageFilter<RLEImage<TPixelIn, VImageDimensionIn, CounterTypeIn>,
231 RLEImage<TPixelOut, VImageDimensionOut, CounterTypeOut>>
232 : InputAndOutputImagesMustHaveSameDimension<VImageDimensionIn, VImageDimensionOut>
233{};
234
235template <typename TPixel, unsigned int VImageDimension, typename CounterType>
236class RegionOfInterestImageFilter<Image<TPixel, VImageDimension>, RLEImage<TPixel, VImageDimension, CounterType>>
237 : public ImageToImageFilter<Image<TPixel, VImageDimension>, RLEImage<TPixel, VImageDimension, CounterType>>
238{
239public:
240 ITK_DISALLOW_COPY_AND_MOVE(RegionOfInterestImageFilter);
241
244
251
253 itkNewMacro(Self);
254
256 itkOverrideGetNameOfClassMacro(RegionOfInterestImageFilter);
257
262
266
268 itkSetMacro(RegionOfInterest, RegionType);
269 itkGetConstMacro(RegionOfInterest, RegionType);
270
272 static constexpr unsigned int ImageDimension = VImageDimension;
273 static constexpr unsigned int OutputImageDimension = VImageDimension;
274
275 static_assert(ImageDimension == OutputImageDimension);
277
278protected:
280 ~RegionOfInterestImageFilter() override = default;
281 void
282 PrintSelf(std::ostream & os, Indent indent) const override;
283
284 void
286
287 void
289
298 void
300
310 void
311 DynamicThreadedGenerateData(const RegionType & outputRegionForThread) override;
312
313private:
315};
316
317template <typename TPixel, unsigned int VImageDimension, typename CounterType>
318class RegionOfInterestImageFilter<RLEImage<TPixel, VImageDimension, CounterType>, Image<TPixel, VImageDimension>>
319 : public ImageToImageFilter<RLEImage<TPixel, VImageDimension, CounterType>, Image<TPixel, VImageDimension>>
320{
321public:
322 ITK_DISALLOW_COPY_AND_MOVE(RegionOfInterestImageFilter);
323
326
333
335 itkNewMacro(Self);
336
338 itkOverrideGetNameOfClassMacro(RegionOfInterestImageFilter);
339
344
348
350 itkSetMacro(RegionOfInterest, RegionType);
351 itkGetConstMacro(RegionOfInterest, RegionType);
352
354 static constexpr unsigned int ImageDimension = VImageDimension;
355 static constexpr unsigned int OutputImageDimension = VImageDimension;
356
357 static_assert(ImageDimension == OutputImageDimension);
359
360protected:
362 ~RegionOfInterestImageFilter() override = default;
363 void
364 PrintSelf(std::ostream & os, Indent indent) const override;
365
366 void
368
369 void
371
380 void
382
392 void
393 DynamicThreadedGenerateData(const RegionType & outputRegionForThread) override;
394
395private:
397};
398} // end namespace itk
399
400#ifndef ITK_MANUAL_INSTANTIATION
401# include "itkRLERegionOfInterestImageFilter.hxx"
402#endif
403
404#endif // itkRLERegionOfInterestImageFilter_h
Base class for all data objects in ITK.
virtual void DynamicMultiThreadingOn()
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:53
Run-Length Encoded image. It saves memory for label images at the expense of processing times....
Definition itkRLEImage.h:53
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)