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: 2007/12/21 15:35:40 $
00007   Version:   $Revision: 1.42 $
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   itkSetVectorMacro(Size,unsigned long,TOutputImage::ImageDimension);
00065 
00067   itkGetVectorMacro(Size,unsigned long,TOutputImage::ImageDimension);
00068 
00070   itkSetVectorMacro(Spacing,float,TOutputImage::ImageDimension);
00071 
00073   itkGetVectorMacro(Spacing,float,TOutputImage::ImageDimension);
00074 
00076   itkSetVectorMacro(Origin,float,TOutputImage::ImageDimension);
00077 
00079   itkGetVectorMacro(Origin,float,TOutputImage::ImageDimension);
00080 
00083   itkSetClampMacro(Min, OutputImagePixelType,
00084                    NumericTraits<OutputImagePixelType>::NonpositiveMin(),
00085                    NumericTraits<OutputImagePixelType>::max());
00086 
00088   itkGetMacro(Min, OutputImagePixelType);
00089 
00092   itkSetClampMacro(Max, OutputImagePixelType,
00093                    NumericTraits<OutputImagePixelType>::NonpositiveMin(),
00094                    NumericTraits<OutputImagePixelType>::max());
00095 
00097   itkGetMacro(Max, OutputImagePixelType);
00098 
00099 protected:
00100   RandomImageSource();
00101   ~RandomImageSource();
00102   void PrintSelf(std::ostream& os, Indent indent) const;
00103   
00104   virtual void 
00105   ThreadedGenerateData(const OutputImageRegionType& 
00106                        outputRegionForThread, int threadId );
00107   virtual void GenerateOutputInformation();
00108 
00109 private:
00110   RandomImageSource(const RandomImageSource&); //purposely not implemented
00111   void operator=(const RandomImageSource&); //purposely not implemented
00112 
00113   unsigned long *m_Size;    //size of the output image
00114   float         *m_Spacing; //spacing
00115   float         *m_Origin;  //origin
00116 
00117   typename TOutputImage::PixelType m_Min; //minimum possible value
00118   typename TOutputImage::PixelType m_Max; //maximum possible value
00119 };
00120 
00121 } // end namespace itk
00122 
00123 #ifndef ITK_MANUAL_INSTANTIATION
00124 #include "itkRandomImageSource.txx"
00125 #endif
00126 
00127 #endif
00128 

Generated at Tue Jul 29 21:54:31 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000