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: 2005/12/03 22:15:26 $
00007   Version:   $Revision: 1.50.10.1 $
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 
00113   OutputImageType * GetOutput(void);
00114   OutputImageType * GetOutput(unsigned int idx);
00115   
00151   virtual void GraftOutput(DataObject *output);
00152 
00159   virtual void GraftNthOutput(unsigned int idx, DataObject *output);
00160 
00174   virtual DataObjectPointer MakeOutput(unsigned int idx);
00175   
00176 protected:
00177   ImageSource();
00178   virtual ~ImageSource() {}
00179   
00195   virtual void GenerateData();
00196 
00219   virtual
00220   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00221                             int threadId );
00222 
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 #ifdef ITK_EXPLICIT_INSTANTIATION
00280    extern template class ImageSource<Image<float         ,2> >;
00281    extern template class ImageSource<Image<double        ,2> >;
00282    extern template class ImageSource<Image<unsigned char ,2> >;
00283    extern template class ImageSource<Image<unsigned short,2> >;
00284    extern template class ImageSource<Image<unsigned int  ,2> >;
00285    extern template class ImageSource<Image<signed char   ,2> >;
00286    extern template class ImageSource<Image<signed short  ,2> >;
00287    extern template class ImageSource<Image<signed int    ,2> >;
00288    extern template class ImageSource<Image<float         ,3> >;
00289    extern template class ImageSource<Image<double        ,3> >;
00290    extern template class ImageSource<Image<unsigned char ,3> >;
00291    extern template class ImageSource<Image<unsigned short,3> >;
00292    extern template class ImageSource<Image<unsigned int  ,3> >;
00293    extern template class ImageSource<Image<signed char   ,3> >;
00294    extern template class ImageSource<Image<signed short  ,3> >;
00295    extern template class ImageSource<Image<signed int    ,3> >;
00296 #endif
00297 
00298 } // end namespace itk
00299 
00300 #ifndef ITK_MANUAL_INSTANTIATION
00301 #include "itkImageSource.txx"
00302 #endif
00303 
00304 #endif
00305   

Generated at Wed May 24 23:26:30 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000