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
00039 template <typename TOutputImage>
00040 class ITK_EXPORT RandomImageSource : public ImageSource<TOutputImage>
00041 {
00042 public:
00044 typedef RandomImageSource Self;
00045 typedef ImageSource<TOutputImage> Superclass;
00046 typedef SmartPointer<Self> Pointer;
00047 typedef SmartPointer<const Self> ConstPointer;
00048
00050 typedef typename TOutputImage::PixelType OutputImagePixelType;
00051
00053 typedef typename TOutputImage::RegionType OutputImageRegionType;
00054
00056 itkTypeMacro(RandomImageSource,ImageSource);
00057
00059 itkNewMacro(Self);
00060
00062 itkSetVectorMacro(Size,unsigned long,TOutputImage::ImageDimension);
00063
00065 itkGetVectorMacro(Size,unsigned long,TOutputImage::ImageDimension);
00066
00068 itkSetVectorMacro(Spacing,float,TOutputImage::ImageDimension);
00069
00071 itkGetVectorMacro(Spacing,float,TOutputImage::ImageDimension);
00072
00074 itkSetVectorMacro(Origin,float,TOutputImage::ImageDimension);
00075
00077 itkGetVectorMacro(Origin,float,TOutputImage::ImageDimension);
00078
00081 itkSetClampMacro(Min, OutputImagePixelType,
00082 NumericTraits<OutputImagePixelType>::NonpositiveMin(),
00083 NumericTraits<OutputImagePixelType>::max());
00084
00086 itkGetMacro(Min, OutputImagePixelType);
00087
00090 itkSetClampMacro(Max, OutputImagePixelType,
00091 NumericTraits<OutputImagePixelType>::NonpositiveMin(),
00092 NumericTraits<OutputImagePixelType>::max());
00093
00095 itkGetMacro(Max, OutputImagePixelType);
00096
00097 protected:
00098 RandomImageSource();
00099 ~RandomImageSource();
00100 void PrintSelf(std::ostream& os, Indent indent) const;
00101
00102 virtual void
00103 ThreadedGenerateData(const OutputImageRegionType&
00104 outputRegionForThread, int threadId );
00105 virtual void GenerateOutputInformation();
00106
00107 private:
00108 RandomImageSource(const RandomImageSource&);
00109 void operator=(const RandomImageSource&);
00110
00111 unsigned long *m_Size;
00112 float *m_Spacing;
00113 float *m_Origin;
00114
00115 typename TOutputImage::PixelType m_Min;
00116 typename TOutputImage::PixelType m_Max;
00117 };
00118
00119 }
00120
00121 #ifndef ITK_MANUAL_INSTANTIATION
00122 #include "itkRandomImageSource.txx"
00123 #endif
00124
00125 #endif
00126