ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkRegionOfInterestImageFilter.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 #ifndef itkRegionOfInterestImageFilter_h
19 #define itkRegionOfInterestImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkSmartPointer.h"
23 
24 namespace itk
25 {
52 template< typename TInputImage, typename TOutputImage >
53 class ITK_TEMPLATE_EXPORT RegionOfInterestImageFilter:
54  public ImageToImageFilter< TInputImage, TOutputImage >
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_ASSIGN(RegionOfInterestImageFilter);
58 
64  using InputImageRegionType = typename Superclass::InputImageRegionType;
65 
67  itkNewMacro(Self);
68 
71 
75  using SizeType = typename TInputImage::SizeType;
76 
78  using OutputImagePixelType = typename TOutputImage::PixelType;
79  using InputImagePixelType = typename TInputImage::PixelType;
80 
82  itkSetMacro(RegionOfInterest, RegionType);
83  itkGetConstMacro(RegionOfInterest, RegionType);
85 
87  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
88  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
89 
90 #ifdef ITK_USE_CONCEPT_CHECKING
91  // Begin concept checking
92  itkConceptMacro( SameDimensionCheck,
94  itkConceptMacro( InputConvertibleToOutputCheck,
96  // End concept checking
97 #endif
98 
99 protected:
101  ~RegionOfInterestImageFilter() override = default;
102  void PrintSelf(std::ostream & os, Indent indent) const override;
103 
104  void GenerateInputRequestedRegion() override;
105 
106  void EnlargeOutputRequestedRegion(DataObject *output) override;
107 
115  void GenerateOutputInformation() override;
116 
126  void DynamicThreadedGenerateData(const RegionType & outputRegionForThread) override;
127 
128 private:
130 };
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkRegionOfInterestImageFilter.hxx"
135 #endif
136 
137 #endif
typename TInputImage::RegionType RegionType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Extract a region of interest from the input image.
typename InputImageType::RegionType InputImageRegionType
typename TInputImage::IndexType IndexType
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
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.