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: 2003/02/19 18:30:25 $
00007   Version:   $Revision: 1.45 $
00008 
00009   Copyright (c) 2002 Insight 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 
00025 namespace itk
00026 {
00027 
00039 template <class TOutputImage>
00040 class ITK_EXPORT ImageSource : public ProcessObject
00041 {
00042 public:
00044   typedef ImageSource         Self;
00045   typedef ProcessObject  Superclass;
00046   typedef SmartPointer<Self>  Pointer;
00047   typedef SmartPointer<const Self>  ConstPointer;
00048   
00050   typedef DataObject::Pointer DataObjectPointer;
00051 
00053   itkTypeMacro(ImageSource,ProcessObject);
00054 
00056   typedef TOutputImage OutputImageType;
00057   typedef typename OutputImageType::Pointer OutputImagePointer;
00058   typedef typename OutputImageType::RegionType OutputImageRegionType;
00059   typedef typename OutputImageType::PixelType OutputImagePixelType;
00060 
00101   OutputImageType * GetOutput(void);
00102   OutputImageType * GetOutput(unsigned int idx);
00103   
00107   void SetOutput(OutputImageType *output);
00108 
00144   virtual void GraftOutput(OutputImageType *output);
00145 
00152   virtual void GraftNthOutput(unsigned int idx, OutputImageType *output);
00153 
00167   virtual DataObjectPointer MakeOutput(unsigned int idx);
00168   
00169 protected:
00170   ImageSource();
00171   virtual ~ImageSource() {}
00172   
00188   virtual void GenerateData();
00189 
00212   virtual
00213   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00214                             int threadId );
00215 
00216 
00222   virtual void PrepareOutputs() {};
00223 
00229   virtual void AllocateOutputs();
00230   
00241   virtual void BeforeThreadedGenerateData() {};
00242   
00253   virtual void AfterThreadedGenerateData() {};
00254   
00260   virtual
00261   int SplitRequestedRegion(int i, int num, OutputImageRegionType& splitRegion);
00262 
00266   static ITK_THREAD_RETURN_TYPE ThreaderCallback( void *arg );
00267 
00269   struct ThreadStruct
00270   {
00271    Pointer Filter;
00272   };
00273   
00274 private:
00275   ImageSource(const Self&); //purposely not implemented
00276   void operator=(const Self&); //purposely not implemented
00277 
00278 };
00279 
00280 } // end namespace itk
00281 
00282 #ifndef ITK_MANUAL_INSTANTIATION
00283 #include "itkImageSource.txx"
00284 #endif
00285 
00286 #endif
00287   

Generated at Fri May 21 01:14:56 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000