ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkVectorResampleImageFilter.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 __itkVectorResampleImageFilter_h
19 #define __itkVectorResampleImageFilter_h
20 
21 #include "itkTransform.h"
22 #include "itkImageRegionIterator.h"
23 #include "itkImageToImageFilter.h"
25 #include "itkSize.h"
26 
27 namespace itk
28 {
58 template< class TInputImage, class TOutputImage, class TInterpolatorPrecisionType = double >
59 class ITK_EXPORT VectorResampleImageFilter:
60  public ImageToImageFilter< TInputImage, TOutputImage >
61 {
62 public:
68 
69  typedef TInputImage InputImageType;
70  typedef TOutputImage OutputImageType;
71  typedef typename InputImageType::Pointer InputImagePointer;
72  typedef typename InputImageType::ConstPointer InputImageConstPointer;
73  typedef typename OutputImageType::Pointer OutputImagePointer;
74  typedef typename InputImageType::RegionType InputImageRegionType;
75 
77  itkNewMacro(Self);
78 
81 
83  itkStaticConstMacro(ImageDimension, unsigned int,
84  TOutputImage::ImageDimension);
85 
91  typedef Transform< TInterpolatorPrecisionType, itkGetStaticConstMacro(ImageDimension),
92  itkGetStaticConstMacro(ImageDimension) > TransformType;
93  typedef typename TransformType::ConstPointer
96 
100 
103 
105  typedef typename TOutputImage::IndexType IndexType;
106 
109 
111  typedef typename TOutputImage::PixelType PixelType;
112  typedef typename PixelType::ValueType PixelComponentType;
113 
115  typedef typename TOutputImage::RegionType OutputImageRegionType;
116 
118  typedef typename TOutputImage::SpacingType SpacingType;
119  typedef typename TOutputImage::PointType OriginPointType;
120  typedef typename TOutputImage::DirectionType DirectionType;
121 
127  itkSetConstObjectMacro(Transform, TransformType);
128 
131  itkSetObjectMacro(Interpolator, InterpolatorType);
132 
134  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
135 
137  itkSetMacro(Size, SizeType);
138 
140  itkGetConstReferenceMacro(Size, SizeType);
141 
144  itkSetMacro(DefaultPixelValue, PixelType);
145 
147  itkGetConstMacro(DefaultPixelValue, PixelType);
148 
150  itkSetMacro(OutputSpacing, SpacingType);
151  virtual void SetOutputSpacing(const double *values);
153 
155  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
156 
158  itkSetMacro(OutputOrigin, PointType);
159  virtual void SetOutputOrigin(const double *values);
161 
163  itkGetConstReferenceMacro(OutputOrigin, PointType);
164 
166  itkSetMacro(OutputDirection, DirectionType);
167  itkGetConstReferenceMacro(OutputDirection, DirectionType);
169 
172  itkSetMacro(OutputStartIndex, IndexType);
173 
175  itkGetConstReferenceMacro(OutputStartIndex, IndexType);
176 
182  virtual void GenerateOutputInformation();
183 
189  virtual void GenerateInputRequestedRegion();
190 
193  virtual void BeforeThreadedGenerateData();
194 
197  virtual void AfterThreadedGenerateData();
198 
200  ModifiedTimeType GetMTime(void) const;
201 
202 #ifdef ITK_USE_CONCEPT_CHECKING
203 
204  itkConceptMacro( InputHasNumericTraitsCheck,
206  itkConceptMacro( OutputHasNumericTraitsCheck,
208 
210 #endif
211 
212 protected:
215  void PrintSelf(std::ostream & os, Indent indent) const;
216 
225  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
226  ThreadIdType threadId);
227 
228 private:
229  VectorResampleImageFilter(const Self &); //purposely not implemented
230  void operator=(const Self &); //purposely not implemented
231 
232  SizeType m_Size; // Size of the output image
233  TransformPointerType m_Transform; // Coordinate transform to use
235  // Image function for interpolation
237  // default pixel value if the point
238  // is outside the image
239  SpacingType m_OutputSpacing; // output image spacing
240  PointType m_OutputOrigin; // output image origin
241  DirectionType m_OutputDirection; // output image direction cosines
242  IndexType m_OutputStartIndex; // output start index
243 };
244 } // end namespace itk
245 
246 #ifndef ITK_MANUAL_INSTANTIATION
247 #include "itkVectorResampleImageFilter.hxx"
248 #endif
249 
250 #endif
251