ITK  5.0.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:
111  ITK_DISALLOW_COPY_AND_ASSIGN(ImageToImageFilter);
112 
118 
120  itkTypeMacro(ImageToImageFilter, ImageSource);
121 
123  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
124  using OutputImagePixelType = typename Superclass::OutputImagePixelType;
125 
127  using InputImageType = TInputImage;
128  using InputImagePointer = typename InputImageType::Pointer;
129  using InputImageConstPointer = typename InputImageType::ConstPointer;
131  using InputImagePixelType = typename InputImageType::PixelType;
132 
134  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
135  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
136 
138  using Superclass::SetInput;
139  virtual void SetInput(const InputImageType *image);
140 
141  virtual void SetInput(unsigned int, const TInputImage *image);
142 
143  const InputImageType * GetInput() const;
144 
145  const InputImageType * GetInput(unsigned int idx) const;
146 
166  virtual void PushBackInput(const InputImageType *image);
167 
168  void PopBackInput() override;
169 
170  virtual void PushFrontInput(const InputImageType *image);
171 
172  void PopFrontInput() override;
173 
179  itkSetMacro(CoordinateTolerance,double);
180  itkGetConstMacro(CoordinateTolerance,double);
182 
188  itkSetMacro(DirectionTolerance,double);
189  itkGetConstMacro(DirectionTolerance,double);
191 
200 
201 
210 
211 
212 protected:
214  ~ImageToImageFilter() override {};
215 
216  void PrintSelf(std::ostream & os, Indent indent) const override;
217 
237  void VerifyInputInformation() ITKv5_CONST override;
238 
263  void GenerateInputRequestedRegion() override;
264 
267  using InputToOutputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier<
268  Self::OutputImageDimension,
269  Self::InputImageDimension >;
270 
273  using OutputToInputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier<
274  Self::InputImageDimension,
275  Self::OutputImageDimension >;
276 
312  virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType & destRegion,
313  const OutputImageRegionType & srcRegion);
314 
345  virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType & destRegion,
346  const InputImageRegionType & srcRegion);
347 
356  void PushBackInput(const DataObject *input) override
357  { Superclass::PushBackInput(input); }
358  void PushFrontInput(const DataObject *input) override
359  { Superclass::PushFrontInput(input); }
361 
362 private:
369 };
370 } // end namespace itk
371 
372 #ifndef ITK_MANUAL_INSTANTIATION
373 #include "itkImageToImageFilter.hxx"
374 #endif
375 
376 #endif
void PushFrontInput(const DataObject *input) override
Light weight base class for most itk classes.
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)...
Base class for all process objects that output image data.
static double GetGlobalDefaultCoordinateTolerance()
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()
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for all data objects in ITK.