ITK  5.0.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:
60  ITK_DISALLOW_COPY_AND_ASSIGN(SliceImageFilter);
61 
67 
69  itkNewMacro(Self);
70 
72  itkTypeMacro(SliceImageFilter, ImageToImageFilter);
73 
75  using OutputImageType = TOutputImage;
76  using InputImageType = TInputImage;
77  using OutputImagePointer = typename OutputImageType::Pointer;
78  using InputImagePointer = typename InputImageType::Pointer;
79  using InputImageConstPointer = typename InputImageType::ConstPointer;
80 
83  using OutputOffsetType = typename TOutputImage::OffsetType;
84 
87 
89  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
90  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
91 
92 
96 
98  itkSetMacro(Start, IndexType);
99  itkGetConstReferenceMacro(Start, IndexType);
100  void SetStart(IndexValueType start);
102 
104  itkSetMacro(Stop, IndexType);
105  itkGetConstReferenceMacro(Stop, IndexType);
106  void SetStop(IndexValueType stop);
108 
113  itkSetMacro(Step, ArrayType);
114  itkGetConstReferenceMacro(Step, ArrayType);
115  void SetStep( int step);
117 
118 
119 #ifdef ITK_USE_CONCEPT_CHECKING
120 
121  itkConceptMacro( InputConvertibleToOutputCheck,
123  itkConceptMacro( SameDimensionCheck,
125 
127 #endif
128 
129 protected:
131  ~SliceImageFilter() override = default;
132  void PrintSelf(std::ostream & os, Indent indent) const override;
133 
138  void GenerateOutputInformation() override;
139 
140  void GenerateInputRequestedRegion() override;
141 
152  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
153 
154 
155  void VerifyInputInformation() ITKv5_CONST override;
156 
157 private:
158  IndexType m_Start;
159  IndexType m_Stop;
160  ArrayType m_Step;
161 };
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkSliceImageFilter.hxx"
166 #endif
167 
168 #endif
typename OutputImageType::Pointer OutputImagePointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename InputImageType::Pointer InputImagePointer
typename TOutputImage::OffsetType OutputOffsetType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename TInputImage::IndexType InputIndexType
signed long IndexValueType
Definition: itkIntTypes.h:90
Slices an image based on a starting index and a stopping index, and a step size.
typename InputImageType::IndexType IndexType
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)
typename TOutputImage::IndexType OutputIndexType
typename InputImageType::ConstPointer InputImageConstPointer
typename InputIndexType::IndexValueType IndexValueType