Orfeo Toolbox  4.0
itkImageSource.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 __itkImageSource_h
29 #define __itkImageSource_h
30 
31 #include "itkProcessObject.h"
32 #include "itkImage.h"
34 
35 namespace itk
36 {
37 
50 struct ITKCommon_EXPORT ImageSourceCommon
51 {
55  static const ImageRegionSplitterBase* GetGlobalDefaultSplitter(void);
56 };
57 
85 template< typename TOutputImage >
87  : public ProcessObject, private ImageSourceCommon
88 {
89 public:
91  typedef ImageSource Self;
95 
98 
101 
103  itkTypeMacro(ImageSource, ProcessObject);
104 
106  typedef TOutputImage OutputImageType;
107  typedef typename OutputImageType::Pointer OutputImagePointer;
108  typedef typename OutputImageType::RegionType OutputImageRegionType;
109  typedef typename OutputImageType::PixelType OutputImagePixelType;
110 
112  itkStaticConstMacro(OutputImageDimension, unsigned int,
113  TOutputImage::ImageDimension);
114 
162  OutputImageType * GetOutput(void);
163  const OutputImageType * GetOutput(void) const;
164 
165  OutputImageType * GetOutput(unsigned int idx);
166 
202  virtual void GraftOutput(DataObject *output);
203 
209  virtual void GraftOutput(const DataObjectIdentifierType & key, DataObject *output);
210 
217  virtual void GraftNthOutput(unsigned int idx, DataObject *output);
218 
234 
235 protected:
236  ImageSource();
237  virtual ~ImageSource() {}
238 
254  virtual void GenerateData();
255 
278  virtual
279  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
280  ThreadIdType threadId);
281 
287  virtual void AllocateOutputs();
288 
299  virtual void BeforeThreadedGenerateData() {}
300 
311  virtual void AfterThreadedGenerateData() {}
312 
319  {
321  }
322 
333  virtual const ImageRegionSplitterBase* GetImageRegionSplitter(void) const;
334 
349  virtual
350  unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType & splitRegion);
351 
355  static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg);
356 
359  struct ThreadStruct {
361  };
362 
363 private:
364  ImageSource(const Self &); //purposely not implemented
365  void operator=(const Self &); //purposely not implemented
366 };
367 } // end namespace itk
368 
369 #ifndef ITK_MANUAL_INSTANTIATION
370 #include "itkImageSource.hxx"
371 #endif
372 
373 #endif

Generated at Sat Mar 8 2014 14:54:29 for Orfeo Toolbox with doxygen 1.8.3.1