ITK  5.0.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< typename TInputImage >
59 class ITK_TEMPLATE_EXPORT ImageTransformer:public ProcessObject
60 {
61 public:
62  ITK_DISALLOW_COPY_AND_ASSIGN(ImageTransformer);
63 
69 
72 
74  itkTypeMacro(ImageTransformer, ProcessObject);
75 
77  using InputImageType = TInputImage;
78  using InputImagePointer = typename InputImageType::Pointer;
80  using InputImagePixelType = typename InputImageType::PixelType;
81 
83  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
84 
86  using Superclass::SetInput;
87  virtual void SetInput(const InputImageType *image);
88  virtual void SetInput(unsigned int, const TInputImage *image);
89  const InputImageType * GetInput() const;
90  InputImageType * GetInput();
91  const InputImageType * GetInput(unsigned int idx) const;
93 
113  virtual void PushBackInput(const InputImageType *image);
114  void PopBackInput() override;
115  virtual void PushFrontInput(const InputImageType *image);
116  void PopFrontInput() override;
118 
119 protected:
121  ~ImageTransformer() override = default;
122 
136  void GenerateInputRequestedRegion() override;
137 
153  void GenerateData() override;
154 
177  virtual
178  void ThreadedGenerateData(const InputImageRegionType & inputRegionForThread,
179  ThreadIdType threadId);
180 
184  void ClassicMultiThread(ThreadFunctionType callbackFunction);
185 
191  virtual void AllocateOutputs();
192 
203  virtual void BeforeThreadedGenerateData() {}
204 
215  virtual void AfterThreadedGenerateData() {}
216 
222  virtual
223  unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, InputImageRegionType & splitRegion);
224 
228  static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreaderCallback(void *arg);
229 
239  void PushBackInput(const DataObject *input) override
240  { Superclass::PushBackInput(input); }
241  void PushFrontInput(const DataObject *input) override
242  { Superclass::PushFrontInput(input); }
244 
247  struct ThreadStruct {
249  };
250 };
251 } // end namespace itk
252 
253 #ifndef ITK_MANUAL_INSTANTIATION
254 #include "itkImageTransformer.hxx"
255 #endif
256 
257 #endif
void(* ThreadFunctionType)(void *)
typename InputImageType::Pointer InputImagePointer
Light weight base class for most itk classes.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
itk::ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
void PushBackInput(const DataObject *input) override
typename InputImageType::RegionType InputImageRegionType
void PushFrontInput(const DataObject *input) override
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:40
virtual void AfterThreadedGenerateData()
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
typename InputImageType::PixelType InputImagePixelType
Base class for all process objects that transform an image into something else.
SmartPointer< Self > Pointer
virtual void BeforeThreadedGenerateData()
Base class for all data objects in ITK.