ITK  5.4.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 
84  void
85  SetTransformPrecision(unsigned int precision);
86 
87  unsigned int
88  GetTransformPrecision();
89 
91  itkSetMacro(WriteImagesInSeparateFile, bool);
92  itkGetConstMacro(WriteImagesInSeparateFile, bool);
93  itkBooleanMacro(WriteImagesInSeparateFile);
97  void
98  RegisterMetaConverter(const char * metaTypeName,
99  const char * spatialObjectTypeName,
100  MetaConverterBaseType * converter);
101 
102 protected:
103  std::string m_FileName{};
104  bool m_BinaryPoints{};
105  bool m_WriteImagesInSeparateFile{};
106 
108  ~SpatialObjectWriter() override = default;
109 
110 private:
111  SpatialObjectConstPointer m_SpatialObject{};
112 
113  typename MetaSceneConverterType::Pointer m_MetaToSpatialConverter{};
114 };
115 } // namespace itk
116 
117 #ifndef ITK_MANUAL_INSTANTIATION
118 # include "itkSpatialObjectWriter.hxx"
119 #endif
120 
121 #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: itkAnnulusOperator.h:24
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