00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSpatialObjectWriter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/01/21 20:19:32 $ 00007 Version: $Revision: 1.10 $ 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 __itkSpatialObjectWriter_h 00018 #define __itkSpatialObjectWriter_h 00019 00020 #include "itkMetaSceneConverter.h" 00021 #include "itkProcessObject.h" 00022 #include "itkSpatialObject.h" 00023 #include "itkSceneSpatialObject.h" 00024 #include <itkDefaultStaticMeshTraits.h> 00025 00026 namespace itk 00027 { 00028 00029 template <unsigned int NDimensions = 3, 00030 typename PixelType = unsigned char, 00031 typename TMeshTraits = DefaultStaticMeshTraits< PixelType , 00032 NDimensions, 00033 NDimensions > 00034 > 00035 class SpatialObjectWriter : public Object 00036 { 00037 public: 00038 00040 typedef SpatialObjectWriter Self; 00041 typedef SmartPointer<Self> Pointer; 00042 00043 typedef SpatialObject<NDimensions> SpatialObjectType; 00044 typedef typename SpatialObjectType::Pointer SpatialObjectPointer; 00045 typedef SceneSpatialObject<NDimensions> SceneType; 00046 00048 itkNewMacro(Self); 00049 00051 typedef Object Superclass; 00052 itkTypeMacro(SpatialObjectWriter, Object); 00053 00055 void Update(void); 00056 00058 itkSetStringMacro(FileName); 00059 00061 itkGetStringMacro(FileName); 00062 00064 void SetInput(SpatialObjectType * input){m_SpatialObject=input;} 00065 00066 void SetInput(SceneType * input){m_Scene=input;} 00067 00068 itkSetMacro(BinaryPoints,bool); 00069 itkGetMacro(BinaryPoints,bool); 00070 00071 void SetTransformPrecision(unsigned int precision); 00072 unsigned int GetTransformPrecision(); 00073 00074 protected: 00075 00076 std::string m_FileName; 00077 bool m_BinaryPoints; 00078 00079 SpatialObjectWriter(); 00080 virtual ~SpatialObjectWriter(); 00081 00082 private: 00083 00084 SpatialObjectPointer m_SpatialObject; 00085 SceneType * m_Scene; 00086 00087 MetaSceneConverter<NDimensions,PixelType,TMeshTraits> 00088 m_MetaToSpatialConverter; 00089 }; 00090 00091 } // namespace itk 00092 00093 00094 #ifndef ITK_MANUAL_INSTANTIATION 00095 #include "itkSpatialObjectWriter.txx" 00096 #endif 00097 00098 #endif // __itkSpatialObjectWriter_h