00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSpatialObjectReader.h,v $ 00005 Language: C++ 00006 Date: $Date: 2006/12/02 21:11:55 $ 00007 Version: $Revision: 1.12 $ 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 __itkSpatialObjectReader_h 00018 #define __itkSpatialObjectReader_h 00019 00020 #include "itkMetaSceneConverter.h" 00021 #include "itkSpatialObject.h" 00022 #include "itkGroupSpatialObject.h" 00023 #include "itkProcessObject.h" 00024 #include "itkSceneSpatialObject.h" 00025 #include "itkMetaEvent.h" 00026 #include <itkDefaultStaticMeshTraits.h> 00027 00028 namespace itk 00029 { 00030 00031 template <unsigned int NDimensions = 3, 00032 typename PixelType = unsigned char, 00033 typename TMeshTraits = DefaultStaticMeshTraits< PixelType , NDimensions, NDimensions > 00034 > 00035 class SpatialObjectReader : public Object 00036 { 00037 public: 00038 00040 typedef SpatialObjectReader Self; 00041 typedef SmartPointer<Self> Pointer; 00042 00043 typedef SpatialObject<NDimensions> SpatialObjectType; 00044 typedef typename SpatialObjectType::Pointer SpatialObjectPointer; 00045 00046 typedef GroupSpatialObject<NDimensions> GroupType; 00047 typedef typename GroupType::Pointer GroupPointer; 00048 00049 typedef SceneSpatialObject<NDimensions> SceneType; 00050 typedef typename SceneType::Pointer ScenePointer; 00051 00053 itkNewMacro(Self); 00054 00056 typedef Object Superclass; 00057 itkTypeMacro(SpatialObjectReader, Object); 00059 00061 void Update(void); 00062 00064 itkSetStringMacro(FileName); 00065 00067 itkGetStringMacro(FileName); 00068 00070 ScenePointer GetScene(void) {return m_Scene;} 00071 GroupPointer GetGroup(void) {return m_Group;} 00073 00075 const MetaEvent* GetEvent() {return m_MetaToSpatialConverter.GetEvent();} 00076 void SetEvent(MetaEvent* event) {m_MetaToSpatialConverter.SetEvent(event);} 00078 00079 protected: 00080 SpatialObjectReader(const Self&); //purposely not implemented 00081 void operator=(const Self&); //purposely not implemented 00082 00083 std::string m_FileName; 00084 00085 SpatialObjectReader(); 00086 virtual ~SpatialObjectReader(); 00087 00088 private: 00089 00090 ScenePointer m_Scene; 00091 GroupPointer m_Group; 00092 MetaSceneConverter<NDimensions,PixelType,TMeshTraits> m_MetaToSpatialConverter; 00093 }; 00094 00095 } // namespace itk 00096 00097 00098 #ifndef ITK_MANUAL_INSTANTIATION 00099 #include "itkSpatialObjectReader.txx" 00100 #endif 00101 00102 #endif // __itkSpatialObjectReader_h 00103