ITK  5.1.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  * 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 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_ASSIGN(ExtractOrthogonalSwath2DImageFilter);
48 
54 
56  itkNewMacro(Self);
57 
60 
62  using ImageType = TImage;
63  using ImagePointer = typename ImageType::Pointer;
64  using ImageConstPointer = typename ImageType::ConstPointer;
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 
114 
116  itkSetMacro(DefaultPixelValue, ImagePixelType)
117 
118  //--------------------------------------------------------------------------
119  //
120 
121 
122  void EnlargeOutputRequestedRegion(DataObject * output) override
123  {
124  output->SetRequestedRegionToLargestPossibleRegion();
125  }
126 
127  //
128  //--------------------------------------------------------------------------
129 
130 protected:
132  {
133  m_DefaultPixelValue = NumericTraits<ImagePixelType>::ZeroValue();
134  m_Size[0] = 512;
135  m_Size[1] = 16 * 2 + 1; // must be odd
136  m_Origin[0] = m_Origin[1] = 0.0;
137  m_Spacing[0] = m_Spacing[1] = 1.0;
138  }
139 
140  ~ExtractOrthogonalSwath2DImageFilter() override = default;
141  void
142  PrintSelf(std::ostream & os, Indent indent) const override;
143 
144  //--------------------------------------------------------------------------
145  //
146 
148  void
149  GenerateOutputInformation() override;
150 
152  void
154  {
155  Superclass::GenerateInputRequestedRegion();
156  this->GetNonConstImageInput()->SetRequestedRegionToLargestPossibleRegion();
157  this->GetNonConstPathInput()->SetRequestedRegionToLargestPossibleRegion();
158  }
160 
161  void
162  GenerateData() override;
163 
164  //
165  //--------------------------------------------------------------------------
166 
167 private:
170  double m_Origin[ImageDimension];
171  double m_Spacing[ImageDimension];
172 };
173 } // end namespace itk
174 
175 #ifndef ITK_MANUAL_INSTANTIATION
176 # include "itkExtractOrthogonalSwath2DImageFilter.hxx"
177 #endif
178 
179 #endif
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
itk::Size
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:69
itk::ParametricPath< 2 >::OutputType
typename Superclass::OutputType OutputType
Definition: itkParametricPath.h:85
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::ExtractOrthogonalSwath2DImageFilter::m_Size
SizeType m_Size
Definition: itkExtractOrthogonalSwath2DImageFilter.h:169
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:153
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:59
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:67
itk::NumericTraits::ZeroValue
static T ZeroValue()
Definition: itkNumericTraits.h:148
itk::ExtractOrthogonalSwath2DImageFilter::m_DefaultPixelValue
ImagePixelType m_DefaultPixelValue
Definition: itkExtractOrthogonalSwath2DImageFilter.h:168
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
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::ParametricPath< 2 >::InputType
typename Superclass::InputType InputType
Definition: itkParametricPath.h:82
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:131