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: 2003/09/10 14:28:54 $
00007   Version:   $Revision: 1.40 $
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 
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&); //purposely not implemented
00109   void operator=(const RandomImageSource&); //purposely not implemented
00110 
00111   unsigned long *m_Size;    //size of the output image
00112   float         *m_Spacing; //spacing
00113   float         *m_Origin;  //origin
00114 
00115   typename TOutputImage::PixelType m_Min; //minimum possible value
00116   typename TOutputImage::PixelType m_Max; //maximum possible value
00117 };
00118 
00119 } // end namespace itk
00120 
00121 #ifndef ITK_MANUAL_INSTANTIATION
00122 #include "itkRandomImageSource.txx"
00123 #endif
00124 
00125 #endif

Generated at Wed May 24 23:54:25 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000