ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkExtractOrthogonalSwath2DImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
41 template< typename TImage >
42 class ITK_TEMPLATE_EXPORT ExtractOrthogonalSwath2DImageFilter:public
43  ImageAndPathToImageFilter< TImage, ParametricPath< 2 >, TImage >
44 {
45 public:
46  ITK_DISALLOW_COPY_AND_ASSIGN(ExtractOrthogonalSwath2DImageFilter);
47 
50  using Superclass =
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 SetSpacing(const double *spacing);
89 
90  virtual void SetSpacing(const float *spacing);
91 
92  virtual const double * GetSpacing() const;
93 
98  virtual void SetOrigin(const double *origin);
99 
100  virtual void SetOrigin(const float *origin);
101 
102  virtual const double * GetOrigin() const;
103 
106  itkSetMacro(Size, SizeType)
107 
108 
110  itkSetMacro(DefaultPixelValue, ImagePixelType)
111 
112  //--------------------------------------------------------------------------
113  //
114 
116  void EnlargeOutputRequestedRegion(DataObject *output) override
117  {
118  output->SetRequestedRegionToLargestPossibleRegion();
119  }
120 
121  //
122  //--------------------------------------------------------------------------
123 
124 protected:
126  {
127  m_DefaultPixelValue = NumericTraits< ImagePixelType >::ZeroValue();
128  m_Size[0] = 512;
129  m_Size[1] = 16 * 2 + 1; // must be odd
130  m_Origin[0] = m_Origin[1] = 0.0;
131  m_Spacing[0] = m_Spacing[1] = 1.0;
132  }
133 
134  ~ExtractOrthogonalSwath2DImageFilter() override = default;
135  void PrintSelf(std::ostream & os, Indent indent) const override;
136 
137  //--------------------------------------------------------------------------
138  //
139 
141  void GenerateOutputInformation() override;
142 
145  {
146  Superclass::GenerateInputRequestedRegion();
147  this->GetNonConstImageInput()->SetRequestedRegionToLargestPossibleRegion();
148  this->GetNonConstPathInput()->SetRequestedRegionToLargestPossibleRegion();
149  }
151 
152  void GenerateData() override;
153 
154  //
155  //--------------------------------------------------------------------------
156 
157 private:
160  double m_Origin[ImageDimension];
161  double m_Spacing[ImageDimension];
162 };
163 } // end namespace itk
164 
165 #ifndef ITK_MANUAL_INSTANTIATION
166 #include "itkExtractOrthogonalSwath2DImageFilter.hxx"
167 #endif
168 
169 #endif
Light weight base class for most itk classes.
Define numeric traits for std::vector.
typename Superclass::InputType InputType
Base class for filters that take both a path and an image as input and produce a path as output...
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:68
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image...
Definition: itkOffset.h:67
A templated class holding a point in n-Dimensional image space.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Extracts into rectangular form a &quot;swath&quot; image from the input image along the parametric path...
typename Superclass::OutputType OutputType
Base class for all data objects in ITK.
typename PathType::ContinuousIndexType PathContinuousIndexType