Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkImageSource.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImageSource.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-03-12 01:11:08 $
00007   Version:   $Revision: 1.59 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkImageSource_h
00021 #define __itkImageSource_h
00022 
00023 #include "itkProcessObject.h"
00024 #include "itkImage.h"
00025 
00026 namespace itk
00027 {
00028 
00051 template <class TOutputImage>
00052 class ITK_EXPORT ImageSource : public ProcessObject
00053 {
00054 public:
00056   typedef ImageSource               Self;
00057   typedef ProcessObject             Superclass;
00058   typedef SmartPointer<Self>        Pointer;
00059   typedef SmartPointer<const Self>  ConstPointer;
00060 
00062   typedef DataObject::Pointer DataObjectPointer;
00063 
00065   itkTypeMacro(ImageSource,ProcessObject);
00066 
00068   typedef TOutputImage                         OutputImageType;
00069   typedef typename OutputImageType::Pointer    OutputImagePointer;
00070   typedef typename OutputImageType::RegionType OutputImageRegionType;
00071   typedef typename OutputImageType::PixelType  OutputImagePixelType;
00072 
00074   itkStaticConstMacro(OutputImageDimension, unsigned int,
00075                       TOutputImage::ImageDimension);
00076 
00124   OutputImageType * GetOutput(void);
00125   OutputImageType * GetOutput(unsigned int idx);
00127 
00163   virtual void GraftOutput(DataObject *output);
00164 
00171   virtual void GraftNthOutput(unsigned int idx, DataObject *output);
00172 
00186   virtual DataObjectPointer MakeOutput(unsigned int idx);
00187 
00188 protected:
00189   ImageSource();
00190   virtual ~ImageSource() {}
00191   
00207   virtual void GenerateData();
00208 
00231   virtual
00232   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00233                             int threadId ) ITK_NO_RETURN;
00234 
00235 
00241   virtual void AllocateOutputs();
00242 
00253   virtual void BeforeThreadedGenerateData() {};
00254 
00265   virtual void AfterThreadedGenerateData() {};
00266 
00272   virtual
00273   int SplitRequestedRegion(int i, int num, OutputImageRegionType& splitRegion);
00274 
00278   static ITK_THREAD_RETURN_TYPE ThreaderCallback( void *arg );
00279 
00281   struct ThreadStruct
00282     {
00283     Pointer Filter;
00284     };
00285 
00286 private:
00287   ImageSource(const Self&); //purposely not implemented
00288   void operator=(const Self&); //purposely not implemented
00289 
00290 };
00291 
00292 } // end namespace itk
00293 
00294 // Define instantiation macro for this template.
00295 #define ITK_TEMPLATE_ImageSource(_, EXPORT, x, y) namespace itk { \
00296   _(1(class EXPORT ImageSource< ITK_TEMPLATE_1 x >)) \
00297   namespace Templates { typedef ImageSource< ITK_TEMPLATE_1 x > ImageSource##y; } \
00298   }
00299 
00300 #if ITK_TEMPLATE_EXPLICIT
00301 # include "Templates/itkImageSource+-.h"
00302 #endif
00303 
00304 #if ITK_TEMPLATE_TXX
00305 # include "itkImageSource.txx"
00306 #endif
00307 
00308 #endif
00309 

Generated at Mon Jul 12 2010 18:46:05 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000