ITK  4.6.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< typename TInputImage, typename TOutputImage, typename TInterpolatorPrecisionType = double >
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, OriginPointType);
159  virtual void SetOutputOrigin(const double *values);
161 
163  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
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  // Begin concept checking
204  itkConceptMacro( InputHasNumericTraitsCheck,
206  itkConceptMacro( OutputHasNumericTraitsCheck,
208  // End concept checking
209 #endif
210 
211 protected:
214  void PrintSelf(std::ostream & os, Indent indent) const;
215 
224  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
225  ThreadIdType threadId);
226 
227 private:
228  VectorResampleImageFilter(const Self &); //purposely not implemented
229  void operator=(const Self &); //purposely not implemented
230 
231  SizeType m_Size; // Size of the output image
232  TransformPointerType m_Transform; // Coordinate transform to use
234  // Image function for interpolation
236  // default pixel value if the point
237  // is outside the image
238  SpacingType m_OutputSpacing; // output image spacing
239  OriginPointType m_OutputOrigin; // output image origin
240  DirectionType m_OutputDirection; // output image direction cosines
241  IndexType m_OutputStartIndex; // output start index
242 };
243 } // end namespace itk
244 
245 #ifndef ITK_MANUAL_INSTANTIATION
246 #include "itkVectorResampleImageFilter.hxx"
247 #endif
248 
249 #endif
Resample an image via a coordinate transform.
virtual void SetOutputSpacing(SpacingType _arg)
TOutputImage::RegionType OutputImageRegionType
virtual void BeforeThreadedGenerateData()
InterpolatorType::Pointer InterpolatorPointerType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
TOutputImage::DirectionType DirectionType
Base class for all process objects that output image data.
Size< itkGetStaticConstMacro(ImageDimension) > SizeType
virtual void AfterThreadedGenerateData()
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
void PrintSelf(std::ostream &os, Indent indent) const
void operator=(const Self &)
InputImageType::RegionType InputImageRegionType
virtual void GenerateInputRequestedRegion()
Transform< TInterpolatorPrecisionType, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension) > TransformType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Base class for filters that take an image as input and produce an image as output.
VectorInterpolateImageFunction< InputImageType, TInterpolatorPrecisionType > InterpolatorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for all vector image interpolaters.
ModifiedTimeType GetMTime(void) const
#define itkConceptMacro(name, concept)
TransformType::ConstPointer TransformPointerType
virtual void SetOutputOrigin(OriginPointType _arg)
virtual void GenerateOutputInformation()
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
InputImageType::ConstPointer InputImageConstPointer