ITK  5.2.0
Insight Toolkit
itkMetaConverterBase.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  * 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 itkMetaConverterBase_h
19 #define itkMetaConverterBase_h
20 
21 #include "itkSpatialObject.h"
22 #include "metaObject.h"
23 
24 namespace itk
25 {
26 
41 template <unsigned VDimension = 3>
42 class ITK_TEMPLATE_EXPORT MetaConverterBase : public Object
43 {
44 public:
45 
48  using Superclass = Object;
51 
53  itkTypeMacro(MetaConverterBase, Object);
54 
57  using MetaObjectType = MetaObject;
58 
60  virtual SpatialObjectPointer
61  ReadMeta(const char * name);
62 
64  virtual bool
65  WriteMeta(const SpatialObjectType * spatialObject, const char * name);
66 
68  virtual SpatialObjectPointer
69  MetaObjectToSpatialObject(const MetaObjectType * mo) = 0;
70 
72  virtual MetaObjectType *
73  SpatialObjectToMetaObject(const SpatialObjectType * spatialObject) = 0;
74 
78  itkSetMacro(WriteImagesInSeparateFile, bool);
79  itkGetConstMacro(WriteImagesInSeparateFile, bool);
80  itkBooleanMacro(WriteImagesInSeparateFile);
82 
83 protected:
84  MetaConverterBase() = default;
85  ~MetaConverterBase() override = default;
86 
88  virtual MetaObjectType *
89  CreateMetaObject() = 0;
90 
91 
92 private:
93  bool m_WriteImagesInSeparateFile{ false };
94 };
95 
96 } // namespace itk
97 
98 #ifndef ITK_MANUAL_INSTATIATION
99 # include "itkMetaConverterBase.hxx"
100 #endif
101 
102 #endif // itkMetaConverterBase_h
itkSpatialObject.h
itk::SmartPointer< Self >
itk::MetaConverterBase< NDimensions >::MetaObjectType
MetaObject MetaObjectType
Definition: itkMetaConverterBase.h:57
itk::MetaConverterBase< NDimensions >::SpatialObjectPointer
typename SpatialObjectType::Pointer SpatialObjectPointer
Definition: itkMetaConverterBase.h:56
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:57
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:62