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 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&);
00240 void operator=(const Self&);
00241
00242 };
00243
00244 }
00245
00246 #ifndef ITK_MANUAL_INSTANTIATION
00247 #include "itkImageSource.txx"
00248 #endif
00249
00250 #endif
00251