ITK  4.3.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< class TInputImage, class TOutputImage >
53 class ITK_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;
72  typedef typename TInputImage::IndexType IndexType;
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 
93  itkConceptMacro( SameDimensionCheck,
95  itkConceptMacro( InputConvertibleToOutputCheck,
97 
99 #endif
100 
101 protected:
104  void PrintSelf(std::ostream & os, Indent indent) const;
105 
106  virtual void GenerateInputRequestedRegion();
107 
108  virtual void EnlargeOutputRequestedRegion(DataObject *output);
109 
118  virtual void GenerateOutputInformation();
119 
129  void ThreadedGenerateData(const RegionType & outputRegionForThread,
130  ThreadIdType threadId);
131 
132 private:
133  RegionOfInterestImageFilter(const Self &); //purposely not implemented
134  void operator=(const Self &); //purposely not implemented
135 
137 };
138 } // end namespace itk
139 
140 #ifndef ITK_MANUAL_INSTANTIATION
141 #include "itkRegionOfInterestImageFilter.hxx"
142 #endif
143 
144 #endif
145