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);
00054
00056 void Update(void);
00057
00059 itkSetStringMacro(FileName);
00060
00062 itkGetStringMacro(FileName);
00063
00065 void SetInput(SpatialObjectType * input){m_SpatialObject=input;}
00066
00067 void SetInput(SceneType * input){m_Scene=input;}
00068
00069 itkSetMacro(BinaryPoints,bool);
00070 itkGetMacro(BinaryPoints,bool);
00071
00072 void SetTransformPrecision(unsigned int precision);
00073 unsigned int GetTransformPrecision();
00074
00076 itkSetMacro(WriteImagesInSeparateFile,bool);
00077 itkGetMacro(WriteImagesInSeparateFile,bool);
00079
00080
00081 protected:
00082 SpatialObjectWriter(const Self&);
00083 void operator=(const Self&);
00084
00085 std::string m_FileName;
00086 bool m_BinaryPoints;
00087 bool m_WriteImagesInSeparateFile;
00088
00089 SpatialObjectWriter();
00090 virtual ~SpatialObjectWriter();
00091
00092 private:
00093
00094 SpatialObjectPointer m_SpatialObject;
00095 SceneType * m_Scene;
00096
00097 MetaSceneConverter<NDimensions,PixelType,TMeshTraits>
00098 m_MetaToSpatialConverter;
00099 };
00100
00101 }
00102
00103
00104 #ifndef ITK_MANUAL_INSTANTIATION
00105 #include "itkSpatialObjectWriter.txx"
00106 #endif
00107
00108 #endif // __itkSpatialObjectWriter_h
00109