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: 2002/05/10 22:56:17 $
00007   Version:   $Revision: 1.43 $
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   itkNewMacro(Self);  
00054 
00056   itkTypeMacro(ImageSource,ProcessObject);
00057 
00059   typedef TOutputImage OutputImageType;
00060   typedef typename OutputImageType::Pointer OutputImagePointer;
00061   typedef typename OutputImageType::RegionType OutputImageRegionType;
00062   typedef typename OutputImageType::PixelType OutputImagePixelType;
00063     
00065   OutputImageType * GetOutput(void);
00066   OutputImageType * GetOutput(unsigned int idx);
00067   
00071   void SetOutput(OutputImageType *output);
00072 
00108   virtual void GraftOutput(OutputImageType *output);
00109 
00116   virtual void GraftNthOutput(unsigned int idx, OutputImageType *output);
00117 
00131   virtual DataObjectPointer MakeOutput(unsigned int idx);
00132   
00133 protected:
00134   ImageSource();
00135   virtual ~ImageSource() {}
00136   
00152   virtual void GenerateData();
00153 
00176   virtual
00177   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00178                             int threadId );
00179 
00180 
00186   virtual void PrepareOutputs() {};
00187 
00193   virtual void AllocateOutputs();
00194   
00205   virtual void BeforeThreadedGenerateData() {};
00206   
00217   virtual void AfterThreadedGenerateData() {};
00218   
00224   virtual
00225   int SplitRequestedRegion(int i, int num, OutputImageRegionType& splitRegion);
00226 
00230   static ITK_THREAD_RETURN_TYPE ThreaderCallback( void *arg );
00231 
00233   struct ThreadStruct
00234   {
00235    Pointer Filter;
00236   };
00237   
00238 private:
00239   ImageSource(const Self&); //purposely not implemented
00240   void operator=(const Self&); //purposely not implemented
00241 
00242 };
00243 
00244 } // end namespace itk
00245 
00246 #ifndef ITK_MANUAL_INSTANTIATION
00247 #include "itkImageSource.txx"
00248 #endif
00249 
00250 #endif
00251   

Generated at Wed Mar 12 01:13:02 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000