ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkImageToImageFilter.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 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef __itkImageToImageFilter_h
29 #define __itkImageToImageFilter_h
30 
31 #include "itkImageSource.h"
32 #include "itkConceptChecking.h"
34 
35 namespace itk
36 {
79 template< class TInputImage, class TOutputImage >
80 class ITK_EXPORT ImageToImageFilter:public ImageSource< TOutputImage >
81 {
82 public:
88 
91 
93  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
94  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
95 
97  typedef TInputImage InputImageType;
98  typedef typename InputImageType::Pointer InputImagePointer;
99  typedef typename InputImageType::ConstPointer InputImageConstPointer;
100  typedef typename InputImageType::RegionType InputImageRegionType;
101  typedef typename InputImageType::PixelType InputImagePixelType;
102 
104  itkStaticConstMacro(InputImageDimension, unsigned int,
105  TInputImage::ImageDimension);
106  itkStaticConstMacro(OutputImageDimension, unsigned int,
107  TOutputImage::ImageDimension);
109 
111  using Superclass::SetInput;
112  virtual void SetInput(const InputImageType *image);
113 
114  virtual void SetInput(unsigned int, const TInputImage *image);
115 
116  const InputImageType * GetInput(void) const;
117 
118  const InputImageType * GetInput(unsigned int idx) const;
119 
139  virtual void PushBackInput(const InputImageType *image);
140 
141  virtual void PopBackInput();
142 
143  virtual void PushFrontInput(const InputImageType *image);
144 
145  virtual void PopFrontInput();
146 
147 protected:
150 
151  virtual void PrintSelf(std::ostream & os, Indent indent) const;
152 
172  virtual void VerifyInputInformation();
173 
198  virtual void GenerateInputRequestedRegion();
199 
202  typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(OutputImageDimension),
203  itkGetStaticConstMacro(InputImageDimension) >
205 
208  typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(InputImageDimension),
209  itkGetStaticConstMacro(OutputImageDimension) >
211 
247  virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType & destRegion,
248  const OutputImageRegionType & srcRegion);
249 
280  virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType & destRegion,
281  const InputImageRegionType & srcRegion);
282 
291  void PushBackInput(const DataObject *input)
292  { Superclass::PushBackInput(input); }
293  void PushFrontInput(const DataObject *input)
294  { Superclass::PushFrontInput(input); }
295 private:
296  ImageToImageFilter(const Self &); //purposely not implemented
297  void operator=(const Self &); //purposely not implemented
298 };
299 } // end namespace itk
301 
302 // Define instantiation macro for this template.
303 #define ITK_TEMPLATE_ImageToImageFilter(_, EXPORT, TypeX, TypeY) \
304  namespace itk \
305  { \
306  _( 2 ( class EXPORT ImageToImageFilter< ITK_TEMPLATE_2 TypeX > ) ) \
307  namespace Templates \
308  { \
309  typedef ImageToImageFilter< ITK_TEMPLATE_2 TypeX > ImageToImageFilter##TypeY; \
310  } \
311  }
312 
313 #if ITK_TEMPLATE_EXPLICIT
314 #include "Templates/itkImageToImageFilter+-.h"
315 #endif
316 
317 #if ITK_TEMPLATE_TXX
318 #include "itkImageToImageFilter.hxx"
319 #endif
320 
321 #endif
322