RTK  1.4.0
Reconstruction Toolkit
rtkUpsampleImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK 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 #ifndef rtkUpsampleImageFilter_h
20 #define rtkUpsampleImageFilter_h
21 
22 #include "itkImageToImageFilter.h"
23 
24 namespace rtk
25 {
26 
37 template <class TInputImage, class TOutputImage = TInputImage>
38 class ITK_EXPORT UpsampleImageFilter:
39  public itk::ImageToImageFilter<TInputImage,TOutputImage>
40 {
41 public:
47 
49  itkNewMacro(Self);
50 
53 
55  typedef TOutputImage OutputImageType;
56  typedef TInputImage InputImageType;
57  typedef typename OutputImageType::Pointer OutputImagePointer;
58  typedef typename InputImageType::Pointer InputImagePointer;
59  typedef typename InputImageType::ConstPointer InputImageConstPointer;
60 
62  typedef typename TOutputImage::RegionType OutputImageRegionType;
63 
65  itkStaticConstMacro(ImageDimension, unsigned int,
66  TInputImage::ImageDimension );
67 
70  void SetFactors(unsigned int factors[]);
71 
74  void SetFactor(unsigned int dimension, unsigned int factor);
75 
83  void GenerateOutputInformation() ITK_OVERRIDE;
84 
90  void GenerateInputRequestedRegion() ITK_OVERRIDE;
91 
97  itkSetMacro(Order, unsigned int)
98  itkGetMacro(Order, unsigned int)
99 
105  itkSetMacro(OutputSize, typename TOutputImage::SizeType)
106  itkGetMacro(OutputSize, typename TOutputImage::SizeType)
107 
114  itkSetMacro(OutputIndex, typename TOutputImage::IndexType)
115  itkGetMacro(OutputIndex, typename TOutputImage::IndexType)
116 
117 protected:
119  virtual ~UpsampleImageFilter() ITK_OVERRIDE {}
120 
131 // void BeforeThreadedGenerateData();
132 #if ITK_VERSION_MAJOR<5
133  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) ITK_OVERRIDE;
134 #else
135  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE;
136 #endif
137 // void AfterThreadedGenerateData();
139 
140 private:
141  UpsampleImageFilter(const Self&); //purposely not implemented
142  void operator=(const Self&); //purposely not implemented
143 
144  unsigned int m_Factors[ImageDimension];
145  unsigned int m_Order;
146  typename TOutputImage::SizeType m_OutputSize;
147  typename TOutputImage::IndexType m_OutputIndex;
148 };
149 
150 
151 } // end namespace rtk
152 
153 #ifndef rtk_MANUAL_INSTANTIATION
154 #include "rtkUpsampleImageFilter.hxx"
155 #endif
156 
157 #endif
InputImageType::Pointer InputImagePointer
itk::SmartPointer< Self > Pointer
OutputImageType::Pointer OutputImagePointer
Upsamples an image by the given factor for each dimension.
itk::SmartPointer< const Self > ConstPointer
ImageBaseType::SizeType SizeType
ImageBaseType::IndexType IndexType
TOutputImage::SizeType m_OutputSize
TOutputImage::RegionType OutputImageRegionType
unsigned int ThreadIdType
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
TOutputImage::IndexType m_OutputIndex
InputImageType::ConstPointer InputImageConstPointer
#define itkSetMacro(name, type)