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

itkImportImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImportImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/30 15:24:40 $
00007   Version:   $Revision: 1.23 $
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      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkImportImageFilter_h
00018 #define __itkImportImageFilter_h
00019 
00020 #include "itkImageSource.h"
00021 #include "itkImage.h"
00022 
00023 namespace itk
00024 {
00025 
00038 template <typename TPixel, unsigned int VImageDimension=2>
00039 class ITK_EXPORT ImportImageFilter: 
00040     public ImageSource< Image<TPixel,VImageDimension> >
00041 {
00042 public:
00044   typedef Image<TPixel,VImageDimension> OutputImageType;
00045   typedef typename OutputImageType::Pointer OutputImagePointer;
00046   
00048   typedef ImportImageFilter   Self;
00049   typedef ImageSource<OutputImageType>  Superclass;
00050   typedef SmartPointer<Self>  Pointer;
00051   typedef SmartPointer<const Self>  ConstPointer;
00052 
00054   itkNewMacro(Self);
00055 
00057   itkTypeMacro(ImportImageFilter,ImageSource);
00058 
00060   typedef Index<VImageDimension>  IndexType;
00061 
00063   typedef Size<VImageDimension>  SizeType;
00064 
00067   typedef ImageRegion<VImageDimension>  RegionType;
00068 
00070   typedef TPixel OutputImagePixelType;
00071   
00073   TPixel *GetImportPointer();
00074 
00081   void SetImportPointer(TPixel *ptr, unsigned long num,
00082                         bool LetSourceManageMemory);
00083 
00088   void SetRegion(const RegionType &region)
00089     { if (m_Region != region) {m_Region = region; this->Modified();} };
00090   
00095   const RegionType& GetRegion() const
00096     { return m_Region;};
00097   
00100   itkSetVectorMacro(Spacing, const double, VImageDimension);
00101   itkSetVectorMacro(Spacing, const float, VImageDimension);
00102 
00105   itkGetVectorMacro(Spacing, const double, VImageDimension);
00106   
00109   itkSetVectorMacro(Origin, const double, VImageDimension);
00110   itkSetVectorMacro(Origin, const float, VImageDimension);
00111 
00114   itkGetVectorMacro(Origin, const double, VImageDimension);
00115 
00116 protected:
00117  ImportImageFilter();
00118   ~ImportImageFilter();
00119   void PrintSelf(std::ostream& os, Indent indent) const;
00120 
00123   virtual void GenerateData();
00124 
00128   virtual void GenerateOutputInformation();
00129 
00137   virtual void EnlargeOutputRequestedRegion(DataObject *output);
00138 
00139 private:  
00140   ImportImageFilter(const ImportImageFilter &); //purposely not implemented
00141   void operator=(const ImportImageFilter&); //purposely not implemented
00142 
00143   RegionType  m_Region;
00144   double   m_Spacing[VImageDimension];
00145   double   m_Origin[VImageDimension];
00146 
00147   TPixel*  m_ImportPointer;
00148   bool     m_SourceManageMemory;
00149   unsigned long m_Size;
00150 };
00151 
00152 } // end namespace itk
00153 
00154 #ifndef ITK_MANUAL_INSTANTIATION
00155 #include "itkImportImageFilter.txx"
00156 #endif
00157 
00158 #endif
00159 
00160 
00161 
00162 

Generated at Fri May 21 01:14:57 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000