ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkTestingExtractSliceImageFilter.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 itkTestingExtractSliceImageFilter_h
19 #define itkTestingExtractSliceImageFilter_h
20 
21 #include "itkSmartPointer.h"
22 #include "itkImageSource.h"
24 
25 namespace itk
26 {
27 namespace Testing
28 {
82 template< typename TInputImage, typename TOutputImage >
84  public ImageSource< TOutputImage >
85 {
86 public:
92 
94  itkNewMacro(Self);
95 
98 
100  typedef TInputImage InputImageType;
101  typedef TOutputImage OutputImageType;
102 
104  typedef typename TOutputImage::RegionType OutputImageRegionType;
105  typedef typename TInputImage::RegionType InputImageRegionType;
106 
108  typedef typename TOutputImage::PixelType OutputImagePixelType;
109  typedef typename TInputImage::PixelType InputImagePixelType;
110 
112  typedef typename TOutputImage::IndexType OutputImageIndexType;
113  typedef typename TInputImage::IndexType InputImageIndexType;
114  typedef typename TOutputImage::SizeType OutputImageSizeType;
115  typedef typename TInputImage::SizeType InputImageSizeType;
116 
123 
124 
150  {
151  switch(choosenStrategy)
152  {
156  break;
158  default:
159  itkExceptionMacro( << "Invalid Strategy Chosen for itk::ExtractSliceImageFilter" );
160  }
162 
163  this->m_DirectionCollaspeStrategy=choosenStrategy;
164  this->Modified();
165  }
166 
176  {
177  return this->m_DirectionCollaspeStrategy;
178  }
179 
182  {
184  }
185 
188  {
190  }
191 
194  {
196  }
197 
198 
200  itkStaticConstMacro(InputImageDimension, unsigned int,
201  TInputImage::ImageDimension);
202  itkStaticConstMacro(OutputImageDimension, unsigned int,
203  TOutputImage::ImageDimension);
205 
207  itkGetStaticConstMacro(InputImageDimension),
209 
215  void SetExtractionRegion(InputImageRegionType extractRegion);
216  itkGetConstMacro(ExtractionRegion, InputImageRegionType);
218 
220  using Superclass::SetInput;
221  virtual void SetInput(const TInputImage *image);
222  const TInputImage * GetInput() const;
224 
225 #ifdef ITK_USE_CONCEPT_CHECKING
226  // Begin concept checking
227  itkConceptMacro( InputCovertibleToOutputCheck,
229  // End concept checking
230 #endif
231 
232 protected:
235  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
236 
245  virtual void GenerateOutputInformation() ITK_OVERRIDE;
246 
257  const OutputImageRegionType & srcRegion);
258 
267  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
268  ThreadIdType threadId) ITK_OVERRIDE;
269 
271 
273 
274 private:
275  ExtractSliceImageFilter(const Self &) ITK_DELETE_FUNCTION;
276  void operator=(const Self &) ITK_DELETE_FUNCTION;
277 
279 };
280 } // end namespace Testing
281 } // end namespace itk
282 
283 #ifndef ITK_MANUAL_INSTANTIATION
284 #include "itkTestingExtractSliceImageFilter.hxx"
285 #endif
286 
287 #endif
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
A special variation of ImageRegionCopier for when the output image has fewer dimensions than the inpu...
const TInputImage * GetInput() const
Base class for all process objects that output image data.
ImageToImageFilterDetail::ExtractImageFilterRegionCopier< itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > ExtractSliceImageFilterRegionCopierType
virtual void SetInput(const TInputImage *image)
void SetExtractionRegion(InputImageRegionType extractRegion)
enum itk::Testing::ExtractSliceImageFilter::DirectionCollaspeStrategyEnum DIRECTIONCOLLAPSESTRATEGY
virtual void GenerateOutputInformation() override
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
virtual void Modified() const
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion)
void PrintSelf(std::ostream &os, Indent indent) const override
OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
DIRECTIONCOLLAPSESTRATEGY GetDirectionCollapseToStrategy() const
void SetDirectionCollapseToStrategy(const DIRECTIONCOLLAPSESTRATEGY choosenStrategy)
Decrease the image size by cropping the image to the selected region bounds.