ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkSpatialObjectWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkSpatialObjectWriter_h
19 #define itkSpatialObjectWriter_h
20 
21 #include "itkMetaSceneConverter.h"
22 #include "itkMetaConverterBase.h"
23 #include "itkSpatialObject.h"
24 
25 namespace itk
26 {
32 template< unsigned int NDimensions = 3,
33  typename PixelType = unsigned char,
34  typename TMeshTraits = DefaultStaticMeshTraits< PixelType,
35  NDimensions,
36  NDimensions >
37  >
38 class ITK_TEMPLATE_EXPORT SpatialObjectWriter:public Object
39 {
40 public:
41 
45 
49 
54 
56  itkNewMacro(Self);
57 
59  typedef Object Superclass;
60  itkTypeMacro(SpatialObjectWriter, Object);
62 
64  void Update();
65 
67  itkSetStringMacro(FileName);
68 
70  itkGetStringMacro(FileName);
71 
73  void SetInput(SpatialObjectType *input){ m_SpatialObject = input; }
74 
75  void SetInput(SceneType *input){ m_Scene = input; }
76 
77  itkSetMacro(BinaryPoints, bool);
78  itkGetConstMacro(BinaryPoints, bool);
79 
80  void SetTransformPrecision(unsigned int precision);
81 
82  unsigned int GetTransformPrecision();
83 
85  itkSetMacro(WriteImagesInSeparateFile, bool);
86  itkGetConstMacro(WriteImagesInSeparateFile, bool);
88 
90  void RegisterMetaConverter(const char *metaTypeName,
91  const char *spatialObjectTypeName,
92  MetaConverterBaseType *converter);
93 
94 protected:
95  ITK_DISALLOW_COPY_AND_ASSIGN(SpatialObjectWriter);
96 
97  std::string m_FileName;
100 
102  virtual ~SpatialObjectWriter() ITK_OVERRIDE;
103 
104 private:
105 
106  SpatialObjectPointer m_SpatialObject;
107  SceneType * m_Scene;
108 
109  MetaSceneConverter< NDimensions, PixelType, TMeshTraits >
110  m_MetaToSpatialConverter;
111 };
112 } // namespace itk
113 
114 #ifndef ITK_MANUAL_INSTANTIATION
115 #include "itkSpatialObjectWriter.hxx"
116 #endif
117 
118 #endif // itkSpatialObjectWriter_h
Light weight base class for most itk classes.
SpatialObject< NDimensions > SpatialObjectType
void SetInput(SpatialObjectType *input)
a SceneSpatialObject has a list of SpatialObjects
SpatialObjectType::Pointer SpatialObjectPointer
MetaConverterBase< NDimensions > MetaConverterBaseType
void SetInput(SceneType *input)
SceneSpatialObject< NDimensions > SceneType
Implementation of the composite pattern.
Converts between MetaObject and SpaitalObject scenes.
SmartPointer< Self > Pointer
Base class for most ITK classes.
Definition: itkObject.h:59