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: 2002/03/25 21:00:34 $
00007   Version:   $Revision: 1.38 $
00008 
00009   Copyright (c) 2002 Insight 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 Mar 12 01:13:09 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000