Go to the documentation of this file.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 typedef typename TOutputImage::SizeType SizeType;
00065 typedef typename TOutputImage::IndexType IndexType;
00066 typedef typename TOutputImage::SpacingType SpacingType;
00067 typedef typename TOutputImage::PointType PointType;
00068 typedef typename SizeType::SizeValueType SizeValueType;
00069 typedef SizeValueType SizeValueArrayType[TOutputImage::ImageDimension];
00070 typedef typename TOutputImage::SpacingValueType SpacingValueType;
00071 typedef SpacingValueType SpacingValueArrayType[TOutputImage::ImageDimension];
00072 typedef typename TOutputImage::PointValueType PointValueType;
00073 typedef PointValueType PointValueArrayType[TOutputImage::ImageDimension];
00074
00076 itkSetMacro( Size, SizeType );
00077 virtual void SetSize( SizeValueArrayType sizeArray );
00078 virtual const SizeValueType * GetSize() const;
00080
00082 itkSetMacro( Spacing, SpacingType );
00083 virtual void SetSpacing( SpacingValueArrayType spacingArray );
00084 virtual const SpacingValueType * GetSpacing() const;
00086
00088 itkSetMacro( Origin, PointType );
00089 virtual void SetOrigin( PointValueArrayType originArray );
00090 virtual const PointValueType * GetOrigin() const;
00092
00095 itkSetClampMacro(Min, OutputImagePixelType,
00096 NumericTraits<OutputImagePixelType>::NonpositiveMin(),
00097 NumericTraits<OutputImagePixelType>::max());
00098
00100 itkGetConstMacro(Min, OutputImagePixelType);
00101
00104 itkSetClampMacro(Max, OutputImagePixelType,
00105 NumericTraits<OutputImagePixelType>::NonpositiveMin(),
00106 NumericTraits<OutputImagePixelType>::max());
00107
00109 itkGetConstMacro(Max, OutputImagePixelType);
00110
00111 protected:
00112 RandomImageSource();
00113 ~RandomImageSource();
00114 void PrintSelf(std::ostream& os, Indent indent) const;
00115
00116 virtual void
00117 ThreadedGenerateData(const OutputImageRegionType&
00118 outputRegionForThread, int threadId );
00119 virtual void GenerateOutputInformation();
00120
00121 private:
00122 RandomImageSource(const RandomImageSource&);
00123 void operator=(const RandomImageSource&);
00124
00125 SizeType m_Size;
00126 SpacingType m_Spacing;
00127 PointType m_Origin;
00128
00129 typename TOutputImage::PixelType m_Min;
00130 typename TOutputImage::PixelType m_Max;
00131
00132
00133
00134 mutable PointValueArrayType m_OriginArray;
00135 mutable SpacingValueArrayType m_SpacingArray;
00136
00137 };
00138
00139 }
00140
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkRandomImageSource.txx"
00143 #endif
00144
00145 #endif
00146