ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkCheckerBoardImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 itkCheckerBoardImageFilter_h
19 #define itkCheckerBoardImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
44 template< typename TImage >
45 class ITK_TEMPLATE_EXPORT CheckerBoardImageFilter:
46  public ImageToImageFilter< TImage, TImage >
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_ASSIGN(CheckerBoardImageFilter);
50 
56 
57  using InputImageType = TImage;
58  using OutputImageType = TImage;
59  using InputImageConstPointer = typename InputImageType::ConstPointer;
60  using OutputImagePointer = typename OutputImageType::Pointer;
62 
64  itkNewMacro(Self);
65 
68 
70  static constexpr unsigned int ImageDimension = TImage::ImageDimension;
71 
73  using PatternArrayType = FixedArray< unsigned int,
74  TImage ::ImageDimension >;
75 
77  void SetInput1(const TImage *image1);
78 
80  void SetInput2(const TImage *image2);
81 
84  itkSetMacro(CheckerPattern, PatternArrayType);
85  itkGetConstReferenceMacro(CheckerPattern, PatternArrayType);
87 
88 protected:
90  ~CheckerBoardImageFilter() override = default;
91  void PrintSelf(std::ostream & os, Indent indent) const override;
92 
101  void DynamicThreadedGenerateData(const ImageRegionType & outputRegionForThread) override;
102 
103 
104 private:
106 };
107 } // end namespace itk
108 
109 #ifndef ITK_MANUAL_INSTANTIATION
110 #include "itkCheckerBoardImageFilter.hxx"
111 #endif
112 
113 #endif
Light weight base class for most itk classes.
typename OutputImageType::Pointer OutputImagePointer
Combines two images in a checkerboard pattern.
typename OutputImageType::RegionType ImageRegionType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename InputImageType::ConstPointer InputImageConstPointer