ITK  6.0.0
Insight Toolkit
itkImageToImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 
107 template <typename TInputImage, typename TOutputImage>
108 class ITK_TEMPLATE_EXPORT ImageToImageFilter
109  : public ImageSource<TOutputImage>
110  , private ImageToImageFilterCommon
111 {
112 public:
113  ITK_DISALLOW_COPY_AND_MOVE(ImageToImageFilter);
114 
120 
122  itkOverrideGetNameOfClassMacro(ImageToImageFilter);
123 
125  using typename Superclass::OutputImageRegionType;
126  using typename Superclass::OutputImagePixelType;
127 
129  using InputImageType = TInputImage;
133  using InputImagePixelType = typename InputImageType::PixelType;
134 
136  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
137  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
138 
140  using Superclass::SetInput;
141  virtual void
142  SetInput(const InputImageType * input);
143 
144  virtual void
145  SetInput(unsigned int, const TInputImage * image);
146 
147  const InputImageType *
148  GetInput() const;
149 
150  const InputImageType *
151  GetInput(unsigned int idx) const;
152 
172  virtual void
173  PushBackInput(const InputImageType * input);
174 
175  void
176  PopBackInput() override;
177 
178  virtual void
179  PushFrontInput(const InputImageType * input);
180 
181  void
182  PopFrontInput() override;
183 
189  itkSetMacro(CoordinateTolerance, double);
190  itkGetConstMacro(CoordinateTolerance, double);
198  itkSetMacro(DirectionTolerance, double);
199  itkGetConstMacro(DirectionTolerance, double);
210 
211 
220 
221 
222 protected:
224  ~ImageToImageFilter() override = default;
225 
226  void
227  PrintSelf(std::ostream & os, Indent indent) const override;
228 
248  void
249  VerifyInputInformation() const override;
250 
275  void
276  GenerateInputRequestedRegion() override;
277 
282 
287 
323  virtual void
324  CallCopyOutputRegionToInputRegion(InputImageRegionType & destRegion, const OutputImageRegionType & srcRegion);
325 
356  virtual void
357  CallCopyInputRegionToOutputRegion(OutputImageRegionType & destRegion, const InputImageRegionType & srcRegion);
358 
367  using Superclass::PushBackInput;
368  using Superclass::PushFrontInput;
371 private:
376  double m_CoordinateTolerance{};
377  double m_DirectionTolerance{};
378 };
379 } // end namespace itk
380 
381 #ifndef ITK_MANUAL_INSTANTIATION
382 # include "itkImageToImageFilter.hxx"
383 #endif
384 
385 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itkImageSource.h
itk::ImageToImageFilterCommon::GetGlobalDefaultCoordinateTolerance
static double GetGlobalDefaultCoordinateTolerance()
itk::ImageToImageFilterCommon::SetGlobalDefaultDirectionTolerance
static void SetGlobalDefaultDirectionTolerance(double)
itkConceptChecking.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkImageToImageFilterCommon.h
itk::ImageToImageFilter< TInputImage, Image< IdentifierType, TInputImage::ImageDimension > >::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToImageFilter.h:133
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::ImageToImageFilter< TInputImage, Image< IdentifierType, TInputImage::ImageDimension > >::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itkImageToImageFilterDetail.h
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter< TInputImage, Image< IdentifierType, TInputImage::ImageDimension > >::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::ImageToImageFilterCommon
Secondary base class of ImageToImageFilter common between templates.
Definition: itkImageToImageFilterCommon.h:38
itk::ImageToImageFilterCommon::SetGlobalDefaultCoordinateTolerance
static void SetGlobalDefaultCoordinateTolerance(double)
itk::ImageSource< Image< IdentifierType, TInputImage::ImageDimension > >::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::ImageToImageFilterCommon::GetGlobalDefaultDirectionTolerance
static double GetGlobalDefaultDirectionTolerance()
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ImageToImageFilterDetail::ImageRegionCopier
A Function object used to dispatching to a routine to copy a region (start index and size).
Definition: itkImageToImageFilterDetail.h:318
itk::ImageToImageFilter< TInputImage, Image< IdentifierType, TInputImage::ImageDimension > >::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::ImageToImageFilter< TInputImage, Image< IdentifierType, TInputImage::ImageDimension > >::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageToImageFilter.h:131