00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
00139 virtual void GraftOutput(OutputImageType *output);
00140
00147 virtual void GraftNthOutput(unsigned int idx, OutputImageType *output);
00148
00162 virtual DataObjectPointer MakeOutput(unsigned int idx);
00163
00164 protected:
00165 ImageSource();
00166 virtual ~ImageSource() {}
00167
00183 virtual void GenerateData();
00184
00207 virtual
00208 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00209 int threadId );
00210
00211
00217 virtual void PrepareOutputs() {};
00218
00224 virtual void AllocateOutputs();
00225
00236 virtual void BeforeThreadedGenerateData() {};
00237
00248 virtual void AfterThreadedGenerateData() {};
00249
00255 virtual
00256 int SplitRequestedRegion(int i, int num, OutputImageRegionType& splitRegion);
00257
00261 static ITK_THREAD_RETURN_TYPE ThreaderCallback( void *arg );
00262
00264 struct ThreadStruct
00265 {
00266 Pointer Filter;
00267 };
00268
00269 private:
00270 ImageSource(const Self&);
00271 void operator=(const Self&);
00272
00273 };
00274
00275 }
00276
00277 #ifndef ITK_MANUAL_INSTANTIATION
00278 #include "itkImageSource.txx"
00279 #endif
00280
00281 #endif
00282