ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMetaConverterBase.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 itkMetaConverterBase_h
19 #define itkMetaConverterBase_h
20 
21 #include "itkSpatialObject.h"
22 #include "metaObject.h"
23 
24 namespace itk
25 {
26 
40 template <unsigned VDimension = 3>
41 class ITK_TEMPLATE_EXPORT MetaConverterBase : public Object
42 {
43 public:
46  using Superclass = Object;
49 
51  itkTypeMacro(MetaConverterBase, Object);
52 
55  using MetaObjectType = MetaObject;
56 
58  virtual SpatialObjectPointer ReadMeta(const char *name);
59 
61  virtual bool WriteMeta(
62  const SpatialObjectType *spatialObject, const char *name);
63 
65  virtual SpatialObjectPointer MetaObjectToSpatialObject(
66  const MetaObjectType *mo) = 0;
67 
69  virtual MetaObjectType *SpatialObjectToMetaObject(
70  const SpatialObjectType *spatialObject) = 0;
71 
75  itkSetMacro( WriteImagesInSeparateFile, bool );
76  itkGetConstMacro( WriteImagesInSeparateFile, bool );
78 
79 protected:
81  ~MetaConverterBase() = default;
82 
84  virtual MetaObjectType *CreateMetaObject() = 0;
85 
86 
87 private:
88  bool m_WriteImagesInSeparateFile{false};
89 };
90 
91 }
92 
93 #ifndef ITK_MANUAL_INSTATIATION
94  #include "itkMetaConverterBase.hxx"
95 #endif
96 
97 #endif // itkMetaConverterBase_h
Light weight base class for most itk classes.
Implementation of the composite pattern.
Base class for MetaObject&lt;-&gt;SpatialObject converters.
typename SpatialObjectType::Pointer SpatialObjectPointer
Base class for most ITK classes.
Definition: itkObject.h:60