00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00075 itkSetMacro(WriteImagesInSeparateFile,bool);
00076 itkGetMacro(WriteImagesInSeparateFile,bool);
00077
00078
00079 protected:
00080
00081 std::string m_FileName;
00082 bool m_BinaryPoints;
00083 bool m_WriteImagesInSeparateFile;
00084
00085 SpatialObjectWriter();
00086 virtual ~SpatialObjectWriter();
00087
00088 private:
00089
00090 SpatialObjectPointer m_SpatialObject;
00091 SceneType * m_Scene;
00092
00093 MetaSceneConverter<NDimensions,PixelType,TMeshTraits>
00094 m_MetaToSpatialConverter;
00095 };
00096
00097 }
00098
00099
00100 #ifndef ITK_MANUAL_INSTANTIATION
00101 #include "itkSpatialObjectWriter.txx"
00102 #endif
00103
00104 #endif // __itkSpatialObjectWriter_h