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: 2004/05/22 02:21:38 $
00007   Version:   $Revision: 1.28 $
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      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   typedef typename OutputImageType::SpacingType SpacingType;
00047   typedef typename OutputImageType::PointType   OriginType;
00048 
00049   
00051   typedef ImportImageFilter   Self;
00052   typedef ImageSource<OutputImageType>  Superclass;
00053   typedef SmartPointer<Self>  Pointer;
00054   typedef SmartPointer<const Self>  ConstPointer;
00055 
00057   itkNewMacro(Self);
00058 
00060   itkTypeMacro(ImportImageFilter,ImageSource);
00061 
00063   typedef Index<VImageDimension>  IndexType;
00064 
00066   typedef Size<VImageDimension>  SizeType;
00067 
00070   typedef ImageRegion<VImageDimension>  RegionType;
00071 
00073   typedef TPixel OutputImagePixelType;
00074 
00076   TPixel *GetImportPointer();
00077 
00085   void SetImportPointer(TPixel *ptr, unsigned long num,
00086                         bool LetFilterManageMemory);
00087 
00092   void SetRegion(const RegionType &region)
00093   { if (m_Region != region) {m_Region = region; this->Modified();} };
00094 
00099   const RegionType& GetRegion() const
00100   { return m_Region;};
00101 
00104   itkSetVectorMacro(Spacing, const double, VImageDimension);
00105   itkSetVectorMacro(Spacing, const float, VImageDimension);
00107 
00110   itkGetVectorMacro(Spacing, const double, VImageDimension);
00111   void SetSpacing( const SpacingType & spacing );
00113 
00116   itkSetVectorMacro(Origin, const double, VImageDimension);
00117   itkSetVectorMacro(Origin, const float, VImageDimension);
00118   void SetOrigin( const OriginType & origin );
00120 
00123   itkGetVectorMacro(Origin, const double, VImageDimension);
00124 
00125 protected:
00126   ImportImageFilter();
00127   ~ImportImageFilter();
00128   void PrintSelf(std::ostream& os, Indent indent) const;
00129 
00132   virtual void GenerateData();
00133 
00137   virtual void GenerateOutputInformation();
00138 
00146   virtual void EnlargeOutputRequestedRegion(DataObject *output);
00147 
00148 private:  
00149   ImportImageFilter(const ImportImageFilter &); //purposely not implemented
00150   void operator=(const ImportImageFilter&); //purposely not implemented
00151 
00152   RegionType  m_Region;
00153   double   m_Spacing[VImageDimension];
00154   double   m_Origin[VImageDimension];
00155 
00156   TPixel*  m_ImportPointer;
00157   bool     m_FilterManageMemory;
00158   unsigned long m_Size;
00159 };
00160 
00161 } // end namespace itk
00162 
00163 #ifndef ITK_MANUAL_INSTANTIATION
00164 #include "itkImportImageFilter.txx"
00165 #endif
00166 
00167 #endif
00168 
00169 
00170 
00171 
00172 

Generated at Mon Mar 12 01:17:55 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000