ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkExtractImageFilter.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 __itkExtractImageFilter_h
19 #define __itkExtractImageFilter_h
20 
21 #include "itkInPlaceImageFilter.h"
22 #include "itkSmartPointer.h"
24 
25 namespace itk
26 {
89 template< typename TInputImage, typename TOutputImage >
91  public InPlaceImageFilter< TInputImage, TOutputImage >
92 {
93 public:
99 
101  itkNewMacro(Self);
102 
105 
107  typedef TInputImage InputImageType;
108  typedef TOutputImage OutputImageType;
109 
111  typedef typename TOutputImage::RegionType OutputImageRegionType;
112  typedef typename TInputImage::RegionType InputImageRegionType;
113 
115  typedef typename TOutputImage::PixelType OutputImagePixelType;
116  typedef typename TInputImage::PixelType InputImagePixelType;
117 
119  typedef typename TOutputImage::IndexType OutputImageIndexType;
120  typedef typename TInputImage::IndexType InputImageIndexType;
121  typedef typename TOutputImage::SizeType OutputImageSizeType;
122  typedef typename TInputImage::SizeType InputImageSizeType;
123 
130 
131 
157  {
158  switch(choosenStrategy)
159  {
163  break;
165  default:
166  itkExceptionMacro( << "Invalid Strategy Chosen for itk::ExtractImageFilter" );
167  }
169 
170  this->m_DirectionCollapseStrategy=choosenStrategy;
171  this->Modified();
172  }
173 
183  {
184  return this->m_DirectionCollapseStrategy;
185  }
186 
189  {
191  }
192 
195  {
197  }
198 
201  {
203  }
204 
205 
207  itkStaticConstMacro(InputImageDimension, unsigned int,
208  TInputImage::ImageDimension);
209  itkStaticConstMacro(OutputImageDimension, unsigned int,
210  TOutputImage::ImageDimension);
212 
214  itkGetStaticConstMacro(InputImageDimension),
216 
222  void SetExtractionRegion(InputImageRegionType extractRegion);
223  itkGetConstMacro(ExtractionRegion, InputImageRegionType);
225 
226 #ifdef ITK_USE_CONCEPT_CHECKING
227  // Begin concept checking
228  itkConceptMacro( InputCovertibleToOutputCheck,
230  // End concept checking
231 #endif
232 
233 protected:
236  void PrintSelf(std::ostream & os, Indent indent) const;
237 
246  virtual void GenerateOutputInformation();
247 
259  const OutputImageRegionType & srcRegion);
260 
270  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
271  ThreadIdType threadId);
272 
276  void GenerateData();
277 
279 
281 
282 private:
283  ExtractImageFilter(const Self &); //purposely not implemented
284  void operator=(const Self &); //purposely not implemented
285 
287 };
288 } // end namespace itk
289 
290 #ifndef ITK_MANUAL_INSTANTIATION
291 #include "itkExtractImageFilter.hxx"
292 #endif
293 
294 #endif
static const unsigned int InputImageDimension
virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion)
void operator=(const Self &)
TOutputImage::SizeType OutputImageSizeType
Decrease the image size by cropping the image to the selected region bounds.
A special variation of ImageRegionCopier for when the output image has fewer dimensions than the inpu...
TInputImage::IndexType InputImageIndexType
InPlaceImageFilter< TInputImage, TOutputImage > Superclass
ImageToImageFilterDetail::ExtractImageFilterRegionCopier< itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > ExtractImageFilterRegionCopierType
SmartPointer< Self > Pointer
static const unsigned int OutputImageDimension
SmartPointer< const Self > ConstPointer
DIRECTIONCOLLAPSESTRATEGY m_DirectionCollapseStrategy
TOutputImage::IndexType OutputImageIndexType
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
virtual void Modified() const
void SetExtractionRegion(InputImageRegionType extractRegion)
TInputImage::PixelType InputImagePixelType
virtual void GenerateOutputInformation()
enum itk::ExtractImageFilter::DirectionCollapseStrategyEnum DIRECTIONCOLLAPSESTRATEGY
void SetDirectionCollapseToStrategy(const DIRECTIONCOLLAPSESTRATEGY choosenStrategy)
TOutputImage::RegionType OutputImageRegionType
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
OutputImageRegionType m_OutputImageRegion
Base class for filters that take an image as input and overwrite that image as the output...
TInputImage::SizeType InputImageSizeType
InputImageRegionType m_ExtractionRegion
TOutputImage::PixelType OutputImagePixelType
void PrintSelf(std::ostream &os, Indent indent) const
#define itkConceptMacro(name, concept)
DIRECTIONCOLLAPSESTRATEGY GetDirectionCollapseToStrategy() const
TInputImage::RegionType InputImageRegionType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159