ITK  4.9.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 {
61 template< typename TInputImage, typename TOutputImage, typename TInterpolatorPrecisionType = double >
63  public ImageToImageFilter< TInputImage, TOutputImage >
64 {
65 public:
71 
72  typedef TInputImage InputImageType;
73  typedef TOutputImage OutputImageType;
74  typedef typename InputImageType::Pointer InputImagePointer;
75  typedef typename InputImageType::ConstPointer InputImageConstPointer;
76  typedef typename OutputImageType::Pointer OutputImagePointer;
77  typedef typename InputImageType::RegionType InputImageRegionType;
78 
80  itkNewMacro(Self);
81 
84 
86  itkStaticConstMacro(ImageDimension, unsigned int,
87  TOutputImage::ImageDimension);
88 
94  typedef Transform< TInterpolatorPrecisionType, itkGetStaticConstMacro(ImageDimension),
95  itkGetStaticConstMacro(ImageDimension) > TransformType;
96  typedef typename TransformType::ConstPointer
99 
103 
106 
108  typedef typename TOutputImage::IndexType IndexType;
109 
112 
114  typedef typename TOutputImage::PixelType PixelType;
115  typedef typename PixelType::ValueType PixelComponentType;
116 
118  typedef typename TOutputImage::RegionType OutputImageRegionType;
119 
121  typedef typename TOutputImage::SpacingType SpacingType;
122  typedef typename TOutputImage::PointType OriginPointType;
123  typedef typename TOutputImage::DirectionType DirectionType;
124 
130  itkSetConstObjectMacro(Transform, TransformType);
131 
134  itkSetObjectMacro(Interpolator, InterpolatorType);
135 
137  itkGetModifiableObjectMacro(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, OriginPointType);
162  virtual void SetOutputOrigin(const double *values);
164 
166  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
167 
169  itkSetMacro(OutputDirection, DirectionType);
170  itkGetConstReferenceMacro(OutputDirection, DirectionType);
172 
175  itkSetMacro(OutputStartIndex, IndexType);
176 
178  itkGetConstReferenceMacro(OutputStartIndex, IndexType);
179 
185  virtual void GenerateOutputInformation() ITK_OVERRIDE;
186 
192  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
193 
196  virtual void BeforeThreadedGenerateData() ITK_OVERRIDE;
197 
200  virtual void AfterThreadedGenerateData() ITK_OVERRIDE;
201 
203  ModifiedTimeType GetMTime(void) const ITK_OVERRIDE;
204 
205 #ifdef ITK_USE_CONCEPT_CHECKING
206  // Begin concept checking
207  itkConceptMacro( InputHasNumericTraitsCheck,
209  itkConceptMacro( OutputHasNumericTraitsCheck,
211  // End concept checking
212 #endif
213 
214 protected:
217  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
218 
227  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
228  ThreadIdType threadId) ITK_OVERRIDE;
229 
230 private:
231  VectorResampleImageFilter(const Self &) ITK_DELETE_FUNCTION;
232  void operator=(const Self &) ITK_DELETE_FUNCTION;
233 
234  SizeType m_Size; // Size of the output image
235  TransformPointerType m_Transform; // Coordinate transform to use
237  // Image function for interpolation
239  // default pixel value if the point
240  // is outside the image
241  SpacingType m_OutputSpacing; // output image spacing
242  OriginPointType m_OutputOrigin; // output image origin
243  DirectionType m_OutputDirection; // output image direction cosines
244  IndexType m_OutputStartIndex; // output start index
245 };
246 } // end namespace itk
247 
248 #ifndef ITK_MANUAL_INSTANTIATION
249 #include "itkVectorResampleImageFilter.hxx"
250 #endif
251 
252 #endif
Resample an image via a coordinate transform.
virtual void SetOutputSpacing(SpacingType _arg)
ModifiedTimeType GetMTime(void) const override
TOutputImage::RegionType OutputImageRegionType
InterpolatorType::Pointer InterpolatorPointerType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
TOutputImage::DirectionType DirectionType
virtual void GenerateOutputInformation() override
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for all process objects that output image data.
Size< itkGetStaticConstMacro(ImageDimension) > SizeType
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
virtual void GenerateInputRequestedRegion() override
virtual void BeforeThreadedGenerateData() override
InputImageType::RegionType InputImageRegionType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
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.
#define itkConceptMacro(name, concept)
virtual void AfterThreadedGenerateData() override
TransformType::ConstPointer TransformPointerType
virtual void SetOutputOrigin(OriginPointType _arg)
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
InputImageType::ConstPointer InputImageConstPointer