ITK  4.5.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"
23 
24 namespace itk
25 {
26 namespace Testing
27 {
81 template< typename TInputImage, typename TOutputImage >
83  public ImageSource< TOutputImage >
84 {
85 public:
91 
93  itkNewMacro(Self);
94 
97 
99  typedef TInputImage InputImageType;
100  typedef TOutputImage OutputImageType;
101 
103  typedef typename TOutputImage::RegionType OutputImageRegionType;
104  typedef typename TInputImage::RegionType InputImageRegionType;
105 
107  typedef typename TOutputImage::PixelType OutputImagePixelType;
108  typedef typename TInputImage::PixelType InputImagePixelType;
109 
111  typedef typename TOutputImage::IndexType OutputImageIndexType;
112  typedef typename TInputImage::IndexType InputImageIndexType;
113  typedef typename TOutputImage::SizeType OutputImageSizeType;
114  typedef typename TInputImage::SizeType InputImageSizeType;
115 
122 
123 
149  {
150  switch(choosenStrategy)
151  {
155  break;
157  default:
158  itkExceptionMacro( << "Invalid Strategy Chosen for itk::ExtractSliceImageFilter" );
159  }
161 
162  this->m_DirectionCollaspeStrategy=choosenStrategy;
163  this->Modified();
164  }
165 
175  {
176  return this->m_DirectionCollaspeStrategy;
177  }
178 
181  {
183  }
184 
187  {
189  }
190 
193  {
195  }
196 
197 
199  itkStaticConstMacro(InputImageDimension, unsigned int,
200  TInputImage::ImageDimension);
201  itkStaticConstMacro(OutputImageDimension, unsigned int,
202  TOutputImage::ImageDimension);
204 
206  itkGetStaticConstMacro(InputImageDimension),
208 
214  void SetExtractionRegion(InputImageRegionType extractRegion);
215  itkGetConstMacro(ExtractionRegion, InputImageRegionType);
217 
219  using Superclass::SetInput;
220  virtual void SetInput(const TInputImage *image);
221  const TInputImage * GetInput(void) const;
223 
224 #ifdef ITK_USE_CONCEPT_CHECKING
225  // Begin concept checking
226  itkConceptMacro( InputCovertibleToOutputCheck,
228  // End concept checking
229 #endif
230 
231 protected:
234  void PrintSelf(std::ostream & os, Indent indent) const;
235 
244  virtual void GenerateOutputInformation();
245 
256  const OutputImageRegionType & srcRegion);
257 
266  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
267  ThreadIdType threadId);
268 
270 
272 
273 private:
274  ExtractSliceImageFilter(const Self &); //purposely not implemented
275  void operator=(const Self &); //purposely not implemented
276 
278 };
279 } // end namespace Testing
280 } // end namespace itk
281 
282 #ifndef ITK_MANUAL_INSTANTIATION
283 #include "itkTestingExtractSliceImageFilter.hxx"
284 #endif
285 
286 #endif
A special variation of ImageRegionCopier for when the output image has fewer dimensions than the inpu...
Base class for all process objects that output image data.
ImageToImageFilterDetail::ExtractImageFilterRegionCopier< itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > ExtractSliceImageFilterRegionCopierType
virtual void SetInput(const TInputImage *image)
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
void SetExtractionRegion(InputImageRegionType extractRegion)
enum itk::Testing::ExtractSliceImageFilter::DirectionCollaspeStrategyEnum DIRECTIONCOLLAPSESTRATEGY
const TInputImage * GetInput(void) const
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
virtual void Modified() const
virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion)
OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
void PrintSelf(std::ostream &os, Indent indent) const
DIRECTIONCOLLAPSESTRATEGY GetDirectionCollapseToStrategy() const
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
void SetDirectionCollapseToStrategy(const DIRECTIONCOLLAPSESTRATEGY choosenStrategy)
Decrease the image size by cropping the image to the selected region bounds.