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 #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&);
00276 void operator=(const Self&);
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 }
00299
00300 #ifndef ITK_MANUAL_INSTANTIATION
00301 #include "itkImageSource.txx"
00302 #endif
00303
00304 #endif
00305