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
00033 template <unsigned int NDimensions = 3,
00034 typename PixelType = unsigned char,
00035 typename TMeshTraits = DefaultStaticMeshTraits< PixelType ,
00036 NDimensions,
00037 NDimensions >
00038 >
00039 class SpatialObjectWriter : public Object
00040 {
00041 public:
00042
00044 typedef SpatialObjectWriter Self;
00045 typedef SmartPointer<Self> Pointer;
00046
00047 typedef SpatialObject<NDimensions> SpatialObjectType;
00048 typedef typename SpatialObjectType::Pointer SpatialObjectPointer;
00049 typedef SceneSpatialObject<NDimensions> SceneType;
00050
00052 itkNewMacro(Self);
00053
00055 typedef Object Superclass;
00056 itkTypeMacro(SpatialObjectWriter, Object);
00058
00060 void Update(void);
00061
00063 itkSetStringMacro(FileName);
00064
00066 itkGetStringMacro(FileName);
00067
00069 void SetInput(SpatialObjectType * input){m_SpatialObject=input;}
00070
00071 void SetInput(SceneType * input){m_Scene=input;}
00072
00073 itkSetMacro(BinaryPoints,bool);
00074 itkGetConstMacro(BinaryPoints,bool);
00075
00076 void SetTransformPrecision(unsigned int precision);
00077 unsigned int GetTransformPrecision();
00078
00080 itkSetMacro(WriteImagesInSeparateFile,bool);
00081 itkGetConstMacro(WriteImagesInSeparateFile,bool);
00083
00084
00085 protected:
00086 SpatialObjectWriter(const Self&);
00087 void operator=(const Self&);
00088
00089 std::string m_FileName;
00090 bool m_BinaryPoints;
00091 bool m_WriteImagesInSeparateFile;
00092
00093 SpatialObjectWriter();
00094 virtual ~SpatialObjectWriter();
00095
00096 private:
00097
00098 SpatialObjectPointer m_SpatialObject;
00099 SceneType * m_Scene;
00100
00101 MetaSceneConverter<NDimensions,PixelType,TMeshTraits>
00102 m_MetaToSpatialConverter;
00103 };
00104
00105 }
00106
00107
00108 #ifndef ITK_MANUAL_INSTANTIATION
00109 #include "itkSpatialObjectWriter.txx"
00110 #endif
00111
00112 #endif // __itkSpatialObjectWriter_h
00113