ITK  4.13.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"
35 
36 namespace itk
37 {
38 
106 template< typename TInputImage, typename TOutputImage >
107 class ITK_TEMPLATE_EXPORT ImageToImageFilter:public ImageSource< TOutputImage >,
109 {
110 public:
116 
119 
121  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
122  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
123 
125  typedef TInputImage InputImageType;
126  typedef typename InputImageType::Pointer InputImagePointer;
127  typedef typename InputImageType::ConstPointer InputImageConstPointer;
128  typedef typename InputImageType::RegionType InputImageRegionType;
129  typedef typename InputImageType::PixelType InputImagePixelType;
130 
132  itkStaticConstMacro(InputImageDimension, unsigned int,
133  TInputImage::ImageDimension);
134  itkStaticConstMacro(OutputImageDimension, unsigned int,
135  TOutputImage::ImageDimension);
137 
139  using Superclass::SetInput;
140  virtual void SetInput(const InputImageType *image);
141 
142  virtual void SetInput(unsigned int, const TInputImage *image);
143 
144  const InputImageType * GetInput() const;
145 
146  const InputImageType * GetInput(unsigned int idx) const;
147 
167  virtual void PushBackInput(const InputImageType *image);
168 
169  virtual void PopBackInput() ITK_OVERRIDE;
170 
171  virtual void PushFrontInput(const InputImageType *image);
172 
173  virtual void PopFrontInput() ITK_OVERRIDE;
174 
180  itkSetMacro(CoordinateTolerance,double);
181  itkGetConstMacro(CoordinateTolerance,double);
183 
189  itkSetMacro(DirectionTolerance,double);
190  itkGetConstMacro(DirectionTolerance,double);
192 
199  using ImageToImageFilterCommon::SetGlobalDefaultDirectionTolerance;
200  using ImageToImageFilterCommon::GetGlobalDefaultDirectionTolerance;
201 
202 
209  using ImageToImageFilterCommon::SetGlobalDefaultCoordinateTolerance;
210  using ImageToImageFilterCommon::GetGlobalDefaultCoordinateTolerance;
211 
212 
213 protected:
215  ~ImageToImageFilter() ITK_OVERRIDE;
216 
217  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
218 
238  virtual void VerifyInputInformation() ITK_OVERRIDE;
239 
264  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
265 
268  typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(OutputImageDimension),
269  itkGetStaticConstMacro(InputImageDimension) >
271 
274  typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(InputImageDimension),
275  itkGetStaticConstMacro(OutputImageDimension) >
277 
313  virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType & destRegion,
314  const OutputImageRegionType & srcRegion);
315 
346  virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType & destRegion,
347  const InputImageRegionType & srcRegion);
348 
357  void PushBackInput(const DataObject *input) ITK_OVERRIDE
358  { Superclass::PushBackInput(input); }
359  void PushFrontInput(const DataObject *input) ITK_OVERRIDE
360  { Superclass::PushFrontInput(input); }
362 
363 private:
364  ITK_DISALLOW_COPY_AND_ASSIGN(ImageToImageFilter);
369  double m_CoordinateTolerance;
371 };
372 } // end namespace itk
373 
374 #ifndef ITK_MANUAL_INSTANTIATION
375 #include "itkImageToImageFilter.hxx"
376 #endif
377 
378 #endif
void PushFrontInput(const DataObject *input) override
InputImageType::ConstPointer InputImageConstPointer
Secondary base class of ImageToImageFilter common between templates.
A Function object used to dispatching to a routine to copy a region (start index and size)...
InputImageType::Pointer InputImagePointer
Superclass::OutputImagePixelType OutputImagePixelType
Base class for all process objects that output image data.
SmartPointer< Self > Pointer
InputImageType::RegionType InputImageRegionType
InputImageType::PixelType InputImagePixelType
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
Superclass::OutputImageRegionType OutputImageRegionType
SmartPointer< const Self > ConstPointer
Base class for all data objects in ITK.
ImageSource< TOutputImage > Superclass