ITK  4.4.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< class TImage >
42 class ITK_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;
64  typedef typename ImageType::IndexType ImageIndexType;
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)
118  {
119  output->SetRequestedRegionToLargestPossibleRegion();
120  }
121 
122  //
123  //--------------------------------------------------------------------------
124 
125 protected:
127  {
128  m_DefaultPixelValue = NumericTraits< ImagePixelType >::Zero;
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 
136  void PrintSelf(std::ostream & os, Indent indent) const;
137 
138  //--------------------------------------------------------------------------
139  //
140 
142  virtual void GenerateOutputInformation(void);
143 
145  virtual void GenerateInputRequestedRegion()
146  {
147  Superclass::GenerateInputRequestedRegion();
148  this->GetNonConstImageInput()->SetRequestedRegionToLargestPossibleRegion();
149  this->GetNonConstPathInput()->SetRequestedRegionToLargestPossibleRegion();
150  }
152 
153  virtual void GenerateData(void);
154 
155  //
156  //--------------------------------------------------------------------------
157 
158 private:
159  ExtractOrthogonalSwath2DImageFilter(const Self &); //purposely not implemented
160  void operator=(const Self &); //purposely not implemented
161 
164  double m_Origin[ImageDimension];
165  double m_Spacing[ImageDimension];
166 };
167 } // end namespace itk
168 
169 #ifndef ITK_MANUAL_INSTANTIATION
170 #include "itkExtractOrthogonalSwath2DImageFilter.hxx"
171 #endif
172 
173 #endif
174