ITK  4.13.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:
62  typedef typename Superclass::InputImageRegionType InputImageRegionType;
63 
65  itkNewMacro(Self);
66 
69 
71  typedef typename TInputImage::RegionType RegionType;
73  typedef typename TInputImage::SizeType SizeType;
74 
76  typedef typename TOutputImage::PixelType OutputImagePixelType;
77  typedef typename TInputImage::PixelType InputImagePixelType;
78 
80  itkSetMacro(RegionOfInterest, RegionType);
81  itkGetConstMacro(RegionOfInterest, RegionType);
83 
85  itkStaticConstMacro(ImageDimension, unsigned int,
86  TInputImage::ImageDimension);
87  itkStaticConstMacro(OutputImageDimension, unsigned int,
88  TOutputImage::ImageDimension);
90 
91 #ifdef ITK_USE_CONCEPT_CHECKING
92  // Begin concept checking
93  itkConceptMacro( SameDimensionCheck,
95  itkConceptMacro( InputConvertibleToOutputCheck,
97  // End concept checking
98 #endif
99 
100 protected:
103  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
104 
105  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
106 
107  virtual void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
108 
116  virtual void GenerateOutputInformation() ITK_OVERRIDE;
117 
127  void ThreadedGenerateData(const RegionType & outputRegionForThread,
128  ThreadIdType threadId) ITK_OVERRIDE;
129 
130 private:
131  ITK_DISALLOW_COPY_AND_ASSIGN(RegionOfInterestImageFilter);
132 
133  RegionType m_RegionOfInterest;
134 };
135 } // end namespace itk
136 
137 #ifndef ITK_MANUAL_INSTANTIATION
138 #include "itkRegionOfInterestImageFilter.hxx"
139 #endif
140 
141 #endif
Superclass::InputImageRegionType InputImageRegionType
Base class for all process objects that output image data.
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Extract a region of interest from the input image.
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
ImageToImageFilter< TInputImage, TOutputImage > Superclass
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.