ITK  5.2.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  * 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 
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  itkTypeMacro(ImageToImageFilter, ImageSource);
123 
125  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
126  using OutputImagePixelType = typename Superclass::OutputImagePixelType;
127 
129  using InputImageType = TInputImage;
130  using InputImagePointer = typename InputImageType::Pointer;
131  using InputImageConstPointer = typename InputImageType::ConstPointer;
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);
192 
198  itkSetMacro(DirectionTolerance, double);
199  itkGetConstMacro(DirectionTolerance, double);
201 
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() ITKv5_CONST override;
250 
275  void
276  GenerateInputRequestedRegion() override;
277 
281  ImageToImageFilterDetail::ImageRegionCopier<Self::OutputImageDimension, Self::InputImageDimension>;
282 
286  ImageToImageFilterDetail::ImageRegionCopier<Self::InputImageDimension, Self::OutputImageDimension>;
287 
323  virtual void
324  CallCopyOutputRegionToInputRegion(InputImageRegionType & destRegion, const OutputImageRegionType & srcRegion);
325 
356  virtual void
357  CallCopyInputRegionToOutputRegion(OutputImageRegionType & destRegion, const InputImageRegionType & srcRegion);
358 
367  void
368  PushBackInput(const DataObject * input) override
369  {
370  Superclass::PushBackInput(input);
371  }
372  void
373  PushFrontInput(const DataObject * input) override
374  {
375  Superclass::PushFrontInput(input);
376  }
378 
379 private:
386 };
387 } // end namespace itk
388 
389 #ifndef ITK_MANUAL_INSTANTIATION
390 # include "itkImageToImageFilter.hxx"
391 #endif
392 
393 #endif
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:59
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::PushFrontInput
void PushFrontInput(const DataObject *input) override
Definition: itkImageToImageFilter.h:373
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: itkAnnulusOperator.h:24
itk::ImageToImageFilter::m_DirectionTolerance
double m_DirectionTolerance
Definition: itkImageToImageFilter.h:385
itk::ImageSource< Image< IdentifierType, TInputImage::ImageDimension > >::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::ImageToImageFilterDetail::ImageRegionCopier
A Function object used to dispatching to a routine to copy a region (start index and size).
Definition: itkImageToImageFilterDetail.h:328
itk::ImageToImageFilter::m_CoordinateTolerance
double m_CoordinateTolerance
Definition: itkImageToImageFilter.h:384
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
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293