ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkSliceImageFilter.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 itkSliceImageFilter_h
19 #define itkSliceImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
55 template< class TInputImage, class TOutputImage >
56 class ITK_TEMPLATE_EXPORT SliceImageFilter:
57  public ImageToImageFilter< TInputImage, TOutputImage >
58 {
59 public:
65 
67  itkNewMacro(Self);
68 
71 
73  typedef TOutputImage OutputImageType;
74  typedef TInputImage InputImageType;
75  typedef typename OutputImageType::Pointer OutputImagePointer;
76  typedef typename InputImageType::Pointer InputImagePointer;
77  typedef typename InputImageType::ConstPointer InputImageConstPointer;
78 
81  typedef typename TOutputImage::OffsetType OutputOffsetType;
82 
84  typedef typename TOutputImage::RegionType OutputImageRegionType;
85 
87  itkStaticConstMacro(ImageDimension, unsigned int,
88  TInputImage::ImageDimension);
89  itkStaticConstMacro(OutputImageDimension, unsigned int,
90  TOutputImage::ImageDimension);
92 
93 
97 
99  itkSetMacro(Start, IndexType);
100  itkGetConstReferenceMacro(Start, IndexType);
101  void SetStart(IndexValueType start);
103 
105  itkSetMacro(Stop, IndexType);
106  itkGetConstReferenceMacro(Stop, IndexType);
107  void SetStop(IndexValueType stop);
109 
114  itkSetMacro(Step, ArrayType);
115  itkGetConstReferenceMacro(Step, ArrayType);
116  void SetStep( int step);
118 
119 
120 #ifdef ITK_USE_CONCEPT_CHECKING
121 
122  itkConceptMacro( InputConvertibleToOutputCheck,
124  itkConceptMacro( SameDimensionCheck,
126 
128 #endif
129 
130 protected:
132  ~SliceImageFilter() ITK_OVERRIDE {}
133  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
134 
139  virtual void GenerateOutputInformation() ITK_OVERRIDE;
140 
141  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
142 
153  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
154  ThreadIdType threadId) ITK_OVERRIDE;
155 
156  void VerifyInputInformation() ITK_OVERRIDE;
157 
158 private:
159  ITK_DISALLOW_COPY_AND_ASSIGN(SliceImageFilter);
160 
161  IndexType m_Start;
162  IndexType m_Stop;
163  ArrayType m_Step;
164 };
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkSliceImageFilter.hxx"
169 #endif
170 
171 #endif
TOutputImage::RegionType OutputImageRegionType
FixedArray< int, ImageDimension > ArrayType
signed long IndexValueType
Definition: itkIntTypes.h:150
InputIndexType::IndexValueType IndexValueType
Base class for all process objects that output image data.
InputImageType::ConstPointer InputImageConstPointer
OutputImageType::Pointer OutputImagePointer
InputImageType::Pointer InputImagePointer
Slices an image based on a starting index and a stopping index, and a step size.
ImageToImageFilter< TInputImage, TOutputImage > Superclass
TOutputImage::OffsetType OutputOffsetType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
TInputImage::IndexType InputIndexType
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
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
#define itkConceptMacro(name, concept)
TOutputImage::IndexType OutputIndexType
InputImageType::IndexType IndexType