ITK  4.8.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 ImageToImageFilter:public ImageSource< TOutputImage >,
109 {
110 public:
116 
119 
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 
201 
202 
211 
212 
213 protected:
215  ~ImageToImageFilter();
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 
314  const OutputImageRegionType & srcRegion);
315 
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  ImageToImageFilter(const Self &); //purposely not implemented
365  void operator=(const Self &); //purposely not implemented
372 };
373 } // end namespace itk
374 
375 #ifndef ITK_MANUAL_INSTANTIATION
376 #include "itkImageToImageFilter.hxx"
377 #endif
378 
379 #endif
void PushFrontInput(const DataObject *input) override
virtual void VerifyInputInformation() override
Verifies that the input images occupy the same physical space and the each index is at the same physi...
virtual void PrintSelf(std::ostream &os, Indent indent) const 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)...
virtual void PushFrontInput(const DataObject *input)
virtual void PopBackInput() override
InputImageType::Pointer InputImagePointer
virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion)
Superclass::OutputImagePixelType OutputImagePixelType
void operator=(const Self &)
Base class for all process objects that output image data.
static const unsigned int InputImageDimension
SmartPointer< Self > Pointer
virtual void SetInput(const InputImageType *image)
InputImageType::RegionType InputImageRegionType
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
virtual void PushBackInput(const DataObject *input)
Push/Pop an indexed input of this process object.
virtual void GenerateInputRequestedRegion() override
static const unsigned int OutputImageDimension
const InputImageType * GetInput() const
OutputImageType::PixelType OutputImagePixelType
virtual void PushFrontInput(const InputImageType *image)
static double GetGlobalDefaultCoordinateTolerance()
InputImageType::PixelType InputImagePixelType
virtual void PushBackInput(const InputImageType *image)
static void SetGlobalDefaultDirectionTolerance(double)
Base class for filters that take an image as input and produce an image as output.
static void SetGlobalDefaultCoordinateTolerance(double)
static double GetGlobalDefaultDirectionTolerance()
OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType &destRegion, const InputImageRegionType &srcRegion)
Superclass::OutputImageRegionType OutputImageRegionType
SmartPointer< const Self > ConstPointer
virtual void PopFrontInput() override
Base class for all data objects in ITK.
ImageSource< TOutputImage > Superclass