ITK  4.4.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 {
101 template< class TInputImage, class TOutputImage >
102 class ITK_EXPORT ImageToImageFilter:public ImageSource< TOutputImage >
103 {
104 public:
110 
113 
115  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
116  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
117 
119  typedef TInputImage InputImageType;
120  typedef typename InputImageType::Pointer InputImagePointer;
121  typedef typename InputImageType::ConstPointer InputImageConstPointer;
122  typedef typename InputImageType::RegionType InputImageRegionType;
123  typedef typename InputImageType::PixelType InputImagePixelType;
124 
126  itkStaticConstMacro(InputImageDimension, unsigned int,
127  TInputImage::ImageDimension);
128  itkStaticConstMacro(OutputImageDimension, unsigned int,
129  TOutputImage::ImageDimension);
131 
133  using Superclass::SetInput;
134  virtual void SetInput(const InputImageType *image);
135 
136  virtual void SetInput(unsigned int, const TInputImage *image);
137 
138  const InputImageType * GetInput(void) const;
139 
140  const InputImageType * GetInput(unsigned int idx) const;
141 
161  virtual void PushBackInput(const InputImageType *image);
162 
163  virtual void PopBackInput();
164 
165  virtual void PushFrontInput(const InputImageType *image);
166 
167  virtual void PopFrontInput();
168 
174  itkSetMacro(CoordinateTolerance,double);
175  itkGetConstMacro(CoordinateTolerance,double);
177 
183  itkSetMacro(DirectionTolerance,double);
184  itkGetConstMacro(DirectionTolerance,double);
186 
187 protected:
190 
191  virtual void PrintSelf(std::ostream & os, Indent indent) const;
192 
212  virtual void VerifyInputInformation();
213 
238  virtual void GenerateInputRequestedRegion();
239 
242  typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(OutputImageDimension),
243  itkGetStaticConstMacro(InputImageDimension) >
245 
248  typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(InputImageDimension),
249  itkGetStaticConstMacro(OutputImageDimension) >
251 
287  virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType & destRegion,
288  const OutputImageRegionType & srcRegion);
289 
320  virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType & destRegion,
321  const InputImageRegionType & srcRegion);
322 
331  void PushBackInput(const DataObject *input)
332  { Superclass::PushBackInput(input); }
333  void PushFrontInput(const DataObject *input)
334  { Superclass::PushFrontInput(input); }
336 
337 private:
338  ImageToImageFilter(const Self &); //purposely not implemented
339  void operator=(const Self &); //purposely not implemented
346 };
347 } // end namespace itk
348 
349 #ifndef ITK_MANUAL_INSTANTIATION
350 #include "itkImageToImageFilter.hxx"
351 #endif
352 
353 #endif
354