ITK  6.0.0
Insight Toolkit
itkDOMReader.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
19#ifndef itkDOMReader_h
20#define itkDOMReader_h
21
22#include "itkDOMNodeXMLReader.h"
23#include "itkObject.h"
24#include "itkLogger.h"
25
26namespace itk
27{
28
64template <typename TOutput>
65class ITK_TEMPLATE_EXPORT DOMReader : public Object
66{
67public:
68 ITK_DISALLOW_COPY_AND_MOVE(DOMReader);
72 using Self = DOMReader;
73
74 itkOverrideGetNameOfClassMacro(DOMReader);
75
76 using OutputType = TOutput;
77
80
83
85 itkSetStringMacro(FileName);
86
88 itkGetStringMacro(FileName);
89
94 virtual void
96
100
102 const OutputType *
103 GetOutput() const;
104
109 itkGetConstMacro(Logger, LoggerType *);
110
116 void
117 Update(const DOMNodeType * inputdom, const void * userdata = nullptr);
118
122 virtual void
124
125protected:
127
135 virtual void
136 GenerateData(const DOMNodeType * inputdom, const void * userdata) = 0;
137
138private:
140 itkSetObjectMacro(IntermediateDOM, DOMNodeType);
141 itkGetModifiableObjectMacro(IntermediateDOM, DOMNodeType);
145 std::string m_FileName{};
146
148 OutputType * m_Output{};
149
151 typename LightObject::Pointer m_OutputHolder{};
152
154 DOMNodePointer m_IntermediateDOM{};
155
157 mutable LoggerPointer m_Logger{};
158};
159
160} // namespace itk
161
162#ifndef ITK_MANUAL_INSTANTIATION
163# include "itkDOMReader.hxx"
164#endif
165
166#endif // itkDOMReader_h
Class to represent a node in a Document Object Model (DOM) tree structure.
Definition: itkDOMNode.h:54
Class to read an ITK object from an XML file or a DOM object, using the DOM APIs.
Definition: itkDOMReader.h:66
TOutput OutputType
Definition: itkDOMReader.h:76
virtual void Update()
virtual void GenerateData(const DOMNodeType *inputdom, const void *userdata)=0
typename DOMNodeType::Pointer DOMNodePointer
Definition: itkDOMReader.h:79
virtual void SetOutput(OutputType *output)
void Update(const DOMNodeType *inputdom, const void *userdata=nullptr)
OutputType * GetOutput()
typename LoggerType::Pointer LoggerPointer
Definition: itkDOMReader.h:82
const OutputType * GetOutput() const
Light weight base class for most itk classes.
Used for logging information during a run.
Definition: itkLogger.h:37
Base class for most ITK classes.
Definition: itkObject.h:62
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....