ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkImageTransformer.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 __itkImageTransformer_h
29 #define __itkImageTransformer_h
30 
31 #include "itkProcessObject.h"
32 #include "itkImage.h"
33 
34 namespace itk
35 {
58 template< class TInputImage >
59 class ITK_EXPORT ImageTransformer:public ProcessObject
60 {
61 public:
67 
70 
73 
75  typedef TInputImage InputImageType;
76  typedef typename InputImageType::Pointer InputImagePointer;
77  typedef typename InputImageType::RegionType InputImageRegionType;
78  typedef typename InputImageType::PixelType InputImagePixelType;
79 
81  itkStaticConstMacro(InputImageDimension, unsigned int,
82  TInputImage::ImageDimension);
83 
85  using Superclass::SetInput;
86  virtual void SetInput(const InputImageType *image);
87  virtual void SetInput(unsigned int, const TInputImage *image);
88  const InputImageType * GetInput(void) const;
89  InputImageType * GetInput(void);
90  const InputImageType * GetInput(unsigned int idx) const;
92 
112  virtual void PushBackInput(const InputImageType *image);
113  virtual void PopBackInput();
114  virtual void PushFrontInput(const InputImageType *image);
115  virtual void PopFrontInput();
117 
118 protected:
120  virtual ~ImageTransformer() {}
121 
135  virtual void GenerateInputRequestedRegion();
136 
152  virtual void GenerateData();
153 
176  virtual
177  void ThreadedGenerateData(const InputImageRegionType & inputRegionForThread,
178  ThreadIdType threadId);
179 
185  virtual void AllocateOutputs();
186 
197  virtual void BeforeThreadedGenerateData() {}
198 
209  virtual void AfterThreadedGenerateData() {}
210 
216  virtual
217  unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, InputImageRegionType & splitRegion);
218 
222  static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg);
223 
233  void PushBackInput(const DataObject *input)
234  { Superclass::PushBackInput(input); }
235  void PushFrontInput(const DataObject *input)
236  { Superclass::PushFrontInput(input); }
238 
241  struct ThreadStruct {
243  };
244 private:
245  ImageTransformer(const Self &); //purposely not implemented
246  void operator=(const Self &); //purposely not implemented
247 };
248 } // end namespace itk
250 
251 // Define instantiation macro for this template.
252 #define ITK_TEMPLATE_ImageTransformer(_, EXPORT, TypeX, TypeY) \
253  namespace itk \
254  { \
255  _( 1 ( class EXPORT ImageTransformer< ITK_TEMPLATE_1 TypeX > ) ) \
256  namespace Templates \
257  { \
258  typedef ImageTransformer< ITK_TEMPLATE_1 TypeX > ImageTransformer##TypeY; \
259  } \
260  }
261 
262 #if ITK_TEMPLATE_EXPLICIT
263 #include "Templates/itkImageTransformer+-.h"
264 #endif
265 
266 #if ITK_TEMPLATE_TXX
267 #include "itkImageTransformer.hxx"
268 #endif
269 
270 #endif
271