ITK  6.0.0
Insight Toolkit
itkSliceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 : public ImageToImageFilter<TInputImage, TOutputImage>
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_MOVE(SliceImageFilter);
60 
66 
68  itkNewMacro(Self);
69 
71  itkOverrideGetNameOfClassMacro(SliceImageFilter);
72 
74  using OutputImageType = TOutputImage;
75  using InputImageType = TInputImage;
79 
82  using OutputOffsetType = typename TOutputImage::OffsetType;
83 
86 
88  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
89  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
90 
91 
95 
97  itkSetMacro(Start, IndexType);
98  itkGetConstReferenceMacro(Start, IndexType);
99  void
100  SetStart(IndexValueType start);
104  itkSetMacro(Stop, IndexType);
105  itkGetConstReferenceMacro(Stop, IndexType);
106  void
107  SetStop(IndexValueType stop);
114  itkSetMacro(Step, ArrayType);
115  itkGetConstReferenceMacro(Step, ArrayType);
116  void
117  SetStep(int step);
121 #ifdef ITK_USE_CONCEPT_CHECKING
122 
123  itkConceptMacro(InputConvertibleToOutputCheck,
126 
128 #endif
129 
130 protected:
132  ~SliceImageFilter() override = default;
133  void
134  PrintSelf(std::ostream & os, Indent indent) const override;
135 
140  void
141  GenerateOutputInformation() override;
142 
143  void
144  GenerateInputRequestedRegion() override;
145 
156  void
157  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
158 
159 
160  void
161  VerifyInputInformation() const override;
162 
163 private:
164  IndexType m_Start{};
165  IndexType m_Stop{};
166  ArrayType m_Step{};
167 };
168 } // end namespace itk
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 # include "itkSliceImageFilter.hxx"
172 #endif
173 
174 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::SliceImageFilter::IndexType
typename InputImageType::IndexType IndexType
Definition: itkSliceImageFilter.h:92
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::SliceImageFilter::OutputOffsetType
typename TOutputImage::OffsetType OutputOffsetType
Definition: itkSliceImageFilter.h:82
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::SliceImageFilter::InputIndexType
typename TInputImage::IndexType InputIndexType
Definition: itkSliceImageFilter.h:81
itk::IndexValueType
long IndexValueType
Definition: itkIntTypes.h:93
itk::Concept::SameDimension
Definition: itkConceptChecking.h:697
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::FixedArray< int, ImageDimension >
itk::SliceImageFilter::OutputIndexType
typename TOutputImage::IndexType OutputIndexType
Definition: itkSliceImageFilter.h:80
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::SliceImageFilter::IndexValueType
typename InputIndexType::IndexValueType IndexValueType
Definition: itkSliceImageFilter.h:93
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Concept::Convertible
Definition: itkConceptChecking.h:217
itk::ImageToImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageToImageFilter.h:131
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::SliceImageFilter
Slices an image based on a starting index and a stopping index, and a step size.
Definition: itkSliceImageFilter.h:56