Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkRandomImageSource.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRandomImageSource.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-07-12 10:45:28 $
00007   Version:   $Revision: 1.44 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
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&); //purposely not implemented
00123   void operator=(const RandomImageSource&); //purposely not implemented
00124 
00125   SizeType       m_Size;    //size of the output image
00126   SpacingType    m_Spacing; //spacing
00127   PointType      m_Origin;  //origin
00128 
00129   typename TOutputImage::PixelType m_Min; //minimum possible value
00130   typename TOutputImage::PixelType m_Max; //maximum possible value
00131 
00132   // The following variables are deprecated, and provided here just for
00133   // backward compatibility. It use is discouraged.
00134   mutable  PointValueArrayType      m_OriginArray;
00135   mutable  SpacingValueArrayType    m_SpacingArray;
00136 
00137 };
00138 
00139 } // end namespace itk
00140 
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkRandomImageSource.txx"
00143 #endif
00144 
00145 #endif
00146 

Generated at Mon Jul 12 2010 19:33:24 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000