ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkCheckerBoardImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkCheckerBoardImageFilter_h
00019 #define __itkCheckerBoardImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00044 template< class TImage >
00045 class ITK_EXPORT CheckerBoardImageFilter:
00046   public ImageToImageFilter< TImage, TImage >
00047 {
00048 public:
00050   typedef CheckerBoardImageFilter              Self;
00051   typedef ImageToImageFilter< TImage, TImage > Superclass;
00052   typedef SmartPointer< Self >                 Pointer;
00053   typedef SmartPointer< const Self >           ConstPointer;
00054 
00055   typedef TImage                                InputImageType;
00056   typedef TImage                                OutputImageType;
00057   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00058   typedef typename OutputImageType::Pointer     OutputImagePointer;
00059   typedef typename OutputImageType::RegionType  ImageRegionType;
00060 
00062   itkNewMacro(Self);
00063 
00065   itkTypeMacro(CheckerBoardImageFilter, ImageToImageFilter);
00066 
00068   itkStaticConstMacro(ImageDimension, unsigned int,
00069                       TImage::ImageDimension);
00070 
00072   typedef FixedArray< unsigned int,
00073                       ::itk::GetImageDimension< TImage >::ImageDimension >  PatternArrayType;
00074 
00076   void SetInput1(const TImage *image1);
00077 
00079   void SetInput2(const TImage *image2);
00080 
00082   itkSetMacro(CheckerPattern, PatternArrayType);
00083   itkGetConstReferenceMacro(CheckerPattern, PatternArrayType);
00084 protected:
00085   CheckerBoardImageFilter();
00086   ~CheckerBoardImageFilter() {}
00087   void PrintSelf(std::ostream & os, Indent indent) const;
00089 
00098   void ThreadedGenerateData(const ImageRegionType & outputRegionForThread,
00099                             ThreadIdType threadId);
00100 
00101 private:
00102   CheckerBoardImageFilter(const Self &); //purposely not implemented
00103   void operator=(const Self &);          //purposely not implemented
00104 
00105   PatternArrayType m_CheckerPattern;
00106 };
00107 } // end namespace itk
00108 
00109 #ifndef ITK_MANUAL_INSTANTIATION
00110 #include "itkCheckerBoardImageFilter.hxx"
00111 #endif
00112 
00113 #endif
00114