ITK  6.0.0
Insight Toolkit
itkExtractOrthogonalSwath2DImageFilter.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 itkExtractOrthogonalSwath2DImageFilter_h
19#define itkExtractOrthogonalSwath2DImageFilter_h
20
22#include "itkParametricPath.h"
23
24namespace itk
25{
42template <typename TImage>
43class ITK_TEMPLATE_EXPORT ExtractOrthogonalSwath2DImageFilter
44 : public ImageAndPathToImageFilter<TImage, ParametricPath<2>, TImage>
45{
46public:
47 ITK_DISALLOW_COPY_AND_MOVE(ExtractOrthogonalSwath2DImageFilter);
48
54
56 itkNewMacro(Self);
57
59 itkOverrideGetNameOfClassMacro(ExtractOrthogonalSwath2DImageFilter);
60
62 using ImageType = TImage;
67 using ImagePixelType = typename ImageType::PixelType;
76 using SizeType = typename ImageType::SizeType;
77
79 static constexpr unsigned int PathDimension = 2;
80 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
81
88 virtual void
89 SetSpacing(const double * spacing);
90
91 virtual void
92 SetSpacing(const float * spacing);
93
94 virtual const double *
95 GetSpacing() const;
96
101 virtual void
102 SetOrigin(const double * origin);
103
104 virtual void
105 SetOrigin(const float * origin);
106
107 virtual const double *
108 GetOrigin() const;
109
112 itkSetMacro(Size, SizeType);
113
116 itkSetMacro(DefaultPixelValue, ImagePixelType);
117
118 //--------------------------------------------------------------------------
119 //
120
122 void
124 {
126 }
127
128 //
129 //--------------------------------------------------------------------------
130
131protected:
133 {
134 m_DefaultPixelValue = ImagePixelType{};
135 m_Size[0] = 512;
136 m_Size[1] = 16 * 2 + 1; // must be odd
137 m_Origin[0] = m_Origin[1] = 0.0;
138 m_Spacing[0] = m_Spacing[1] = 1.0;
139 }
140
142 void
143 PrintSelf(std::ostream & os, Indent indent) const override;
144
145 //--------------------------------------------------------------------------
146 //
147
149 void
151
153 void
155 {
156 Superclass::GenerateInputRequestedRegion();
157 this->GetNonConstImageInput()->SetRequestedRegionToLargestPossibleRegion();
158 this->GetNonConstPathInput()->SetRequestedRegionToLargestPossibleRegion();
159 }
162 void
163 GenerateData() override;
164
165 //
166 //--------------------------------------------------------------------------
167
168private:
169 ImagePixelType m_DefaultPixelValue{};
170 SizeType m_Size{};
171 double m_Origin[ImageDimension]{};
172 double m_Spacing[ImageDimension]{};
173};
174} // end namespace itk
175
176#ifndef ITK_MANUAL_INSTANTIATION
177# include "itkExtractOrthogonalSwath2DImageFilter.hxx"
178#endif
179
180#endif
A templated class holding a point in n-Dimensional image space.
Base class for all data objects in ITK.
virtual void SetRequestedRegionToLargestPossibleRegion()
Extracts into rectangular form a "swath" image from the input image along the parametric path.
typename PathType::ContinuousIndexType PathContinuousIndexType
virtual const double * GetSpacing() const
virtual const double * GetOrigin() const
virtual void SetSpacing(const double *spacing)
virtual void SetOrigin(const double *origin)
~ExtractOrthogonalSwath2DImageFilter() override=default
virtual void SetOrigin(const float *origin)
virtual void SetSpacing(const float *spacing)
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for filters that take both a path and an image as input and produce a path as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:70