ITK  6.0.0
Insight Toolkit
itkSpatialObjectWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 VDimension = 3,
33  typename PixelType = unsigned char,
34  typename TMeshTraits = DefaultStaticMeshTraits<PixelType, VDimension, VDimension>>
35 class ITK_TEMPLATE_EXPORT SpatialObjectWriter : public Object
36 {
37 public:
38  ITK_DISALLOW_COPY_AND_MOVE(SpatialObjectWriter);
39 
43 
45  using Superclass = Object;
46 
50 
55 
57 
59  itkNewMacro(Self);
60 
61  itkOverrideGetNameOfClassMacro(SpatialObjectWriter);
62 
64  void
65  Update();
66 
68  itkSetStringMacro(FileName);
69 
71  itkGetStringMacro(FileName);
72 
74  void
75  SetInput(const SpatialObjectType * input)
76  {
77  m_SpatialObject = input;
78  }
79 
80  itkSetMacro(BinaryPoints, bool);
81  itkGetConstMacro(BinaryPoints, bool);
82  itkBooleanMacro(BinaryPoints);
83 
89  void
90  SetMetaIOVersion(unsigned int ver);
91  unsigned int
92  GetMetaIOVersion(void) const;
93 
94  void
95  SetTransformPrecision(unsigned int precision);
96 
97  unsigned int
98  GetTransformPrecision();
99 
101  itkSetMacro(WriteImagesInSeparateFile, bool);
102  itkGetConstMacro(WriteImagesInSeparateFile, bool);
103  itkBooleanMacro(WriteImagesInSeparateFile);
107  void
108  RegisterMetaConverter(const char * metaTypeName,
109  const char * spatialObjectTypeName,
110  MetaConverterBaseType * converter);
111 
112 protected:
113  std::string m_FileName{};
114  bool m_BinaryPoints{};
115  bool m_WriteImagesInSeparateFile{};
116 
118  ~SpatialObjectWriter() override = default;
119 
120 private:
121  SpatialObjectConstPointer m_SpatialObject{};
122 
123  typename MetaSceneConverterType::Pointer m_MetaToSpatialConverter{};
124 };
125 } // namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 # include "itkSpatialObjectWriter.hxx"
129 #endif
130 
131 #endif // itkSpatialObjectWriter_h
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::SpatialObjectWriter::SetInput
void SetInput(const SpatialObjectType *input)
Definition: itkSpatialObjectWriter.h:75
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itkSpatialObject.h
itk::SmartPointer< Self >
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkMetaSceneConverter.h
itk::SpatialObjectWriter::SpatialObjectConstPointer
typename SpatialObjectType::ConstPointer SpatialObjectConstPointer
Definition: itkSpatialObjectWriter.h:49
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:58
itk::MetaConverterBase
Base class for MetaObject<->SpatialObject converters.
Definition: itkMetaConverterBase.h:42
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::SpatialObjectWriter::SpatialObjectPointer
typename SpatialObjectType::Pointer SpatialObjectPointer
Definition: itkSpatialObjectWriter.h:48
itk::SpatialObjectWriter
TODO.
Definition: itkSpatialObjectWriter.h:35
itk::MetaSceneConverter
Converts between MetaObject and SpatialObject group.
Definition: itkMetaSceneConverter.h:48
itkMetaConverterBase.h