ITK  4.3.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  itkGetMacro(CoordinateTolerance,double);
176 
182  itkSetMacro(DirectionTolerance,double);
183  itkGetMacro(DirectionTolerance,double);
184 protected:
188 
189  virtual void PrintSelf(std::ostream & os, Indent indent) const;
190 
210  virtual void VerifyInputInformation();
211 
236  virtual void GenerateInputRequestedRegion();
237 
240  typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(OutputImageDimension),
241  itkGetStaticConstMacro(InputImageDimension) >
243 
246  typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(InputImageDimension),
247  itkGetStaticConstMacro(OutputImageDimension) >
249 
285  virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType & destRegion,
286  const OutputImageRegionType & srcRegion);
287 
318  virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType & destRegion,
319  const InputImageRegionType & srcRegion);
320 
329  void PushBackInput(const DataObject *input)
330  { Superclass::PushBackInput(input); }
331  void PushFrontInput(const DataObject *input)
332  { Superclass::PushFrontInput(input); }
334 
335 private:
336  ImageToImageFilter(const Self &); //purposely not implemented
337  void operator=(const Self &); //purposely not implemented
344 };
345 } // end namespace itk
346 
347 #ifndef ITK_MANUAL_INSTANTIATION
348 #include "itkImageToImageFilter.hxx"
349 #endif
350 
351 #endif
352