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
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&);
00276 void operator=(const Self&);
00277
00278 };
00279
00280 }
00281
00282 #ifndef ITK_MANUAL_INSTANTIATION
00283 #include "itkImageSource.txx"
00284 #endif
00285
00286 #endif
00287