00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __itkRandomImageSource_h
00021 #define __itkRandomImageSource_h
00022
00023 #include "itkImageSource.h"
00024 #include "itkNumericTraits.h"
00025
00026 namespace itk
00027 {
00028
00041 template <typename TOutputImage>
00042 class ITK_EXPORT RandomImageSource : public ImageSource<TOutputImage>
00043 {
00044 public:
00046 typedef RandomImageSource Self;
00047 typedef ImageSource<TOutputImage> Superclass;
00048 typedef SmartPointer<Self> Pointer;
00049 typedef SmartPointer<const Self> ConstPointer;
00050
00052 typedef typename TOutputImage::PixelType OutputImagePixelType;
00053
00055 typedef typename TOutputImage::RegionType OutputImageRegionType;
00056
00058 itkTypeMacro(RandomImageSource,ImageSource);
00059
00061 itkNewMacro(Self);
00062
00064 itkSetVectorMacro(Size,unsigned long,TOutputImage::ImageDimension);
00065
00067 itkGetVectorMacro(Size,unsigned long,TOutputImage::ImageDimension);
00068
00070 itkSetVectorMacro(Spacing,float,TOutputImage::ImageDimension);
00071
00073 itkGetVectorMacro(Spacing,float,TOutputImage::ImageDimension);
00074
00076 itkSetVectorMacro(Origin,float,TOutputImage::ImageDimension);
00077
00079 itkGetVectorMacro(Origin,float,TOutputImage::ImageDimension);
00080
00083 itkSetClampMacro(Min, OutputImagePixelType,
00084 NumericTraits<OutputImagePixelType>::NonpositiveMin(),
00085 NumericTraits<OutputImagePixelType>::max());
00086
00088 itkGetConstMacro(Min, OutputImagePixelType);
00089
00092 itkSetClampMacro(Max, OutputImagePixelType,
00093 NumericTraits<OutputImagePixelType>::NonpositiveMin(),
00094 NumericTraits<OutputImagePixelType>::max());
00095
00097 itkGetConstMacro(Max, OutputImagePixelType);
00098
00099 protected:
00100 RandomImageSource();
00101 ~RandomImageSource();
00102 void PrintSelf(std::ostream& os, Indent indent) const;
00103
00104 virtual void
00105 ThreadedGenerateData(const OutputImageRegionType&
00106 outputRegionForThread, int threadId );
00107 virtual void GenerateOutputInformation();
00108
00109 private:
00110 RandomImageSource(const RandomImageSource&);
00111 void operator=(const RandomImageSource&);
00112
00113 unsigned long *m_Size;
00114 float *m_Spacing;
00115 float *m_Origin;
00116
00117 typename TOutputImage::PixelType m_Min;
00118 typename TOutputImage::PixelType m_Max;
00119 };
00120
00121 }
00122
00123 #ifndef ITK_MANUAL_INSTANTIATION
00124 #include "itkRandomImageSource.txx"
00125 #endif
00126
00127 #endif
00128