ITK  4.13.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:
52 
54  itkNewMacro(Self);
55 
58 
60  typedef TImage ImageType;
61  typedef typename ImageType::Pointer ImagePointer;
62  typedef typename ImageType::ConstPointer ImageConstPointer;
63  typedef typename ImageType::RegionType ImageRegionType;
65  typedef typename ImageType::PixelType ImagePixelType;
74  typedef typename ImageType::SizeType SizeType;
75 
77  itkStaticConstMacro(PathDimension, unsigned int,
78  2);
79  itkStaticConstMacro(ImageDimension, unsigned int,
80  TImage::ImageDimension);
82 
89  virtual void SetSpacing(const double *spacing);
90 
91  virtual void SetSpacing(const float *spacing);
92 
93  virtual const double * GetSpacing() const;
94 
99  virtual void SetOrigin(const double *origin);
100 
101  virtual void SetOrigin(const float *origin);
102 
103  virtual const double * GetOrigin() const;
104 
107  itkSetMacro(Size, SizeType)
108 
109 
111  itkSetMacro(DefaultPixelValue, ImagePixelType)
112 
113  //--------------------------------------------------------------------------
114  //
115 
117  virtual void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE
118  {
119  output->SetRequestedRegionToLargestPossibleRegion();
120  }
121 
122  //
123  //--------------------------------------------------------------------------
124 
125 protected:
127  {
128  m_DefaultPixelValue = NumericTraits< ImagePixelType >::ZeroValue();
129  m_Size[0] = 512;
130  m_Size[1] = 16 * 2 + 1; // must be odd
131  m_Origin[0] = m_Origin[1] = 0.0;
132  m_Spacing[0] = m_Spacing[1] = 1.0;
133  }
134 
135  virtual ~ExtractOrthogonalSwath2DImageFilter() ITK_OVERRIDE {}
136  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
137 
138  //--------------------------------------------------------------------------
139  //
140 
142  virtual void GenerateOutputInformation(void) ITK_OVERRIDE;
143 
145  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE
146  {
147  Superclass::GenerateInputRequestedRegion();
148  this->GetNonConstImageInput()->SetRequestedRegionToLargestPossibleRegion();
149  this->GetNonConstPathInput()->SetRequestedRegionToLargestPossibleRegion();
150  }
152 
153  virtual void GenerateData(void) ITK_OVERRIDE;
154 
155  //
156  //--------------------------------------------------------------------------
157 
158 private:
159  ITK_DISALLOW_COPY_AND_ASSIGN(ExtractOrthogonalSwath2DImageFilter);
160 
161  ImagePixelType m_DefaultPixelValue;
162  SizeType m_Size;
163  double m_Origin[ImageDimension];
164  double m_Spacing[ImageDimension];
165 };
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkExtractOrthogonalSwath2DImageFilter.hxx"
170 #endif
171 
172 #endif
Light weight base class for most itk classes.
Superclass::OutputType OutputType
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
Superclass::InputType InputType
Base class for filters that take both a path and an image as input and produce a path as output...
ImageAndPathToImageFilter< TImage, ParametricPath< 2 >, TImage > Superclass
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...
Base class for all data objects in ITK.