ITK  4.13.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:
54 
55  typedef TImage InputImageType;
56  typedef TImage OutputImageType;
57  typedef typename InputImageType::ConstPointer InputImageConstPointer;
58  typedef typename OutputImageType::Pointer OutputImagePointer;
59  typedef typename OutputImageType::RegionType ImageRegionType;
60 
62  itkNewMacro(Self);
63 
66 
68  itkStaticConstMacro(ImageDimension, unsigned int,
69  TImage::ImageDimension);
70 
72  typedef FixedArray< unsigned int,
73  TImage ::ImageDimension > PatternArrayType;
74 
76  void SetInput1(const TImage *image1);
77 
79  void SetInput2(const TImage *image2);
80 
83  itkSetMacro(CheckerPattern, PatternArrayType);
84  itkGetConstReferenceMacro(CheckerPattern, PatternArrayType);
86 
87 protected:
89  ~CheckerBoardImageFilter() ITK_OVERRIDE {}
90  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
91 
100  void ThreadedGenerateData(const ImageRegionType & outputRegionForThread,
101  ThreadIdType threadId) ITK_OVERRIDE;
102 
103 private:
104  ITK_DISALLOW_COPY_AND_ASSIGN(CheckerBoardImageFilter);
105 
107 };
108 } // end namespace itk
109 
110 #ifndef ITK_MANUAL_INSTANTIATION
111 #include "itkCheckerBoardImageFilter.hxx"
112 #endif
113 
114 #endif
Light weight base class for most itk classes.
InputImageType::ConstPointer InputImageConstPointer
FixedArray< unsigned int, TImage::ImageDimension > PatternArrayType
SmartPointer< const Self > ConstPointer
Simulate a standard C array with copy semnatics.
Definition: itkFixedArray.h:50
Combines two images in a checkerboard pattern.
OutputImageType::Pointer OutputImagePointer
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
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
ImageToImageFilter< TImage, TImage > Superclass
OutputImageType::RegionType ImageRegionType