ITK  6.0.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 * 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 itkMetaConverterBase_h
19#define itkMetaConverterBase_h
20
21#include "itkSpatialObject.h"
22#include "metaObject.h"
23
24namespace itk
25{
26
41template <unsigned int VDimension = 3>
42class ITK_TEMPLATE_EXPORT MetaConverterBase : public Object
43{
44public:
45
51
53 itkOverrideGetNameOfClassMacro(MetaConverterBase);
54
58 using MetaObjectType = MetaObject;
59
60 itkSetMacro(MetaIOVersion, unsigned int);
61 itkGetConstMacro(MetaIOVersion, unsigned int);
62
65 ReadMeta(const char * name);
66
68 virtual bool
69 WriteMeta(const SpatialObjectType * spatialObject, const char * name);
70
71 void
73
74 void
76
80
82 virtual MetaObjectType *
83 SpatialObjectToMetaObject(const SpatialObjectType * spatialObject) = 0;
84
88 itkSetMacro(WriteImagesInSeparateFile, bool);
89 itkGetConstMacro(WriteImagesInSeparateFile, bool);
90 itkBooleanMacro(WriteImagesInSeparateFile);
93protected:
94 MetaConverterBase() = default;
95 ~MetaConverterBase() override = default;
96
98 virtual MetaObjectType *
100
101
102private:
103 bool m_WriteImagesInSeparateFile{ false };
104 unsigned int m_MetaIOVersion{ 0 };
105};
106
107} // namespace itk
108
109#ifndef ITK_MANUAL_INSTATIATION
110# include "itkMetaConverterBase.hxx"
111#endif
112
113#endif // itkMetaConverterBase_h
Light weight base class for most itk classes.
Base class for MetaObject<->SpatialObject converters.
virtual SpatialObjectPointer MetaObjectToSpatialObject(const MetaObjectType *mo)=0
typename SpatialObjectType::Pointer SpatialObjectPointer
~MetaConverterBase() override=default
typename SpatialObjectType::ConstPointer SpatialObjectConstPointer
void SpatialObjectToMetaObjectBase(SpatialObjectConstPointer spatialObject, MetaObjectType *mo)
virtual SpatialObjectPointer ReadMeta(const char *name)
virtual MetaObjectType * SpatialObjectToMetaObject(const SpatialObjectType *spatialObject)=0
void MetaObjectToSpatialObjectBase(const MetaObjectType *mo, SpatialObjectPointer spatialObject)
virtual MetaObjectType * CreateMetaObject()=0
virtual bool WriteMeta(const SpatialObjectType *spatialObject, const char *name)
Base class for most ITK classes.
Definition: itkObject.h:62
Implementation of the composite pattern.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....