Orfeo Toolbox  3.16
itkImageSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkImageSource.h,v $
5  Language: C++
6  Date: $Date: 2009-03-12 01:11:08 $
7  Version: $Revision: 1.59 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  Portions of this code are covered under the VTK copyright.
13  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14 
15  This software is distributed WITHOUT ANY WARRANTY; without even
16  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17  PURPOSE. See the above copyright notices for more information.
18 
19 =========================================================================*/
20 #ifndef __itkImageSource_h
21 #define __itkImageSource_h
22 
23 #include "itkProcessObject.h"
24 #include "itkImage.h"
25 
26 namespace itk
27 {
28 
51 template <class TOutputImage>
53 {
54 public:
56  typedef ImageSource Self;
60 
63 
65  itkTypeMacro(ImageSource,ProcessObject);
66 
68  typedef TOutputImage OutputImageType;
69  typedef typename OutputImageType::Pointer OutputImagePointer;
70  typedef typename OutputImageType::RegionType OutputImageRegionType;
71  typedef typename OutputImageType::PixelType OutputImagePixelType;
72 
74  itkStaticConstMacro(OutputImageDimension, unsigned int,
75  TOutputImage::ImageDimension);
76 
124  OutputImageType * GetOutput(void);
125  OutputImageType * GetOutput(unsigned int idx);
126 
162  virtual void GraftOutput(DataObject *output);
163 
170  virtual void GraftNthOutput(unsigned int idx, DataObject *output);
171 
185  virtual DataObjectPointer MakeOutput(unsigned int idx);
186 
187 protected:
188  ImageSource();
189  virtual ~ImageSource() {}
190 
206  virtual void GenerateData();
207 
230  virtual
231  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
232  int threadId );
233 
234 
240  virtual void AllocateOutputs();
241 
252  virtual void BeforeThreadedGenerateData() {};
253 
264  virtual void AfterThreadedGenerateData() {};
265 
271  virtual
272  int SplitRequestedRegion(int i, int num, OutputImageRegionType& splitRegion);
273 
277  static ITK_THREAD_RETURN_TYPE ThreaderCallback( void *arg );
278 
281  {
283  };
284 
285 private:
286  ImageSource(const Self&); //purposely not implemented
287  void operator=(const Self&); //purposely not implemented
288 
289 };
290 
291 } // end namespace itk
292 
293 // Define instantiation macro for this template.
294 #define ITK_TEMPLATE_ImageSource(_, EXPORT, x, y) namespace itk { \
295  _(1(class EXPORT ImageSource< ITK_TEMPLATE_1 x >)) \
296  namespace Templates { typedef ImageSource< ITK_TEMPLATE_1 x > ImageSource##y; } \
297  }
298 
299 #if ITK_TEMPLATE_EXPLICIT
300 # include "Templates/itkImageSource+-.h"
301 #endif
302 
303 #if ITK_TEMPLATE_TXX
304 # include "itkImageSource.txx"
305 #endif
306 
307 #endif

Generated at Sat Feb 2 2013 23:44:50 for Orfeo Toolbox with doxygen 1.8.1.1