ITK  5.4.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
22
23namespace itk
24{
55template <class TInputImage, class TOutputImage>
56class ITK_TEMPLATE_EXPORT SliceImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
57{
58public:
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
104 itkSetMacro(Stop, IndexType);
105 itkGetConstReferenceMacro(Stop, IndexType);
106 void
114 itkSetMacro(Step, ArrayType);
115 itkGetConstReferenceMacro(Step, ArrayType);
116 void
117 SetStep(int step);
121#ifdef ITK_USE_CONCEPT_CHECKING
123 itkConceptMacro(InputConvertibleToOutputCheck,
126
128#endif
129
130protected:
132 ~SliceImageFilter() override = default;
133 void
134 PrintSelf(std::ostream & os, Indent indent) const override;
135
140 void
142
143 void
145
156 void
157 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
158
159
160 void
161 VerifyInputInformation() ITKv5_CONST override;
162
163private:
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
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
Base class for filters that take an image as input and produce an image as output.
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::Pointer InputImagePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Slices an image based on a starting index and a stopping index, and a step size.
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
void PrintSelf(std::ostream &os, Indent indent) const override
~SliceImageFilter() override=default
void SetStart(IndexValueType start)
void VerifyInputInformation() ITKv5_CONST override
Verifies that the input images occupy the same physical space and the each index is at the same physi...
void SetStop(IndexValueType stop)
typename TInputImage::IndexType InputIndexType
typename TOutputImage::OffsetType OutputOffsetType
typename TOutputImage::IndexType OutputIndexType
void SetStep(int step)
void GenerateInputRequestedRegion() override
typename InputIndexType::IndexValueType IndexValueType
void GenerateOutputInformation() override
typename InputImageType::IndexType IndexType
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
long IndexValueType
Definition: itkIntTypes.h:90