ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkInterpolateImagePointsFilter.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 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef __itkInterpolateImagePointsFilter_h
29 #define __itkInterpolateImagePointsFilter_h
30 
32 #include "itkImageToImageFilter.h"
33 #include "itkImageRegionIterator.h"
34 
35 namespace itk
36 {
76 template< class TInputImage,
77  class TOutputImage,
78  class TCoordType = typename TInputImage::PixelType,
79  class InterpolatorType = BSplineInterpolateImageFunction< TInputImage, TCoordType > >
81  public ImageToImageFilter< TInputImage, TOutputImage >
82 {
83 public:
89 
92 
94  itkNewMacro(Self);
95 
97  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
98 
100  typedef typename Superclass::InputImageType InputImageType;
101  typedef typename Superclass::OutputImageType OutputImageType;
102  typedef typename Superclass::InputImagePointer InputImagePointer;
103 
105  typedef typename TOutputImage::Pointer OutputImagePointer;
107  typedef typename OutputImageType::RegionType OutputImageRegionType;
108 
110  typedef typename TOutputImage::PixelType PixelType;
111 
113  typedef typename InterpolatorType::Pointer InterpolatorPointer;
114  typedef typename InterpolatorType::ContinuousIndexType ContinuousIndexType;
115 
118 
120  typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(ImageDimension),
121  itkGetStaticConstMacro(ImageDimension) > RegionCopierType;
122 
127  void SetInputImage(const TInputImage *inputImage);
128 
131  void SetInterpolationCoordinate(const CoordImageType *coordinate, unsigned int setDimension);
132 
134  itkSetMacro(DefaultPixelValue, PixelType);
135 
137  itkGetConstMacro(DefaultPixelValue, PixelType);
138 
140  InterpolatorPointer GetInterpolator()
141  { return m_Interpolator; }
142 
145  void GenerateOutputInformation();
146 
148  void GenerateInputRequestedRegion();
149 
150 #ifdef ITK_USE_CONCEPT_CHECKING
151 
152  itkConceptMacro( InputHasNumericTraitsCheck,
154 
156 #endif
157 
158 protected:
160  // ~InterpolateImagePointsFilter(){} default implemnetation ok
161 
162  void PrintSelf(std::ostream & os, Indent indent) const;
163 
169  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
170  ThreadIdType threadId);
171 
172  void BeforeThreadedGenerateData();
173 
179  virtual void VerifyInputInformation() {}
180 
181 private:
182 
187 
188  InterpolateImagePointsFilter(const Self &); //purposely not implemented
189  void operator=(const Self &); //purposely not implemented
190 
192  PixelType m_DefaultPixelValue; // default pixel value if the
193  // point is outside the image
194 };
195 } // namespace itk
196 
197 #ifndef ITK_MANUAL_INSTANTIATION
198 #include "itkInterpolateImagePointsFilter.hxx"
199 #endif
200 
201 #endif
202