ITK  4.2.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 
130  itkGetConstObjectMacro(Transform, TransformType);
131 
134  itkSetObjectMacro(Interpolator, InterpolatorType);
135 
137  itkGetConstObjectMacro(Interpolator, InterpolatorType);
138 
140  itkSetMacro(Size, SizeType);
141 
143  itkGetConstReferenceMacro(Size, SizeType);
144 
147  itkSetMacro(DefaultPixelValue, PixelType);
148 
150  itkGetConstMacro(DefaultPixelValue, PixelType);
151 
153  itkSetMacro(OutputSpacing, SpacingType);
154  virtual void SetOutputSpacing(const double *values);
156 
158  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
159 
161  itkSetMacro(OutputOrigin, PointType);
162  virtual void SetOutputOrigin(const double *values);
164 
166  itkGetConstReferenceMacro(OutputOrigin, PointType);
167 
169  itkSetMacro(OutputDirection, DirectionType);
170  itkGetConstReferenceMacro(OutputDirection, DirectionType);
172 
175  itkSetMacro(OutputStartIndex, IndexType);
176 
178  itkGetConstReferenceMacro(OutputStartIndex, IndexType);
179 
185  virtual void GenerateOutputInformation();
186 
192  virtual void GenerateInputRequestedRegion();
193 
196  virtual void BeforeThreadedGenerateData();
197 
200  virtual void AfterThreadedGenerateData();
201 
203  unsigned long GetMTime(void) const;
204 
205 #ifdef ITK_USE_CONCEPT_CHECKING
206 
207  itkConceptMacro( InputHasNumericTraitsCheck,
209  itkConceptMacro( OutputHasNumericTraitsCheck,
211 
213 #endif
214 protected:
217  void PrintSelf(std::ostream & os, Indent indent) const;
219 
228  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
229  ThreadIdType threadId);
230 
231 private:
232  VectorResampleImageFilter(const Self &); //purposely not implemented
233  void operator=(const Self &); //purposely not implemented
234 
235  SizeType m_Size; // Size of the output image
236  TransformPointerType m_Transform; // Coordinate transform to use
238  // Image function for interpolation
240  // default pixel value if the point
241  // is outside the image
242  SpacingType m_OutputSpacing; // output image spacing
243  PointType m_OutputOrigin; // output image origin
244  DirectionType m_OutputDirection; // output image direction cosines
245  IndexType m_OutputStartIndex; // output start index
246 };
247 } // end namespace itk
248 
249 #ifndef ITK_MANUAL_INSTANTIATION
250 #include "itkVectorResampleImageFilter.hxx"
251 #endif
252 
253 #endif
254