ITK  5.4.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 
24 namespace itk
25 {
42 template <typename TImage>
43 class ITK_TEMPLATE_EXPORT ExtractOrthogonalSwath2DImageFilter
44  : public ImageAndPathToImageFilter<TImage, ParametricPath<2>, TImage>
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_MOVE(ExtractOrthogonalSwath2DImageFilter);
48 
54 
56  itkNewMacro(Self);
57 
59  itkOverrideGetNameOfClassMacro(ExtractOrthogonalSwath2DImageFilter);
60 
62  using ImageType = TImage;
63  using ImagePointer = typename ImageType::Pointer;
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 
131 protected:
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 
141  ~ExtractOrthogonalSwath2DImageFilter() override = default;
142  void
143  PrintSelf(std::ostream & os, Indent indent) const override;
144 
145  //--------------------------------------------------------------------------
146  //
147 
149  void
150  GenerateOutputInformation() override;
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 
168 private:
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
itk::DataObject::SetRequestedRegionToLargestPossibleRegion
virtual void SetRequestedRegionToLargestPossibleRegion()
Definition: itkDataObject.h:485
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ImageAndPathToImageFilter
Base class for filters that take both a path and an image as input and produce a path as output.
Definition: itkImageAndPathToImageFilter.h:40
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::ExtractOrthogonalSwath2DImageFilter::EnlargeOutputRequestedRegion
void EnlargeOutputRequestedRegion(DataObject *output) override
Definition: itkExtractOrthogonalSwath2DImageFilter.h:123
itk::Size
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:71
itk::ParametricPath< 2 >
itk::ExtractOrthogonalSwath2DImageFilter::PathVectorType
typename PathType::VectorType PathVectorType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:75
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::ExtractOrthogonalSwath2DImageFilter
Extracts into rectangular form a "swath" image from the input image along the parametric path.
Definition: itkExtractOrthogonalSwath2DImageFilter.h:43
itk::ExtractOrthogonalSwath2DImageFilter::GenerateInputRequestedRegion
void GenerateInputRequestedRegion() override
Definition: itkExtractOrthogonalSwath2DImageFilter.h:154
itk::ExtractOrthogonalSwath2DImageFilter::PathOutputType
typename PathType::OutputType PathOutputType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:71
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ExtractOrthogonalSwath2DImageFilter::PathInputType
typename PathType::InputType PathInputType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:70
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ExtractOrthogonalSwath2DImageFilter::ImagePixelType
typename ImageType::PixelType ImagePixelType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:67
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::ExtractOrthogonalSwath2DImageFilter::PathIndexType
typename PathType::IndexType PathIndexType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:72
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ExtractOrthogonalSwath2DImageFilter::ImageRegionType
typename ImageType::RegionType ImageRegionType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:65
itk::ExtractOrthogonalSwath2DImageFilter::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkExtractOrthogonalSwath2DImageFilter.h:63
itk::ExtractOrthogonalSwath2DImageFilter::ImageConstPointer
typename ImageType::ConstPointer ImageConstPointer
Definition: itkExtractOrthogonalSwath2DImageFilter.h:64
itkImageAndPathToImageFilter.h
itk::ExtractOrthogonalSwath2DImageFilter::PathContinuousIndexType
typename PathType::ContinuousIndexType PathContinuousIndexType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:73
itk::Offset
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
Definition: itkOffset.h:69
itk::Path< double, ContinuousIndex< SpacePrecisionType, VDimension >, VDimension >::InputType
double InputType
Definition: itkPath.h:72
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ContinuousIndex
A templated class holding a point in n-Dimensional image space.
Definition: itkContinuousIndex.h:46
itk::ExtractOrthogonalSwath2DImageFilter::ImageIndexType
typename ImageType::IndexType ImageIndexType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:66
itk::ExtractOrthogonalSwath2DImageFilter::PathOffsetType
typename PathType::OffsetType PathOffsetType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:74
itkParametricPath.h
itk::ExtractOrthogonalSwath2DImageFilter::ImageType
TImage ImageType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:62
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293
itk::ExtractOrthogonalSwath2DImageFilter::SizeType
typename ImageType::SizeType SizeType
Definition: itkExtractOrthogonalSwath2DImageFilter.h:76
itk::ExtractOrthogonalSwath2DImageFilter::PathConstPointer
typename PathType::ConstPointer PathConstPointer
Definition: itkExtractOrthogonalSwath2DImageFilter.h:69
itk::ExtractOrthogonalSwath2DImageFilter::ExtractOrthogonalSwath2DImageFilter
ExtractOrthogonalSwath2DImageFilter()
Definition: itkExtractOrthogonalSwath2DImageFilter.h:132