ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkGenerateImageSource.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 
00019 #ifndef __itkGenerateImageSource_h
00020 #define __itkGenerateImageSource_h
00021 
00022 #include "itkImageSource.h"
00023 
00024 namespace itk
00025 {
00026 
00039 template< typename TOutputImage >
00040 class GenerateImageSource
00041   : public ImageSource< TOutputImage >
00042 {
00043 public:
00044   typedef GenerateImageSource         Self;
00045   typedef ImageSource< TOutputImage > Superclass;
00046   typedef SmartPointer< Self >        Pointer;
00047   typedef SmartPointer< const Self>   ConstPointer;
00048 
00050   typedef TOutputImage                            OutputImageType;
00051   typedef typename OutputImageType::PixelType     PixelType;
00052   typedef typename OutputImageType::RegionType    RegionType;
00053   typedef typename OutputImageType::SpacingType   SpacingType;
00054   typedef typename OutputImageType::PointType     PointType;
00055   typedef typename OutputImageType::DirectionType DirectionType;
00056 
00057 
00058   typedef typename TOutputImage::SizeType        SizeType;
00059   typedef typename TOutputImage::SizeValueType SizeValueType;
00060 
00062   itkStaticConstMacro(NDimensions, unsigned int, TOutputImage::ImageDimension);
00063 
00065   itkTypeMacro(GeneratemageSource, ImageSource);
00066 
00070   itkSetMacro(Size, SizeType);
00071   itkGetConstReferenceMacro(Size, SizeType);
00072   itkSetVectorMacro(Size, SizeValueType, NDimensions);
00074 
00078   itkSetMacro(Spacing, SpacingType);
00079   itkGetConstReferenceMacro(Spacing, SpacingType);
00080   itkSetVectorMacro(Spacing, const float, NDimensions);
00082 
00083 
00087   itkSetMacro(Origin, PointType);
00088   itkGetConstReferenceMacro(Origin, PointType);
00089   itkSetVectorMacro(Origin, const float, NDimensions);
00091 
00096   itkSetMacro(Direction, DirectionType);
00097   itkGetConstReferenceMacro(Direction, DirectionType);
00099 
00100 protected:
00101   GenerateImageSource( );
00102   // virtual ~GenerateImageSource() default implementation ok
00103   void PrintSelf(std::ostream & os, Indent indent) const;
00104 
00105   virtual void GenerateOutputInformation();
00106 
00107 private:
00108   GenerateImageSource( const GenerateImageSource &); //purposely not implemented
00109   void operator=( const GenerateImageSource &);  //purposely not implemented
00110 
00111   SizeType      m_Size;            //size of the output image
00112   SpacingType   m_Spacing;         //spacing
00113   PointType     m_Origin;          //origin
00114   DirectionType m_Direction;       //direciton
00115 
00116 };
00117 
00118 }
00119 
00120 
00121 #ifndef ITK_MANUAL_INSTANTIATION
00122 #include "itkGenerateImageSource.hxx"
00123 #endif
00124 
00125 
00126 #endif //__itkGenerateImageSource_h
00127